Altera_Forum
Honored Contributor
7 years agocache data on chip ram
Hi,
Say i have a large dataset that i wanted to cache it on chip ram and the following code is what i wrote.
__kernel(global *input, uint g, uint data_length){
__local memory data_buffer;
for(a++){
//for every iteration in 'a' loop
//renew data on chip ram
for(g++){ //assume this is line 4
data_buffer = input;
}
for(b++){
for(g++){
// load data from __local memory
data = data_buffer
}
}
} The report shows me i have memory dependency in line 4, causing the whole block to execute serially. Any advice on how i can fix this or modify it to remove the dependency? I saw some people uses specific pragma to counter this issue e.g.# pragma ivdep but i have no idea what it is. g varries for each kernel execution. So, put unroll pragma doesnt work. Thank you