Compiler error: Predicate variable must be in register state space

Hi all,

whenever I am trying to compile a kernel that uses code similar to

__local bool pred;

...

if (pred) {}

else {}

I get the following error:

-----------------------------------------------------------

Build Log:

ptxas application ptx input, line 17; error   : Predicate variable 'shr_1_early' must be in register state space

ptxas fatal   : Ptx assembly aborted due to errors

error   : Ptx compilation failed: gpu='sm_13', device code='anonymous_jit_identity'

: Retrieving binary for 'anonymous_jit_identity', for gpu='sm_13', usage mode=' --maxrregcount 32'

: Considering profile 'compute_10' for gpu='sm_13' in 'anonymous_jit_identity'

: Control flags for 'anonymous_jit_identity' disable search path

: Ptx binary found for 'anonymous_jit_identity', architecture='compute_10'

: Ptx compilation for 'anonymous_jit_identity', for gpu='sm_13', ocg options=' --maxrregcount 32'

-----------------------------------------------------------

!!! Error # -45 (CL_INVALID_PROGRAM_EXECUTABLE) at line 141 , in file main.cpp !!!

Exiting...

-----------------------------------------------------------

Is my code not conforming to the OpenCL spec or is this a compiler bug?

Edit: I am using CUDA 3.0 final

Best,

Jens

Looks like a bug in the compiler. Just curious, why do you want to use ‘__local bool’? Do you mean ‘__private bool’ (which is compiled fine)?

Thanks. I was playing around with a __local bool as I am running into register pressure and I have a non-trivial condition in my kernel … it was mostly just an experiment, I guess it wouldn’t have been that helpful. However I was confused by the result :rolleyes: