I'm using OpenCL with an AMD video card and have the latest driver in Linux.
When I do something like:
int a = get_group_id(0) > 0 ? vector[ get_group_id(0)-1 ].word[ id ] : 0;
I get a wrong result. But if use a barrier(CLK_LOCAL_MEM_FENCE); after this, I get the correct results.
Why is that happening?
Ps1.: Using a NVIDIA video card on both Linux or Windows, I get the right answer without using a barrier.
The block is( using __global *input, __global *output ):
int a = get_group_id(0) > 0 ? vector[ get_group_id(0)-1 ].word[ id ] : 0;
int b = get_group_id(0) > 0 ? c + a : a;
output[b + id] = input[ d + id ]; //Last kernel line
I'm using 128 workgroup size. I've tried in HD 6790 - linux
Thanks