Problem writing to 3d image object

Hello everyone,
I am using this sample kernel code to write to 3d image objects. However, there is error when I build the program using clBuildProgram(). The error code it returns is -11.

const char *source=
"#pragma OPENCL EXTENSION cl_khr_3d_image_writes : enable
"
"__kernel void hello( write_only image3d_t out)
"
"{
"
"int4 cd=(int4)(1,1,1,1);
"
"uint4 c=(uint4)(1,2,3,4);
"
"write_imageui( out, cd, c);
"
"}
";

Please tell me where am I going wrong. Thank You.

Are you sure that your device has support for the cl_khr_3d_image_writes extension?

Also use clGetProgramBuildInfo() with CL_PROGRAM_BUILD_LOG to get more info about the reason why the build failed.

No. I am not sure of that. I am using Intel Dual Core CPU as the device. How do I know that?

Check whether the extension is present in the string returned by clGetDeviceInfo() with CL_DEVICE_EXTENSIONS.