diff --git a/include/RAJA/internal/ThreadUtils_CPU.hpp b/include/RAJA/internal/ThreadUtils_CPU.hpp index 8d23e910e6..5a45c67ea2 100644 --- a/include/RAJA/internal/ThreadUtils_CPU.hpp +++ b/include/RAJA/internal/ThreadUtils_CPU.hpp @@ -24,7 +24,9 @@ #include "RAJA/config.hpp" #include "RAJA/pattern/thread.hpp" +#if defined(RAJA_ENABLE_OPENMP) #include "RAJA/policy/openmp/thread.hpp" +#endif #include "RAJA/policy/sequential/thread.hpp" namespace RAJA diff --git a/include/RAJA/policy/openmp/forall.hpp b/include/RAJA/policy/openmp/forall.hpp index a66c9253be..371b3064b3 100644 --- a/include/RAJA/policy/openmp/forall.hpp +++ b/include/RAJA/policy/openmp/forall.hpp @@ -82,6 +82,12 @@ forall_impl(resources::Host host_res, } else { +// This branch handles the case of an OpenMP reduction through the RAJA::kernel +// abstraction. MSVC is not supported in this case. +#if defined(RAJA_COMPILER_MSVC) + static_assert(false, "MSVC does not support an OpenMP reduction through " + "the RAJA::kernel abstraction"); +#else auto reducers_tuple = loop_body.data.param_tuple; using EXEC_POL = camp::decay; @@ -110,6 +116,7 @@ forall_impl(resources::Host host_res, } } RAJA::expt::detail::resolve_params(reducers_tuple); +#endif } return resources::EventProxy(host_res); } diff --git a/include/RAJA/policy/openmp/policy.hpp b/include/RAJA/policy/openmp/policy.hpp index d7ca61c0d2..29fec382f8 100644 --- a/include/RAJA/policy/openmp/policy.hpp +++ b/include/RAJA/policy/openmp/policy.hpp @@ -21,6 +21,7 @@ #define policy_openmp_HPP #include +#include #include "RAJA/policy/PolicyBase.hpp" @@ -39,8 +40,6 @@ typedef enum omp_sched_t // schedule modifier omp_sched_monotonic = 0x80000000u } omp_sched_t; -#else -#include #endif namespace RAJA