1 Reply Latest reply on Jan 14, 2010 5:37 PM by omkaranathan

    Strange behavior of ? : clause for vector types

      ? : clause used for vector types causes the segmatation fault

      The kernel attached to this post (the code is nonsensical - it is only an example) results in segmentation fault when run on CPU or GPU. I know that it is not a good idea to leave variables unintialized but still you would not expect a program to crash with segmentation fault just because of that.


      My system: My system: Linux, kernel 2.6.28-16, gcc 4.3.3, CPU AMD64, quad core, GPU: ATI HD4770, fglrx-8.682.2

      #define f4_0 (float4)(0.f,0.f,0.f,0.f) #define f4_1 (float4)(1.f,1.f,1.f,1.f) /*---------------------------------------------------------------------*/ __kernel void qsimKernel() { float4 a, b, c=1; a = (b/c <= -9.f) ? f4_0 : (b/c >= 9.f) ? f4_0 : f4_1; }