diff --git a/vtkm/cont/ArrayHandleGroupVecVariable.h b/vtkm/cont/ArrayHandleGroupVecVariable.h index 5e2f78997..d7b19347d 100644 --- a/vtkm/cont/ArrayHandleGroupVecVariable.h +++ b/vtkm/cont/ArrayHandleGroupVecVariable.h @@ -119,10 +119,9 @@ namespace arg // Instead, you need to implement the Load to point to the array portal. You // can also ignore the Store because the data is already set in the array at // that point. -template +template struct Fetch> { using ExecObjectType = @@ -130,15 +129,16 @@ struct Fetch + VTKM_EXEC ValueType Load(const ThreadIndicesType& indices, + const ExecObjectType& arrayPortal) const { return arrayPortal.Get(indices.GetOutputIndex()); } VTKM_SUPPRESS_EXEC_WARNINGS - VTKM_EXEC - void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const + template + VTKM_EXEC void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const { // We can actually ignore this because the VecFromPortal will already have // set new values in the array. diff --git a/vtkm/exec/arg/Boundary.h b/vtkm/exec/arg/Boundary.h index df3612a3e..526837874 100644 --- a/vtkm/exec/arg/Boundary.h +++ b/vtkm/exec/arg/Boundary.h @@ -40,24 +40,20 @@ struct Boundary : vtkm::exec::arg::ExecutionSignatureTagBase }; template -struct Fetch +struct Fetch { - using ThreadIndicesType = vtkm::exec::arg::ThreadIndicesPointNeighborhood; using ValueType = vtkm::exec::BoundaryState; VTKM_SUPPRESS_EXEC_WARNINGS - VTKM_EXEC - ValueType Load(const ThreadIndicesType& indices, const ExecObjectType&) const + template + VTKM_EXEC ValueType Load(const ThreadIndicesType& indices, const ExecObjectType&) const { return indices.GetBoundaryState(); } - VTKM_EXEC - void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const + template + VTKM_EXEC void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const { // Store is a no-op. } diff --git a/vtkm/exec/arg/CellShape.h b/vtkm/exec/arg/CellShape.h index a5660283d..83d813315 100644 --- a/vtkm/exec/arg/CellShape.h +++ b/vtkm/exec/arg/CellShape.h @@ -12,7 +12,6 @@ #include #include -#include namespace vtkm { @@ -38,25 +37,19 @@ struct CellShape : vtkm::exec::arg::ExecutionSignatureTagBase using AspectTag = vtkm::exec::arg::AspectTagCellShape; }; -template -struct Fetch, - ExecObjectType> +template +struct Fetch { - using ThreadIndicesType = vtkm::exec::arg::ThreadIndicesTopologyMap; - - using ValueType = typename ThreadIndicesType::CellShapeTag; - VTKM_SUPPRESS_EXEC_WARNINGS - VTKM_EXEC - ValueType Load(const ThreadIndicesType& indices, const ExecObjectType&) const + template + VTKM_EXEC auto Load(const ThreadIndicesType& indices, const ExecObjectType&) const + -> decltype(indices.GetCellShape()) { return indices.GetCellShape(); } - VTKM_EXEC - void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const + template + VTKM_EXEC void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const { // Store is a no-op. } diff --git a/vtkm/exec/arg/Fetch.h b/vtkm/exec/arg/Fetch.h index 9fbfcde3e..5d23ec4d5 100644 --- a/vtkm/exec/arg/Fetch.h +++ b/vtkm/exec/arg/Fetch.h @@ -45,10 +45,7 @@ namespace arg /// ExecutionSignature with a particular aspect is pointing to the wrong /// argument or an invalid argument in the ControlSignature. /// -template +template struct Fetch #ifdef VTKM_DOXYGEN_ONLY { @@ -68,8 +65,9 @@ struct Fetch /// work instance. If there is no actual data to load (for example for a /// write-only fetch), this method can be a no-op and return any value. /// - VTKM_EXEC - ValueType Load(const ThreadIndicesType& indices, const ExecObjectType& execObject) const; + template + VTKM_EXEC ValueType Load(const ThreadIndicesType& indices, + const ExecObjectType& execObject) const; /// \brief Store data from a work instance. /// @@ -80,10 +78,10 @@ struct Fetch /// fetch. If the store is not applicable (for example for a read-only /// fetch), this method can be a no-op. /// - VTKM_EXEC - void Store(const ThreadIndicesType& indices, - const ExecObjectType& execObject, - const ValueType& value) const; + template + VTKM_EXEC void Store(const ThreadIndicesType& indices, + const ExecObjectType& execObject, + const ValueType& value) const; }; #else // VTKM_DOXYGEN_ONLY ; diff --git a/vtkm/exec/arg/FetchExtrude.h b/vtkm/exec/arg/FetchExtrude.h index ecc6cd9fa..05bac2a33 100644 --- a/vtkm/exec/arg/FetchExtrude.h +++ b/vtkm/exec/arg/FetchExtrude.h @@ -26,26 +26,20 @@ namespace arg { //Optimized fetch for point ids when iterating the cells ConnectivityExtrude -template -struct Fetch>, - ExecObjectType> +template +struct Fetch { - using ThreadIndicesType = - vtkm::exec::arg::ThreadIndicesTopologyMap>; - - using ValueType = vtkm::Vec; - VTKM_SUPPRESS_EXEC_WARNINGS - VTKM_EXEC - ValueType Load(const ThreadIndicesType& indices, const ExecObjectType&) const + template + VTKM_EXEC auto Load(const vtkm::exec::arg::ThreadIndicesTopologyMap< + vtkm::exec::ConnectivityExtrude>& indices, + const ExecObjectType&) const -> vtkm::Vec { // std::cout << "opimized fetch for point ids" << std::endl; const auto& xgcidx = indices.GetIndicesIncident(); const vtkm::Id offset1 = (xgcidx.Planes[0] * xgcidx.NumberOfPointsPerPlane); const vtkm::Id offset2 = (xgcidx.Planes[1] * xgcidx.NumberOfPointsPerPlane); - ValueType result; + vtkm::Vec result; result[0] = offset1 + xgcidx.PointIds[0][0]; result[1] = offset1 + xgcidx.PointIds[0][1]; result[2] = offset1 + xgcidx.PointIds[0][2]; @@ -55,132 +49,104 @@ struct Fetch + VTKM_EXEC auto Load(const vtkm::exec::arg::ThreadIndicesTopologyMap& indices, + const ExecObjectType&) const -> decltype(indices.GetIndicesIncident()) + { + return indices.GetIndicesIncident(); + } + + template + VTKM_EXEC void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const { // Store is a no-op. } }; -//Optimized fetch for point arrays when iterating the cells ConnectivityExtrude -template -struct Fetch>, - PortalType> -{ - using ThreadIndicesType = - vtkm::exec::arg::ThreadIndicesTopologyMap>; - using ValueType = vtkm::Vec; - - VTKM_SUPPRESS_EXEC_WARNINGS - VTKM_EXEC - ValueType Load(const ThreadIndicesType& indices, const PortalType& portal) - { - // std::cout << "opimized fetch for point values" << std::endl; - const auto& xgcidx = indices.GetIndicesIncident(); - const vtkm::Id offset1 = (xgcidx.Planes[0] * xgcidx.NumberOfPointsPerPlane); - const vtkm::Id offset2 = (xgcidx.Planes[1] * xgcidx.NumberOfPointsPerPlane); - ValueType result; - result[0] = portal.Get(offset1 + xgcidx.PointIds[0][0]); - result[1] = portal.Get(offset1 + xgcidx.PointIds[0][1]); - result[2] = portal.Get(offset1 + xgcidx.PointIds[0][2]); - result[3] = portal.Get(offset2 + xgcidx.PointIds[1][0]); - result[4] = portal.Get(offset2 + xgcidx.PointIds[1][1]); - result[5] = portal.Get(offset2 + xgcidx.PointIds[1][2]); - return result; - } - - VTKM_EXEC - void Store(const ThreadIndicesType&, const PortalType&, const ValueType&) const - { - // Store is a no-op for this fetch. - } -}; - //Optimized fetch for point coordinates when iterating the cells of ConnectivityExtrude -template +template struct Fetch>, vtkm::exec::ArrayPortalExtrude> { - using ThreadIndicesType = - vtkm::exec::arg::ThreadIndicesTopologyMap>; - using ValueType = vtkm::Vec::ValueType, 6>; - VTKM_SUPPRESS_EXEC_WARNINGS - VTKM_EXEC - ValueType Load(const ThreadIndicesType& indices, const vtkm::exec::ArrayPortalExtrude& points) + template + VTKM_EXEC auto Load(const ThreadIndicesType& indices, + const vtkm::exec::ArrayPortalExtrude& points) + -> decltype(points.GetWedge(indices.GetIndicesIncident())) { // std::cout << "opimized fetch for point coordinates" << std::endl; return points.GetWedge(indices.GetIndicesIncident()); } - VTKM_EXEC - void Store(const ThreadIndicesType&, - const vtkm::exec::ArrayPortalExtrude&, - const ValueType&) const + template + VTKM_EXEC void Store(const ThreadIndicesType&, + const vtkm::exec::ArrayPortalExtrude&, + const ValueType&) const { // Store is a no-op for this fetch. } }; //Optimized fetch for point coordinates when iterating the cells of ConnectivityExtrude -template +template struct Fetch>, vtkm::exec::ArrayPortalExtrudePlane> { - using ThreadIndicesType = - vtkm::exec::arg::ThreadIndicesTopologyMap>; - using ValueType = vtkm::Vec::ValueType, 6>; - VTKM_SUPPRESS_EXEC_WARNINGS - VTKM_EXEC - ValueType Load(const ThreadIndicesType& indices, - const vtkm::exec::ArrayPortalExtrudePlane& portal) + template + VTKM_EXEC auto Load(const ThreadIndicesType& indices, + const vtkm::exec::ArrayPortalExtrudePlane& portal) + -> decltype(portal.GetWedge(indices.GetIndicesIncident())) { // std::cout << "opimized fetch for point coordinates" << std::endl; return portal.GetWedge(indices.GetIndicesIncident()); } - VTKM_EXEC - void Store(const ThreadIndicesType&, - const vtkm::exec::ArrayPortalExtrudePlane&, - const ValueType&) const + template + VTKM_EXEC void Store(const ThreadIndicesType&, + const vtkm::exec::ArrayPortalExtrudePlane&, + const ValueType&) const { // Store is a no-op for this fetch. } }; //Optimized fetch for point coordinates when iterating the points of ConnectivityExtrude -template -struct Fetch< - vtkm::exec::arg::FetchTagArrayDirectIn, - vtkm::exec::arg::AspectTagDefault, - vtkm::exec::arg::ThreadIndicesTopologyMap>, - vtkm::exec::ArrayPortalExtrude> +template +struct Fetch> { - using ThreadIndicesType = - vtkm::exec::arg::ThreadIndicesTopologyMap>; - using ValueType = typename vtkm::exec::ArrayPortalExtrude::ValueType; + VTKM_SUPPRESS_EXEC_WARNINGS + template + VTKM_EXEC auto Load(const ThreadIndicesType& indices, + const vtkm::exec::ArrayPortalExtrude& points) + -> decltype(points.Get(indices.GetInputIndex())) + { + // std::cout << "optimized fetch for point coordinates" << std::endl; + return points.Get(indices.GetInputIndex()); + } VTKM_SUPPRESS_EXEC_WARNINGS - VTKM_EXEC - ValueType Load(const ThreadIndicesType& indices, const vtkm::exec::ArrayPortalExtrude& points) + template + VTKM_EXEC auto Load(const vtkm::exec::arg::ThreadIndicesTopologyMap< + vtkm::exec::ReverseConnectivityExtrude>& indices, + const vtkm::exec::ArrayPortalExtrude& points) + -> decltype(points.Get(indices.GetIndexLogical())) { - // std::cout << "opimized fetch for point coordinates" << std::endl; + // std::cout << "optimized fetch for point coordinates" << std::endl; return points.Get(indices.GetIndexLogical()); } - VTKM_EXEC - void Store(const ThreadIndicesType&, - const vtkm::exec::ArrayPortalExtrude&, - const ValueType&) const + template + VTKM_EXEC void Store(const ThreadIndicesType&, + const vtkm::exec::ArrayPortalExtrude&, + const ValueType&) const { // Store is a no-op for this fetch. } diff --git a/vtkm/exec/arg/FetchTagArrayDirectIn.h b/vtkm/exec/arg/FetchTagArrayDirectIn.h index 851e8d899..959220a8c 100644 --- a/vtkm/exec/arg/FetchTagArrayDirectIn.h +++ b/vtkm/exec/arg/FetchTagArrayDirectIn.h @@ -45,10 +45,9 @@ inline VTKM_EXEC T load(const U* u, vtkm::Id v) return u->Get(v); } -template +template struct Fetch { //need to remove pointer type from ThreadIdicesType @@ -59,14 +58,14 @@ struct Fetch + VTKM_EXEC ValueType Load(const ThreadIndicesType& indices, PortalType arrayPortal) const { return load(arrayPortal, indices.GetInputIndex()); } - VTKM_EXEC - void Store(const ThreadIndicesType&, PortalType, const ValueType&) const + template + VTKM_EXEC void Store(const ThreadIndicesType&, PortalType, const ValueType&) const { // Store is a no-op for this fetch. } diff --git a/vtkm/exec/arg/FetchTagArrayDirectInOut.h b/vtkm/exec/arg/FetchTagArrayDirectInOut.h index b6129007b..f6f7abad6 100644 --- a/vtkm/exec/arg/FetchTagArrayDirectInOut.h +++ b/vtkm/exec/arg/FetchTagArrayDirectInOut.h @@ -40,26 +40,26 @@ struct FetchTagArrayDirectInOut { }; -template +template struct Fetch { using ValueType = typename ExecObjectType::ValueType; VTKM_SUPPRESS_EXEC_WARNINGS - VTKM_EXEC - ValueType Load(const ThreadIndicesType& indices, const ExecObjectType& arrayPortal) const + template + VTKM_EXEC ValueType Load(const ThreadIndicesType& indices, + const ExecObjectType& arrayPortal) const { return arrayPortal.Get(indices.GetOutputIndex()); } VTKM_SUPPRESS_EXEC_WARNINGS - VTKM_EXEC - void Store(const ThreadIndicesType& indices, - const ExecObjectType& arrayPortal, - const ValueType& value) const + template + VTKM_EXEC void Store(const ThreadIndicesType& indices, + const ExecObjectType& arrayPortal, + const ValueType& value) const { arrayPortal.Set(indices.GetOutputIndex(), value); } diff --git a/vtkm/exec/arg/FetchTagArrayDirectOut.h b/vtkm/exec/arg/FetchTagArrayDirectOut.h index 1a429b61a..1ca3d997e 100644 --- a/vtkm/exec/arg/FetchTagArrayDirectOut.h +++ b/vtkm/exec/arg/FetchTagArrayDirectOut.h @@ -30,16 +30,15 @@ struct FetchTagArrayDirectOut { }; -template +template struct Fetch { VTKM_SUPPRESS_EXEC_WARNINGS - VTKM_EXEC - auto Load(const ThreadIndicesType&, const ExecObjectType&) -> - typename ExecObjectType::ValueType const + template + VTKM_EXEC auto Load(const ThreadIndicesType&, const ExecObjectType&) const -> + typename ExecObjectType::ValueType { // Load is a no-op for this fetch. using ValueType = typename ExecObjectType::ValueType; @@ -47,7 +46,7 @@ struct Fetch + template VTKM_EXEC void Store(const ThreadIndicesType& indices, const ExecObjectType& arrayPortal, const T& value) const diff --git a/vtkm/exec/arg/FetchTagArrayNeighborhoodIn.h b/vtkm/exec/arg/FetchTagArrayNeighborhoodIn.h index 86ee7f028..6964b55b0 100644 --- a/vtkm/exec/arg/FetchTagArrayNeighborhoodIn.h +++ b/vtkm/exec/arg/FetchTagArrayNeighborhoodIn.h @@ -34,21 +34,20 @@ struct FetchTagArrayNeighborhoodIn template struct Fetch { - using ThreadIndicesType = vtkm::exec::arg::ThreadIndicesPointNeighborhood; using ValueType = vtkm::exec::FieldNeighborhood; VTKM_SUPPRESS_EXEC_WARNINGS - VTKM_EXEC - ValueType Load(const ThreadIndicesType& indices, const ExecObjectType& arrayPortal) const + template + VTKM_EXEC ValueType Load(const ThreadIndicesType& indices, + const ExecObjectType& arrayPortal) const { return ValueType(arrayPortal, indices.GetBoundaryState()); } - VTKM_EXEC - void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const + template + VTKM_EXEC void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const { // Store is a no-op for this fetch. } diff --git a/vtkm/exec/arg/FetchTagArrayTopologyMapIn.h b/vtkm/exec/arg/FetchTagArrayTopologyMapIn.h index b99664af2..28af1c867 100644 --- a/vtkm/exec/arg/FetchTagArrayTopologyMapIn.h +++ b/vtkm/exec/arg/FetchTagArrayTopologyMapIn.h @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -51,12 +52,9 @@ namespace detail // and the field is regular point coordinates, it is much faster to compute the // field directly. -template +template struct FetchArrayTopologyMapInImplementation { - using ThreadIndicesType = vtkm::exec::arg::ThreadIndicesTopologyMap; - - // ThreadIndicesTopologyMap has special incident element indices that are // stored in a Vec-like object. using IndexVecType = typename ThreadIndicesType::IndicesIncidentType; @@ -128,18 +126,18 @@ static inline VTKM_EXEC vtkm::VecAxisAlignedPointCoordinates<3> make_VecAxisAlig return vtkm::VecAxisAlignedPointCoordinates<3>(offsetOrigin, spacing); } -template +template struct FetchArrayTopologyMapInImplementation< vtkm::exec::ConnectivityStructured, - vtkm::internal::ArrayPortalUniformPointCoordinates> + vtkm::internal::ArrayPortalUniformPointCoordinates, + ThreadIndicesType> { using ConnectivityType = vtkm::exec::ConnectivityStructured; - using ThreadIndicesType = vtkm::exec::arg::ThreadIndicesTopologyMap; using ValueType = vtkm::VecAxisAlignedPointCoordinates; @@ -155,14 +153,15 @@ struct FetchArrayTopologyMapInImplementation< } }; -template +template struct FetchArrayTopologyMapInImplementation< vtkm::exec::ConnectivityPermutedVisitCellsWithPoints< PermutationPortal, vtkm::exec::ConnectivityStructured>, - vtkm::internal::ArrayPortalUniformPointCoordinates> + vtkm::internal::ArrayPortalUniformPointCoordinates, + ThreadIndicesType> { using ConnectivityType = vtkm::exec::ConnectivityPermutedVisitCellsWithPoints< @@ -170,7 +169,6 @@ struct FetchArrayTopologyMapInImplementation< vtkm::exec::ConnectivityStructured>; - using ThreadIndicesType = vtkm::exec::arg::ThreadIndicesTopologyMap; using ValueType = vtkm::VecAxisAlignedPointCoordinates; @@ -191,28 +189,56 @@ struct FetchArrayTopologyMapInImplementation< } // namespace detail -template +template struct Fetch, ExecObjectType> { - using ThreadIndicesType = vtkm::exec::arg::ThreadIndicesTopologyMap; - - using Implementation = - detail::FetchArrayTopologyMapInImplementation; - - using ValueType = typename Implementation::ValueType; + //using ConnectivityType = typename ThreadIndicesType::Connectivity; VTKM_SUPPRESS_EXEC_WARNINGS - VTKM_EXEC - ValueType Load(const ThreadIndicesType& indices, const ExecObjectType& field) const + template + VTKM_EXEC auto Load(const ThreadIndicesType& indices, const ExecObjectType& field) const + -> decltype( + detail::FetchArrayTopologyMapInImplementation::Load(indices, field)) { + using Implementation = + detail::FetchArrayTopologyMapInImplementation; return Implementation::Load(indices, field); } - VTKM_EXEC - void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const + //Optimized fetch for point arrays when iterating the cells ConnectivityExtrude + VTKM_SUPPRESS_EXEC_WARNINGS + template + VTKM_EXEC auto Load(const vtkm::exec::arg::ThreadIndicesTopologyMap< + vtkm::exec::ConnectivityExtrude>& indices, + const ExecObjectType& portal) + -> vtkm::Vec + { + // std::cout << "opimized fetch for point values" << std::endl; + const auto& xgcidx = indices.GetIndicesIncident(); + const vtkm::Id offset1 = (xgcidx.Planes[0] * xgcidx.NumberOfPointsPerPlane); + const vtkm::Id offset2 = (xgcidx.Planes[1] * xgcidx.NumberOfPointsPerPlane); + + using ValueType = vtkm::Vec; + ValueType result; + + result[0] = portal.Get(offset1 + xgcidx.PointIds[0][0]); + result[1] = portal.Get(offset1 + xgcidx.PointIds[0][1]); + result[2] = portal.Get(offset1 + xgcidx.PointIds[0][2]); + result[3] = portal.Get(offset2 + xgcidx.PointIds[1][0]); + result[4] = portal.Get(offset2 + xgcidx.PointIds[1][1]); + result[5] = portal.Get(offset2 + xgcidx.PointIds[1][2]); + return result; + } + + + template + VTKM_EXEC void Store(const ThreadIndicesType&, const ExecObjectType&, const T&) const { // Store is a no-op for this fetch. } diff --git a/vtkm/exec/arg/FetchTagCellSetIn.h b/vtkm/exec/arg/FetchTagCellSetIn.h index 05b1a3af5..cc0fedc29 100644 --- a/vtkm/exec/arg/FetchTagCellSetIn.h +++ b/vtkm/exec/arg/FetchTagCellSetIn.h @@ -12,7 +12,6 @@ #include #include -#include namespace vtkm { @@ -31,25 +30,19 @@ struct FetchTagCellSetIn { }; -template -struct Fetch, - ExecObjectType> +template +struct Fetch { - using ThreadIndicesType = vtkm::exec::arg::ThreadIndicesTopologyMap; - - using ValueType = typename ThreadIndicesType::CellShapeTag; - VTKM_SUPPRESS_EXEC_WARNINGS - VTKM_EXEC - ValueType Load(const ThreadIndicesType& indices, const ExecObjectType&) const + template + VTKM_EXEC auto Load(const ThreadIndicesType& indices, const ExecObjectType&) const + -> decltype(indices.GetCellShape()) { return indices.GetCellShape(); } - VTKM_EXEC - void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const + template + VTKM_EXEC void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const { // Store is a no-op for this fetch. } diff --git a/vtkm/exec/arg/FetchTagExecObject.h b/vtkm/exec/arg/FetchTagExecObject.h index 6945354c8..f98c9cfe9 100644 --- a/vtkm/exec/arg/FetchTagExecObject.h +++ b/vtkm/exec/arg/FetchTagExecObject.h @@ -33,24 +33,21 @@ struct FetchTagExecObject { }; -template -struct Fetch +template +struct Fetch { using ValueType = ExecObjectType; VTKM_SUPPRESS_EXEC_WARNINGS - VTKM_EXEC - ValueType Load(const ThreadIndicesType& vtkmNotUsed(indices), - const ExecObjectType& execObject) const + template + 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 + template + VTKM_EXEC void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const { // Store is a no-op for this fetch. } diff --git a/vtkm/exec/arg/FetchTagKeysIn.h b/vtkm/exec/arg/FetchTagKeysIn.h index 0f1076391..e3a540c25 100644 --- a/vtkm/exec/arg/FetchTagKeysIn.h +++ b/vtkm/exec/arg/FetchTagKeysIn.h @@ -36,24 +36,22 @@ template > { - using ThreadIndicesType = vtkm::exec::arg::ThreadIndicesReduceByKey; using ExecObjectType = vtkm::exec::internal::ReduceByKeyLookup; using ValueType = typename ExecObjectType::KeyType; VTKM_SUPPRESS_EXEC_WARNINGS - VTKM_EXEC - ValueType Load(const ThreadIndicesType& indices, const ExecObjectType& keys) const + template + VTKM_EXEC ValueType Load(const ThreadIndicesType& indices, const ExecObjectType& keys) const { return keys.UniqueKeys.Get(indices.GetInputIndex()); } - VTKM_EXEC - void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const + template + VTKM_EXEC void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const { // Store is a no-op for this fetch. } diff --git a/vtkm/exec/arg/FetchTagWholeCellSetIn.h b/vtkm/exec/arg/FetchTagWholeCellSetIn.h index b57a00655..59a456d1f 100644 --- a/vtkm/exec/arg/FetchTagWholeCellSetIn.h +++ b/vtkm/exec/arg/FetchTagWholeCellSetIn.h @@ -29,24 +29,23 @@ struct FetchTagWholeCellSetIn { }; -template +template struct Fetch { using ValueType = ExecObjectType; VTKM_SUPPRESS_EXEC_WARNINGS - VTKM_EXEC - ValueType Load(const ThreadIndicesType& vtkmNotUsed(indices), - const ExecObjectType& execObject) const + template + 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 + template + VTKM_EXEC void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const { // Store is a no-op for this fetch. } diff --git a/vtkm/exec/arg/IncidentElementCount.h b/vtkm/exec/arg/IncidentElementCount.h index 251467bf9..1ca276adc 100644 --- a/vtkm/exec/arg/IncidentElementCount.h +++ b/vtkm/exec/arg/IncidentElementCount.h @@ -12,7 +12,6 @@ #include #include -#include namespace vtkm { @@ -44,25 +43,20 @@ struct IncidentElementCount : vtkm::exec::arg::ExecutionSignatureTagBase using AspectTag = vtkm::exec::arg::AspectTagIncidentElementCount; }; -template -struct Fetch, - ExecObjectType> +template +struct Fetch { - using ThreadIndicesType = vtkm::exec::arg::ThreadIndicesTopologyMap; - using ValueType = vtkm::IdComponent; VTKM_SUPPRESS_EXEC_WARNINGS - VTKM_EXEC - ValueType Load(const ThreadIndicesType& indices, const ExecObjectType&) const + template + VTKM_EXEC ValueType Load(const ThreadIndicesType& indices, const ExecObjectType&) const { return indices.GetIndicesIncident().GetNumberOfComponents(); } - VTKM_EXEC - void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const + template + VTKM_EXEC void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const { // Store is a no-op. } diff --git a/vtkm/exec/arg/IncidentElementIndices.h b/vtkm/exec/arg/IncidentElementIndices.h index f14cc81bd..d90b930f6 100644 --- a/vtkm/exec/arg/IncidentElementIndices.h +++ b/vtkm/exec/arg/IncidentElementIndices.h @@ -12,7 +12,6 @@ #include #include -#include namespace vtkm { @@ -44,30 +43,6 @@ struct IncidentElementIndices : vtkm::exec::arg::ExecutionSignatureTagBase static constexpr vtkm::IdComponent INDEX = 1; using AspectTag = vtkm::exec::arg::AspectTagIncidentElementIndices; }; - -template -struct Fetch, - ExecObjectType> -{ - using ThreadIndicesType = vtkm::exec::arg::ThreadIndicesTopologyMap; - - using ValueType = typename ThreadIndicesType::IndicesIncidentType; - - VTKM_SUPPRESS_EXEC_WARNINGS - VTKM_EXEC - ValueType Load(const ThreadIndicesType& indices, const ExecObjectType&) const - { - return indices.GetIndicesIncident(); - } - - VTKM_EXEC - void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const - { - // Store is a no-op. - } -}; } } } // namespace vtkm::exec::arg diff --git a/vtkm/exec/arg/InputIndex.h b/vtkm/exec/arg/InputIndex.h index ffa2de996..c71dd3eb2 100644 --- a/vtkm/exec/arg/InputIndex.h +++ b/vtkm/exec/arg/InputIndex.h @@ -50,19 +50,19 @@ struct InputIndex : vtkm::exec::arg::ExecutionSignatureTagBase using AspectTag = vtkm::exec::arg::AspectTagInputIndex; }; -template -struct Fetch +template +struct Fetch { using ValueType = vtkm::Id; - VTKM_EXEC - vtkm::Id Load(const ThreadIndicesType& indices, const ExecObjectType&) const + template + VTKM_EXEC vtkm::Id Load(const ThreadIndicesType& indices, const ExecObjectType&) const { return indices.GetInputIndex(); } - VTKM_EXEC - void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const + template + VTKM_EXEC void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const { // Store is a no-op. } diff --git a/vtkm/exec/arg/OutputIndex.h b/vtkm/exec/arg/OutputIndex.h index 665ba00a1..1d426f57d 100644 --- a/vtkm/exec/arg/OutputIndex.h +++ b/vtkm/exec/arg/OutputIndex.h @@ -50,19 +50,19 @@ struct OutputIndex : vtkm::exec::arg::ExecutionSignatureTagBase using AspectTag = vtkm::exec::arg::AspectTagOutputIndex; }; -template -struct Fetch +template +struct Fetch { using ValueType = vtkm::Id; - VTKM_EXEC - vtkm::Id Load(const ThreadIndicesType& indices, const ExecObjectType&) const + template + VTKM_EXEC vtkm::Id Load(const ThreadIndicesType& indices, const ExecObjectType&) const { return indices.GetOutputIndex(); } - VTKM_EXEC - void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const + template + VTKM_EXEC void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const { // Store is a no-op. } diff --git a/vtkm/exec/arg/ThreadIndices.h b/vtkm/exec/arg/ThreadIndices.h index e000d3d3c..90f6be812 100644 --- a/vtkm/exec/arg/ThreadIndices.h +++ b/vtkm/exec/arg/ThreadIndices.h @@ -49,19 +49,21 @@ struct ThreadIndices : vtkm::exec::arg::ExecutionSignatureTagBase using AspectTag = vtkm::exec::arg::AspectTagThreadIndices; }; -template -struct Fetch +template +struct Fetch { - using ValueType = const ThreadIndicesType&; - VTKM_EXEC - const ThreadIndicesType& Load(const ThreadIndicesType& indices, const ExecObjectType&) const + template + VTKM_EXEC const ThreadIndicesType& Load(const ThreadIndicesType& indices, + const ExecObjectType&) const { return indices; } - VTKM_EXEC - void Store(const ThreadIndicesType&, const ExecObjectType&, const ThreadIndicesType&) const + template + VTKM_EXEC void Store(const ThreadIndicesType&, + const ExecObjectType&, + const ThreadIndicesType&) const { // Store is a no-op. } diff --git a/vtkm/exec/arg/ThreadIndicesExtrude.h b/vtkm/exec/arg/ThreadIndicesExtrude.h index 3db0498e6..21f9f1f5c 100644 --- a/vtkm/exec/arg/ThreadIndicesExtrude.h +++ b/vtkm/exec/arg/ThreadIndicesExtrude.h @@ -31,7 +31,7 @@ public: using CellShapeTag = typename ConnectivityType::CellShapeTag; using IndicesIncidentType = typename ConnectivityType::IndicesType; using LogicalIndexType = typename ConnectivityType::SchedulingRangeType; - + using Connectivity = vtkm::exec::ConnectivityExtrude; VTKM_SUPPRESS_EXEC_WARNINGS VTKM_EXEC ThreadIndicesTopologyMap(vtkm::Id threadIndex, @@ -184,6 +184,7 @@ public: using CellShapeTag = typename ConnectivityType::CellShapeTag; using IndicesIncidentType = typename ConnectivityType::IndicesType; using LogicalIndexType = typename ConnectivityType::SchedulingRangeType; + using Connectivity = ConnectivityType; VTKM_SUPPRESS_EXEC_WARNINGS VTKM_EXEC diff --git a/vtkm/exec/arg/ThreadIndicesTopologyMap.h b/vtkm/exec/arg/ThreadIndicesTopologyMap.h index 8809365be..a32f85a0b 100644 --- a/vtkm/exec/arg/ThreadIndicesTopologyMap.h +++ b/vtkm/exec/arg/ThreadIndicesTopologyMap.h @@ -88,6 +88,7 @@ class ThreadIndicesTopologyMap : public vtkm::exec::arg::ThreadIndicesBasic public: using IndicesIncidentType = typename ConnectivityType::IndicesType; using CellShapeTag = typename ConnectivityType::CellShapeTag; + using Connectivity = ConnectivityType; VTKM_SUPPRESS_EXEC_WARNINGS VTKM_EXEC ThreadIndicesTopologyMap(vtkm::Id threadIndex, @@ -155,6 +156,8 @@ public: using IndicesIncidentType = typename ConnectivityType::IndicesType; using CellShapeTag = typename ConnectivityType::CellShapeTag; using LogicalIndexType = typename ConnectivityType::SchedulingRangeType; + using Connectivity = + vtkm::exec::ConnectivityStructured; VTKM_EXEC ThreadIndicesTopologyMap(vtkm::Id threadIndex, vtkm::Id inIndex, @@ -317,6 +320,11 @@ public: using IndicesIncidentType = typename ConnectivityType::IndicesType; using CellShapeTag = typename ConnectivityType::CellShapeTag; using LogicalIndexType = typename ConnectivityType::SchedulingRangeType; + using Connectivity = vtkm::exec::ConnectivityPermutedVisitCellsWithPoints< + PermutationPortal, + vtkm::exec::ConnectivityStructured>; VTKM_EXEC ThreadIndicesTopologyMap(vtkm::Id threadIndex, vtkm::Id inputIndex, diff --git a/vtkm/exec/arg/ValueCount.h b/vtkm/exec/arg/ValueCount.h index 9caf6860e..e97af9966 100644 --- a/vtkm/exec/arg/ValueCount.h +++ b/vtkm/exec/arg/ValueCount.h @@ -44,24 +44,20 @@ struct ValueCount : vtkm::exec::arg::ExecutionSignatureTagBase }; template -struct Fetch +struct Fetch { - using ThreadIndicesType = vtkm::exec::arg::ThreadIndicesReduceByKey; using ValueType = vtkm::IdComponent; VTKM_SUPPRESS_EXEC_WARNINGS - VTKM_EXEC - ValueType Load(const ThreadIndicesType& indices, const ExecObjectType&) const + template + VTKM_EXEC ValueType Load(const ThreadIndicesType& indices, const ExecObjectType&) const { return indices.GetNumberOfValues(); } - VTKM_EXEC - void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const + template + VTKM_EXEC void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const { // Store is a no-op. } diff --git a/vtkm/exec/arg/VisitIndex.h b/vtkm/exec/arg/VisitIndex.h index 1d055713b..7be61cf7e 100644 --- a/vtkm/exec/arg/VisitIndex.h +++ b/vtkm/exec/arg/VisitIndex.h @@ -51,19 +51,19 @@ struct VisitIndex : vtkm::exec::arg::ExecutionSignatureTagBase using AspectTag = vtkm::exec::arg::AspectTagVisitIndex; }; -template -struct Fetch +template +struct Fetch { using ValueType = vtkm::IdComponent; - VTKM_EXEC - vtkm::IdComponent Load(const ThreadIndicesType& indices, const ExecObjectType&) const + template + VTKM_EXEC vtkm::IdComponent Load(const ThreadIndicesType& indices, const ExecObjectType&) const { return indices.GetVisitIndex(); } - VTKM_EXEC - void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const + template + VTKM_EXEC void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const { // Store is a no-op. } diff --git a/vtkm/exec/arg/WorkIndex.h b/vtkm/exec/arg/WorkIndex.h index d4af78062..c4799a5f6 100644 --- a/vtkm/exec/arg/WorkIndex.h +++ b/vtkm/exec/arg/WorkIndex.h @@ -47,19 +47,19 @@ struct WorkIndex : vtkm::exec::arg::ExecutionSignatureTagBase using AspectTag = vtkm::exec::arg::AspectTagWorkIndex; }; -template -struct Fetch +template +struct Fetch { using ValueType = vtkm::Id; - VTKM_EXEC - vtkm::Id Load(const ThreadIndicesType& indices, const ExecObjectType&) const + template + VTKM_EXEC vtkm::Id Load(const ThreadIndicesType& indices, const ExecObjectType&) const { return indices.GetThreadIndex(); } - VTKM_EXEC - void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const + template + VTKM_EXEC void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const { // Store is a no-op. } diff --git a/vtkm/exec/arg/testing/UnitTestFetchArrayDirectIn.cxx b/vtkm/exec/arg/testing/UnitTestFetchArrayDirectIn.cxx index 2bed5a70f..0d638ce31 100644 --- a/vtkm/exec/arg/testing/UnitTestFetchArrayDirectIn.cxx +++ b/vtkm/exec/arg/testing/UnitTestFetchArrayDirectIn.cxx @@ -45,7 +45,6 @@ struct FetchArrayDirectInTests using FetchType = vtkm::exec::arg::Fetch>; FetchType fetch; diff --git a/vtkm/exec/arg/testing/UnitTestFetchArrayDirectIn3d.cxx b/vtkm/exec/arg/testing/UnitTestFetchArrayDirectIn3d.cxx index fea0dd9d3..ad21f53cd 100644 --- a/vtkm/exec/arg/testing/UnitTestFetchArrayDirectIn3d.cxx +++ b/vtkm/exec/arg/testing/UnitTestFetchArrayDirectIn3d.cxx @@ -54,21 +54,21 @@ namespace arg template struct Fetch> { using ValueType = T; using PortalType = const TestPortal&; - using ThreadIndicesType = vtkm::exec::arg::ThreadIndicesBasic3D; - VTKM_EXEC - ValueType Load(const ThreadIndicesType& indices, PortalType field) const + template + VTKM_EXEC ValueType Load(const ThreadIndicesType& indices, PortalType field) const { return field.Get(indices.GetInputIndex3D()); } - VTKM_EXEC - void Store(const ThreadIndicesType&, PortalType, ValueType) const {} + template + VTKM_EXEC void Store(const ThreadIndicesType&, PortalType, ValueType) const + { + } }; } } @@ -86,7 +86,6 @@ struct FetchArrayDirectIn3DTests using FetchType = vtkm::exec::arg::Fetch>; FetchType fetch; diff --git a/vtkm/exec/arg/testing/UnitTestFetchArrayDirectInOut.cxx b/vtkm/exec/arg/testing/UnitTestFetchArrayDirectInOut.cxx index bfc094e41..55f358977 100644 --- a/vtkm/exec/arg/testing/UnitTestFetchArrayDirectInOut.cxx +++ b/vtkm/exec/arg/testing/UnitTestFetchArrayDirectInOut.cxx @@ -58,7 +58,6 @@ struct FetchArrayDirectInTests using FetchType = vtkm::exec::arg::Fetch>; FetchType fetch; diff --git a/vtkm/exec/arg/testing/UnitTestFetchArrayDirectOut.cxx b/vtkm/exec/arg/testing/UnitTestFetchArrayDirectOut.cxx index f714ea75b..d829b6a71 100644 --- a/vtkm/exec/arg/testing/UnitTestFetchArrayDirectOut.cxx +++ b/vtkm/exec/arg/testing/UnitTestFetchArrayDirectOut.cxx @@ -50,7 +50,6 @@ struct FetchArrayDirectOutTests using FetchType = vtkm::exec::arg::Fetch>; FetchType fetch; diff --git a/vtkm/exec/arg/testing/UnitTestFetchArrayNeighborhoodIn.cxx b/vtkm/exec/arg/testing/UnitTestFetchArrayNeighborhoodIn.cxx index e824f9fa2..99b970dab 100644 --- a/vtkm/exec/arg/testing/UnitTestFetchArrayNeighborhoodIn.cxx +++ b/vtkm/exec/arg/testing/UnitTestFetchArrayNeighborhoodIn.cxx @@ -96,7 +96,6 @@ struct FetchArrayNeighborhoodInTests using FetchType = vtkm::exec::arg::Fetch>; FetchType fetch; diff --git a/vtkm/exec/arg/testing/UnitTestFetchArrayTopologyMapIn.cxx b/vtkm/exec/arg/testing/UnitTestFetchArrayTopologyMapIn.cxx index 5ef6873cc..1ab639ed1 100644 --- a/vtkm/exec/arg/testing/UnitTestFetchArrayTopologyMapIn.cxx +++ b/vtkm/exec/arg/testing/UnitTestFetchArrayTopologyMapIn.cxx @@ -8,15 +8,13 @@ // PURPOSE. See the above copyright notice for more information. //============================================================================ +#include + #include - #include - #include #include -#include - namespace { @@ -93,7 +91,6 @@ struct FetchArrayTopologyMapInTests using FetchType = vtkm::exec::arg::Fetch>; FetchType fetch; @@ -105,7 +102,7 @@ struct FetchArrayTopologyMapInTests ThreadIndicesType indices( threadIndex, inputIndex, visitIndex, outputIndex, invocation.GetInputDomain()); - typename FetchType::ValueType value = + auto value = fetch.Load(indices, vtkm::internal::ParameterGet(invocation.Parameters)); VTKM_TEST_ASSERT(value.GetNumberOfComponents() == 8, "Topology fetch got wrong number of components."); @@ -173,7 +170,6 @@ void TryStructuredPointCoordinatesInvocation(const Invocation& invocation) vtkm::exec::arg::Fetch fetch; diff --git a/vtkm/exec/arg/testing/UnitTestFetchExecObject.cxx b/vtkm/exec/arg/testing/UnitTestFetchExecObject.cxx index 651224ea1..3df0af672 100644 --- a/vtkm/exec/arg/testing/UnitTestFetchExecObject.cxx +++ b/vtkm/exec/arg/testing/UnitTestFetchExecObject.cxx @@ -38,7 +38,6 @@ void TryInvocation() using FetchType = vtkm::exec::arg::Fetch; FetchType fetch; diff --git a/vtkm/exec/arg/testing/UnitTestFetchWorkIndex.cxx b/vtkm/exec/arg/testing/UnitTestFetchWorkIndex.cxx index 9df7f1802..c23ad40b8 100644 --- a/vtkm/exec/arg/testing/UnitTestFetchWorkIndex.cxx +++ b/vtkm/exec/arg/testing/UnitTestFetchWorkIndex.cxx @@ -26,7 +26,6 @@ void TestWorkIndexFetch() using FetchType = vtkm::exec::arg::Fetch; FetchType fetch; diff --git a/vtkm/exec/cuda/internal/testing/UnitTestTaskStrided.cu b/vtkm/exec/cuda/internal/testing/UnitTestTaskStrided.cu index e43f47a15..c68db0c92 100644 --- a/vtkm/exec/cuda/internal/testing/UnitTestTaskStrided.cu +++ b/vtkm/exec/cuda/internal/testing/UnitTestTaskStrided.cu @@ -97,10 +97,7 @@ namespace arg { template <> -struct Fetch +struct Fetch { using ValueType = vtkm::Id; @@ -119,10 +116,7 @@ struct Fetch -struct Fetch +struct Fetch { using ValueType = vtkm::Id; diff --git a/vtkm/exec/internal/WorkletInvokeFunctorDetail.h b/vtkm/exec/internal/WorkletInvokeFunctorDetail.h index 178e789fa..2d3f6229d 100644 --- a/vtkm/exec/internal/WorkletInvokeFunctorDetail.h +++ b/vtkm/exec/internal/WorkletInvokeFunctorDetail.h @@ -84,7 +84,7 @@ struct InvocationToFetch typename Invocation::DeviceAdapterTag, typename Invocation::ParameterInterface::template ParameterType::type>::type; - using type = vtkm::exec::arg::Fetch; + using type = vtkm::exec::arg::Fetch; VTKM_EXEC static ExecObjectType GetParameterImpl(const Invocation&, std::true_type) { diff --git a/vtkm/exec/internal/WorkletInvokeFunctorDetail.h.in b/vtkm/exec/internal/WorkletInvokeFunctorDetail.h.in index af3548c32..679043a63 100644 --- a/vtkm/exec/internal/WorkletInvokeFunctorDetail.h.in +++ b/vtkm/exec/internal/WorkletInvokeFunctorDetail.h.in @@ -145,7 +145,7 @@ struct InvocationToFetch typename Invocation::DeviceAdapterTag, typename Invocation::ParameterInterface::template ParameterType::type>::type; - using type = vtkm::exec::arg::Fetch; + using type = vtkm::exec::arg::Fetch; VTKM_EXEC static ExecObjectType GetParameterImpl(const Invocation&, std::true_type) { diff --git a/vtkm/exec/internal/testing/TestingTaskTiling.h b/vtkm/exec/internal/testing/TestingTaskTiling.h index c7d4152d3..0a02f83df 100644 --- a/vtkm/exec/internal/testing/TestingTaskTiling.h +++ b/vtkm/exec/internal/testing/TestingTaskTiling.h @@ -104,10 +104,7 @@ namespace arg using namespace vtkm::exec::internal::testing; template <> -struct Fetch +struct Fetch { using ValueType = vtkm::Id; @@ -126,10 +123,7 @@ struct Fetch -struct Fetch +struct Fetch { using ValueType = vtkm::Id; diff --git a/vtkm/exec/internal/testing/UnitTestTaskSingular.cxx b/vtkm/exec/internal/testing/UnitTestTaskSingular.cxx index d0144fa52..c1940fa62 100644 --- a/vtkm/exec/internal/testing/UnitTestTaskSingular.cxx +++ b/vtkm/exec/internal/testing/UnitTestTaskSingular.cxx @@ -87,10 +87,7 @@ namespace arg { template <> -struct Fetch +struct Fetch { using ValueType = vtkm::Id; @@ -109,10 +106,7 @@ struct Fetch -struct Fetch +struct Fetch { using ValueType = vtkm::Id; @@ -226,7 +220,6 @@ VTKM_STATIC_ASSERT( InvocationToFetch::type, vtkm::exec::arg::Fetch>::type::value)); VTKM_STATIC_ASSERT( @@ -234,7 +227,6 @@ VTKM_STATIC_ASSERT( InvocationToFetch::type, vtkm::exec::arg::Fetch>::type::value)); VTKM_STATIC_ASSERT( @@ -242,7 +234,6 @@ VTKM_STATIC_ASSERT( InvocationToFetch::type, vtkm::exec::arg::Fetch>::type::value)); void TestNormalFunctorInvoke() diff --git a/vtkm/exec/internal/testing/UnitTestWorkletInvokeFunctor.cxx b/vtkm/exec/internal/testing/UnitTestWorkletInvokeFunctor.cxx index 9113aee4a..df6f22974 100644 --- a/vtkm/exec/internal/testing/UnitTestWorkletInvokeFunctor.cxx +++ b/vtkm/exec/internal/testing/UnitTestWorkletInvokeFunctor.cxx @@ -88,10 +88,7 @@ namespace arg { template <> -struct Fetch +struct Fetch { using ValueType = vtkm::Id; @@ -110,10 +107,7 @@ struct Fetch -struct Fetch +struct Fetch { using ValueType = vtkm::Id; diff --git a/vtkm/worklet/gradient/PointGradient.h b/vtkm/worklet/gradient/PointGradient.h index e77322bae..8960c569c 100644 --- a/vtkm/worklet/gradient/PointGradient.h +++ b/vtkm/worklet/gradient/PointGradient.h @@ -15,6 +15,7 @@ #include #include +#include #include @@ -50,6 +51,7 @@ struct PointGradient : public vtkm::worklet::WorkletVisitPointsWithCells GradientOutType& outputGradient) const { using CellThreadIndices = vtkm::exec::arg::ThreadIndicesTopologyMap; + using ValueType = typename WholeFieldIn::ValueType; using CellShapeTag = typename CellSetInType::CellShapeTag; @@ -107,10 +109,9 @@ private: } } - template - VTKM_EXEC vtkm::IdComponent GetPointIndexForCell( - const vtkm::exec::arg::ThreadIndicesTopologyMap& indices, - vtkm::Id pointId) const + template + VTKM_EXEC vtkm::IdComponent GetPointIndexForCell(const ThreadIndicesType& indices, + vtkm::Id pointId) const { vtkm::IdComponent result = 0; const auto& topo = indices.GetIndicesIncident(); @@ -128,14 +129,12 @@ private: //VecRectilinearPointCoordinates when using structured connectivity, and //uniform point coordinates. //c++14 would make the return type simply auto - template - VTKM_EXEC - typename vtkm::exec::arg::Fetch, - typename WholeFieldIn::PortalType>::ValueType - GetValues(const vtkm::exec::arg::ThreadIndicesTopologyMap& indices, - const WholeFieldIn& in) const + template + VTKM_EXEC auto GetValues(const ThreadIndicesType& indices, const WholeFieldIn& in) const + -> decltype(std::declval>() + .Load(indices, in.GetPortal())) { //the current problem is that when the topology is structured //we are passing in an vtkm::Id when it wants a Id2 or an Id3 that @@ -143,7 +142,6 @@ private: using ExecObjectType = typename WholeFieldIn::PortalType; using Fetch = vtkm::exec::arg::Fetch, ExecObjectType>; Fetch fetch; return fetch.Load(indices, in.GetPortal()); diff --git a/vtkm/worklet/internal/testing/UnitTestDispatcherBase.cxx b/vtkm/worklet/internal/testing/UnitTestDispatcherBase.cxx index 373c57365..0acecaaf5 100644 --- a/vtkm/worklet/internal/testing/UnitTestDispatcherBase.cxx +++ b/vtkm/worklet/internal/testing/UnitTestDispatcherBase.cxx @@ -185,10 +185,7 @@ namespace arg { template <> -struct Fetch +struct Fetch { using ValueType = vtkm::Id; @@ -207,10 +204,7 @@ struct Fetch -struct Fetch +struct Fetch { using ValueType = vtkm::Id; diff --git a/vtkm/worklet/testing/UnitTestWorkletMapField3d.cxx b/vtkm/worklet/testing/UnitTestWorkletMapField3d.cxx index 272517fc6..aeda0a6f4 100644 --- a/vtkm/worklet/testing/UnitTestWorkletMapField3d.cxx +++ b/vtkm/worklet/testing/UnitTestWorkletMapField3d.cxx @@ -59,21 +59,21 @@ namespace arg template struct Fetch> { using ValueType = typename PType::ValueType; using PortalType = mapfield3d::ExecutionObject; - using ThreadIndicesType = vtkm::exec::arg::ThreadIndicesBasic3D; - VTKM_EXEC - ValueType Load(const ThreadIndicesType& indices, const PortalType& field) const + template + VTKM_EXEC ValueType Load(const ThreadIndicesType& indices, const PortalType& field) const { return field.Portal.Get(indices.GetInputIndex()); } - VTKM_EXEC - void Store(const ThreadIndicesType&, const PortalType&, const ValueType&) const {} + template + VTKM_EXEC void Store(const ThreadIndicesType&, const PortalType&, const ValueType&) const + { + } }; } }