Пример #1
0
int main(int ac, char **av)
{
   FILE *fin;
   char *cp, *cp_cur;    
   int lc;				/* loop counter */
   char *msg;			/* parse_opts() return message */

   if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL)
   { tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg); }
   setup();

   /*
   * The following loop checks looping state if -i option given
   */
   for (lc = 0; TEST_LOOPING(lc); lc++) 
   {
      Tst_count = 0;
 
      if ((fin = popen(pwd, "r")) == NULL) 
      {
         tst_resm(TINFO, "%s: can't run %s", TCID, pwd);
         tst_brkm(TBROK, cleanup, "%s FAILED", TCID);
         /*NOTREACHED*/
      }
      while (fgets(pwd_buf, sizeof(pwd_buf), fin) != NULL) 
      {
         if ((cp = strchr(pwd_buf, '\n')) == (char *)NULL) 
         {
            tst_brkm(TBROK, cleanup, "pwd output too long");
            /*NOTREACHED*/
         }
         *cp = 0;
         cp_cur = pwd_buf;
      }
      pclose(fin);

      do_block1();
      do_block2();
      do_block3();
      do_block4();
      do_block5();
      do_block6();
      do_block7();
   }
   cleanup();
   /*NOTREACHED*/
   return(0);
}
Пример #2
0
void do_block1(const int lda,
              const double * A, const double * B, double * C,
              const int i, const int j, const int k)
{
    const int n_blocks = BLOCK1_SIZE / BLOCK2_SIZE + (BLOCK1_SIZE%BLOCK2_SIZE? 1 : 0);
    int bi, bj, bk;
    for (bi = 0; bi < n_blocks; ++bi) {
        const int r = bi * BLOCK2_SIZE;
        for (bj = 0; bj < n_blocks; ++bj) {
            const int s = bj * BLOCK2_SIZE;
            for (bk = 0; bk < n_blocks; ++bk) {
                const int t = bk * BLOCK2_SIZE;
                do_block2(lda, A, B, C, i+r, j+s, k+t);
            }
        }
    }
}
Пример #3
0
void dgemm3(const int lda, const int M, const int N, const int K,
            const double *A, const double *B, double *C)
{
    const int m_blocks = M / BLOCK_SIZE2 + (M%BLOCK_SIZE2? 1 : 0);
    const int n_blocks = N / BLOCK_SIZE2 + (N%BLOCK_SIZE2? 1 : 0);
    const int k_blocks = K / BLOCK_SIZE2 + (K%BLOCK_SIZE2? 1 : 0);
    //printf("%d %d %d\n", m_blocks, n_blocks, k_blocks);
    int bi, bj, bk;
    for (bi = 0; bi < m_blocks; ++bi) {
        const int i = bi * BLOCK_SIZE2;
        for (bj = 0; bj < n_blocks; ++bj) {
            const int j = bj * BLOCK_SIZE2;
            for (bk = 0; bk < k_blocks; ++bk) {
                const int k = bk * BLOCK_SIZE2;
                //printf("%.0f, %.0f, %.0f\n", A[0], B[0], C[0]);
                do_block2(lda, M, N, K, A, B, C, i, j, k);
            }
        }
    }
}