You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to gather data from a struct of arrays, which contains some vector of vectors. thrust::zip_iterator is used to fuse the calls of individual arrays. This causes a series of warnings.
#include <thrust/iterator/zip_iterator.h>
#include <thrust/gather.h>
#include <thrust/host_vector.h>
int main(){
thrust::host_vector<int> map(42);
thrust::host_vector<thrust::host_vector<char>> vecvec(42);
thrust::host_vector<thrust::host_vector<char>> outvecvec(42);
auto in = thrust::make_zip_iterator(thrust::make_tuple(
vecvec.begin()
));
auto out = thrust::make_zip_iterator(thrust::make_tuple(
outvecvec.begin()
));
#if 1
// warning calling a __host__ function from a __host__ __device__
thrust::gather(
map.begin(),
map.end(),
in,
out
);
#else
// no warning
thrust::gather(
map.begin(),
map.end(),
vecvec.begin(),
outvecvec.begin()
);
#endif
}
/opt/compiler-explorer/libs/thrustcub/trunk/thrust/detail/tuple.inl(458): warning: calling a __host__ function from a __host__ __device__ function is not allowed
detected during:
instantiation of "thrust::detail::cons<HT, thrust::null_type>::cons(const thrust::detail::cons<HT2, thrust::null_type> &) [with HT=thrust::host_vector<char, std::allocator<char>>, HT2=thrust::host_vector<char, std::allocator<char>> &]"
/opt/compiler-explorer/libs/thrustcub/trunk/thrust/tuple.h(346): here
/opt/compiler-explorer/libs/thrustcub/trunk/thrust/detail/function.h(118): warning: calling a __host__ function("thrust::host_vector<char, ::std::allocator<char> > ::~host_vector()") from a __host__ __device__ function("thrust::detail::cons< ::thrust::host_vector<char, ::std::allocator<char> > , ::thrust::null_type> ::~cons") is not allowed
/opt/compiler-explorer/libs/thrustcub/trunk/thrust/detail/tuple.inl(458): warning: calling a __host__ function("thrust::host_vector<char, ::std::allocator<char> > ::host_vector(const thrust::host_vector<char, ::std::allocator<char> > &)") from a __host__ __device__ function("thrust::detail::cons< ::thrust::host_vector<char, ::std::allocator<char> > , ::thrust::null_type> ::cons< ::thrust::host_vector<char, ::std::allocator<char> > &> ") is not allowed
The text was updated successfully, but these errors were encountered:
I would like to gather data from a struct of arrays, which contains some vector of vectors.
thrust::zip_iterator
is used to fuse the calls of individual arrays. This causes a series of warnings.https://cuda.godbolt.org/z/4Ebo6Yn57
The text was updated successfully, but these errors were encountered: