cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

song_h
Journeyman III

OpenCL same kernel, R7-260x and Rx480 produce different result

For same application, I used R7-260x (driver: fglrx, os: ubuntu 14.04) and Rx480(driver: amdgpu-pro, os: ubuntu16.04), they produced different result.

The application is:

Romein-gridding/Gridding-0.2 at master · awson/Romein-gridding · GitHub

If I modified the kernel (see the attachment), they can produce the same result, but for the runtime , the Rx480's performance is much worse than R7.

0 Likes
2 Replies
dipak
Big Boss

Thanks for reporting this. We'll check and get back to you shortly.

Regards,

0 Likes

Inside the kernel “add_to_grid” in "Kernel.cl", following code is incorrect.

for (uint i = get_local_id(0); i < TIMESTEPS * CHANNELS; i += get_local_size(0)) {

...

shared_visR[0] = (float4) (visXX.x, visXY.x, visYX.x, visYY.x);

It creates out of bound access and triggers undefined behaviour. C99 standard ISO/IEC 9899:TC3 Annex J.2:

— "An array subscript is out of range, even if an object is apparently accessible with the given subscript (as in the lvalue expression a[1][7] given the declaration int a[4][5]) (6.5.6)."

Given the incorrect code compiler can produce fast but incorrect code.

Regards,

0 Likes