cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

pswwsp
Journeyman III

Bug in OpenCL (GCN only)

Hello,

I’ve got the working OpenCL kernel that calculates SHA-256 hash of VERY long string and it takes too much time. I decided to split this kernel into several parts and save the intermediate results in global buffer. This means the same kernel is called several times and, if the calculation is not completed, the previous intermediate context is loaded from this buffer, more hash calculation is performed and new intermediate result is saved again.

Unfortunately, the new split kernel is not working – the global buffer with intermediate result has always zeros. But,

  1. It’s not working on GCN architecture only (I’ve tested on Capeverde). I've tested Catalyst from 12.3 up to 12.11. It works fine on VLIW5 and NVIDIA GPU.
  2. If I try to print using printf() the intermediate buffer, the code works ok.
  3. If I comment some lines in the code , the buffer is also not zero.

The minimal sample is attached. If there is the right way to report such a bug, please let me know – I couldn’t find it. Thanks.

0 Likes
1 Solution
himanshu_gautam
Grandmaster

I could reproduce it.

Looks like the compiler was optimizing out the code.

1. Making ‘HashRounds’ variable volatile solves the issue temporarily -- file zerobuf-gcn.cl, line 206

2. Alternatively disabling optimization by passing "-cl-opt-disable" to clbuildProgram() also solves the issue

View solution in original post

0 Likes
28 Replies