AnsweredAssumed Answered

float4 to (float*) casting

Question asked by nyanthiss on Aug 6, 2012
Latest reply on Aug 7, 2012 by nyanthiss

Hi,

 

I started playing with darktable OpenCL code. I noticed this code [1]:

 

void rgb_to_lch (float *rgb, float *lch) {
   ... 
}  

kernel void highlights (...) {
   ...   
   float4 pixel = read_imagef(in, sampleri, (int2)(x, y));
   float4 inc, lchi, lchc, lch;
   ...       
   rgb_to_lch((float *)&pixel, (float *)&lchi);
   ... 
}

I found out, the float4 to (float*) cast doesn't work, at least on my system (rhel 6.2, OpenCL 1.2 AMD-APP (938.1), HD 7950). Is this expected behaviour ? Could it be that it works on nvidia ?

 

1. https://github.com/darktable-org/darktable/blob/master/data/kernels/basic.cl

Outcomes