cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

jmyc
Journeyman III

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; }

0 Likes
1 Reply
omkaranathan
Adept I

The issue has been passed to developers. Thanks for reporting.

0 Likes