cucapra/dahlia

Multidimensional array access fails

Closed this issue · 0 comments

This program:

decl x: float[5][5];
let y = x[0][3];

Successfully generates this code:

void kernel(float x[25]) {
  #pragma HLS ARRAY_PARTITION variable=x factor=1 dim=1
  #pragma HLS ARRAY_PARTITION variable=x factor=1 dim=2
  float y = x[0][3];
}

However, since x is flattened, when I try to compile this generated CPP with g++, I get this error:

testme.cpp:7:17: error: subscripted value is not an array, pointer, or vector
  float y = x[0][3];
            ~~~~^~
1 error generated.