I’m having a similar problem,
__constant sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP | CLK_FILTER_NEAREST;
__kernel void masking_image( __read_only image2d_t srcImg, __write_only image2d_t dstImg,__global const float *mask, int width, int height)
{
}
Kernel is empty at this moment.
size_t LWS_IMAGE[2] = {1,1};
size_t GWS_IMAGE[2] = {16,16};
printf("LWS : %ldx%ld, GWS : %ldx%ld
", LWS_IMAGE[0],LWS_IMAGE[1], GWS_IMAGE[0], GWS_IMAGE[1]);
}
void exec_opencl_image(int width, int height, unsigned char* input, unsigned char* output, float *mask)
{
cl_int ret=0;
size_t Offset[2] = {1,1};
clSetKernelArg(ckKernel[1], 0, sizeof(cl_mem), (void *)&cmDevImageInput); CheckFN(ret);
clSetKernelArg(ckKernel[1], 1, sizeof(cl_mem), (void *)&cmDevImageOutput); CheckFN(ret);
clSetKernelArg(ckKernel[1], 2, sizeof(cl_mem), (void *)&cmDevMask); CheckFN(ret);
clSetKernelArg(ckKernel[1], 3, sizeof(int), (void *)&width); CheckFN(ret);
clSetKernelArg(ckKernel[1], 4, sizeof(int), (void *)&height); CheckFN(ret);
//Just to make sure it's divisible
size_t LWS_IMAGE[2] = {1,1};
size_t GWS_IMAGE[2] = {16,16};
//Where I'm having "Floating-point exception"
ret = clEnqueueNDRangeKernel(cqCommandQueueGPU, ckKernel[1], 2, Offset, GWS_IMAGE,LWS_IMAGE, 0, NULL,NULL); CheckFN(ret);
const size_t image_origin[3] = {0,0,0};
//const size_t host_origin[3] = {0,0,0};
const size_t region[3] = {width,height,1};
//ret = clEnqueueReadImage(cqCommandQueueGPU, cmDevImageOutput, CL_TRUE, image_origin,region,0,0,output, NULL, 0,NULL); CheckFN(ret);
}
Any headups? I’m stuck in here for two days, and no luck with digging forums and googling~ Original image i’m using is 1920x1080x3.
Thanks in advance.