7 Replies Latest reply on Apr 20, 2016 5:24 AM by dipak

    Problems with accessing arrays with a negative offset (R9 290, Catalyst 15.7)


      In some cases in OpenCL kernels we are getting incorrect values when reading from arrays using a negative index. For example, we could have something like this:


      _global float a[10];

      _global float* b = a + 5;

      float c = b[-1]  + b[-2];     // this sometimes returns incorrect value


      This happens on R9 290 running under Catalyst 15.7 driver (Win 7 x64) and does not happen with Catalyst 14.9 or with HD 7970 (any driver version).

      We could not figure out when exactly the problem happens, but managed to prepare a test case that reproduces the error in our environment. I'm attaching it to this post.