Compilation error for `transform_reduce` for the openMP implementation
- Dominant language
- C++
- Stars
- 2.5k
- Forks
- 487
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 296
Description
The following code does not compile for openMP (with the flag `-DTHRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_OMP`) but otherwise it compiles (see [godbolt](https://godbolt.org/z/7oe3f7jao)) .
```
#include
#include
#include
#include
#include
int main()
{
std::vector inputVector = { 1, 2, 3, 4};
thrust::device_vector deviceVector = inputVector;
auto sum = thrust::transform_reduce(deviceVector.begin(), deviceVector.end(), thrust::square(), 0, thrust::plus());
std::cout << "Sum of squares of integers: " << sum << std::endl;
return 0;
}
```
The error message contains
``
../thrust/system/omp/detail/default_decomposition.inl(43): error: static assertion failed with "OpenMP compiler support is not enabled"
static_assert((thrust::detail::depend_on_instantiation< IndexType, (0 == 1) >::value), "OpenMP compiler support is not enabled")
``
Are there any plans to fix this?
Contributor guide
Assessment
This issue has not been assessed yet.