I am currently learning how to use OpenCL but I am having an issue with trying to enqueue a kernel to my queue.
The kernel is supposed to receive a float and 2 Buffer of type unsigned char and unsigned int -
__kernel void task2(float value,
__global unsigned char *chars,
__global unsigned int *ints)
My program looks like the following -
bufferA = cl::Buffer(context, CL_MEM_WRITE_ONLY, sizeof(cl_uchar) * alphabets.size());
bufferB = cl::Buffer(context, CL_MEM_READ_WRITE, sizeof(cl_uint) * numbers.size());
kernel = cl::Kernel(prog, "kernelTest");
kernel.setArg(0, 2.55);
kernel.setArg(1, bufferA);
kernel.setArg(2, bufferB);
queue.enqueueTask(kernel);
where alphabets and numbers are vectors. The program is built successfully but excluded since I think it'd be irrelevant to this question.
When reaching the enqueueTask portion in the program, I receive an error -
Error in: clSetKernelArg
Error code: -51 (CL_INVALID_ARG_SIZE)
Unless I am completely wrong about this, the kernel takes in 3 arguments and I am passing in three arguments of float, unsigned char Buffer and unsigned Int buffer respectively. Am I doing something wrong?