Quantcast
Channel: Intel® Software - OpenCL*
Viewing all articles
Browse latest Browse all 1182

Comparison of get_global_id() to int differs when optimizations on/off

$
0
0

Hi,

 

With the following kernel:

__kernel void A(__global double* input) {
  int tid = get_global_id(0);
  if (tid < - 1) {
    input[tid] = 1;
  }
}

The 'if' branch of the conditional should never be executed, since global id is always >= 0. However, on my E5-2620 and i5-4570, it is. When optimizations are disabled, it isn't. Could this be a compiler bug?

Full test case is here: http://paste.ubuntu.com/25213218/ 

My driver version is 1.2.0.25.

Cheers,
Chris


Viewing all articles
Browse latest Browse all 1182

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>