Hi, i am using a struct containing three values, one of which is an STL vector in my opencl code. I have defined this struct in my cpp file and i have to define it in my cl file as well and it does not seem to be straightforward.
struct my_struct{
int a;
int b;
std::vector<int> vec(2);
}
I am getting this error "type name requires a specifier or qualifier", may be because kernel does not know about vector library. Do i have to send the header file or is it just not possible to define this struct in the kernel file?
Solved! Go to Solution.
1. OepnCL is based on C language. STL vector is from C++.
2. there is experimental partial support for C++ in AMD implementation but http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2012/10/CPP_kernel_language.pdf but STL is still not supported.
so your struct is not possible.
1. OepnCL is based on C language. STL vector is from C++.
2. there is experimental partial support for C++ in AMD implementation but http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2012/10/CPP_kernel_language.pdf but STL is still not supported.
so your struct is not possible.