From b8e9ca4ca5424498aaafa0f8d0cf3359d701a45a Mon Sep 17 00:00:00 2001 From: Dave Pugmire Date: Tue, 18 Apr 2023 15:55:38 -0400 Subject: [PATCH 1/6] Remove warning. Add BoundsMap methods. --- vtkm/filter/flow/internal/BoundsMap.h | 8 ++++++++ vtkm/filter/flow/testing/UnitTestStreamlineFilterMPI.cxx | 8 ++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/vtkm/filter/flow/internal/BoundsMap.h b/vtkm/filter/flow/internal/BoundsMap.h index a60a237e3..981ce32b8 100644 --- a/vtkm/filter/flow/internal/BoundsMap.h +++ b/vtkm/filter/flow/internal/BoundsMap.h @@ -61,6 +61,14 @@ public: this->Init(pds.GetPartitions(), blockIds); } + vtkm::Bounds GetGlobalBounds() const { return this->GlobalBounds; } + + vtkm::Bounds GetBlockBounds(std::size_t idx) const + { + VTKM_ASSERT(idx < this->BlockBounds.size()); + return this->BlockBounds[idx]; + } + vtkm::Id GetLocalBlockId(vtkm::Id idx) const { VTKM_ASSERT(idx >= 0 && idx < this->LocalNumBlocks); diff --git a/vtkm/filter/flow/testing/UnitTestStreamlineFilterMPI.cxx b/vtkm/filter/flow/testing/UnitTestStreamlineFilterMPI.cxx index 453879207..872b42cc6 100644 --- a/vtkm/filter/flow/testing/UnitTestStreamlineFilterMPI.cxx +++ b/vtkm/filter/flow/testing/UnitTestStreamlineFilterMPI.cxx @@ -115,10 +115,10 @@ void SetFilter(FilterType& filter, filter.SetSeeds(seedArray); filter.SetActiveField(fieldName); filter.SetUseThreadedAlgorithm(useThreaded); - // if (useAsyncComm) - // filter.SetUseAsynchronousCommunication(); - // else - // filter.SetUseSynchronousCommunication(); + if (useAsyncComm) + filter.SetUseAsynchronousCommunication(); + else + filter.SetUseSynchronousCommunication(); if (useBlockIds) filter.SetBlockIDs(blockIds); From 9d0a9bfbaebbaf17a623ce6e67422d4b9892beaf Mon Sep 17 00:00:00 2001 From: Dave Pugmire Date: Tue, 18 Apr 2023 21:09:10 -0400 Subject: [PATCH 2/6] Fix compiler warnings...... --- vtkm/filter/flow/internal/BoundsMap.h | 8 ++++---- vtkm/filter/flow/internal/DataSetIntegrator.h | 17 +++++++++-------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/vtkm/filter/flow/internal/BoundsMap.h b/vtkm/filter/flow/internal/BoundsMap.h index 981ce32b8..6114843b2 100644 --- a/vtkm/filter/flow/internal/BoundsMap.h +++ b/vtkm/filter/flow/internal/BoundsMap.h @@ -63,10 +63,10 @@ public: vtkm::Bounds GetGlobalBounds() const { return this->GlobalBounds; } - vtkm::Bounds GetBlockBounds(std::size_t idx) const + vtkm::Bounds GetBlockBounds(vtkm::Id idx) const { - VTKM_ASSERT(idx < this->BlockBounds.size()); - return this->BlockBounds[idx]; + VTKM_ASSERT(idx >= 0 && static_cast(idx) < this->BlockBounds.size()); + return this->BlockBounds[static_cast(idx)]; } vtkm::Id GetLocalBlockId(vtkm::Id idx) const @@ -146,7 +146,7 @@ private: //note: there might be duplicates... vtkm::Id globalNumBlocks = - std::accumulate(globalBlockCounts.begin(), globalBlockCounts.end(), 0); + std::accumulate(globalBlockCounts.begin(), globalBlockCounts.end(), vtkm::Id{ 0 }); //3. given the counts per rank, calc offset for this rank. vtkm::Id offset = 0; diff --git a/vtkm/filter/flow/internal/DataSetIntegrator.h b/vtkm/filter/flow/internal/DataSetIntegrator.h index ce24c2006..a810dc77b 100644 --- a/vtkm/filter/flow/internal/DataSetIntegrator.h +++ b/vtkm/filter/flow/internal/DataSetIntegrator.h @@ -74,15 +74,16 @@ public: void Validate(vtkm::Id num) { -#ifndef NDEBUG //Make sure we didn't miss anything. Every particle goes into a single bucket. - VTKM_ASSERT(static_cast(num) == - (this->InBounds.Particles.size() + this->OutOfBounds.Particles.size() + - this->TermIdx.size())); - VTKM_ASSERT(this->InBounds.Particles.size() == this->InBounds.BlockIDs.size()); - VTKM_ASSERT(this->OutOfBounds.Particles.size() == this->OutOfBounds.BlockIDs.size()); - VTKM_ASSERT(this->TermIdx.size() == this->TermID.size()); -#endif + if ((static_cast(num) != + (this->InBounds.Particles.size() + this->OutOfBounds.Particles.size() + + this->TermIdx.size())) || + (this->InBounds.Particles.size() != this->InBounds.BlockIDs.size()) || + (this->OutOfBounds.Particles.size() != this->OutOfBounds.BlockIDs.size()) || + (this->TermIdx.size() != this->TermID.size())) + { + throw vtkm::cont::ErrorFilterExecution("Particle count mismatch after classification"); + } } void AddTerminated(vtkm::Id idx, vtkm::Id pID) From 5fba6382bdbaf97014970e81ae6c19d3ad5dbf6d Mon Sep 17 00:00:00 2001 From: Dave Pugmire Date: Wed, 19 Apr 2023 12:25:10 -0400 Subject: [PATCH 3/6] Kick the dashboards.......... --- vtkm/filter/flow/internal/BoundsMap.h | 1 + 1 file changed, 1 insertion(+) diff --git a/vtkm/filter/flow/internal/BoundsMap.h b/vtkm/filter/flow/internal/BoundsMap.h index 6114843b2..99c3ccde8 100644 --- a/vtkm/filter/flow/internal/BoundsMap.h +++ b/vtkm/filter/flow/internal/BoundsMap.h @@ -66,6 +66,7 @@ public: vtkm::Bounds GetBlockBounds(vtkm::Id idx) const { VTKM_ASSERT(idx >= 0 && static_cast(idx) < this->BlockBounds.size()); + return this->BlockBounds[static_cast(idx)]; } From 166f5d405b91a6417623c44aeed7f2efb70c2e46 Mon Sep 17 00:00:00 2001 From: Dave Pugmire Date: Thu, 20 Apr 2023 14:01:51 -0400 Subject: [PATCH 4/6] Kick the dashboards..... --- vtkm/filter/flow/internal/AdvectAlgorithmThreaded.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vtkm/filter/flow/internal/AdvectAlgorithmThreaded.h b/vtkm/filter/flow/internal/AdvectAlgorithmThreaded.h index 775f3dd3a..81597b0d0 100644 --- a/vtkm/filter/flow/internal/AdvectAlgorithmThreaded.h +++ b/vtkm/filter/flow/internal/AdvectAlgorithmThreaded.h @@ -137,8 +137,8 @@ protected: if (!this->UseAsynchronousCommunication) { VTKM_LOG_S(vtkm::cont::LogLevel::Info, - "Synchronous communication not supported for AdvectAlgorithmThreaded. Forcing " - "asynchronous communication."); + "Synchronous communication not supported for AdvectAlgorithmThreaded." + "Forcing asynchronous communication."); } bool useAsync = true; From 1ce2922d15da0d4db3aa7e98ba5e1f8a5209489b Mon Sep 17 00:00:00 2001 From: Dave Pugmire Date: Tue, 18 Apr 2023 15:55:38 -0400 Subject: [PATCH 5/6] Remove warning. Add BoundsMap methods. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix compiler warnings...... Kick the dashboards.......... Kick the dashboards..... use lambda instead of functor, remove unused code ArrayHandle::StorageType should be public StorageType is public in vtkm::cont::ArrayHandle, but some subclasses   re-declare it as private. Having it public provides a convenient way to   get the storage type of an ArrayHandle, otherwise it is quite verbose. Addresses: #314 Tetrahedralize and Triangulate filters check if input is already triangulated Previously, tetrahedralize/triangulate would blindly convert all the cells to tetrahedra/triangles, even when they were already. Now, the dataset is directly returned if the CellSet is a CellSetSingleType of tetras/triangles, and no further processing is done in the worklets for CellSetExplicit when all shapes are tetras or triangles. ci,crusher: changed fs to orion ci,osx,macos: fix value of GIT_CLONE_PATH --- .gitlab/ci/crusher.yml | 10 +-- .gitlab/ci/macos.yml | 1 + .../tetrahedralize-triangulate-check.md | 3 + vtkm/cont/ArrayHandle.h | 5 +- vtkm/cont/ArrayHandleCartesianProduct.h | 4 -- vtkm/cont/ArrayHandleCompositeVector.h | 7 +- vtkm/cont/ArrayHandleConcatenate.h | 4 -- vtkm/cont/ArrayHandleDecorator.h | 2 - vtkm/cont/ArrayHandleExtractComponent.h | 7 +- vtkm/cont/ArrayHandleGroupVecVariable.h | 4 -- vtkm/cont/ArrayHandleImplicit.h | 1 - vtkm/cont/ArrayHandleMultiplexer.h | 4 -- vtkm/cont/ArrayHandlePermutation.h | 4 -- vtkm/cont/ArrayHandleRecombineVec.h | 4 -- vtkm/cont/ArrayHandleReverse.h | 1 - vtkm/cont/ArrayHandleRuntimeVec.h | 1 - vtkm/cont/ArrayHandleSOA.h | 2 - vtkm/cont/ArrayHandleStride.h | 4 -- vtkm/cont/ArrayHandleTransform.h | 14 +--- .../cont/ArrayHandleUniformPointCoordinates.h | 4 -- vtkm/cont/ArrayHandleView.h | 4 -- vtkm/cont/ArrayHandleXGCCoordinates.h | 4 -- vtkm/cont/ArrayHandleZip.h | 7 -- .../testing/UnitTestArrayHandleCounting.cxx | 10 +-- .../flow/internal/AdvectAlgorithmThreaded.h | 4 +- vtkm/filter/flow/internal/BoundsMap.h | 11 ++- vtkm/filter/flow/internal/DataSetIntegrator.h | 17 ++--- .../testing/UnitTestStreamlineFilterMPI.cxx | 8 +-- .../geometry_refinement/Tetrahedralize.cxx | 71 +++++++++++++++++-- .../geometry_refinement/Triangulate.cxx | 67 +++++++++++++++-- .../testing/UnitTestTetrahedralizeFilter.cxx | 47 ++++++++++++ .../testing/UnitTestTriangulateFilter.cxx | 46 ++++++++++++ .../raytracing/VolumeRendererStructured.cxx | 49 +++---------- .../raytracing/VolumeRendererStructured.h | 21 +----- 34 files changed, 277 insertions(+), 175 deletions(-) create mode 100644 docs/changelog/tetrahedralize-triangulate-check.md diff --git a/.gitlab/ci/crusher.yml b/.gitlab/ci/crusher.yml index 9c45c9a3f..5e5fdbba0 100644 --- a/.gitlab/ci/crusher.yml +++ b/.gitlab/ci/crusher.yml @@ -1,9 +1,9 @@ # Ad-hoc build that runs in the ECP Hardware, concretely in OLCF Spock. .crusher_gcc_hip: variables: - CCACHE_BASEDIR: "/gpfs/alpine/csc331/scratch/" - CCACHE_DIR: "/gpfs/alpine/csc331/scratch/vbolea/ci/vtk-m/ccache" - CUSTOM_CI_BUILDS_DIR: "/gpfs/alpine/csc331/scratch/vbolea/ci/vtk-m/runtime" + CCACHE_BASEDIR: "/lustre/orion/csc331/scratch/" + CCACHE_DIR: "/lustre/orion/csc331/scratch/vbolea/ci/vtk-m/ccache" + CUSTOM_CI_BUILDS_DIR: "/lustre/orion/csc331/scratch/vbolea/ci/vtk-m/runtime" # -isystem= is not affected by CCACHE_BASEDIR, thus we must ignore it CCACHE_IGNOREOPTIONS: "-isystem=*" @@ -14,6 +14,9 @@ CMAKE_GENERATOR: "Ninja" CMAKE_PREFIX_PATH: "$CI_BUILDS_DIR/kokkos_install" + # We do not want to use the user's ~/.gitconfig + GIT_CONFIG_GLOBAL: "true" + KOKKOS_OPTS: >- -DCMAKE_INSTALL_PREFIX:PATH=$CI_BUILDS_DIR/kokkos_install -DCMAKE_CXX_COMPILER:FILEPATH=/opt/rocm-4.5.0/hip/bin/hipcc @@ -21,7 +24,6 @@ # DefApps/default;craype;rocm;gcc should be loaded first JOB_MODULES: >- - DefApps/default craype-accel-amd-gfx90a rocm/4.5.0 gcc/12 diff --git a/.gitlab/ci/macos.yml b/.gitlab/ci/macos.yml index 6f2a53b09..bbe134023 100644 --- a/.gitlab/ci/macos.yml +++ b/.gitlab/ci/macos.yml @@ -25,6 +25,7 @@ test:macos_xcode13: CC: gcc CXX: g++ DEVELOPER_DIR: "/Applications/Xcode-13.3.app/Contents/Developer" + GIT_CLONE_PATH: "$CI_BUILDS_DIR/vtk-m-ci" VTKM_SETTINGS: "64bit_floats+shared+ccache" .cmake_build_macos: diff --git a/docs/changelog/tetrahedralize-triangulate-check.md b/docs/changelog/tetrahedralize-triangulate-check.md new file mode 100644 index 000000000..de95e8b6c --- /dev/null +++ b/docs/changelog/tetrahedralize-triangulate-check.md @@ -0,0 +1,3 @@ +# Tetrahedralize and Triangulate filters now check if the input is already tetrahedral/triangular + +Previously, tetrahedralize/triangulate would blindly convert all the cells to tetrahedra/triangles, even when they were already. Now, the dataset is directly returned if the CellSet is a CellSetSingleType of tetras/triangles, and no further processing is done in the worklets for CellSetExplicit when all shapes are tetras or triangles. diff --git a/vtkm/cont/ArrayHandle.h b/vtkm/cont/ArrayHandle.h index 6a4467b15..8c149a440 100644 --- a/vtkm/cont/ArrayHandle.h +++ b/vtkm/cont/ArrayHandle.h @@ -200,7 +200,10 @@ struct GetTypeInParentheses } \ \ using ValueType = typename__ Superclass::ValueType; \ - using StorageTag = typename__ Superclass::StorageTag + using StorageTag = typename__ Superclass::StorageTag; \ + using StorageType = typename__ Superclass::StorageType; \ + using ReadPortalType = typename__ Superclass::ReadPortalType; \ + using WritePortalType = typename__ Superclass::WritePortalType /// \brief Macro to make default methods in ArrayHandle subclasses. /// diff --git a/vtkm/cont/ArrayHandleCartesianProduct.h b/vtkm/cont/ArrayHandleCartesianProduct.h index 037f9ee03..d9fb12c1c 100644 --- a/vtkm/cont/ArrayHandleCartesianProduct.h +++ b/vtkm/cont/ArrayHandleCartesianProduct.h @@ -344,10 +344,6 @@ public: SecondHandleType, ThirdHandleType>::Superclass)); -private: - using StorageType = vtkm::cont::internal::Storage; - -public: VTKM_CONT ArrayHandleCartesianProduct(const FirstHandleType& firstArray, const SecondHandleType& secondArray, diff --git a/vtkm/cont/ArrayHandleCompositeVector.h b/vtkm/cont/ArrayHandleCompositeVector.h index 02bbf59e7..53cce488c 100644 --- a/vtkm/cont/ArrayHandleCompositeVector.h +++ b/vtkm/cont/ArrayHandleCompositeVector.h @@ -188,7 +188,6 @@ struct CompositeVectorTraits using ValueType = typename vtkm::internal::compvec::GetValueType::ValueType; using StorageTag = vtkm::cont::StorageTagCompositeVec; - using StorageType = Storage; using Superclass = ArrayHandle; }; @@ -400,14 +399,10 @@ class ArrayHandleCompositeVector : public ArrayHandle::ValueType, typename internal::CompositeVectorTraits::StorageTag> { -private: - using Traits = internal::CompositeVectorTraits; - using StorageType = typename Traits::StorageType; - public: VTKM_ARRAY_HANDLE_SUBCLASS(ArrayHandleCompositeVector, (ArrayHandleCompositeVector), - (typename Traits::Superclass)); + (typename internal::CompositeVectorTraits::Superclass)); VTKM_CONT ArrayHandleCompositeVector(const ArrayTs&... arrays) diff --git a/vtkm/cont/ArrayHandleConcatenate.h b/vtkm/cont/ArrayHandleConcatenate.h index a8a1cdc2f..d976f1254 100644 --- a/vtkm/cont/ArrayHandleConcatenate.h +++ b/vtkm/cont/ArrayHandleConcatenate.h @@ -251,10 +251,6 @@ public: StorageTagConcatenate>)); -protected: - using StorageType = vtkm::cont::internal::Storage; - -public: VTKM_CONT ArrayHandleConcatenate(const ArrayHandleType1& array1, const ArrayHandleType2& array2) : Superclass(StorageType::CreateBuffers(array1, array2)) diff --git a/vtkm/cont/ArrayHandleDecorator.h b/vtkm/cont/ArrayHandleDecorator.h index dc71d3d62..ffd85d0de 100644 --- a/vtkm/cont/ArrayHandleDecorator.h +++ b/vtkm/cont/ArrayHandleDecorator.h @@ -565,7 +565,6 @@ struct DecoratorHandleTraits using StorageTraits = decor::DecoratorStorageTraits; using ValueType = typename StorageTraits::ValueType; using StorageTag = StorageTagDecorator; - using StorageType = vtkm::cont::internal::Storage; using Superclass = vtkm::cont::ArrayHandle; }; @@ -651,7 +650,6 @@ class ArrayHandleDecorator private: using Traits = internal::DecoratorHandleTraits::type, typename std::decay::type...>; - using StorageType = typename Traits::StorageType; public: VTKM_ARRAY_HANDLE_SUBCLASS(ArrayHandleDecorator, diff --git a/vtkm/cont/ArrayHandleExtractComponent.h b/vtkm/cont/ArrayHandleExtractComponent.h index 66f3c7137..8e243c3b1 100644 --- a/vtkm/cont/ArrayHandleExtractComponent.h +++ b/vtkm/cont/ArrayHandleExtractComponent.h @@ -94,8 +94,7 @@ class Storage::Com { using SourceValueType = typename ArrayHandleType::ValueType; using ValueType = typename vtkm::VecTraits::ComponentType; - using SourceStorageTag = typename ArrayHandleType::StorageTag; - using SourceStorage = vtkm::cont::internal::Storage; + using SourceStorage = typename ArrayHandleType::StorageType; public: VTKM_CONT static vtkm::IdComponent ComponentIndex( @@ -198,10 +197,6 @@ public: typename vtkm::VecTraits::ComponentType, StorageTagExtractComponent>)); -protected: - using StorageType = vtkm::cont::internal::Storage; - -public: VTKM_CONT ArrayHandleExtractComponent(const ArrayHandleType& array, vtkm::IdComponent component) : Superclass(StorageType::CreateBuffers(component, array)) diff --git a/vtkm/cont/ArrayHandleGroupVecVariable.h b/vtkm/cont/ArrayHandleGroupVecVariable.h index d7d512b09..ffc0949a0 100644 --- a/vtkm/cont/ArrayHandleGroupVecVariable.h +++ b/vtkm/cont/ArrayHandleGroupVecVariable.h @@ -285,10 +285,6 @@ public: using ComponentType = typename ComponentsArrayHandleType::ValueType; -private: - using StorageType = vtkm::cont::internal::Storage; - -public: VTKM_CONT ArrayHandleGroupVecVariable(const ComponentsArrayHandleType& componentsArray, const OffsetsArrayHandleType& offsetsArray) diff --git a/vtkm/cont/ArrayHandleImplicit.h b/vtkm/cont/ArrayHandleImplicit.h index ceb3b42a9..e21ab2588 100644 --- a/vtkm/cont/ArrayHandleImplicit.h +++ b/vtkm/cont/ArrayHandleImplicit.h @@ -158,7 +158,6 @@ struct ArrayHandleImplicitTraits using PortalType = vtkm::internal::ArrayPortalImplicit; using StorageTag = vtkm::cont::StorageTagImplicit; using Superclass = vtkm::cont::ArrayHandle; - using StorageType = vtkm::cont::internal::Storage; }; } // namespace detail diff --git a/vtkm/cont/ArrayHandleMultiplexer.h b/vtkm/cont/ArrayHandleMultiplexer.h index d05ab60c3..3337d9c3e 100644 --- a/vtkm/cont/ArrayHandleMultiplexer.h +++ b/vtkm/cont/ArrayHandleMultiplexer.h @@ -408,10 +408,6 @@ public: (ArrayHandleMultiplexer), (vtkm::cont::ArrayHandle)); -private: - using StorageType = vtkm::cont::internal::Storage; - -public: template VTKM_CONT ArrayHandleMultiplexer(const vtkm::cont::ArrayHandle& src) : Superclass(StorageType::CreateBuffers(src)) diff --git a/vtkm/cont/ArrayHandlePermutation.h b/vtkm/cont/ArrayHandlePermutation.h index bcd826801..920c317d5 100644 --- a/vtkm/cont/ArrayHandlePermutation.h +++ b/vtkm/cont/ArrayHandlePermutation.h @@ -248,10 +248,6 @@ public: vtkm::cont::StorageTagPermutation>)); -private: - using StorageType = vtkm::cont::internal::Storage; - -public: VTKM_CONT ArrayHandlePermutation(const IndexArrayHandleType& indexArray, const ValueArrayHandleType& valueArray) diff --git a/vtkm/cont/ArrayHandleRecombineVec.h b/vtkm/cont/ArrayHandleRecombineVec.h index 1a817e296..121d3fa4a 100644 --- a/vtkm/cont/ArrayHandleRecombineVec.h +++ b/vtkm/cont/ArrayHandleRecombineVec.h @@ -604,10 +604,6 @@ public: (vtkm::cont::ArrayHandle, vtkm::cont::internal::StorageTagRecombineVec>)); -private: - using StorageType = vtkm::cont::internal::Storage; - -public: vtkm::IdComponent GetNumberOfComponents() const { return StorageType::GetNumberOfComponents(this->GetBuffers()); diff --git a/vtkm/cont/ArrayHandleReverse.h b/vtkm/cont/ArrayHandleReverse.h index 4a41d2905..77cbeb2d2 100644 --- a/vtkm/cont/ArrayHandleReverse.h +++ b/vtkm/cont/ArrayHandleReverse.h @@ -156,7 +156,6 @@ public: (vtkm::cont::ArrayHandle>)); -public: ArrayHandleReverse(const ArrayHandleType& handle) : Superclass(handle.GetBuffers()) { diff --git a/vtkm/cont/ArrayHandleRuntimeVec.h b/vtkm/cont/ArrayHandleRuntimeVec.h index 4143c8bd4..8b6575796 100644 --- a/vtkm/cont/ArrayHandleRuntimeVec.h +++ b/vtkm/cont/ArrayHandleRuntimeVec.h @@ -327,7 +327,6 @@ public: vtkm::cont::StorageTagRuntimeVec>)); private: - using StorageType = vtkm::cont::internal::Storage; using ComponentsArrayType = vtkm::cont::ArrayHandle; public: diff --git a/vtkm/cont/ArrayHandleSOA.h b/vtkm/cont/ArrayHandleSOA.h index d50d64470..08e522977 100644 --- a/vtkm/cont/ArrayHandleSOA.h +++ b/vtkm/cont/ArrayHandleSOA.h @@ -246,8 +246,6 @@ class ArrayHandleSOA : public ArrayHandle using ComponentType = typename vtkm::VecTraits::ComponentType; static constexpr vtkm::IdComponent NUM_COMPONENTS = vtkm::VecTraits::NUM_COMPONENTS; - using StorageType = vtkm::cont::internal::Storage; - using ComponentArrayType = vtkm::cont::ArrayHandle; public: diff --git a/vtkm/cont/ArrayHandleStride.h b/vtkm/cont/ArrayHandleStride.h index 68a0b2f5e..ef48f7c6b 100644 --- a/vtkm/cont/ArrayHandleStride.h +++ b/vtkm/cont/ArrayHandleStride.h @@ -333,10 +333,6 @@ public: (ArrayHandleStride), (ArrayHandle)); -private: - using StorageType = vtkm::cont::internal::Storage; - -public: ArrayHandleStride(vtkm::Id stride, vtkm::Id offset, vtkm::Id modulo = 0, vtkm::Id divisor = 1) : Superclass(StorageType::CreateBuffers( vtkm::cont::internal::Buffer{}, diff --git a/vtkm/cont/ArrayHandleTransform.h b/vtkm/cont/ArrayHandleTransform.h index 67f8ffcdc..12994ea14 100644 --- a/vtkm/cont/ArrayHandleTransform.h +++ b/vtkm/cont/ArrayHandleTransform.h @@ -246,8 +246,7 @@ class Storage::ValueT using FunctorManager = TransformFunctorManager; using ValueType = typename StorageTagTransform::ValueType; - using SourceStorage = - Storage; + using SourceStorage = typename ArrayHandleType::StorageType; static std::vector SourceBuffers( const std::vector& buffers) @@ -323,8 +322,7 @@ class Storage< using InverseFunctorManager = TransformFunctorManager; using ValueType = typename StorageTagTransform::ValueType; - using SourceStorage = - Storage; + using SourceStorage = typename ArrayHandleType::StorageType; static std::vector SourceBuffers( const std::vector& buffers) @@ -454,10 +452,6 @@ public: typename internal::StorageTagTransform::ValueType, internal::StorageTagTransform>)); -private: - using StorageType = vtkm::cont::internal::Storage; - -public: VTKM_CONT ArrayHandleTransform(const ArrayHandleType& handle, const FunctorType& functor = FunctorType{}, @@ -498,10 +492,6 @@ public: ValueType, internal::StorageTagTransform>)); -private: - using StorageType = vtkm::cont::internal::Storage; - -public: ArrayHandleTransform(const ArrayHandleType& handle, const FunctorType& functor = FunctorType(), const InverseFunctorType& inverseFunctor = InverseFunctorType()) diff --git a/vtkm/cont/ArrayHandleUniformPointCoordinates.h b/vtkm/cont/ArrayHandleUniformPointCoordinates.h index a0f425d27..72a33725f 100644 --- a/vtkm/cont/ArrayHandleUniformPointCoordinates.h +++ b/vtkm/cont/ArrayHandleUniformPointCoordinates.h @@ -51,10 +51,6 @@ public: ArrayHandleUniformPointCoordinates, (vtkm::cont::ArrayHandle)); -private: - using StorageType = vtkm::cont::internal::Storage; - -public: VTKM_CONT ArrayHandleUniformPointCoordinates(vtkm::Id3 dimensions, ValueType origin = ValueType(0.0f, 0.0f, 0.0f), diff --git a/vtkm/cont/ArrayHandleView.h b/vtkm/cont/ArrayHandleView.h index ff286439d..1465d22fe 100644 --- a/vtkm/cont/ArrayHandleView.h +++ b/vtkm/cont/ArrayHandleView.h @@ -197,10 +197,6 @@ public: (vtkm::cont::ArrayHandle>)); -private: - using StorageType = vtkm::cont::internal::Storage; - -public: VTKM_CONT ArrayHandleView(const ArrayHandleType& array, vtkm::Id startIndex, vtkm::Id numValues) : Superclass(StorageType::CreateBuffers(startIndex, numValues, array)) diff --git a/vtkm/cont/ArrayHandleXGCCoordinates.h b/vtkm/cont/ArrayHandleXGCCoordinates.h index 19ccbec13..975e2a8c9 100644 --- a/vtkm/cont/ArrayHandleXGCCoordinates.h +++ b/vtkm/cont/ArrayHandleXGCCoordinates.h @@ -291,10 +291,6 @@ public: (ArrayHandleXGCCoordinates), (vtkm::cont::ArrayHandle, vtkm::cont::StorageTagXGCCoordinates>)); -private: - using StorageType = vtkm::cont::internal::Storage; - -public: VTKM_CONT ArrayHandleXGCCoordinates(const OriginalType& array, vtkm::Id numberOfPlanes, diff --git a/vtkm/cont/ArrayHandleZip.h b/vtkm/cont/ArrayHandleZip.h index 3b96e62cb..b8a18e2fd 100644 --- a/vtkm/cont/ArrayHandleZip.h +++ b/vtkm/cont/ArrayHandleZip.h @@ -129,10 +129,6 @@ struct ArrayHandleZipTraits using Tag = StorageTagZip; - /// The storage type. - /// - using Storage = vtkm::cont::internal::Storage; - /// The superclass for ArrayHandleZip. /// using Superclass = vtkm::cont::ArrayHandle; @@ -259,9 +255,6 @@ class ArrayHandleZip // template argument is not a valid ArrayHandle type. VTKM_IS_ARRAY_HANDLE(SecondHandleType); - using StorageType = - typename internal::ArrayHandleZipTraits::Storage; - public: VTKM_ARRAY_HANDLE_SUBCLASS( ArrayHandleZip, diff --git a/vtkm/cont/testing/UnitTestArrayHandleCounting.cxx b/vtkm/cont/testing/UnitTestArrayHandleCounting.cxx index 1b1ff7da5..bad2c5fd7 100644 --- a/vtkm/cont/testing/UnitTestArrayHandleCounting.cxx +++ b/vtkm/cont/testing/UnitTestArrayHandleCounting.cxx @@ -27,12 +27,7 @@ template struct TemplatedTests { using ArrayHandleType = vtkm::cont::ArrayHandleCounting; - - using ArrayHandleType2 = vtkm::cont::ArrayHandle; - - using PortalType = - typename vtkm::cont::internal::Storage::ReadPortalType; + using PortalType = typename ArrayHandleType::ReadPortalType; void operator()(const ValueType& startingValue, const ValueType& step) { @@ -41,7 +36,8 @@ struct TemplatedTests ArrayHandleType arrayMake = vtkm::cont::make_ArrayHandleCounting(startingValue, step, ARRAY_SIZE); - ArrayHandleType2 arrayHandle = ArrayHandleType(startingValue, step, ARRAY_SIZE); + typename ArrayHandleType::Superclass arrayHandle = + ArrayHandleType(startingValue, step, ARRAY_SIZE); VTKM_TEST_ASSERT(arrayConst.GetNumberOfValues() == ARRAY_SIZE, "Counting array using constructor has wrong size."); diff --git a/vtkm/filter/flow/internal/AdvectAlgorithmThreaded.h b/vtkm/filter/flow/internal/AdvectAlgorithmThreaded.h index 775f3dd3a..81597b0d0 100644 --- a/vtkm/filter/flow/internal/AdvectAlgorithmThreaded.h +++ b/vtkm/filter/flow/internal/AdvectAlgorithmThreaded.h @@ -137,8 +137,8 @@ protected: if (!this->UseAsynchronousCommunication) { VTKM_LOG_S(vtkm::cont::LogLevel::Info, - "Synchronous communication not supported for AdvectAlgorithmThreaded. Forcing " - "asynchronous communication."); + "Synchronous communication not supported for AdvectAlgorithmThreaded." + "Forcing asynchronous communication."); } bool useAsync = true; diff --git a/vtkm/filter/flow/internal/BoundsMap.h b/vtkm/filter/flow/internal/BoundsMap.h index a60a237e3..99c3ccde8 100644 --- a/vtkm/filter/flow/internal/BoundsMap.h +++ b/vtkm/filter/flow/internal/BoundsMap.h @@ -61,6 +61,15 @@ public: this->Init(pds.GetPartitions(), blockIds); } + vtkm::Bounds GetGlobalBounds() const { return this->GlobalBounds; } + + vtkm::Bounds GetBlockBounds(vtkm::Id idx) const + { + VTKM_ASSERT(idx >= 0 && static_cast(idx) < this->BlockBounds.size()); + + return this->BlockBounds[static_cast(idx)]; + } + vtkm::Id GetLocalBlockId(vtkm::Id idx) const { VTKM_ASSERT(idx >= 0 && idx < this->LocalNumBlocks); @@ -138,7 +147,7 @@ private: //note: there might be duplicates... vtkm::Id globalNumBlocks = - std::accumulate(globalBlockCounts.begin(), globalBlockCounts.end(), 0); + std::accumulate(globalBlockCounts.begin(), globalBlockCounts.end(), vtkm::Id{ 0 }); //3. given the counts per rank, calc offset for this rank. vtkm::Id offset = 0; diff --git a/vtkm/filter/flow/internal/DataSetIntegrator.h b/vtkm/filter/flow/internal/DataSetIntegrator.h index ce24c2006..a810dc77b 100644 --- a/vtkm/filter/flow/internal/DataSetIntegrator.h +++ b/vtkm/filter/flow/internal/DataSetIntegrator.h @@ -74,15 +74,16 @@ public: void Validate(vtkm::Id num) { -#ifndef NDEBUG //Make sure we didn't miss anything. Every particle goes into a single bucket. - VTKM_ASSERT(static_cast(num) == - (this->InBounds.Particles.size() + this->OutOfBounds.Particles.size() + - this->TermIdx.size())); - VTKM_ASSERT(this->InBounds.Particles.size() == this->InBounds.BlockIDs.size()); - VTKM_ASSERT(this->OutOfBounds.Particles.size() == this->OutOfBounds.BlockIDs.size()); - VTKM_ASSERT(this->TermIdx.size() == this->TermID.size()); -#endif + if ((static_cast(num) != + (this->InBounds.Particles.size() + this->OutOfBounds.Particles.size() + + this->TermIdx.size())) || + (this->InBounds.Particles.size() != this->InBounds.BlockIDs.size()) || + (this->OutOfBounds.Particles.size() != this->OutOfBounds.BlockIDs.size()) || + (this->TermIdx.size() != this->TermID.size())) + { + throw vtkm::cont::ErrorFilterExecution("Particle count mismatch after classification"); + } } void AddTerminated(vtkm::Id idx, vtkm::Id pID) diff --git a/vtkm/filter/flow/testing/UnitTestStreamlineFilterMPI.cxx b/vtkm/filter/flow/testing/UnitTestStreamlineFilterMPI.cxx index 453879207..872b42cc6 100644 --- a/vtkm/filter/flow/testing/UnitTestStreamlineFilterMPI.cxx +++ b/vtkm/filter/flow/testing/UnitTestStreamlineFilterMPI.cxx @@ -115,10 +115,10 @@ void SetFilter(FilterType& filter, filter.SetSeeds(seedArray); filter.SetActiveField(fieldName); filter.SetUseThreadedAlgorithm(useThreaded); - // if (useAsyncComm) - // filter.SetUseAsynchronousCommunication(); - // else - // filter.SetUseSynchronousCommunication(); + if (useAsyncComm) + filter.SetUseAsynchronousCommunication(); + else + filter.SetUseSynchronousCommunication(); if (useBlockIds) filter.SetBlockIDs(blockIds); diff --git a/vtkm/filter/geometry_refinement/Tetrahedralize.cxx b/vtkm/filter/geometry_refinement/Tetrahedralize.cxx index bec934e50..979eae5c1 100644 --- a/vtkm/filter/geometry_refinement/Tetrahedralize.cxx +++ b/vtkm/filter/geometry_refinement/Tetrahedralize.cxx @@ -8,6 +8,7 @@ // PURPOSE. See the above copyright notice for more information. //============================================================================ +#include #include #include #include @@ -41,6 +42,18 @@ VTKM_CONT bool DoMapField(vtkm::cont::DataSet& result, return false; } } + +struct IsShapeTetra +{ + VTKM_EXEC_CONT + bool operator()(vtkm::UInt8 shape) const { return shape == vtkm::CELL_SHAPE_TETRA; } +}; + +struct BinaryAnd +{ + VTKM_EXEC_CONT + bool operator()(bool u, bool v) const { return u && v; } +}; } // anonymous namespace namespace vtkm @@ -53,14 +66,58 @@ VTKM_CONT vtkm::cont::DataSet Tetrahedralize::DoExecute(const vtkm::cont::DataSe { const vtkm::cont::UnknownCellSet& inCellSet = input.GetCellSet(); - vtkm::cont::CellSetSingleType<> outCellSet; - vtkm::worklet::Tetrahedralize worklet; - vtkm::cont::CastAndCall(inCellSet, - [&](const auto& concrete) { outCellSet = worklet.Run(concrete); }); + // In case we already have a CellSetSingleType of tetras, + // don't call the worklet and return the input DataSet directly + if (inCellSet.CanConvert>() && + inCellSet.AsCellSet>().GetCellShapeAsId() == + vtkm::CellShapeTagTetra::Id) + { + return input; + } - auto mapper = [&](auto& result, const auto& f) { DoMapField(result, f, worklet); }; - // create the output dataset (without a CoordinateSystem). - vtkm::cont::DataSet output = this->CreateResult(input, outCellSet, mapper); + vtkm::cont::CellSetSingleType<> outCellSet; + vtkm::cont::DataSet output; + + // Optimization in case we only have tetras in the CellSet + bool allTetras = false; + if (inCellSet.CanConvert>()) + { + vtkm::cont::CellSetExplicit<> inCellSetExplicit = + inCellSet.AsCellSet>(); + + auto shapeArray = inCellSetExplicit.GetShapesArray(vtkm::TopologyElementTagCell(), + vtkm::TopologyElementTagPoint()); + auto isCellTetraArray = vtkm::cont::make_ArrayHandleTransform(shapeArray, IsShapeTetra{}); + + allTetras = vtkm::cont::Algorithm::Reduce(isCellTetraArray, true, BinaryAnd{}); + + if (allTetras) + { + // Reuse the input's connectivity array + outCellSet.Fill(inCellSet.GetNumberOfPoints(), + vtkm::CellShapeTagTetra::Id, + 4, + inCellSetExplicit.GetConnectivityArray(vtkm::TopologyElementTagCell(), + vtkm::TopologyElementTagPoint())); + + // Copy all fields from the input + output = this->CreateResult(input, outCellSet, [&](auto& result, const auto& f) { + result.AddField(f); + return true; + }); + } + } + + if (!allTetras) + { + vtkm::worklet::Tetrahedralize worklet; + vtkm::cont::CastAndCall(inCellSet, + [&](const auto& concrete) { outCellSet = worklet.Run(concrete); }); + + auto mapper = [&](auto& result, const auto& f) { DoMapField(result, f, worklet); }; + // create the output dataset (without a CoordinateSystem). + output = this->CreateResult(input, outCellSet, mapper); + } // We did not change the geometry of the input dataset at all. Just attach coordinate system // of input dataset to output dataset. diff --git a/vtkm/filter/geometry_refinement/Triangulate.cxx b/vtkm/filter/geometry_refinement/Triangulate.cxx index e8eba2509..913c485a6 100644 --- a/vtkm/filter/geometry_refinement/Triangulate.cxx +++ b/vtkm/filter/geometry_refinement/Triangulate.cxx @@ -8,6 +8,7 @@ // PURPOSE. See the above copyright notice for more information. //============================================================================ +#include #include #include #include @@ -42,6 +43,18 @@ VTKM_CONT bool DoMapField(vtkm::cont::DataSet& result, return false; } } + +struct IsShapeTriangle +{ + VTKM_EXEC_CONT + bool operator()(vtkm::UInt8 shape) const { return shape == vtkm::CELL_SHAPE_TRIANGLE; } +}; + +struct BinaryAnd +{ + VTKM_EXEC_CONT + bool operator()(bool u, bool v) const { return u && v; } +}; } // anonymous namespace namespace vtkm @@ -54,15 +67,57 @@ VTKM_CONT vtkm::cont::DataSet Triangulate::DoExecute(const vtkm::cont::DataSet& { const vtkm::cont::UnknownCellSet& inCellSet = input.GetCellSet(); + // In case we already have a CellSetSingleType of tetras, + // don't call the worklet and return the input DataSet directly + if (inCellSet.CanConvert>() && + inCellSet.AsCellSet>().GetCellShapeAsId() == + vtkm::CellShapeTagTriangle::Id) + { + return input; + } + vtkm::cont::CellSetSingleType<> outCellSet; - vtkm::worklet::Triangulate worklet; + vtkm::cont::DataSet output; - vtkm::cont::CastAndCall(inCellSet, - [&](const auto& concrete) { outCellSet = worklet.Run(concrete); }); + // Optimization in case we only have triangles in the CellSet + bool allTriangles = false; + if (inCellSet.CanConvert>()) + { + vtkm::cont::CellSetExplicit<> inCellSetExplicit = + inCellSet.AsCellSet>(); - auto mapper = [&](auto& result, const auto& f) { DoMapField(result, f, worklet); }; - // create the output dataset (without a CoordinateSystem). - vtkm::cont::DataSet output = this->CreateResult(input, outCellSet, mapper); + auto shapeArray = inCellSetExplicit.GetShapesArray(vtkm::TopologyElementTagCell(), + vtkm::TopologyElementTagPoint()); + auto isCellTriangleArray = vtkm::cont::make_ArrayHandleTransform(shapeArray, IsShapeTriangle{}); + allTriangles = vtkm::cont::Algorithm::Reduce(isCellTriangleArray, true, BinaryAnd{}); + + if (allTriangles) + { + // Reuse the input's connectivity array + outCellSet.Fill(inCellSet.GetNumberOfPoints(), + vtkm::CellShapeTagTriangle::Id, + 3, + inCellSetExplicit.GetConnectivityArray(vtkm::TopologyElementTagCell(), + vtkm::TopologyElementTagPoint())); + + // Copy all fields from the input + output = this->CreateResult(input, outCellSet, [&](auto& result, const auto& f) { + result.AddField(f); + return true; + }); + } + } + + if (!allTriangles) + { + vtkm::worklet::Triangulate worklet; + vtkm::cont::CastAndCall(inCellSet, + [&](const auto& concrete) { outCellSet = worklet.Run(concrete); }); + + auto mapper = [&](auto& result, const auto& f) { DoMapField(result, f, worklet); }; + // create the output dataset (without a CoordinateSystem). + output = this->CreateResult(input, outCellSet, mapper); + } // We did not change the geometry of the input dataset at all. Just attach coordinate system // of input dataset to output dataset. diff --git a/vtkm/filter/geometry_refinement/testing/UnitTestTetrahedralizeFilter.cxx b/vtkm/filter/geometry_refinement/testing/UnitTestTetrahedralizeFilter.cxx index cae7c2413..0e24e868f 100644 --- a/vtkm/filter/geometry_refinement/testing/UnitTestTetrahedralizeFilter.cxx +++ b/vtkm/filter/geometry_refinement/testing/UnitTestTetrahedralizeFilter.cxx @@ -8,6 +8,7 @@ // PURPOSE. See the above copyright notice for more information. //============================================================================ +#include #include #include @@ -67,10 +68,56 @@ public: VTKM_TEST_ASSERT(outData.ReadPortal().Get(10) == 130.5f, "Wrong cell field data"); } + void TestCellSetSingleTypeTetra() const + { + vtkm::cont::DataSet dataset; + vtkm::cont::CellSetSingleType<> cellSet; + + auto connectivity = vtkm::cont::make_ArrayHandle({ 0, 1, 2, 3, 3, 2, 1, 4 }); + cellSet.Fill(5, vtkm::CELL_SHAPE_TETRA, 4, connectivity); + + dataset.SetCellSet(cellSet); + + vtkm::filter::geometry_refinement::Tetrahedralize tetrahedralize; + vtkm::cont::DataSet output = tetrahedralize.Execute(dataset); + + VTKM_TEST_ASSERT(dataset.GetCellSet().GetCellSetBase() == output.GetCellSet().GetCellSetBase(), + "Pointer to the CellSetSingleType has changed."); + } + + void TestCellSetExplicitTetra() const + { + std::vector coords{ + vtkm::Vec3f_32(0.0f, 0.0f, 0.0f), vtkm::Vec3f_32(2.0f, 0.0f, 0.0f), + vtkm::Vec3f_32(2.0f, 4.0f, 0.0f), vtkm::Vec3f_32(0.0f, 4.0f, 0.0f), + vtkm::Vec3f_32(1.0f, 0.0f, 3.0f), + }; + std::vector shapes{ vtkm::CELL_SHAPE_TETRA, vtkm::CELL_SHAPE_TETRA }; + std::vector indices{ 4, 4 }; + std::vector connectivity{ 0, 1, 2, 3, 1, 2, 3, 4 }; + + vtkm::cont::DataSetBuilderExplicit dsb; + vtkm::cont::DataSet dataset = dsb.Create(coords, shapes, indices, connectivity); + + vtkm::filter::geometry_refinement::Tetrahedralize tetrahedralize; + vtkm::cont::DataSet output = tetrahedralize.Execute(dataset); + vtkm::cont::UnknownCellSet outputCellSet = output.GetCellSet(); + + VTKM_TEST_ASSERT(outputCellSet.IsType>(), + "Output CellSet is not CellSetSingleType"); + VTKM_TEST_ASSERT(output.GetNumberOfCells() == 2, "Wrong number of cells"); + VTKM_TEST_ASSERT(outputCellSet.GetCellShape(0) == vtkm::CellShapeTagTetra::Id, + "Cell is not tetra"); + VTKM_TEST_ASSERT(outputCellSet.GetCellShape(1) == vtkm::CellShapeTagTetra::Id, + "Cell is not tetra"); + } + void operator()() const { this->TestStructured(); this->TestExplicit(); + this->TestCellSetSingleTypeTetra(); + this->TestCellSetExplicitTetra(); } }; } diff --git a/vtkm/filter/geometry_refinement/testing/UnitTestTriangulateFilter.cxx b/vtkm/filter/geometry_refinement/testing/UnitTestTriangulateFilter.cxx index c7f2c5cf2..7a167710e 100644 --- a/vtkm/filter/geometry_refinement/testing/UnitTestTriangulateFilter.cxx +++ b/vtkm/filter/geometry_refinement/testing/UnitTestTriangulateFilter.cxx @@ -8,6 +8,7 @@ // PURPOSE. See the above copyright notice for more information. //============================================================================ +#include #include #include @@ -61,10 +62,55 @@ public: VTKM_TEST_ASSERT(outData.ReadPortal().Get(6) == 3.f, "Wrong cell field data"); } + void TestCellSetSingleTypeTriangle() const + { + vtkm::cont::DataSet dataset; + vtkm::cont::CellSetSingleType<> cellSet; + + auto connectivity = vtkm::cont::make_ArrayHandle({ 0, 1, 2, 1, 2, 3 }); + cellSet.Fill(4, vtkm::CELL_SHAPE_TRIANGLE, 3, connectivity); + + dataset.SetCellSet(cellSet); + + vtkm::filter::geometry_refinement::Triangulate triangulate; + vtkm::cont::DataSet output = triangulate.Execute(dataset); + + VTKM_TEST_ASSERT(dataset.GetCellSet().GetCellSetBase() == output.GetCellSet().GetCellSetBase(), + "Pointer to the CellSetSingleType has changed."); + } + + void TestCellSetExplicitTriangle() const + { + std::vector coords{ vtkm::Vec3f_32(0.0f, 0.0f, 0.0f), + vtkm::Vec3f_32(2.0f, 0.0f, 0.0f), + vtkm::Vec3f_32(2.0f, 4.0f, 0.0f), + vtkm::Vec3f_32(0.0f, 4.0f, 0.0f) }; + std::vector shapes{ vtkm::CELL_SHAPE_TRIANGLE, vtkm::CELL_SHAPE_TRIANGLE }; + std::vector indices{ 3, 3 }; + std::vector connectivity{ 0, 1, 2, 1, 2, 3 }; + + vtkm::cont::DataSetBuilderExplicit dsb; + vtkm::cont::DataSet dataset = dsb.Create(coords, shapes, indices, connectivity); + + vtkm::filter::geometry_refinement::Triangulate triangulate; + vtkm::cont::DataSet output = triangulate.Execute(dataset); + vtkm::cont::UnknownCellSet outputCellSet = output.GetCellSet(); + + VTKM_TEST_ASSERT(outputCellSet.IsType>(), + "Output CellSet is not CellSetSingleType"); + VTKM_TEST_ASSERT(output.GetNumberOfCells() == 2, "Wrong number of cells"); + VTKM_TEST_ASSERT(outputCellSet.GetCellShape(0) == vtkm::CellShapeTagTriangle::Id, + "Cell is not triangular"); + VTKM_TEST_ASSERT(outputCellSet.GetCellShape(1) == vtkm::CellShapeTagTriangle::Id, + "Cell is not triangular"); + } + void operator()() const { this->TestStructured(); this->TestExplicit(); + this->TestCellSetSingleTypeTriangle(); + this->TestCellSetExplicitTriangle(); } }; } diff --git a/vtkm/rendering/raytracing/VolumeRendererStructured.cxx b/vtkm/rendering/raytracing/VolumeRendererStructured.cxx index 268a6753a..d4f95e04c 100644 --- a/vtkm/rendering/raytracing/VolumeRendererStructured.cxx +++ b/vtkm/rendering/raytracing/VolumeRendererStructured.cxx @@ -11,7 +11,6 @@ #include #include -#include #include #include #include @@ -20,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -33,6 +31,9 @@ namespace rendering { namespace raytracing { +using DefaultHandle = vtkm::cont::ArrayHandle; +using CartesianArrayHandle = + vtkm::cont::ArrayHandleCartesianProduct; namespace { @@ -41,9 +42,6 @@ template class RectilinearLocator { protected: - using DefaultHandle = vtkm::cont::ArrayHandle; - using CartesianArrayHandle = - vtkm::cont::ArrayHandleCartesianProduct; using DefaultConstHandle = typename DefaultHandle::ReadPortalType; using CartesianConstPortal = typename CartesianArrayHandle::ReadPortalType; @@ -728,13 +726,6 @@ public: } }; //class CalcRayStart -VolumeRendererStructured::VolumeRendererStructured() -{ - IsSceneDirty = false; - IsUniformDataSet = true; - SampleDistance = -1.f; -} - void VolumeRendererStructured::SetColorMap(const vtkm::cont::ArrayHandle& colorMap) { ColorMap = colorMap; @@ -754,35 +745,15 @@ void VolumeRendererStructured::SetData(const vtkm::cont::CoordinateSystem& coord ScalarRange = scalarRange; } -template -struct VolumeRendererStructured::RenderFunctor -{ -protected: - vtkm::rendering::raytracing::VolumeRendererStructured* Self; - vtkm::rendering::raytracing::Ray& Rays; - -public: - VTKM_CONT - RenderFunctor(vtkm::rendering::raytracing::VolumeRendererStructured* self, - vtkm::rendering::raytracing::Ray& rays) - : Self(self) - , Rays(rays) - { - } - - template - VTKM_CONT bool operator()(Device) - { - VTKM_IS_DEVICE_ADAPTER_TAG(Device); - - this->Self->RenderOnDevice(this->Rays, Device()); - return true; - } -}; - void VolumeRendererStructured::Render(vtkm::rendering::raytracing::Ray& rays) { - RenderFunctor functor(this, rays); + auto functor = [&](auto device) { + using Device = typename std::decay_t; + VTKM_IS_DEVICE_ADAPTER_TAG(Device); + + this->RenderOnDevice(rays, device); + return true; + }; vtkm::cont::TryExecute(functor); } diff --git a/vtkm/rendering/raytracing/VolumeRendererStructured.h b/vtkm/rendering/raytracing/VolumeRendererStructured.h index b203604f8..3df4bf13e 100644 --- a/vtkm/rendering/raytracing/VolumeRendererStructured.h +++ b/vtkm/rendering/raytracing/VolumeRendererStructured.h @@ -25,19 +25,6 @@ namespace raytracing class VTKM_RENDERING_EXPORT VolumeRendererStructured { public: - using DefaultHandle = vtkm::cont::ArrayHandle; - using CartesianArrayHandle = - vtkm::cont::ArrayHandleCartesianProduct; - - VTKM_CONT - VolumeRendererStructured(); - - VTKM_CONT - void EnableCompositeBackground(); - - VTKM_CONT - void DisableCompositeBackground(); - VTKM_CONT void SetColorMap(const vtkm::cont::ArrayHandle& colorMap); @@ -60,17 +47,15 @@ public: protected: template VTKM_CONT void RenderOnDevice(vtkm::rendering::raytracing::Ray& rays, Device); - template - struct RenderFunctor; - bool IsSceneDirty; - bool IsUniformDataSet; + bool IsSceneDirty = false; + bool IsUniformDataSet = true; vtkm::Bounds SpatialExtent; vtkm::cont::CoordinateSystem Coordinates; vtkm::cont::CellSetStructured<3> Cellset; const vtkm::cont::Field* ScalarField; vtkm::cont::ArrayHandle ColorMap; - vtkm::Float32 SampleDistance; + vtkm::Float32 SampleDistance = -1.f; vtkm::Range ScalarRange; }; } From b4376342950bcc93520badcffa9f8f045513b7eb Mon Sep 17 00:00:00 2001 From: Dave Pugmire Date: Mon, 1 May 2023 14:41:32 -0400 Subject: [PATCH 6/6] Kick the dashboards..... --- vtkm/filter/flow/testing/UnitTestStreamlineFilterMPI.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/vtkm/filter/flow/testing/UnitTestStreamlineFilterMPI.cxx b/vtkm/filter/flow/testing/UnitTestStreamlineFilterMPI.cxx index 872b42cc6..e46edf7b1 100644 --- a/vtkm/filter/flow/testing/UnitTestStreamlineFilterMPI.cxx +++ b/vtkm/filter/flow/testing/UnitTestStreamlineFilterMPI.cxx @@ -578,7 +578,6 @@ void TestPartitionedDataSet(vtkm::Id nPerRank, } } - void TestStreamlineFiltersMPI() { auto comm = vtkm::cont::EnvironmentTracker::GetCommunicator();