From 9f2b680594e345a79d1c7884d3b7fce5a98508d9 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Wed, 23 Nov 2016 11:45:50 -0500 Subject: [PATCH] WholeCellSetIn now uses the proper fetch tag. --- vtkm/exec/arg/CMakeLists.txt | 1 + vtkm/exec/arg/FetchTagWholeCellSetIn.h | 70 ++++++++++++++++++++++++++ vtkm/worklet/internal/WorkletBase.h | 3 +- 3 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 vtkm/exec/arg/FetchTagWholeCellSetIn.h diff --git a/vtkm/exec/arg/CMakeLists.txt b/vtkm/exec/arg/CMakeLists.txt index caba1ae93..7d8f1e61f 100644 --- a/vtkm/exec/arg/CMakeLists.txt +++ b/vtkm/exec/arg/CMakeLists.txt @@ -30,6 +30,7 @@ set(headers FetchTagArrayTopologyMapIn.h FetchTagExecObject.h FetchTagCellSetIn.h + FetchTagWholeCellSetIn.h FromCount.h FromIndices.h ThreadIndices.h diff --git a/vtkm/exec/arg/FetchTagWholeCellSetIn.h b/vtkm/exec/arg/FetchTagWholeCellSetIn.h new file mode 100644 index 000000000..4e4459801 --- /dev/null +++ b/vtkm/exec/arg/FetchTagWholeCellSetIn.h @@ -0,0 +1,70 @@ +//============================================================================ +// Copyright (c) Kitware, Inc. +// All rights reserved. +// See LICENSE.txt for details. +// This software is distributed WITHOUT ANY WARRANTY; without even +// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +// PURPOSE. See the above copyright notice for more information. +// +// Copyright 2014 Sandia Corporation. +// Copyright 2014 UT-Battelle, LLC. +// Copyright 2014 Los Alamos National Security. +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National +// Laboratory (LANL), the U.S. Government retains certain rights in +// this software. +//============================================================================ +#ifndef vtk_m_exec_arg_FetchTagWholeCellSetIn_h +#define vtk_m_exec_arg_FetchTagWholeCellSetIn_h + +#include +#include + +#include + +#include + +namespace vtkm { +namespace exec { +namespace arg { + +/// \brief \c Fetch tag for whole cell sets. +/// +/// +struct FetchTagWholeCellSetIn { }; + + +template +struct Fetch< + vtkm::exec::arg::FetchTagWholeCellSetIn, + vtkm::exec::arg::AspectTagDefault, + ThreadIndicesType, + ExecObjectType> +{ + typedef ExecObjectType ValueType; + + VTKM_SUPPRESS_EXEC_WARNINGS + VTKM_EXEC + ValueType Load(const ThreadIndicesType &vtkmNotUsed(indices), + const ExecObjectType &execObject) const + { + return execObject; + } + + VTKM_EXEC + void Store(const ThreadIndicesType &, + const ExecObjectType &, + const ValueType &) const + { + // Store is a no-op for this fetch. + } +}; + +} +} +} // namespace vtkm::exec::arg + +#endif //vtk_m_exec_arg_FetchTagWholeCellSetIn_h diff --git a/vtkm/worklet/internal/WorkletBase.h b/vtkm/worklet/internal/WorkletBase.h index 5811a4ddf..f05c9c737 100644 --- a/vtkm/worklet/internal/WorkletBase.h +++ b/vtkm/worklet/internal/WorkletBase.h @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -295,7 +296,7 @@ public: struct WholeCellSetIn : vtkm::cont::arg::ControlSignatureTagBase { typedef vtkm::cont::arg::TypeCheckTagCellSet TypeCheckTag; typedef vtkm::cont::arg::TransportTagCellSetIn TransportTag; - typedef vtkm::exec::arg::FetchTagExecObject FetchTag; + typedef vtkm::exec::arg::FetchTagWholeCellSetIn FetchTag; }; /// \brief Creates a \c ThreadIndices object.