Hello,I have got a question about the function 'clSetKernelArg()' and the error code 'CL_INVALID_KERNEL'. My problem: My kernel function takes nine parameters. When I try to set the kernel arguments via the function 'clSetKernelArg()' everything works fine until I want to set a cl_float4. I then get a 'CL_INVALID_KERNEL' error. Is cl_float4 not supported by FPGA? When I run the same code on CPU or GPU everything works fine. Any hints will be apprecciated. Tobias
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()?
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().
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.
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.