Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Groups
    • Search
    • 官网
    1. Home
    2. laser2000
    3. Posts
    L
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Posts made by laser2000

    • RE: swacc 编译报错

      复杂访问大概是,数组元素访问编号不是循环变量,而是由循环变量计算后得到。
      这只是一个警告,如果你确定访问没有问题,就不管它

      posted in 技术交流区
      L
      laser2000
    • RE: OpenACC的entire子句

      查看中间代码

      
      void slave_entire_6(void *argv)
      {
        int acc_cp_0_size;
        int acc_cp_1_size;
        acc_cp_0_size = 64 * 1 * 4;
        acc_cp_1_size = 256;
        acc_corenum = acc_get_num_threads();
        acc_myid = acc_get_thread_num();
        acc_check_ldm(0 + sizeof(_ldm_B) + sizeof(_ldm_i) + sizeof(_ldm_j) + sizeof(acc_data_ret) + sizeof(_ldm_A));
        acc_ret = acc_sync_pe_m2l_nostride_copy(_ldm_A,A,acc_cp_0_size);
      {
          for (acc_blockindex_i0_0 = acc_myid * 1; acc_blockindex_i0_0 <= 127; acc_blockindex_i0_0 += 1 * acc_corenum) {
            for (_ldm_i = 0; _ldm_i <= 0; _ldm_i += 1) {
              for (_ldm_j = 0; _ldm_j <= 63; _ldm_j += 1) {
                _ldm_B[_ldm_i][_ldm_j] = _ldm_A[_ldm_j] + (_ldm_i + acc_blockindex_i0_0);
              }
            }
            _swacc_ret = acc_sync_pe_l2m_nostride_copy(&B[acc_blockindex_i0_0][0],_ldm_B[0],acc_cp_1_size);
          }
        }
      }
      

      注意 acc_ret = acc_sync_pe_m2l_nostride_copy(_ldm_A,A,acc_cp_0_size);
      这就是完全拷贝 A

      posted in 技术交流区
      L
      laser2000
    • RE: C++11+fortran+OpenACC移植程序从核报错

      loop不能和copy配合

      posted in 申威芯片版块
      L
      laser2000
    • openacc运行问题

      写了一个很简单的二重循环,采用openacc加速

      
      #define WIDTH 1024
      #define HEIGHT 1024
      
      
      void timer_start(struct timeval *timev);
      void timer_end(double *sec,struct timeval *timev);
      
      
      int main() {
         struct timeval t1_start;
         double t1;
         int y,x;
         float image[HEIGHT][WIDTH];
      
       // FILE *fp=fopen("image.pgm","wb");  fprintf(fp,"P5\n%s\n%d %d\n%d\n","#comment",WIDTH,HEIGHT,MAX_COLOR);
      
        timer_start(&t1_start);
      #pragma acc parallel loop  copyout(image) 
        for(y=0;y<HEIGHT;y++) {
          for(x=0;x<WIDTH;x++) {
             image[y][x]= x+y;
          }
        }
        timer_end(&t1,&t1_start);
      
      
      
        printf("Time: %lf seconds.\n", t1);
        //fwrite((unsigned char*)image,sizeof(unsigned char),WIDTH*HEIGHT,fp);fclose(fp);
        return 0;
      }
      
      void timer_start(struct timeval *timev)
      {
          gettimeofday(timev, 0L);
      }
      
      void timer_end(double *sec,struct timeval *timev)
      {
          struct timeval t;
          gettimeofday(&t, 0L);
          *sec = 1.0*(t.tv_sec-timev->tv_sec) + 0.000001*(t.tv_usec-timev->tv_usec);
      }
      

      但是提交运行,有时候可以有时候不行

      [para080@psn010 test_mandelbrot]$ bsub -I -b  -q q_sw_expr -n 1 -cgsp 64  ./a.out
      Job <52832701> has been submitted to queue <q_sw_expr>
      waiting for dispatch ...
      dispatching ...
      Time: 0.000781 seconds.
      Job 52832701 has been finished.
      [para080@psn010 test_mandelbrot]$ bsub -I -b  -q q_sw_expr -n 1 -cgsp 64  ./a.out
      Job <52832702> has been submitted to queue <q_sw_expr>
      waiting for dispatch ...
      dispatching ...
      Time: 0.000807 seconds.
      
      Job 52832702 has been finished.
      [para080@psn010 test_mandelbrot]$ bsub -I -b  -q q_sw_expr -n 1 -cgsp 64  ./a.out
      Job <52832703> has been submitted to queue <q_sw_expr>
      waiting for dispatch ...
      dispatching ...
      [52832703 ## Fri Jun 11 09:03:33 2021] warning: node [12]: user's mpe task: tid= 0, pid= 9119, terminated by sig 11
      
      Job 52832703 has been finished. exit_code is 104
      [para080@psn010 test_mandelbrot]$ bsub -I -b  -q q_sw_expr -n 1 -cgsp 64  ./a.out
      Job <52832705> has been submitted to queue <q_sw_expr>
      waiting for dispatch ...
      dispatching ...
      [52832705 ## Fri Jun 11 09:04:06 2021] warning: node [12]: user's mpe task: tid= 0, pid= 9133, terminated by sig 11
      Job 52832705 has been finished. exit_code is 104
      [para080@psn010 test_mandelbrot]$ bsub -I -b  -q q_sw_expr -n 1 -cgsp 64  ./a.out
      Job <52832707> has been submitted to queue <q_sw_expr>
      waiting for dispatch ...
      dispatching ...
      Time: 0.000779 seconds.
      Job 52832707 has been finished.
      

      u如果哦将 image 定义为 double 就肯定不行

      posted in 申威芯片版块
      L
      laser2000
    • 1 / 1