cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

gbeatty
Journeyman III

OpenCL - double3 (cl_double3) kernel argument problem

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;

}

0 Likes
1 Reply
dipak
Big Boss

Hi Greg,

Sorry for replying so late.

As I checked on my setup, the following kernel seems working fine.

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

    output[get_global_id(0)] = input;

}

Could you please share the host-side code and setup details (with clinfo output) that you used?

Regards,

0 Likes