AnsweredAssumed Answered

OpenCL - double3 (cl_double3) kernel argument problem

Question asked by gbeatty on Mar 15, 2016
Latest reply on May 11, 2016 by dipak

I'm having a problem passing a cl_double3 as a kernel argument. My simplified test case kernel:

kernel void Double3Arg(double3 input, global double3* output) {

    output[get_global_id(0)] = input;

}

 

I set my kernel arguments with the correct type (cl_double3) and a buffer that is sized correctly with sizeof(cl_double3). When I read back the output buffer, all I get back are zeros. I'm using the C++ bindings from AMD APP SDK 3.0 and I've tried both enqueueReadBuffer(...) as well as enqueueMapBuffer(...) and get the same result either way. I have test cases for all other flavors of 3-component vectors (int3, float3, etc) and they all work fine. My double2 and double4 test cases also work correctly.

Interestingly, if I change "double3 input" to "double4 input" in the kernel only, and still set the arguments using cl_double3, I start getting correct output.

eg:

kernel void Double3Arg(double4 input, global double3* output) {

    output[get_global_id(0)] = input.xyz;

}

Outcomes