UCLA-VAST / AutoSA

AutoSA: Polyhedral-Based Systolic Array Compiler
MIT License
191 stars 31 forks source link

Intel AOC backend: error: use of undeclared identifier 'data' #6

Closed hecmay closed 3 years ago

hecmay commented 3 years ago

Here is the command I ran

./autosa /usr/local/docker/hcl_autosa_t
mp.c --config=./autosa_config/autosa_config.json --target=autosa_opencl --output-dir=./autos
a.tmp/output --sa-sizes="{kernel[]->space_time[3];kernel[]->array_part[32,32,512];kernel[]->
latency[8,8];kernel[]->simd[1]}" --simd-info=./autosa_tests/mm_hcl/simd_info.json --hls --hc
l --data-pack-sizes="{kernel[]->B[8,32,64];kernel[]->A[8,32,64];kernel[]->Y0[8,32,64]}"--no-
linearize-device-arrays --host-serialize

The generated OCL code is kind of problematic (data not declared)

void B_IO_L2_in_intra_trans_3(int c0, int c1, int c2, B_t8 local_B[8][64], bool intra_trans_en)
 {
  /* Variable Declaration */
  int p0 = 3; // module id
  /* Variable Declaration */

  if (!intra_trans_en) return;

  // io_L2
  // io_L1  // pe
  #pragma loop_coalesce 
  for (uint10_t c5 = 0; c5 <= 511; c5 += 1) {
    // latency    
    for (uint4_t c6 = 0; c6 <= 7; c6 += 1) {
      // latency
      for (uint4_t c7 = 0; c7 <= 7; c7 += 1) {
        // hls_pipeline        {
          B_t8 in_data;
          B_t1 out_data;
          in_data = local_B[c6][c5 / 8];          
          int split_idx = (c5) % 8;
          out_data = data.data[split_idx];
          write_channel_intel(fifo_B_PE_0_3, out_data);
        }
      }
    }  
  }
}

I will post the input C code to AutoSA later.

hecmay commented 3 years ago

Here is the input C code to AutoSA

#include <stdio.h>
int main(int argc, char **argv) {

      float Y0[1024][1024];
      float A[1024][1024];
      float B[1024][1024];
#pragma scop
      for (int i = 0; i < 1024; ++i) {
        for (int j = 0; j < 1024; ++j) {
          Y0[i][j] = 0.000000e+00f;
          for (int k = 0; k < 1024; ++k) {
            Y0[i][j] = (Y0[i][j] + (A[i][k] * B[j][k]));
          }
        }
      }
#pragma endscop
      printf("%f", Y0[0][0]);
      printf("%f", A[0][0]);
      printf("%f", B[0][0]);
}
whbldhwj commented 3 years ago

Bug fixed.