The following code worked for me. If you put this code in a file with the extension .cu, it compiles well, but if you put it in a file with the extension .cpp, it will give a compile-time error message.
thrust::device_vector<float> vectors[3]; //thrust::device_vector<float> *vectors = new thrust::device_vector<float>[3]; vectors[0] = thrust::device_vector<float>(10); vectors[1] = thrust::device_vector<float>(10); vectors[2] = thrust::device_vector<float>(10); printf("Works\n");
The approval error is as follows
1>../for_each.inl(96) : error C2027: use of undefined type 'thrust::detail::STATIC_ASSERTION_FAILURE<x>'
phoad source share