From 4676d07f09e7530327849247a866533f4bb81060 Mon Sep 17 00:00:00 2001 From: Mark Bolstad Date: Tue, 5 Dec 2023 10:03:40 -0700 Subject: [PATCH] Fix error under CUDA with private class declarations nvcc doesn't like the couple of places that we have Impl classes hiding behind a private declaration. So for VTKM_CUDA only, ifdef the private declaration out --- vtkm/cont/internal/DeviceAdapterAlgorithmGeneral.h | 3 +++ vtkm/cont/kokkos/internal/DeviceAdapterAlgorithmKokkos.h | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/vtkm/cont/internal/DeviceAdapterAlgorithmGeneral.h b/vtkm/cont/internal/DeviceAdapterAlgorithmGeneral.h index b724d1c49..9fc50061a 100644 --- a/vtkm/cont/internal/DeviceAdapterAlgorithmGeneral.h +++ b/vtkm/cont/internal/DeviceAdapterAlgorithmGeneral.h @@ -529,7 +529,10 @@ public: //-------------------------------------------------------------------------- // Reduce +#ifndef VTKM_CUDA + // nvcc doesn't like the private class declaration so disable under CUDA private: +#endif template class ReduceDecoratorImpl { diff --git a/vtkm/cont/kokkos/internal/DeviceAdapterAlgorithmKokkos.h b/vtkm/cont/kokkos/internal/DeviceAdapterAlgorithmKokkos.h index 0740f1248..1a16ef492 100644 --- a/vtkm/cont/kokkos/internal/DeviceAdapterAlgorithmKokkos.h +++ b/vtkm/cont/kokkos/internal/DeviceAdapterAlgorithmKokkos.h @@ -245,7 +245,10 @@ public: } //---------------------------------------------------------------------------- +#ifndef VTKM_CUDA + // nvcc doesn't like the private class declaration so disable under CUDA private: +#endif template VTKM_CONT static ResultType ReduceImpl(const ArrayHandle& input, BinaryOperator binaryOperator, @@ -414,7 +417,10 @@ public: } //---------------------------------------------------------------------------- +#ifndef VTKM_CUDA + // nvcc doesn't like the private class declaration so disable under CUDA private: +#endif // Scan and Reduce have the same conditions template using UseKokkosScan = UseKokkosReduce; @@ -546,7 +552,10 @@ public: } //---------------------------------------------------------------------------- +#ifndef VTKM_CUDA + // nvcc doesn't like the private class declaration so disable under CUDA private: +#endif template VTKM_CONT static T ScanInclusiveImpl(const vtkm::cont::ArrayHandle& input, vtkm::cont::ArrayHandle& output,