How to process images using SVM of OpenCL2.0?

Discussion created by sky3551211 on Oct 27, 2014
Latest reply on Nov 3, 2014 by sky3551211

As per the (section 5.6.1 from OpenCL 2.0 spec, page 166),we try to create Image objects using SVM like:

svmbuffer=(cl_uchar4*)clSVMAlloc(context,CL_MEM_READ_WRITE,width*height*sizeof(cl_uchar4),0);//coarse grained buffer

memcpy(svmbuffer,inputImageData,width*height*sizeof(cl_uchar4));//copy inputImageData to svmbuffer

cl_mem tem_inputImage2D=clCreateImage(context,CL_MEM_READ_ONLY|CL_MEM_USE_HOST_PTR,&imageFormat,&imageDesc,




status = clSetKernelArg(kernel2D,0,sizeof(cl_mem),&tem_inputImage2D);



But it didn't reach the goal of sharing the pointers between the host and device,  Am I misunderstand it ?

Look forward to your reply.