cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

Tasp
Journeyman III

__local prefix for local arrays changes results - Bug?!

I have a kernel with two small local arrays

float a[3];
float b[3][4];

I get the same results on CPU and GPU. Then I change the code to

__local float a[3];
__local float b[3][4];

Suddenly I get very different results on GPU.

Why is this???

0 Likes
2 Replies
nou
Exemplar

by defaults variables are in __private space which are per work item. then you chnge it to __local which is per work group.

so you most likely overwrite thing in your kernel. CPU is more serial than GPU so it do not show this bug in your code.

0 Likes
Tasp
Journeyman III

Shame on me!

Thank you

0 Likes