For following kernel, I am first allocating OpenCL memory buffer using clCreateBuffer. Then, I use clSetKernelArg with argsize set to sizeof(cl_mem).
float ExampleKernel (__global unsigned char* arg1)
{
// some code
}
My question is even if kernel's argument is of pointer to unsigned char, why do I need to set argsize to sizeof(cl_mem)? Is it because for OpenCL data is allocated always in cl_mem format (sizeof(cl_mem) per element)? And when kernel is called, dynamic type casting to respective argument type is handled by OpenCL?