Forum Discussion
5 Replies
- Altera_Forum
Honored Contributor
Is the "CL_INVALID_KERNEL" error generated by clSetKernelArg() or clEnqueueNDRangeKernel()? CL_INVALID_KERNEL points to an invalid kernel object, I highly doubt your problem has anything to do with using cl_float4. Are you correctly creating your program from a pre-compiled binary using clCreateProgramWithBinary (instead of clCreateProgramWithSource), and then creating your kernel from that program using clCreateKernel()?
- Altera_Forum
Honored Contributor
Hi HRZ,
thank you for your answer. The 'CL_INVALID_KERNEL' error is generated by clSetKernelArg(). After each call of this function the returned cl_int value is checked for errors. There is none for the first eight parameters, but for the ninth (cl_float4). If the order of setting kernel arguments is changed, it is again successful until the cl_float4 argument. The program is obtained from a pre-compiled binary by using clCreateProgramWithBinary() in combination with clBuildProgram(). Afterwards the kernel is created with clCreateKernel(). - Altera_Forum
Honored Contributor
It's a small thing, but check the index value you set in each call of clSetKernelArg. If you accidentally use the same index (from a copy/paste), you will have an issue. cl_float4 should work fine.
- Altera_Forum
Honored Contributor
Can you post the host code starting from clCreateProgramWithBinary() until clEnqueueNDRangeKernel()? Please either attach the file to your post, or copy paste it between the "code" tag so that indentation is preserved.
- Altera_Forum
Honored Contributor
Actually, it was not the cl_float4 value. After I reduced the number of arguments to 8 it worked out.