GRodr25
New Contributor
6 years agoCannot use custom type in kernel
Hello,
I am unable to use a custom type in my OpenCL kernel, passing it by value (error: unsupported kernel argument type. This problem arises in compilation time). I found a solution in this question https://forums.intel.com/s/question/0D50P00004Nr1jn/emulation-fails-with-userdefined-data-type-for-a-kernel-argument, which tackles the problem passing a pointer and setting the address qualifier __global. I would rather stay with the passing by value version, due to some application constraints. I am using Intel FPGA SDK for OpenCL 16.1. Is there other way to overcome this issue instead of this ugly trick?
Just in case it helps you, I reproduced the problem with a minimal kernel:
typedef struct {
char a;
char b;
} error_type;
__kernel void min_kernel(error_type err_data) {
err_data.a = 'a';
err_data.b = 'b';
}Thank you.