So, I am trying to initialize a variable in my opencl host code as follows:
cl_float2 es = (cl_float2)(0.0f,0.0f);
That, using Clang 2.9, fails:
source/solveEikonalEq.c:75:38: warning: expression result unused [-Wunused-value] cl_float2 es = (cl_float2)(0.0f,0.0f); ^~~~ source/solveEikonalEq.c:75:26: error: cast to union type from type 'float' not present in union cl_float2 es = (cl_float2)(0.0f,0.0f); //ray tangent vector ^ ~~~~~~~~~~~
And when using GCC 4.6.1 crash:
source/solveEikonalEq.c:75:42: warning: left-hand operand of comma expression has no effect [-Wunused-value] source/solveEikonalEq.c:75:26: error: cast to union type from type not present in union
I am using AMD opencl sdk and can just create examples. What am I doing wrong?
source share