From acc9774f675aa3ddfb1dd738358878a0f709b7fa Mon Sep 17 00:00:00 2001 From: Kenneth Moreland Date: Fri, 13 Mar 2020 19:47:05 -0600 Subject: [PATCH] Fix CUDA warnings --- vtkm/cont/internal/ArrayPortalCheck.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/vtkm/cont/internal/ArrayPortalCheck.h b/vtkm/cont/internal/ArrayPortalCheck.h index d8beaf92f..197cef8d2 100644 --- a/vtkm/cont/internal/ArrayPortalCheck.h +++ b/vtkm/cont/internal/ArrayPortalCheck.h @@ -78,9 +78,14 @@ public: } VTKM_CONT ~ArrayPortalCheck() {} + // The Get and Set methods are marked for execution environment even though they won't + // work there. This is so that this class can be used in classes that work in both + // control and execution environments without having to suppress warnings in them all. + + VTKM_SUPPRESS_EXEC_WARNINGS template ::value, int>::type = 0> - VTKM_CONT typename Superclass::ValueType Get(vtkm::Id index) const + VTKM_EXEC_CONT typename Superclass::ValueType Get(vtkm::Id index) const { if (!(*this->Valid)) { @@ -96,9 +101,10 @@ public: return this->Superclass::Get(index); } + VTKM_SUPPRESS_EXEC_WARNINGS template ::value, int>::type = 0> - VTKM_CONT void Set(vtkm::Id index, typename Superclass::ValueType value) const + VTKM_EXEC_CONT void Set(vtkm::Id index, typename Superclass::ValueType value) const { if (!(*this->Valid)) {