clFinish(-36) because of data type?

Hallo Everybody,

I try to get work an old kernel code which once was working. Now, it errors with clFinish(-36).

The remaining code is a random number generator routine. I found out which line causes the error. The function float run_mrg32k3a_generate_uniform_float_ is called at first.

float run_mrg32k3a_generate_uniform_float_(private uint* state){
  uint p1, p2;
  p1 = run_mrg32k3a_ModM1(mrg32k3a_a12,state[1] , mrg32k3a_a13,state[0],0,0);
  state[0] = state[1]; state[1] = state[2]; state[2] = p1;
  p2 = run_mrg32k3a_ModM2(mrg32k3a_a21,state[5] , mrg32k3a_a23,state[3],0,0);
  run_mrg32k3a_ModM2(mrg32k3a_a21,state[5] , mrg32k3a_a23,state[3],0,0);
  state[3] = state[4]; state[4] = state[5]; state[5] = p2;
  if (p1 <= p2) return ((float)( 4294967087 - (p2 - p1) )) * 2.3283064365386963e-10;
           else return ((float)(p1 - p2)) * 2.3283064365386963e-10;
uint run_mrg32k3a_ModM1(uint a1,uint b1,uint a2,uint b2,uint a3,uint b3){
  ulong a,b,x;
  x=(ulong)a1*b1;  a=(x>>32);  b=(a*209)+(x-(a<<32));
  x=(ulong)a2*b2;  a=(x>>32);  b+=(a*209)+(x-(a<<32));
  x=(ulong)a3*b3;  a=(x>>32);  b+=(a*209)+(x-(a<<32));
                                x=(b>>32);  b= (x*209)+(b-(x<<32));
  return (b<4294967087) ? (b) : (b - 4294967087);
uint run_mrg32k3a_ModM2(uint a1,uint b1,uint a2,uint b2,uint a3,uint b3){
  ulong a,b,x;
  x=(ulong)a1*b1;  a=(x>>32);  b=(a*22853)+(x-(a<<32));
  x=(ulong)a2*b2;  a=(x>>32);  b+=(a*22853)+(x-(a<<32));
  x=(ulong)a3*b3;  a=(x>>32);  b+=(a*22853)+(x-(a<<32));
                                x=(b>>32);  b= (x*22853)+(b-(x<<32));
  return (b<4294944443) ? b : (b - 4294944443);

If I comment out this line

*p2 = run_mrg32k3a_ModM2(mrg32k3a_a21,state[5] , mrg32k3a_a23,state[3],0,0);*

or do this instead:

*run_mrg32k3a_ModM2(mrg32k3a_a21,state[5] , mrg32k3a_a23,state[3],0,0);*

the kernel is executed for many times.

It didn’t help to do uint fct in return statement:

*return (b<4294944443) ? (uint)b : uint(b - 4294944443);*

Does anyone have an idea? The uint array state is initialized as ever before.

Kind regards,