We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
cl_image_format imageFormat;
imageFormat.image_channel_data_type = CL_UNSIGNED_INT16;
imageFormat.image_channel_order = CL_RGBA; // considering image with only single channel
// Allocate SVM memory
size_t imageSize = width * height * sizeof(cl_uchar);
cl_uchar *imgSvmPtr = (cl_uchar *) clSVMAlloc(context, CL_MEM_READ_WRITE, imageSize, 0);
// Create a buffer object using the SVM memory
cl_mem svmImgBuffer = clCreateBuffer(context, CL_MEM_USE_HOST_PTR, imageSize, imgSvmPtr, NULL);
// Set the SVM buffer to image description parameter and set the other parameters accordingly
cl_image_desc imageDesc;
memset(&imageDesc, '\0', sizeof(cl_image_desc));
imageDesc.image_type = CL_MEM_OBJECT_IMAGE2D;
imageDesc.image_width = width / 4;
imageDesc.image_height = height;
imageDesc.mem_object= svmImgBuffer;
// Create 2D image, which will be used as input as well as output image
cl_mem image2D = clCreateImage(context, CL_MEM_READ_WRITE, &imageFormat, &imageDesc, NULL, &status);
status = -65, I want to know why ? thanks