- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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. TobiasLink Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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()?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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().- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Actually, it was not the cl_float4 value. After I reduced the number of arguments to 8 it worked out.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page