I have two input images, which I pass to the kernel from Host. Dimensions of my images are 370x427.
I want to get my self familiarize with local memory, so i pass a local image to the kernel as well and try to copy the global image to local.
I am sending my image as 1D array.when i try to display the result it does not work.My global worksize is {width*height} and I pass null for local size clEnqueueNDRangeKernel assuming opencl would choose appropriate size for local memory .
Below is my kernel code.
Please if someone could give me an hint.
__kernel void computeSSD(__global unsigned char *imgL,__global unsigned char *imgR,__global unsigned char *result,__global unsigned char *diff,int width,int MAX_DISP,int WIN_SIZE,__local unsigned char *localLeft,__local unsigned char *localRight )
{
int xCord=get_global_id(0);
int yCord=get_local_id(0);
// copy both images to local memory
localRight[yCord]= imgR[yCord];
localLeft[yCord] = imgL[yCord];
barrier(CLK_LOCAL_MEM_FENCE);
// do operation on local images
result[xCord]=localRight[yCord];
//
}