NSriv2
New Contributor
7 years agoHow to tell the compiler that store operations are not dependent?
Hi,
I am trying to compile the following kernel using aoc 18.0
__kernel void C_unloader (
const int num_elems,
__global int* restrict C,
__local int16* __shared
) {
bool read_success[SYS_NUM_ROWS][SYS_NUM_COLS];
Drain_data data[SYS_NUM_ROWS][SYS_NUM_COLS];
int count = 0;
while (count != num_elems) {
#pragma ivdep array(C)
#pragma unroll
for (int y_id = 0; y_id < SYS_NUM_ROWS; y_id++) {
#pragma ivdep array(C)
#pragma unroll
for (int x_id = 0; x_id < SYS_NUM_COLS; x_id++) {
data[y_id][x_id] = read_channel_nb_intel(C_unloader_channel[y_id][x_id], &read_success[y_id][x_id]);
if (read_success[y_id][x_id]) {
count++;
C[data[y_id][x_id].addr] = data[y_id][x_id].data;
}
}
}
}
}And the compiler says that the achieved II is 313 due to the memory dependency between the store operations on line 20. I know these memory accesses will never alias. Is there a way to tell the compiler that these memory accesses will never alias to achieve an II of 1? I tried #pragma ivdep but that does not solve the issue.
Thanks,
Nitish