Forum Discussion
MEIYAN_L_Intel
Frequent Contributor
6 years agoHi,
You can be able to put the struct as a parameter in the kernel declaration and then call clSetKernelArg() from host (https://www.khronos.org/registry/OpenCL/sdk/1.2/docs/man/xhtml/clSetKernelArg.html).
For an example:
// Host
error_type et;
clSetKernelArg( min_kernel, 0, sizeof(error_type), &(et) )
Thanks
- GRodr256 years ago
New Contributor
Hello @MeiYanL_Intel,
Thank your for your answer. I am afraid that will not work, since AOC will not allow me to compile min_kernel. I read in one of the Intel guides structs must be passed as pointers, indeed. So, there seems to be no other way than creating a buffer for the struct and passing a pointer to it.
Thank you.