cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

ifrah
Adept II

Using STL Vector in .cl file?

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?

0 Likes
1 Solution
nou
Exemplar

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.

View solution in original post

0 Likes
1 Reply
nou
Exemplar

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.

0 Likes