cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Observer
Observer
308 Views
Registered: ‎09-12-2018

OpenCL kernel memory access issue: writing local memory at specific starting point

Jump to solution

Hi there,

I am currently trying to write an OpenCL kernel that is able to update its local memory at specific points.

for example, when the kernel is initially deployed, the local memory is written in places 0 to 100. On the next deployment, I'm want to appened data to it at locations 101 to 120 and so on.

The curreny for loop that works and reads into local memory starting at 0 is the following:

voide krnl_name(__global int* bram_mem,const int BRAM_dim){
int local_bram_mem[4096];
int size;
size = BRAM_dim;
__attribute__((xcl_pipeline_loop))
read_bram_mem : for (int i=0;i<size;i++){
    local_bram_mem[i] = bram_mem[i];
}}

The current kernel that we are trying to implement is the following, starting at a given value:

voide krnl_name(__global int* bram_mem,const int BRAM_start, const int BRAM_end){
int local_bram_mem[4096];
int start,end;
start = BRAM_start;
end = BRAM_end;
__attribute__((xcl_pipeline_loop))
read_bram_mem : for (int i=start;i<end;i++){
    local_bram_mem[i] = bram_mem[i];
}}

My question is, does OpenCL let me do the second for loop? When I try the second approach in simulation, it doesn't give us the correct results. But there are also no compilation errors. Does every for loop have to start at zero?

I am using SDAccel 2018.3

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Observer
Observer
272 Views
Registered: ‎09-12-2018

Re: OpenCL kernel memory access issue: writing local memory at specific starting point

Jump to solution

The problem I was running into wasn't because of this. Performing the both types of for loops is acceptable in OpenCL in SDAccel 2018.3.

View solution in original post

0 Kudos
1 Reply
Highlighted
Observer
Observer
273 Views
Registered: ‎09-12-2018

Re: OpenCL kernel memory access issue: writing local memory at specific starting point

Jump to solution

The problem I was running into wasn't because of this. Performing the both types of for loops is acceptable in OpenCL in SDAccel 2018.3.

View solution in original post

0 Kudos