diff --git a/vtkm/cont/kokkos/internal/DeviceAdapterAlgorithmKokkos.h b/vtkm/cont/kokkos/internal/DeviceAdapterAlgorithmKokkos.h index 98ea39907..b5b6e6a26 100644 --- a/vtkm/cont/kokkos/internal/DeviceAdapterAlgorithmKokkos.h +++ b/vtkm/cont/kokkos/internal/DeviceAdapterAlgorithmKokkos.h @@ -32,6 +32,13 @@ VTKM_THIRDPARTY_POST_INCLUDE #include +#if KOKKOS_VERSION_MAJOR > 3 || (KOKKOS_VERSION_MAJOR == 3 && KOKKOS_VERSION_MINOR >= 7) +#define VTKM_VOLATILE +#else +#define VTKM_VOLATILE volatile +#endif + + namespace vtkm { namespace internal @@ -256,7 +263,10 @@ private: } KOKKOS_INLINE_FUNCTION - void join(value_type& dst, const value_type& src) const { dst = this->Operator(dst, src); } + void join(VTKM_VOLATILE value_type& dst, const VTKM_VOLATILE value_type& src) const + { + dst = this->Operator(dst, src); + } KOKKOS_INLINE_FUNCTION void init(value_type& dst) const @@ -791,4 +801,6 @@ public: } } // namespace vtkm::cont +#undef VTKM_VOLATILE + #endif //vtk_m_cont_kokkos_internal_DeviceAdapterAlgorithmKokkos_h