[NV 2716223] `adjacent_difference` generates a warning (warning: calling a __host__ function from a __host__ __device__ function) with the OpenMP backend
- Dominant language
- C++
- Stars
- 2.5k
- Forks
- 486
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 295
Description
Using `thrust::adjacent_difference` with `thrust::omp::par` execution policy produces the warning
```
thrust/system/detail/generic/adjacent_difference.inl(73): warning: calling a __host__ function from a __host__ __device__ function is not allowed
detected during:
instantiation of "OutputIterator thrust::system::detail::generic::adjacent_difference(thrust::execution_policy &, InputIterator, InputIterator, OutputIterator, BinaryFunction) [with DerivedPolicy=thrust::system::omp::detail::par_t, InputIterator=__gnu_cxx::__normal_iterator>>, OutputIterator=__gnu_cxx::__normal_iterator>>, BinaryFunction=thrust::minus]"
```
when passing `std::vector` iterators.
Minimal example:
```
#include
#include
#include
#include
int main(){
std::vector a{0};
std::vector b{1};
thrust::adjacent_difference(thrust::omp::par, a.begin(), a.end(), b.begin());
auto k = thrust::min(a.begin(), b.begin());
thrust::sort(thrust::omp::par, a.begin(), a.end());
}
```
Code is compiled with `nvcc main.cu -Xcompiler "-fopenmp" -o main`.
Cuda compilation tools, release 10.1, V10.1.243
The latest thrust version from Github is used.
NVBug 2716223
Contributor guide
Assessment
This issue has not been assessed yet.