diff --git a/.gitlab/ci/config/initial_config.cmake b/.gitlab/ci/config/initial_config.cmake index e4df50de0..c58a3935b 100644 --- a/.gitlab/ci/config/initial_config.cmake +++ b/.gitlab/ci/config/initial_config.cmake @@ -49,6 +49,9 @@ foreach(option IN LISTS options) elseif(no_rendering STREQUAL option) set(VTKm_ENABLE_RENDERING "OFF" CACHE STRING "") + elseif(no_virtual STREQUAL option) + set(VTKm_NO_DEPRECATED_VIRTUAL "ON" CACHE STRING "") + elseif(examples STREQUAL option) set(VTKm_ENABLE_EXAMPLES "ON" CACHE STRING "") diff --git a/.gitlab/ci/ubuntu1604.yml b/.gitlab/ci/ubuntu1604.yml index 948f3a139..ce4b43231 100644 --- a/.gitlab/ci/ubuntu1604.yml +++ b/.gitlab/ci/ubuntu1604.yml @@ -17,7 +17,7 @@ build:ubuntu1604_gcc5: CC: "gcc-5" CXX: "g++-5" CMAKE_BUILD_TYPE: RelWithDebInfo - VTKM_SETTINGS: "cuda+pascal" + VTKM_SETTINGS: "cuda+pascal+no_virtual" test:ubuntu1604_gcc5: tags: diff --git a/.gitlab/ci/ubuntu1804.yml b/.gitlab/ci/ubuntu1804.yml index a83c45796..41c4858f8 100644 --- a/.gitlab/ci/ubuntu1804.yml +++ b/.gitlab/ci/ubuntu1804.yml @@ -55,7 +55,7 @@ build:ubuntu1804_gcc7: variables: CC: "gcc-7" CXX: "g++-7" - VTKM_SETTINGS: "cuda+turing+mpi+64bit_floats" + VTKM_SETTINGS: "cuda+turing+mpi+64bit_floats+no_virtual" test:ubuntu1804_gcc7: tags: diff --git a/CMake/testing/VTKmCheckSourceInInstall.cmake b/CMake/testing/VTKmCheckSourceInInstall.cmake index fd0d771ca..abf71d1f4 100644 --- a/CMake/testing/VTKmCheckSourceInInstall.cmake +++ b/CMake/testing/VTKmCheckSourceInInstall.cmake @@ -112,6 +112,14 @@ function(do_verify root_dir prefix) set(file_exceptions cont/ColorTablePrivate.hxx thirdparty/diy/vtkmdiy/cmake/mpi_types.h + + # Ignore deprecated virtual classes (which are not installed if VTKm_NO_DEPRECATED_VIRTUAL + # is on). These exceptions can be removed when these files are completely removed. + cont/ArrayHandleVirtual.h + cont/ArrayHandleVirtual.hxx + cont/ArrayHandleVirtualCoordinates.h + cont/StorageVirtual.h + cont/StorageVirtual.hxx ) #by default every header in a testing directory doesn't need to be installed diff --git a/CMakeLists.txt b/CMakeLists.txt index 20fde1539..e907495f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -132,6 +132,13 @@ vtkm_option(VTKm_ENABLE_DEVELOPER_FLAGS "Enable compiler flags that are useful w # Some application might need not to install those, hence this option. vtkm_option(VTKm_NO_INSTALL_README_LICENSE "disable the installation of README and LICENSE files" OFF) +# We are in the process of deprecating the use of virtual methods because they +# are not well supported on many accelerators. Turn this option on to remove +# the code entirely. Note that the deprecation of virtual methods is work in +# progress, so not all use of virtual methods may be done. In VTK-m 2.0 +# virtual methods should be removed entirely and this option will be removed. +vtkm_option(VTKm_NO_DEPRECATED_VIRTUAL "Do not compile support of deprecated virtual methods" OFF) + mark_as_advanced( VTKm_ENABLE_LOGGING VTKm_NO_ASSERT @@ -140,6 +147,7 @@ mark_as_advanced( VTKm_HIDE_PRIVATE_SYMBOLS VTKm_ENABLE_DEVELOPER_FLAGS VTKm_NO_INSTALL_README_LICENSE + VTKm_NO_DEPRECATED_VIRTUAL ) #----------------------------------------------------------------------------- diff --git a/benchmarking/BenchmarkFieldAlgorithms.cxx b/benchmarking/BenchmarkFieldAlgorithms.cxx index a0817f2ca..a23c2c3b8 100644 --- a/benchmarking/BenchmarkFieldAlgorithms.cxx +++ b/benchmarking/BenchmarkFieldAlgorithms.cxx @@ -13,13 +13,16 @@ #include #include -#include #include #include #include #include #include +#ifndef VTKM_NO_DEPRECATED_VIRTUAL +#include +#endif + #include #include @@ -433,15 +436,19 @@ void BenchBlackScholesStatic(::benchmark::State& state) }; VTKM_BENCHMARK_TEMPLATES(BenchBlackScholesStatic, ValueTypes); +#ifndef VTKM_NO_DEPRECATED_VIRTUAL template void BenchBlackScholesDynamic(::benchmark::State& state) { + VTKM_DEPRECATED_SUPPRESS_BEGIN BenchBlackScholesImpl impl{ state }; impl.Run(vtkm::cont::make_ArrayHandleVirtual(impl.StockPrice), vtkm::cont::make_ArrayHandleVirtual(impl.OptionStrike), vtkm::cont::make_ArrayHandleVirtual(impl.OptionYears)); + VTKM_DEPRECATED_SUPPRESS_END }; VTKM_BENCHMARK_TEMPLATES(BenchBlackScholesDynamic, ValueTypes); +#endif //VTKM_NO_DEPRECATED_VIRTUAL template void BenchBlackScholesMultiplexer0(::benchmark::State& state) @@ -537,15 +544,19 @@ void BenchMathStatic(::benchmark::State& state) }; VTKM_BENCHMARK_TEMPLATES(BenchMathStatic, ValueTypes); +#ifndef VTKM_NO_DEPRECATED_VIRTUAL template void BenchMathDynamic(::benchmark::State& state) { + VTKM_DEPRECATED_SUPPRESS_BEGIN BenchMathImpl impl{ state }; impl.Run(vtkm::cont::make_ArrayHandleVirtual(impl.InputHandle), vtkm::cont::make_ArrayHandleVirtual(impl.TempHandle1), vtkm::cont::make_ArrayHandleVirtual(impl.TempHandle2)); + VTKM_DEPRECATED_SUPPRESS_END }; VTKM_BENCHMARK_TEMPLATES(BenchMathDynamic, ValueTypes); +#endif //VTKM_NO_DEPRECATED_VIRTUAL template void BenchMathMultiplexer0(::benchmark::State& state) @@ -636,13 +647,17 @@ void BenchFusedMathStatic(::benchmark::State& state) }; VTKM_BENCHMARK_TEMPLATES(BenchFusedMathStatic, ValueTypes); +#ifndef VTKM_NO_DEPRECATED_VIRTUAL template void BenchFusedMathDynamic(::benchmark::State& state) { + VTKM_DEPRECATED_SUPPRESS_BEGIN BenchFusedMathImpl impl{ state }; impl.Run(vtkm::cont::make_ArrayHandleVirtual(impl.InputHandle)); + VTKM_DEPRECATED_SUPPRESS_END }; VTKM_BENCHMARK_TEMPLATES(BenchFusedMathDynamic, ValueTypes); +#endif //VTKM_NO_DEPRECATED_VIRTUAL template void BenchFusedMathMultiplexer0(::benchmark::State& state) @@ -756,15 +771,19 @@ void BenchEdgeInterpStatic(::benchmark::State& state) }; VTKM_BENCHMARK_TEMPLATES(BenchEdgeInterpStatic, InterpValueTypes); +#ifndef VTKM_NO_DEPRECATED_VIRTUAL template void BenchEdgeInterpDynamic(::benchmark::State& state) { + VTKM_DEPRECATED_SUPPRESS_BEGIN BenchEdgeInterpImpl impl{ state }; impl.Run(vtkm::cont::make_ArrayHandleVirtual(impl.EdgePairHandle), vtkm::cont::make_ArrayHandleVirtual(impl.WeightHandle), vtkm::cont::make_ArrayHandleVirtual(impl.FieldHandle)); + VTKM_DEPRECATED_SUPPRESS_END }; VTKM_BENCHMARK_TEMPLATES(BenchEdgeInterpDynamic, InterpValueTypes); +#endif //VTKM_NO_DEPRECATED_VIRTUAL struct ImplicitFunctionBenchData { diff --git a/docs/changelog/deprecate-virtual-methods.md b/docs/changelog/deprecate-virtual-methods.md new file mode 100644 index 000000000..ff7d3ed36 --- /dev/null +++ b/docs/changelog/deprecate-virtual-methods.md @@ -0,0 +1,17 @@ +# Virtual methods in execution environment deprecated + +The use of classes with any virtual methods in the execution environment is +deprecated. Although we had code to correctly build virtual methods on some +devices such as CUDA, this feature was not universally supported on all +programming models we wish to support. Plus, the implementation of virtual +methods is not hugely convenient on CUDA because the virtual methods could +not be embedded in a library. To get around virtual methods declared in +different libraries, all builds had to be static, and a special linking +step to pull in possible virtual method implementations was required. + +For these reasons, VTK-m is no longer relying on virtual methods. (Other +approaches like multiplexers are used instead.) The code will be officially +removed in version 2.0. It is still supported in a deprecated sense (you +should get a warning). However, if you want to build without virtual +methods, you can set the `VTKm_NO_DEPRECATED_VIRTUAL` CMake flag, and they +will not be compiled. diff --git a/vtkm/cont/ArrayHandleCompositeVector.h b/vtkm/cont/ArrayHandleCompositeVector.h index 034a7dba1..cd7dd6090 100644 --- a/vtkm/cont/ArrayHandleCompositeVector.h +++ b/vtkm/cont/ArrayHandleCompositeVector.h @@ -67,13 +67,12 @@ struct AllAreArrayHandles // `vtkm::Vec`. This also validates that all members have the same `ValueType`. template -constexpr bool CheckValueType() +struct CheckValueType { VTKM_STATIC_ASSERT_MSG((std::is_same::value), "ArrayHandleCompositeVector must be built from " "ArrayHandles with the same ValueTypes."); - return std::is_same::value; -} +}; template struct GetValueType @@ -81,9 +80,7 @@ struct GetValueType static constexpr vtkm::IdComponent COUNT = static_cast(sizeof...(ArrayTypes)) + 1; using ComponentType = typename ArrayType0::ValueType; - static constexpr std::array ValueCheck{ - { true, CheckValueType()... } - }; + using ValueCheck = vtkm::List...>; using ValueType = vtkm::Vec; }; diff --git a/vtkm/cont/ArrayHandleVirtual.cxx b/vtkm/cont/ArrayHandleVirtual.cxx index f6561de5b..062573a68 100644 --- a/vtkm/cont/ArrayHandleVirtual.cxx +++ b/vtkm/cont/ArrayHandleVirtual.cxx @@ -15,6 +15,8 @@ namespace vtkm namespace cont { +VTKM_DEPRECATED_SUPPRESS_BEGIN + #define VTK_M_ARRAY_HANDLE_VIRTUAL_INSTANTIATE(T) \ template class VTKM_CONT_EXPORT ArrayHandle; \ template class VTKM_CONT_EXPORT ArrayHandleVirtual; \ @@ -38,5 +40,8 @@ VTK_M_ARRAY_HANDLE_VIRTUAL_INSTANTIATE(vtkm::Float32); VTK_M_ARRAY_HANDLE_VIRTUAL_INSTANTIATE(vtkm::Float64); #undef VTK_M_ARRAY_HANDLE_VIRTUAL_INSTANTIATE + +VTKM_DEPRECATED_SUPPRESS_END + } } //namespace vtkm::cont diff --git a/vtkm/cont/ArrayHandleVirtual.h b/vtkm/cont/ArrayHandleVirtual.h index 2e467f015..7bb4a8210 100644 --- a/vtkm/cont/ArrayHandleVirtual.h +++ b/vtkm/cont/ArrayHandleVirtual.h @@ -20,14 +20,19 @@ #include +#ifdef VTKM_NO_DEPRECATED_VIRTUAL +#error "ArrayHandleVirtual is removed. Do not include ArrayHandleVirtual.h" +#endif + namespace vtkm { namespace cont { +VTKM_DEPRECATED_SUPPRESS_BEGIN template -class VTKM_ALWAYS_EXPORT ArrayHandleVirtual +class VTKM_ALWAYS_EXPORT VTKM_DEPRECATED(1.6) ArrayHandleVirtual : public vtkm::cont::ArrayHandle { using StorageType = vtkm::cont::internal::Storage; @@ -267,6 +272,7 @@ VTK_M_ARRAY_HANDLE_VIRTUAL_EXPORT(vtkm::Float64); #undef VTK_M_ARRAY_HANDLE_VIRTUAL_EXPORT #endif //vtk_m_cont_ArrayHandleVirtual_cxx +VTKM_DEPRECATED_SUPPRESS_END } } //namespace vtkm::cont diff --git a/vtkm/cont/ArrayHandleVirtual.hxx b/vtkm/cont/ArrayHandleVirtual.hxx index 2dd6386f3..d96e59ba0 100644 --- a/vtkm/cont/ArrayHandleVirtual.hxx +++ b/vtkm/cont/ArrayHandleVirtual.hxx @@ -13,6 +13,7 @@ #include #include +VTKM_DEPRECATED_SUPPRESS_BEGIN namespace vtkm { namespace cont @@ -37,6 +38,7 @@ ArrayHandleType inline ArrayHandleVirtual::CastToType( } } } // namespace vtkm::cont +VTKM_DEPRECATED_SUPPRESS_END #include @@ -45,6 +47,7 @@ ArrayHandleType inline ArrayHandleVirtual::CastToType( //============================================================================= // Specializations of serialization related classes /// @cond SERIALIZATION +VTKM_DEPRECATED_SUPPRESS_BEGIN namespace mangled_diy_namespace { @@ -178,5 +181,6 @@ struct Serialization> }; } // mangled_diy_namespace +VTKM_DEPRECATED_SUPPRESS_END #endif diff --git a/vtkm/cont/ArrayHandleVirtualCoordinates.h b/vtkm/cont/ArrayHandleVirtualCoordinates.h index 83153a54b..bebb5b7f2 100644 --- a/vtkm/cont/ArrayHandleVirtualCoordinates.h +++ b/vtkm/cont/ArrayHandleVirtualCoordinates.h @@ -22,11 +22,17 @@ #include #include +#ifdef VTKM_NO_DEPRECATED_VIRTUAL +#error "ArrayHandleVirtualCoordiantes is removed. Do not include ArrayHandleVirtualCoordinates.h" +#endif + namespace vtkm { namespace cont { +VTKM_DEPRECATED_SUPPRESS_BEGIN + /// ArrayHandleVirtualCoordinates is a specialization of ArrayHandle. class VTKM_ALWAYS_EXPORT VTKM_DEPRECATED(1.6, "Virtual ArrayHandles are being phased out.") ArrayHandleVirtualCoordinates final : public vtkm::cont::ArrayHandleVirtual @@ -35,17 +41,13 @@ public: VTKM_ARRAY_HANDLE_SUBCLASS_NT(ArrayHandleVirtualCoordinates, (vtkm::cont::ArrayHandleVirtual)); - VTKM_DEPRECATED_SUPPRESS_BEGIN template explicit ArrayHandleVirtualCoordinates(const vtkm::cont::ArrayHandle& ah) : vtkm::cont::ArrayHandleVirtual(vtkm::cont::make_ArrayHandleCast(ah)) { } - VTKM_DEPRECATED_SUPPRESS_END }; -VTKM_DEPRECATED_SUPPRESS_BEGIN - template void CastAndCall(const vtkm::cont::ArrayHandleVirtualCoordinates& coords, Functor&& f, diff --git a/vtkm/cont/ArrayRangeCompute.h b/vtkm/cont/ArrayRangeCompute.h index 2a74a31a6..6781a4042 100644 --- a/vtkm/cont/ArrayRangeCompute.h +++ b/vtkm/cont/ArrayRangeCompute.h @@ -16,9 +16,12 @@ #include #include #include -#include #include +#ifndef VTKM_NO_DEPRECATED_VIRTUAL +#include +#endif + namespace vtkm { namespace cont @@ -87,10 +90,14 @@ VTK_M_ARRAY_RANGE_COMPUTE_EXPORT_VEC(vtkm::Float64, 4, vtkm::cont::StorageTagBas #undef VTK_M_ARRAY_RANGE_COMPUTE_EXPORT_T #undef VTK_M_ARRAY_RANGE_COMPUTE_EXPORT_VEC -VTKM_CONT -vtkm::cont::ArrayHandle ArrayRangeCompute( - const vtkm::cont::ArrayHandleVirtual& input, - vtkm::cont::DeviceAdapterId device = vtkm::cont::DeviceAdapterTagAny()); +#ifndef VTKM_NO_DEPRECATED_VIRTUAL +VTKM_DEPRECATED_SUPPRESS_BEGIN +VTKM_CONT VTKM_DEPRECATED(1.6, "ArrayHandleVirtual no longer supported.") + vtkm::cont::ArrayHandle ArrayRangeCompute( + const vtkm::cont::ArrayHandleVirtual& input, + vtkm::cont::DeviceAdapterId device = vtkm::cont::DeviceAdapterTagAny()); +VTKM_DEPRECATED_SUPPRESS_END +#endif //VTKM_NO_DEPRECATED_VIRTUAL VTKM_CONT_EXPORT VTKM_CONT vtkm::cont::ArrayHandle ArrayRangeCompute( const vtkm::cont::ArrayHandle ArrayRangeComputeImpl( } // namespace detail +#ifndef VTKM_NO_DEPRECATED_VIRTUAL +VTKM_DEPRECATED_SUPPRESS_BEGIN VTKM_CONT inline vtkm::cont::ArrayHandle ArrayRangeCompute( const vtkm::cont::ArrayHandleVirtual& input, @@ -132,6 +134,8 @@ inline vtkm::cont::ArrayHandle ArrayRangeCompute( return detail::ArrayRangeComputeImpl(input, device); } } +VTKM_DEPRECATED_SUPPRESS_END +#endif //VTKM_NO_DEPRECATED_VIRTUAL template inline vtkm::cont::ArrayHandle ArrayRangeCompute(const ArrayHandleType& input, diff --git a/vtkm/cont/CMakeLists.txt b/vtkm/cont/CMakeLists.txt index 602225369..2a50baf52 100644 --- a/vtkm/cont/CMakeLists.txt +++ b/vtkm/cont/CMakeLists.txt @@ -41,8 +41,6 @@ set(headers ArrayHandleTransform.h ArrayHandleUniformPointCoordinates.h ArrayHandleView.h - ArrayHandleVirtual.h - ArrayHandleVirtualCoordinates.h ArrayHandleZip.h ArrayPortal.h ArrayPortalToIterators.h @@ -111,7 +109,6 @@ set(headers StorageImplicit.h StorageList.h StorageListTag.h - StorageVirtual.h Timer.h Token.h TryExecute.h @@ -124,7 +121,6 @@ set(headers set(template_sources ArrayHandle.hxx - ArrayHandleVirtual.hxx ArrayRangeCompute.hxx CellSetExplicit.hxx CellSetExtrude.hxx @@ -133,7 +129,6 @@ set(template_sources FieldRangeCompute.hxx FieldRangeGlobalCompute.hxx ParticleArrayCopy.hxx - StorageVirtual.hxx VirtualObjectHandle.hxx ) @@ -162,7 +157,6 @@ set(sources # This list of sources has code that uses devices and so might need to be # compiled with a device-specific compiler (like CUDA). set(device_sources - ArrayHandleVirtual.cxx ArrayRangeCompute.cxx AssignerPartitionedDataSet.cxx BoundsCompute.cxx @@ -190,11 +184,28 @@ set(sources PointLocator.cxx PointLocatorUniformGrid.cxx RuntimeDeviceInformation.cxx - StorageVirtual.cxx Timer.cxx UnknownArrayHandle.cxx ) +if (NOT VTKm_NO_DEPRECATED_VIRTUAL) + set(headers ${headers} + ArrayHandleVirtual.h + ArrayHandleVirtualCoordinates.h + StorageVirtual.h + ) + + set(template_sources ${template_sources} + ArrayHandleVirtual.hxx + StorageVirtual.hxx + ) + + set(device_sources ${device_sources} + ArrayHandleVirtual.cxx + StorageVirtual.cxx + ) +endif() + #----------------------------------------------------------------------------- # Set up default types, which can be custom configured by other build systems. vtkm_get_kit_name(kit_name kit_dir) diff --git a/vtkm/cont/CoordinateSystem.cxx b/vtkm/cont/CoordinateSystem.cxx index 271b85f13..64eac00de 100644 --- a/vtkm/cont/CoordinateSystem.cxx +++ b/vtkm/cont/CoordinateSystem.cxx @@ -16,6 +16,7 @@ namespace vtkm namespace cont { +#ifndef VTKM_NO_DEPRECATED_VIRTUAL namespace detail { @@ -27,6 +28,7 @@ vtkm::cont::ArrayHandleVirtualCoordinates CoordDataDepWrapper::ToArray() const VTKM_DEPRECATED_SUPPRESS_END } // namespace detail +#endif //VTKM_NO_DEPRECATED_VIRTUAL VTKM_CONT CoordinateSystem::CoordinateSystem() : Superclass() @@ -52,10 +54,19 @@ CoordinateSystem::CoordinateSystem(std::string name, { } +#ifndef VTKM_NO_DEPRECATED_VIRTUAL VTKM_CONT vtkm::cont::detail::CoordDataDepWrapper CoordinateSystem::GetData() const { return vtkm::cont::detail::CoordDataDepWrapper(this->Superclass::GetData()); } +#else //!VTKM_NO_DEPRECATED_VIRTUAL +VTKM_CONT vtkm::cont::VariantArrayHandleBase CoordinateSystem::GetData() + const +{ + return vtkm::cont::VariantArrayHandleBase(this->Superclass::GetData()); +} +#endif //!VTKM_NO_DEPRECATED_VIRTUAL + VTKM_CONT vtkm::cont::CoordinateSystem::MultiplexerArrayType CoordinateSystem::GetDataAsMultiplexer() const diff --git a/vtkm/cont/CoordinateSystem.h b/vtkm/cont/CoordinateSystem.h index 7ad9c5e21..1d007e4b3 100644 --- a/vtkm/cont/CoordinateSystem.h +++ b/vtkm/cont/CoordinateSystem.h @@ -14,15 +14,19 @@ #include #include -#include #include #include +#ifndef VTKM_NO_DEPRECATED_VIRTUAL +#include +#endif + namespace vtkm { namespace cont { +#ifndef VTKM_NO_DEPRECATED_VIRTUAL namespace detail { @@ -117,6 +121,7 @@ VTKM_CONT VTKM_DEPRECATED( vtkm::cont::printSummary_ArrayHandle(coordArray, out, full); } VTKM_DEPRECATED_SUPPRESS_END +#endif //VTKM_NO_DEPRECATED_VIRTUAL class VTKM_CONT_EXPORT CoordinateSystem : public vtkm::cont::Field { @@ -146,7 +151,11 @@ public: VTKM_CONT vtkm::Id GetNumberOfPoints() const { return this->GetNumberOfValues(); } +#ifndef VTKM_NO_DEPRECATED_VIRTUAL VTKM_CONT detail::CoordDataDepWrapper GetData() const; +#else + VTKM_CONT vtkm::cont::VariantArrayHandleBase GetData() const; +#endif private: #ifdef VTKM_USE_DOUBLE_PRECISION @@ -267,11 +276,14 @@ struct DynamicTransformTraits using DynamicTag = vtkm::cont::internal::DynamicTransformTagCastAndCall; }; +#ifndef VTKM_NO_DEPRECATED_VIRTUAL template <> struct DynamicTransformTraits { using DynamicTag = vtkm::cont::internal::DynamicTransformTagCastAndCall; }; +#endif //VTKM_NO_DEPRECATED_VIRTUAL + } // namespace internal } // namespace cont @@ -283,12 +295,14 @@ struct DynamicTransformTraits namespace mangled_diy_namespace { +#ifndef VTKM_NO_DEPRECATED_VIRTUAL template <> struct Serialization : public Serialization< vtkm::cont::VariantArrayHandleBase>> { }; +#endif //VTKM_NO_DEPRECATED_VIRTUAL template <> struct Serialization diff --git a/vtkm/cont/StorageVirtual.h b/vtkm/cont/StorageVirtual.h index 71f575243..5212d421d 100644 --- a/vtkm/cont/StorageVirtual.h +++ b/vtkm/cont/StorageVirtual.h @@ -20,6 +20,10 @@ #include +#ifdef VTKM_NO_DEPRECATED_VIRTUAL +#error "ArrayHandleVirtual is removed. Do not include StorageVirtual.h" +#endif + namespace vtkm { namespace cont @@ -58,7 +62,7 @@ namespace vtkm namespace cont { -struct VTKM_ALWAYS_EXPORT StorageTagVirtual +struct VTKM_ALWAYS_EXPORT VTKM_DEPRECATED(1.6) StorageTagVirtual { }; @@ -256,6 +260,7 @@ private: } // namespace detail +VTKM_DEPRECATED_SUPPRESS_BEGIN template class VTKM_ALWAYS_EXPORT Storage { @@ -315,6 +320,7 @@ private: { } }; +VTKM_DEPRECATED_SUPPRESS_END } // namespace internal } diff --git a/vtkm/cont/StorageVirtual.hxx b/vtkm/cont/StorageVirtual.hxx index ee436df82..80b9e4ade 100644 --- a/vtkm/cont/StorageVirtual.hxx +++ b/vtkm/cont/StorageVirtual.hxx @@ -235,6 +235,7 @@ void StorageVirtualImpl::TransferPortalForOutput( } } // namespace detail +VTKM_DEPRECATED_SUPPRESS_BEGIN template void Storage::Allocate(vtkm::Id numberOfValues) { @@ -433,6 +434,7 @@ struct ArrayTransfer : detail::ArrayTr return this->Superclass::PrepareForInPlace(Device()); } }; +VTKM_DEPRECATED_SUPPRESS_END } } } // namespace vtkm::cont::internal diff --git a/vtkm/cont/VariantArrayHandle.h b/vtkm/cont/VariantArrayHandle.h index 03707de53..58999a157 100644 --- a/vtkm/cont/VariantArrayHandle.h +++ b/vtkm/cont/VariantArrayHandle.h @@ -17,7 +17,6 @@ #include #include -#include #include #include #include @@ -26,16 +25,22 @@ #include #include +#ifndef VTKM_NO_DEPRECATED_VIRTUAL +#include +#endif //VTKM_NO_DEPRECATED_VIRTUAL + namespace vtkm { namespace cont { +#ifndef VTKM_NO_DEPRECATED_VIRTUAL namespace internal { namespace variant { +VTKM_DEPRECATED_SUPPRESS_BEGIN struct ForceCastToVirtual { template @@ -84,9 +89,11 @@ private: throw vtkm::cont::ErrorBadType(str.str()); } }; +VTKM_DEPRECATED_SUPPRESS_END } } // namespace internal::variant +#endif //VTKM_NO_DEPRECATED_VIRTUAL /// \brief VariantArrayHandle superclass holding common operations. /// @@ -146,6 +153,7 @@ public: std::forward(args)...); } +#ifndef VTKM_NO_DEPRECATED_VIRTUAL /// Returns this array cast to a `ArrayHandleVirtual` of the given type. /// This will perform type conversions as necessary, and will log warnings /// if the conversion is lossy. @@ -155,10 +163,12 @@ public: /// the CastAndCall. You can also specify a list of types to try as the optional /// third template argument. /// + VTKM_DEPRECATED_SUPPRESS_BEGIN template > - VTKM_CONT vtkm::cont::ArrayHandleVirtual AsVirtual() const + VTKM_CONT VTKM_DEPRECATED(1.6, "ArrayHandleVirtual is no longer supported.") + vtkm::cont::ArrayHandleVirtual AsVirtual() const { VTKM_IS_LIST(StorageList); VTKM_IS_LIST(TypeList); @@ -167,6 +177,8 @@ public: this->CastAndCall(caster, output); return output; } + VTKM_DEPRECATED_SUPPRESS_END +#endif //VTKM_NO_DEPRECATED_VIRTUAL /// Returns this array cast to a `ArrayHandleMultiplexer` of the given type. /// This will attempt to cast the internal array to each supported type of @@ -303,6 +315,7 @@ public: } +#ifndef VTKM_NO_DEPRECATED_VIRTUAL /// Returns this array cast to a \c ArrayHandleVirtual of the given type. /// This will perform type conversions as necessary, and will log warnings /// if the conversion is lossy. @@ -311,11 +324,15 @@ public: /// be specified in the second template parameter, which will be passed to /// the CastAndCall. /// + VTKM_DEPRECATED_SUPPRESS_BEGIN template - VTKM_CONT vtkm::cont::ArrayHandleVirtual AsVirtual() const + VTKM_CONT VTKM_DEPRECATED(1.6, "ArrayHandleVirtual is no longer suported.") + vtkm::cont::ArrayHandleVirtual AsVirtual() const { return this->Superclass::AsVirtual(); } + VTKM_DEPRECATED_SUPPRESS_END +#endif //VTKM_NO_DEPRECATED_VIRTUAL /// Changes the types to try casting to when resolving this variant array, /// which is specified with a list tag like those in TypeList.h. Since C++ diff --git a/vtkm/cont/arg/TransportTagArrayIn.h b/vtkm/cont/arg/TransportTagArrayIn.h index b346cfae2..f3d6e3c40 100644 --- a/vtkm/cont/arg/TransportTagArrayIn.h +++ b/vtkm/cont/arg/TransportTagArrayIn.h @@ -35,6 +35,15 @@ struct TransportTagArrayIn template struct Transport { + // MSVC will issue deprecation warnings here if this template is instantiated with + // a deprecated class even if the template is used from a section of code where + // deprecation warnings are suppressed. This is annoying behavior since this template + // has no control over what class it is used with. To get around it, we have to + // suppress all deprecation warnings here. +#ifdef VTKM_MSVC + VTKM_DEPRECATED_SUPPRESS_BEGIN +#endif + VTKM_IS_ARRAY_HANDLE(ContObjectType); using ExecObjectType = decltype( @@ -54,6 +63,10 @@ struct Transport return object.PrepareForInput(Device(), token); } + +#ifdef VTKM_MSVC + VTKM_DEPRECATED_SUPPRESS_END +#endif }; } } diff --git a/vtkm/cont/arg/TransportTagArrayInOut.h b/vtkm/cont/arg/TransportTagArrayInOut.h index b70d905f2..86c53a61b 100644 --- a/vtkm/cont/arg/TransportTagArrayInOut.h +++ b/vtkm/cont/arg/TransportTagArrayInOut.h @@ -36,6 +36,15 @@ struct TransportTagArrayInOut template struct Transport { + // MSVC will issue deprecation warnings here if this template is instantiated with + // a deprecated class even if the template is used from a section of code where + // deprecation warnings are suppressed. This is annoying behavior since this template + // has no control over what class it is used with. To get around it, we have to + // suppress all deprecation warnings here. +#ifdef VTKM_MSVC + VTKM_DEPRECATED_SUPPRESS_BEGIN +#endif + // If you get a compile error here, it means you tried to use an object that // is not an array handle as an argument that is expected to be one. VTKM_IS_ARRAY_HANDLE(ContObjectType); @@ -57,6 +66,10 @@ struct Transport struct Transport { + // MSVC will issue deprecation warnings here if this template is instantiated with + // a deprecated class even if the template is used from a section of code where + // deprecation warnings are suppressed. This is annoying behavior since this template + // has no control over what class it is used with. To get around it, we have to + // suppress all deprecation warnings here. +#ifdef VTKM_MSVC + VTKM_DEPRECATED_SUPPRESS_BEGIN +#endif + // If you get a compile error here, it means you tried to use an object that // is not an array handle as an argument that is expected to be one. VTKM_IS_ARRAY_HANDLE(ContObjectType); @@ -53,6 +62,10 @@ struct Transport { return object.PrepareForOutput(outputRange, Device(), token); } + +#ifdef VTKM_MSVC + VTKM_DEPRECATED_SUPPRESS_END +#endif }; } } diff --git a/vtkm/cont/arg/TransportTagAtomicArray.h b/vtkm/cont/arg/TransportTagAtomicArray.h index e78730575..90d832c62 100644 --- a/vtkm/cont/arg/TransportTagAtomicArray.h +++ b/vtkm/cont/arg/TransportTagAtomicArray.h @@ -13,8 +13,11 @@ #include #include + +#ifndef VTKM_NO_DEPRECATED_VIRTUAL #include #include +#endif #include @@ -64,6 +67,8 @@ struct Transport struct Transport, @@ -99,6 +104,8 @@ struct Transport struct Transport { + // MSVC will issue deprecation warnings here if this template is instantiated with + // a deprecated class even if the template is used from a section of code where + // deprecation warnings are suppressed. This is annoying behavior since this template + // has no control over what class it is used with. To get around it, we have to + // suppress all deprecation warnings here. +#ifdef VTKM_MSVC + VTKM_DEPRECATED_SUPPRESS_BEGIN +#endif + // If you get a compile error here, it means you tried to use an object that // is not an array handle as an argument that is expected to be one. VTKM_IS_ARRAY_HANDLE(ContObjectType); @@ -62,6 +71,10 @@ struct Transport struct Transport { + // MSVC will issue deprecation warnings here if this template is instantiated with + // a deprecated class even if the template is used from a section of code where + // deprecation warnings are suppressed. This is annoying behavior since this template + // has no control over what class it is used with. To get around it, we have to + // suppress all deprecation warnings here. +#ifdef VTKM_MSVC + VTKM_DEPRECATED_SUPPRESS_BEGIN +#endif + // If you get a compile error here, it means you tried to use an object that // is not an array handle as an argument that is expected to be one. VTKM_IS_ARRAY_HANDLE(ContObjectType); @@ -64,6 +73,10 @@ struct Transport struct Transport { + // MSVC will issue deprecation warnings here if this template is instantiated with + // a deprecated class even if the template is used from a section of code where + // deprecation warnings are suppressed. This is annoying behavior since this template + // has no control over what class it is used with. To get around it, we have to + // suppress all deprecation warnings here. +#ifdef VTKM_MSVC + VTKM_DEPRECATED_SUPPRESS_BEGIN +#endif + // If you get a compile error here, it means you tried to use an object that // is not an array handle as an argument that is expected to be one. VTKM_IS_ARRAY_HANDLE(ContObjectType); @@ -64,6 +73,10 @@ struct Transport #include -#include - #include +#ifndef VTKM_NO_DEPRECATED_VIRTUAL +#include +#endif //VTKM_NO_DEPRECATED_VIRTUAL + namespace vtkm { namespace cont @@ -44,11 +46,15 @@ struct TypeCheck::value; }; +#ifndef VTKM_NO_DEPRECATED_VIRTUAL +VTKM_DEPRECATED_SUPPRESS_BEGIN template struct TypeCheck> { static constexpr bool value = vtkm::ListHas::value; }; +VTKM_DEPRECATED_SUPPRESS_END +#endif //VTKM_NO_DEPRECATED_VIRTUAL } } } // namespace vtkm::cont::arg diff --git a/vtkm/cont/cuda/testing/CMakeLists.txt b/vtkm/cont/cuda/testing/CMakeLists.txt index f2f4874fd..b23f65c5a 100644 --- a/vtkm/cont/cuda/testing/CMakeLists.txt +++ b/vtkm/cont/cuda/testing/CMakeLists.txt @@ -12,7 +12,6 @@ set(unit_tests UnitTestCudaArrayHandle.cu UnitTestCudaArrayHandleFancy.cu UnitTestCudaArrayHandleMultiplexer.cu - UnitTestCudaArrayHandleVirtualCoordinates.cu UnitTestCudaBitField.cu UnitTestCudaCellLocatorRectilinearGrid.cu UnitTestCudaCellLocatorUniformBins.cu diff --git a/vtkm/cont/cuda/testing/UnitTestCudaArrayHandleVirtualCoordinates.cu b/vtkm/cont/cuda/testing/UnitTestCudaArrayHandleVirtualCoordinates.cu deleted file mode 100644 index a1b2d830f..000000000 --- a/vtkm/cont/cuda/testing/UnitTestCudaArrayHandleVirtualCoordinates.cu +++ /dev/null @@ -1,20 +0,0 @@ -//============================================================================ -// 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. -//============================================================================ - -#include -#include - -int UnitTestCudaArrayHandleVirtualCoordinates(int argc, char* argv[]) -{ - auto& tracker = vtkm::cont::GetRuntimeDeviceTracker(); - tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{}); - return vtkm::cont::testing::TestingArrayHandleVirtualCoordinates< - vtkm::cont::DeviceAdapterTagCuda>::Run(argc, argv); -} diff --git a/vtkm/cont/kokkos/testing/CMakeLists.txt b/vtkm/cont/kokkos/testing/CMakeLists.txt index 524821c92..a40f93048 100644 --- a/vtkm/cont/kokkos/testing/CMakeLists.txt +++ b/vtkm/cont/kokkos/testing/CMakeLists.txt @@ -12,7 +12,6 @@ set(unit_tests UnitTestKokkosArrayHandle.cxx UnitTestKokkosArrayHandleFancy.cxx UnitTestKokkosArrayHandleMultiplexer.cxx - UnitTestKokkosArrayHandleVirtualCoordinates.cxx UnitTestKokkosBitField.cxx UnitTestKokkosCellLocatorRectilinearGrid.cxx UnitTestKokkosCellLocatorUniformBins.cxx diff --git a/vtkm/cont/kokkos/testing/UnitTestKokkosArrayHandleVirtualCoordinates.cxx b/vtkm/cont/kokkos/testing/UnitTestKokkosArrayHandleVirtualCoordinates.cxx deleted file mode 100644 index 51732807c..000000000 --- a/vtkm/cont/kokkos/testing/UnitTestKokkosArrayHandleVirtualCoordinates.cxx +++ /dev/null @@ -1,20 +0,0 @@ -//============================================================================ -// 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. -//============================================================================ - -#include -#include - -int UnitTestKokkosArrayHandleVirtualCoordinates(int argc, char* argv[]) -{ - auto& tracker = vtkm::cont::GetRuntimeDeviceTracker(); - tracker.ForceDevice(vtkm::cont::DeviceAdapterTagKokkos{}); - return vtkm::cont::testing::TestingArrayHandleVirtualCoordinates< - vtkm::cont::DeviceAdapterTagKokkos>::Run(argc, argv); -} diff --git a/vtkm/cont/openmp/testing/CMakeLists.txt b/vtkm/cont/openmp/testing/CMakeLists.txt index 1b6f69bf9..2f3c4af2f 100644 --- a/vtkm/cont/openmp/testing/CMakeLists.txt +++ b/vtkm/cont/openmp/testing/CMakeLists.txt @@ -12,7 +12,6 @@ set(unit_tests UnitTestOpenMPArrayHandle.cxx UnitTestOpenMPArrayHandleFancy.cxx UnitTestOpenMPArrayHandleMultiplexer.cxx - UnitTestOpenMPArrayHandleVirtualCoordinates.cxx UnitTestOpenMPBitField.cxx UnitTestOpenMPCellLocatorRectilinearGrid.cxx UnitTestOpenMPCellLocatorUniformBins.cxx diff --git a/vtkm/cont/openmp/testing/UnitTestOpenMPArrayHandleVirtualCoordinates.cxx b/vtkm/cont/openmp/testing/UnitTestOpenMPArrayHandleVirtualCoordinates.cxx deleted file mode 100644 index ab7c8bbbe..000000000 --- a/vtkm/cont/openmp/testing/UnitTestOpenMPArrayHandleVirtualCoordinates.cxx +++ /dev/null @@ -1,19 +0,0 @@ -//============================================================================ -// 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. -//============================================================================ -#include -#include - -int UnitTestOpenMPArrayHandleVirtualCoordinates(int argc, char* argv[]) -{ - auto& tracker = vtkm::cont::GetRuntimeDeviceTracker(); - tracker.ForceDevice(vtkm::cont::DeviceAdapterTagOpenMP{}); - return vtkm::cont::testing::TestingArrayHandleVirtualCoordinates< - vtkm::cont::DeviceAdapterTagOpenMP>::Run(argc, argv); -} diff --git a/vtkm/cont/serial/testing/CMakeLists.txt b/vtkm/cont/serial/testing/CMakeLists.txt index e19eaa301..787a2631b 100644 --- a/vtkm/cont/serial/testing/CMakeLists.txt +++ b/vtkm/cont/serial/testing/CMakeLists.txt @@ -12,7 +12,6 @@ set(unit_tests UnitTestSerialArrayHandle.cxx UnitTestSerialArrayHandleFancy.cxx UnitTestSerialArrayHandleMultiplexer.cxx - UnitTestSerialArrayHandleVirtualCoordinates.cxx UnitTestSerialBitField.cxx UnitTestSerialCellLocatorRectilinearGrid.cxx UnitTestSerialCellLocatorUniformBins.cxx diff --git a/vtkm/cont/serial/testing/UnitTestSerialArrayHandleVirtualCoordinates.cxx b/vtkm/cont/serial/testing/UnitTestSerialArrayHandleVirtualCoordinates.cxx deleted file mode 100644 index a01a70b7d..000000000 --- a/vtkm/cont/serial/testing/UnitTestSerialArrayHandleVirtualCoordinates.cxx +++ /dev/null @@ -1,21 +0,0 @@ -//============================================================================ -// 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. -//============================================================================ - -#include -#include -#include - -int UnitTestSerialArrayHandleVirtualCoordinates(int argc, char* argv[]) -{ - auto& tracker = vtkm::cont::GetRuntimeDeviceTracker(); - tracker.ForceDevice(vtkm::cont::DeviceAdapterTagSerial{}); - return vtkm::cont::testing::TestingArrayHandleVirtualCoordinates< - vtkm::cont::DeviceAdapterTagSerial>::Run(argc, argv); -} diff --git a/vtkm/cont/tbb/testing/CMakeLists.txt b/vtkm/cont/tbb/testing/CMakeLists.txt index 8868478b6..ed484b9b9 100644 --- a/vtkm/cont/tbb/testing/CMakeLists.txt +++ b/vtkm/cont/tbb/testing/CMakeLists.txt @@ -12,7 +12,6 @@ set(unit_tests UnitTestTBBArrayHandle.cxx UnitTestTBBArrayHandleFancy.cxx UnitTestTBBArrayHandleMultiplexer.cxx - UnitTestTBBArrayHandleVirtualCoordinates.cxx UnitTestTBBBitField.cxx UnitTestTBBCellLocatorRectilinearGrid.cxx UnitTestTBBCellLocatorUniformBins.cxx diff --git a/vtkm/cont/tbb/testing/UnitTestTBBArrayHandleVirtualCoordinates.cxx b/vtkm/cont/tbb/testing/UnitTestTBBArrayHandleVirtualCoordinates.cxx deleted file mode 100644 index 877a1c086..000000000 --- a/vtkm/cont/tbb/testing/UnitTestTBBArrayHandleVirtualCoordinates.cxx +++ /dev/null @@ -1,20 +0,0 @@ -//============================================================================ -// 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. -//============================================================================ - -#include -#include - -int UnitTestTBBArrayHandleVirtualCoordinates(int argc, char* argv[]) -{ - auto& tracker = vtkm::cont::GetRuntimeDeviceTracker(); - tracker.ForceDevice(vtkm::cont::DeviceAdapterTagTBB{}); - return vtkm::cont::testing::TestingArrayHandleVirtualCoordinates< - vtkm::cont::DeviceAdapterTagTBB>::Run(argc, argv); -} diff --git a/vtkm/cont/testing/CMakeLists.txt b/vtkm/cont/testing/CMakeLists.txt index e5a9718b9..38ec5ac03 100644 --- a/vtkm/cont/testing/CMakeLists.txt +++ b/vtkm/cont/testing/CMakeLists.txt @@ -14,7 +14,6 @@ set(headers Testing.h TestingArrayHandles.h TestingArrayHandleMultiplexer.h - TestingArrayHandleVirtualCoordinates.h TestingCellLocatorRectilinearGrid.h TestingCellLocatorUniformBins.h TestingCellLocatorUniformGrid.h diff --git a/vtkm/cont/testing/TestingArrayHandleVirtualCoordinates.h b/vtkm/cont/testing/TestingArrayHandleVirtualCoordinates.h deleted file mode 100644 index f80013fbb..000000000 --- a/vtkm/cont/testing/TestingArrayHandleVirtualCoordinates.h +++ /dev/null @@ -1,152 +0,0 @@ -//============================================================================ -// 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. -//============================================================================ -#ifndef vtk_m_cont_testing_TestingArrayHandleVirtualCoordinates_h -#define vtk_m_cont_testing_TestingArrayHandleVirtualCoordinates_h - -// This is testing deprecated functionality. It is left to make sure that old code -// still works, but will be removed if ArrayHandleVirtualCoordinates is removed. - -#include -#include -#include -#include -#include -#include - -VTKM_DEPRECATED_SUPPRESS_BEGIN - -namespace vtkm -{ -namespace cont -{ -namespace testing -{ - -namespace -{ - -struct CopyWorklet : public vtkm::worklet::WorkletMapField -{ - using ControlSignature = void(FieldIn in, FieldOut out); - using ExecutionSignature = _2(_1); - - template - VTKM_EXEC T operator()(const T& in) const - { - return in; - } -}; - -// A dummy worklet -struct DoubleWorklet : public vtkm::worklet::WorkletMapField -{ - typedef void ControlSignature(FieldIn in); - typedef void ExecutionSignature(_1); - using InputDomain = _1; - - template - VTKM_EXEC void operator()(T& in) const - { - in = in * 2; - } -}; - -template -inline void TestVirtualAccess(const vtkm::cont::ArrayHandle& in, - vtkm::cont::ArrayHandle& out) -{ - vtkm::worklet::DispatcherMapField().Invoke( - vtkm::cont::ArrayHandleVirtualCoordinates(in), vtkm::cont::ArrayHandleVirtualCoordinates(out)); - - VTKM_TEST_ASSERT(test_equal_portals(in.ReadPortal(), out.ReadPortal()), - "Input and output portals don't match"); -} - - -} // anonymous namespace - -template -class TestingArrayHandleVirtualCoordinates -{ -private: - using ArrayHandleRectilinearCoords = - vtkm::cont::ArrayHandleCartesianProduct, - vtkm::cont::ArrayHandle, - vtkm::cont::ArrayHandle>; - - - - static void TestAll() - { - using PointType = vtkm::Vec3f; - static constexpr vtkm::Id length = 64; - - vtkm::cont::ArrayHandle out; - - std::cout << "Testing basic ArrayHandle as input\n"; - vtkm::cont::ArrayHandle a1; - a1.Allocate(length); - for (vtkm::Id i = 0; i < length; ++i) - { - a1.WritePortal().Set(i, TestValue(i, PointType())); - } - TestVirtualAccess(a1, out); - - std::cout << "Testing ArrayHandleUniformPointCoordinates as input\n"; - auto t = vtkm::cont::ArrayHandleUniformPointCoordinates(vtkm::Id3(4, 4, 4)); - TestVirtualAccess(t, out); - - std::cout << "Testing ArrayHandleCartesianProduct as input\n"; - vtkm::cont::ArrayHandle c1, c2, c3; - c1.Allocate(length); - c2.Allocate(length); - c3.Allocate(length); - auto portal = a1.ReadPortal(); - for (vtkm::Id i = 0; i < length; ++i) - { - auto p = portal.Get(i); - c1.WritePortal().Set(i, p[0]); - c2.WritePortal().Set(i, p[1]); - c3.WritePortal().Set(i, p[2]); - } - TestVirtualAccess(vtkm::cont::make_ArrayHandleCartesianProduct(c1, c2, c3), out); - - std::cout << "Testing resources releasing on ArrayHandleVirtualCoordinates\n"; - vtkm::cont::ArrayHandleVirtualCoordinates virtualC = - vtkm::cont::ArrayHandleVirtualCoordinates(a1); - vtkm::worklet::DispatcherMapField().Invoke(a1); - virtualC.ReleaseResourcesExecution(); - VTKM_TEST_ASSERT(a1.GetNumberOfValues() == length, - "ReleaseResourcesExecution" - " should not change the number of values on the Arrayhandle"); - VTKM_TEST_ASSERT( - virtualC.GetNumberOfValues() == length, - "ReleaseResources" - " should set the number of values on the ArrayHandleVirtualCoordinates to be 0"); - virtualC.ReleaseResources(); - VTKM_TEST_ASSERT(a1.GetNumberOfValues() == 0, - "ReleaseResources" - " should set the number of values on the Arrayhandle to be 0"); - } - -public: - static int Run(int argc, char* argv[]) - { - vtkm::cont::GetRuntimeDeviceTracker().ForceDevice(DeviceAdapter()); - return vtkm::cont::testing::Testing::Run(TestAll, argc, argv); - } -}; -} -} -} // vtkm::cont::testing - -VTKM_DEPRECATED_SUPPRESS_END - -#endif // vtk_m_cont_testing_TestingArrayHandleVirtualCoordinates_h diff --git a/vtkm/cont/testing/UnitTestArrayHandleVirtual.cxx b/vtkm/cont/testing/UnitTestArrayHandleVirtual.cxx index 084cca8b3..f1a71a6cf 100644 --- a/vtkm/cont/testing/UnitTestArrayHandleVirtual.cxx +++ b/vtkm/cont/testing/UnitTestArrayHandleVirtual.cxx @@ -10,8 +10,11 @@ #include #include + +#ifndef VTKM_NO_DEPRECATED_VIRTUAL #include #include +#endif #include @@ -25,6 +28,9 @@ #include +#ifndef VTKM_NO_DEPRECATED_VIRTUAL +VTKM_DEPRECATED_SUPPRESS_BEGIN + namespace UnitTestArrayHandleVirtualDetail { @@ -246,8 +252,17 @@ void TestArrayHandleVirtual() } // end namespace UnitTestArrayHandleVirtualDetail +VTKM_DEPRECATED_SUPPRESS_END +#endif //VTKM_NO_DEPRECATED_VIRTUAL + int UnitTestArrayHandleVirtual(int argc, char* argv[]) { +#ifndef VTKM_NO_DEPRECATED_VIRTUAL using namespace UnitTestArrayHandleVirtualDetail; return vtkm::cont::testing::Testing::Run(TestArrayHandleVirtual, argc, argv); +#else + (void)argc; + (void)argv; + return 0; +#endif } diff --git a/vtkm/cont/testing/UnitTestMoveConstructors.cxx b/vtkm/cont/testing/UnitTestMoveConstructors.cxx index d173053b4..a932be419 100644 --- a/vtkm/cont/testing/UnitTestMoveConstructors.cxx +++ b/vtkm/cont/testing/UnitTestMoveConstructors.cxx @@ -8,7 +8,6 @@ // PURPOSE. See the above copyright notice for more information. //============================================================================ #include -#include #include #include @@ -94,22 +93,22 @@ struct IsNoExceptHandle void operator()(T) const { using HandleType = vtkm::cont::ArrayHandle; - using VirtualType = vtkm::cont::ArrayHandleVirtual; + using MultiplexerType = vtkm::cont::ArrayHandleMultiplexer; //verify the handle type is_noexcept_movable(); - is_noexcept_movable(); + is_noexcept_movable(); //verify the input portals of the handle is_noexcept_movable().PrepareForInput( vtkm::cont::DeviceAdapterTagSerial{}, std::declval()))>(); - is_noexcept_movable().PrepareForInput( + is_noexcept_movable().PrepareForInput( vtkm::cont::DeviceAdapterTagSerial{}, std::declval()))>(); //verify the output portals of the handle is_noexcept_movable().PrepareForOutput( 2, vtkm::cont::DeviceAdapterTagSerial{}, std::declval()))>(); - is_noexcept_movable().PrepareForOutput( + is_noexcept_movable().PrepareForOutput( 2, vtkm::cont::DeviceAdapterTagSerial{}, std::declval()))>(); } }; @@ -136,14 +135,11 @@ void TestContDataTypesHaveMoveSemantics() vtkm::testing::Testing::TryTypes(IsNoExceptHandle{}, ::vtkmComplexCustomTypes{}); - //verify the DataSet, Field, CoordinateSystem, and ArrayHandleVirtualCoordinates + //verify the DataSet, Field, and CoordinateSystem //all have efficient storage in containers such as std::vector is_noexcept_movable(); is_noexcept_movable(); is_noexcept_movable(); - VTKM_DEPRECATED_SUPPRESS_BEGIN - is_noexcept_movable(); - VTKM_DEPRECATED_SUPPRESS_END //verify the CellSetStructured, and CellSetExplicit //have efficient storage in containers such as std::vector diff --git a/vtkm/cont/testing/UnitTestSerializationArrayHandle.cxx b/vtkm/cont/testing/UnitTestSerializationArrayHandle.cxx index 6307dda58..86b8449a6 100644 --- a/vtkm/cont/testing/UnitTestSerializationArrayHandle.cxx +++ b/vtkm/cont/testing/UnitTestSerializationArrayHandle.cxx @@ -25,7 +25,6 @@ #include #include #include -#include #include #include diff --git a/vtkm/cont/testing/UnitTestVariantArrayHandle.cxx b/vtkm/cont/testing/UnitTestVariantArrayHandle.cxx index 98a74438b..8091c5438 100644 --- a/vtkm/cont/testing/UnitTestVariantArrayHandle.cxx +++ b/vtkm/cont/testing/UnitTestVariantArrayHandle.cxx @@ -22,9 +22,12 @@ #include #include #include -#include #include +#ifndef VTKM_NO_DEPRECATED_VIRTUAL +#include +#endif + #include #include @@ -114,6 +117,8 @@ struct CheckFunctor CheckArray(array); } +#ifndef VTKM_NO_DEPRECATED_VIRTUAL + VTKM_DEPRECATED_SUPPRESS_BEGIN template void operator()(const vtkm::cont::ArrayHandleVirtual& array, bool& vtkmNotUsed(calledBasic), @@ -124,6 +129,8 @@ struct CheckFunctor CheckArray(array); } + VTKM_DEPRECATED_SUPPRESS_END +#endif //VTKM_NO_DEPRECATED_VIRTUAL template void operator()(const vtkm::cont::ArrayHandle&, bool&, bool&) const @@ -246,6 +253,7 @@ void CheckCastToArrayHandle(const ArrayHandleType& array) template using VecOrScalar = typename std::conditional<(NumComps > 1), vtkm::Vec, T>::type; +#ifndef VTKM_NO_DEPRECATED_VIRTUAL template void CheckCastToVirtualArrayHandle(const ArrayType& array) { @@ -264,6 +272,7 @@ void CheckCastToVirtualArrayHandle(const ArrayType& array) VariantArrayType arrayVariant = array; + VTKM_DEPRECATED_SUPPRESS_BEGIN { auto testArray = arrayVariant.template AsVirtual(); VTKM_TEST_ASSERT(testArray.GetNumberOfValues() == array.GetNumberOfValues(), @@ -319,7 +328,9 @@ void CheckCastToVirtualArrayHandle(const ArrayType& array) VTKM_TEST_ASSERT(threw, "Casting to different vector width did not throw expected " "ErrorBadType exception."); + VTKM_DEPRECATED_SUPPRESS_END } +#endif //VTKM_NO_DEPRECATED_VIRTUAL template void TryNewInstance(T, ArrayVariantType originalArray) @@ -451,7 +462,9 @@ template void TryCastToArrayHandle(const ArrayHandleType& array) { CheckCastToArrayHandle(array); +#ifndef VTKM_NO_DEPRECATED_VIRTUAL CheckCastToVirtualArrayHandle(array); +#endif } void TryCastToArrayHandle() diff --git a/vtkm/filter/Contour.h b/vtkm/filter/Contour.h index 120319bc8..aa1a237ca 100644 --- a/vtkm/filter/Contour.h +++ b/vtkm/filter/Contour.h @@ -181,11 +181,15 @@ extern template VTKM_FILTER_CONTOUR_TEMPLATE_EXPORT vtkm::cont::DataSet Contour: const vtkm::filter::FieldMetadata&, vtkm::filter::PolicyBase); +#ifndef VTKM_NO_DEPRECATED_VIRTUAL +VTKM_DEPRECATED_SUPPRESS_BEGIN extern template VTKM_FILTER_CONTOUR_TEMPLATE_EXPORT vtkm::cont::DataSet Contour::DoExecute( const vtkm::cont::DataSet&, const vtkm::cont::ArrayHandle&, const vtkm::filter::FieldMetadata&, vtkm::filter::PolicyBase); +VTKM_DEPRECATED_SUPPRESS_END +#endif extern template VTKM_FILTER_CONTOUR_TEMPLATE_EXPORT vtkm::cont::DataSet Contour::DoExecute( const vtkm::cont::DataSet&, @@ -193,11 +197,15 @@ extern template VTKM_FILTER_CONTOUR_TEMPLATE_EXPORT vtkm::cont::DataSet Contour: const vtkm::filter::FieldMetadata&, vtkm::filter::PolicyBase); +#ifndef VTKM_NO_DEPRECATED_VIRTUAL +VTKM_DEPRECATED_SUPPRESS_BEGIN extern template VTKM_FILTER_CONTOUR_TEMPLATE_EXPORT vtkm::cont::DataSet Contour::DoExecute( const vtkm::cont::DataSet&, const vtkm::cont::ArrayHandle&, const vtkm::filter::FieldMetadata&, vtkm::filter::PolicyBase); +VTKM_DEPRECATED_SUPPRESS_END +#endif extern template VTKM_FILTER_CONTOUR_TEMPLATE_EXPORT vtkm::cont::DataSet Contour::DoExecute( const vtkm::cont::DataSet&, @@ -205,11 +213,15 @@ extern template VTKM_FILTER_CONTOUR_TEMPLATE_EXPORT vtkm::cont::DataSet Contour: const vtkm::filter::FieldMetadata&, vtkm::filter::PolicyBase); +#ifndef VTKM_NO_DEPRECATED_VIRTUAL +VTKM_DEPRECATED_SUPPRESS_BEGIN extern template VTKM_FILTER_CONTOUR_TEMPLATE_EXPORT vtkm::cont::DataSet Contour::DoExecute( const vtkm::cont::DataSet&, const vtkm::cont::ArrayHandle&, const vtkm::filter::FieldMetadata&, vtkm::filter::PolicyBase); +VTKM_DEPRECATED_SUPPRESS_END +#endif extern template VTKM_FILTER_CONTOUR_TEMPLATE_EXPORT vtkm::cont::DataSet Contour::DoExecute( const vtkm::cont::DataSet&, @@ -217,13 +229,17 @@ extern template VTKM_FILTER_CONTOUR_TEMPLATE_EXPORT vtkm::cont::DataSet Contour: const vtkm::filter::FieldMetadata&, vtkm::filter::PolicyBase); +#ifndef VTKM_NO_DEPRECATED_VIRTUAL +VTKM_DEPRECATED_SUPPRESS_BEGIN extern template VTKM_FILTER_CONTOUR_TEMPLATE_EXPORT vtkm::cont::DataSet Contour::DoExecute( const vtkm::cont::DataSet&, const vtkm::cont::ArrayHandle&, const vtkm::filter::FieldMetadata&, vtkm::filter::PolicyBase); - +VTKM_DEPRECATED_SUPPRESS_END #endif + +#endif //!vtkm_filter_ContourExecute_cxx } } // namespace vtkm::filter diff --git a/vtkm/filter/ContourInteger.cxx b/vtkm/filter/ContourInteger.cxx index 007b537c2..8dd3219fb 100644 --- a/vtkm/filter/ContourInteger.cxx +++ b/vtkm/filter/ContourInteger.cxx @@ -23,11 +23,15 @@ template VTKM_FILTER_CONTOUR_EXPORT vtkm::cont::DataSet Contour::DoExecute( const vtkm::filter::FieldMetadata&, vtkm::filter::PolicyBase); +#ifndef VTKM_NO_DEPRECATED_VIRTUAL +VTKM_DEPRECATED_SUPPRESS_BEGIN template VTKM_FILTER_CONTOUR_EXPORT vtkm::cont::DataSet Contour::DoExecute( const vtkm::cont::DataSet&, const vtkm::cont::ArrayHandle&, const vtkm::filter::FieldMetadata&, vtkm::filter::PolicyBase); +VTKM_DEPRECATED_SUPPRESS_END +#endif template VTKM_FILTER_CONTOUR_EXPORT vtkm::cont::DataSet Contour::DoExecute( const vtkm::cont::DataSet&, @@ -35,11 +39,15 @@ template VTKM_FILTER_CONTOUR_EXPORT vtkm::cont::DataSet Contour::DoExecute( const vtkm::filter::FieldMetadata&, vtkm::filter::PolicyBase); +#ifndef VTKM_NO_DEPRECATED_VIRTUAL +VTKM_DEPRECATED_SUPPRESS_BEGIN template VTKM_FILTER_CONTOUR_EXPORT vtkm::cont::DataSet Contour::DoExecute( const vtkm::cont::DataSet&, const vtkm::cont::ArrayHandle&, const vtkm::filter::FieldMetadata&, vtkm::filter::PolicyBase); +VTKM_DEPRECATED_SUPPRESS_END +#endif } } diff --git a/vtkm/filter/ContourScalar.cxx b/vtkm/filter/ContourScalar.cxx index aa0e58135..ca87b6a83 100644 --- a/vtkm/filter/ContourScalar.cxx +++ b/vtkm/filter/ContourScalar.cxx @@ -23,11 +23,15 @@ template VTKM_FILTER_CONTOUR_EXPORT vtkm::cont::DataSet Contour::DoExecute( const vtkm::filter::FieldMetadata&, vtkm::filter::PolicyBase); +#ifndef VTKM_NO_DEPRECATED_VIRTUAL +VTKM_DEPRECATED_SUPPRESS_BEGIN template VTKM_FILTER_CONTOUR_EXPORT vtkm::cont::DataSet Contour::DoExecute( const vtkm::cont::DataSet&, const vtkm::cont::ArrayHandle&, const vtkm::filter::FieldMetadata&, vtkm::filter::PolicyBase); +VTKM_DEPRECATED_SUPPRESS_END +#endif template VTKM_FILTER_CONTOUR_EXPORT vtkm::cont::DataSet Contour::DoExecute( const vtkm::cont::DataSet&, @@ -35,11 +39,15 @@ template VTKM_FILTER_CONTOUR_EXPORT vtkm::cont::DataSet Contour::DoExecute( const vtkm::filter::FieldMetadata&, vtkm::filter::PolicyBase); +#ifndef VTKM_NO_DEPRECATED_VIRTUAL +VTKM_DEPRECATED_SUPPRESS_BEGIN template VTKM_FILTER_CONTOUR_EXPORT vtkm::cont::DataSet Contour::DoExecute( const vtkm::cont::DataSet&, const vtkm::cont::ArrayHandle&, const vtkm::filter::FieldMetadata&, vtkm::filter::PolicyBase); +VTKM_DEPRECATED_SUPPRESS_END +#endif } } diff --git a/vtkm/filter/ContourTreeUniformAugmented.hxx b/vtkm/filter/ContourTreeUniformAugmented.hxx index 8799cce8b..665f02034 100644 --- a/vtkm/filter/ContourTreeUniformAugmented.hxx +++ b/vtkm/filter/ContourTreeUniformAugmented.hxx @@ -303,7 +303,7 @@ VTKM_CONT void ContourTreeAugmented::DoPostExecute( currBlock.GetField(this->GetActiveFieldName(), this->GetActiveFieldAssociation()); //const vtkm::cont::ArrayHandle &fieldData = currField.GetData().Cast >(); vtkm::cont::ArrayHandle fieldData; - vtkm::cont::ArrayCopy(currField.GetData().template AsVirtual(), fieldData); + vtkm::cont::ArrayCopy(currField.GetData().template ResetTypes>(), fieldData); auto currContourTreeMesh = vtkm::worklet::contourtree_distributed::MultiBlockContourTreeHelper:: ComputeLocalContourTreeMesh( this->MultiBlockTreeHelper->MultiBlockSpatialDecomposition.LocalBlockOrigins.ReadPortal() diff --git a/vtkm/filter/Gradient.h b/vtkm/filter/Gradient.h index e6e842faf..800b2a9cd 100644 --- a/vtkm/filter/Gradient.h +++ b/vtkm/filter/Gradient.h @@ -117,11 +117,15 @@ extern template VTKM_FILTER_GRADIENT_TEMPLATE_EXPORT vtkm::cont::DataSet Gradien const vtkm::filter::FieldMetadata&, vtkm::filter::PolicyBase); +#ifndef VTKM_NO_DEPRECATED_VIRTUAL +VTKM_DEPRECATED_SUPPRESS_BEGIN extern template VTKM_FILTER_GRADIENT_TEMPLATE_EXPORT vtkm::cont::DataSet Gradient::DoExecute( const vtkm::cont::DataSet&, const vtkm::cont::ArrayHandle&, const vtkm::filter::FieldMetadata&, vtkm::filter::PolicyBase); +VTKM_DEPRECATED_SUPPRESS_END +#endif extern template VTKM_FILTER_GRADIENT_TEMPLATE_EXPORT vtkm::cont::DataSet Gradient::DoExecute( const vtkm::cont::DataSet&, @@ -129,11 +133,15 @@ extern template VTKM_FILTER_GRADIENT_TEMPLATE_EXPORT vtkm::cont::DataSet Gradien const vtkm::filter::FieldMetadata&, vtkm::filter::PolicyBase); +#ifndef VTKM_NO_DEPRECATED_VIRTUAL +VTKM_DEPRECATED_SUPPRESS_BEGIN extern template VTKM_FILTER_GRADIENT_TEMPLATE_EXPORT vtkm::cont::DataSet Gradient::DoExecute( const vtkm::cont::DataSet&, const vtkm::cont::ArrayHandle&, const vtkm::filter::FieldMetadata&, vtkm::filter::PolicyBase); +VTKM_DEPRECATED_SUPPRESS_END +#endif extern template VTKM_FILTER_GRADIENT_TEMPLATE_EXPORT vtkm::cont::DataSet Gradient::DoExecute( const vtkm::cont::DataSet&, @@ -141,11 +149,15 @@ extern template VTKM_FILTER_GRADIENT_TEMPLATE_EXPORT vtkm::cont::DataSet Gradien const vtkm::filter::FieldMetadata&, vtkm::filter::PolicyBase); +#ifndef VTKM_NO_DEPRECATED_VIRTUAL +VTKM_DEPRECATED_SUPPRESS_BEGIN extern template VTKM_FILTER_GRADIENT_TEMPLATE_EXPORT vtkm::cont::DataSet Gradient::DoExecute( const vtkm::cont::DataSet&, const vtkm::cont::ArrayHandle&, const vtkm::filter::FieldMetadata&, vtkm::filter::PolicyBase); +VTKM_DEPRECATED_SUPPRESS_END +#endif extern template VTKM_FILTER_GRADIENT_TEMPLATE_EXPORT vtkm::cont::DataSet Gradient::DoExecute( const vtkm::cont::DataSet&, @@ -153,11 +165,15 @@ extern template VTKM_FILTER_GRADIENT_TEMPLATE_EXPORT vtkm::cont::DataSet Gradien const vtkm::filter::FieldMetadata&, vtkm::filter::PolicyBase); +#ifndef VTKM_NO_DEPRECATED_VIRTUAL +VTKM_DEPRECATED_SUPPRESS_BEGIN extern template VTKM_FILTER_GRADIENT_TEMPLATE_EXPORT vtkm::cont::DataSet Gradient::DoExecute( const vtkm::cont::DataSet&, const vtkm::cont::ArrayHandle&, const vtkm::filter::FieldMetadata&, vtkm::filter::PolicyBase); +VTKM_DEPRECATED_SUPPRESS_END +#endif extern template VTKM_FILTER_GRADIENT_TEMPLATE_EXPORT vtkm::cont::DataSet Gradient::DoExecute( const vtkm::cont::DataSet&, @@ -165,7 +181,7 @@ extern template VTKM_FILTER_GRADIENT_TEMPLATE_EXPORT vtkm::cont::DataSet Gradien const vtkm::filter::FieldMetadata&, vtkm::filter::PolicyBase); -#endif +#endif //vtkm_filter_Gradient_cxx } } // namespace vtkm::filter diff --git a/vtkm/filter/GradientScalar.cxx b/vtkm/filter/GradientScalar.cxx index 7e3438b78..891391a60 100644 --- a/vtkm/filter/GradientScalar.cxx +++ b/vtkm/filter/GradientScalar.cxx @@ -23,11 +23,15 @@ template VTKM_FILTER_GRADIENT_EXPORT vtkm::cont::DataSet Gradient::DoExecute( const vtkm::filter::FieldMetadata&, vtkm::filter::PolicyBase); +#ifndef VTKM_NO_DEPRECATED_VIRTUAL +VTKM_DEPRECATED_SUPPRESS_BEGIN template VTKM_FILTER_GRADIENT_EXPORT vtkm::cont::DataSet Gradient::DoExecute( const vtkm::cont::DataSet&, const vtkm::cont::ArrayHandle&, const vtkm::filter::FieldMetadata&, vtkm::filter::PolicyBase); +VTKM_DEPRECATED_SUPPRESS_END +#endif template VTKM_FILTER_GRADIENT_EXPORT vtkm::cont::DataSet Gradient::DoExecute( const vtkm::cont::DataSet&, @@ -35,11 +39,15 @@ template VTKM_FILTER_GRADIENT_EXPORT vtkm::cont::DataSet Gradient::DoExecute( const vtkm::filter::FieldMetadata&, vtkm::filter::PolicyBase); +#ifndef VTKM_NO_DEPRECATED_VIRTUAL +VTKM_DEPRECATED_SUPPRESS_BEGIN template VTKM_FILTER_GRADIENT_EXPORT vtkm::cont::DataSet Gradient::DoExecute( const vtkm::cont::DataSet&, const vtkm::cont::ArrayHandle&, const vtkm::filter::FieldMetadata&, vtkm::filter::PolicyBase); +VTKM_DEPRECATED_SUPPRESS_END +#endif } } diff --git a/vtkm/filter/GradientVector.cxx b/vtkm/filter/GradientVector.cxx index 548d7ce95..af7b63cdf 100644 --- a/vtkm/filter/GradientVector.cxx +++ b/vtkm/filter/GradientVector.cxx @@ -23,11 +23,15 @@ template VTKM_FILTER_GRADIENT_EXPORT vtkm::cont::DataSet Gradient::DoExecute( const vtkm::filter::FieldMetadata&, vtkm::filter::PolicyBase); +#ifndef VTKM_NO_DEPRECATED_VIRTUAL +VTKM_DEPRECATED_SUPPRESS_BEGIN template VTKM_FILTER_GRADIENT_EXPORT vtkm::cont::DataSet Gradient::DoExecute( const vtkm::cont::DataSet&, const vtkm::cont::ArrayHandle&, const vtkm::filter::FieldMetadata&, vtkm::filter::PolicyBase); +VTKM_DEPRECATED_SUPPRESS_END +#endif template VTKM_FILTER_GRADIENT_EXPORT vtkm::cont::DataSet Gradient::DoExecute( const vtkm::cont::DataSet&, @@ -35,11 +39,15 @@ template VTKM_FILTER_GRADIENT_EXPORT vtkm::cont::DataSet Gradient::DoExecute( const vtkm::filter::FieldMetadata&, vtkm::filter::PolicyBase); +#ifndef VTKM_NO_DEPRECATED_VIRTUAL +VTKM_DEPRECATED_SUPPRESS_BEGIN template VTKM_FILTER_GRADIENT_EXPORT vtkm::cont::DataSet Gradient::DoExecute( const vtkm::cont::DataSet&, const vtkm::cont::ArrayHandle&, const vtkm::filter::FieldMetadata&, vtkm::filter::PolicyBase); +VTKM_DEPRECATED_SUPPRESS_END +#endif } } diff --git a/vtkm/internal/CMakeLists.txt b/vtkm/internal/CMakeLists.txt index f5523506f..2019eb291 100755 --- a/vtkm/internal/CMakeLists.txt +++ b/vtkm/internal/CMakeLists.txt @@ -35,6 +35,8 @@ endif() set(VTKM_ENABLE_LOGGING ${VTKm_ENABLE_LOGGING}) +set(VTKM_NO_DEPRECATED_VIRTUAL ${VTKm_NO_DEPRECATED_VIRTUAL}) + vtkm_get_kit_name(kit_name kit_dir) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Configure.h.in ${VTKm_BINARY_INCLUDE_DIR}/${kit_dir}/Configure.h diff --git a/vtkm/internal/Configure.h.in b/vtkm/internal/Configure.h.in index 5c81229c0..dc37a7d7d 100644 --- a/vtkm/internal/Configure.h.in +++ b/vtkm/internal/Configure.h.in @@ -301,6 +301,9 @@ //Mark if we have enabled logging. #cmakedefine VTKM_ENABLE_LOGGING +#ifndef VTKM_NO_DEPRECATED_VIRTUAL +#cmakedefine VTKM_NO_DEPRECATED_VIRTUAL +#endif // Define a pair of macros, VTKM_SWALLOW_SEMICOLON_PRE_BLOCK and // VTKM_SWALLOW_SEMICOLON_POST_BLOCK that can be used around a block in a diff --git a/vtkm/io/testing/UnitTestVTKDataSetWriter.cxx b/vtkm/io/testing/UnitTestVTKDataSetWriter.cxx index 980e213ec..a2604eb47 100644 --- a/vtkm/io/testing/UnitTestVTKDataSetWriter.cxx +++ b/vtkm/io/testing/UnitTestVTKDataSetWriter.cxx @@ -44,12 +44,16 @@ struct CheckSameCoordinateSystem CheckSameField{}(originalArray, fileCoords); } +#ifndef VTKM_NO_DEPRECATED_VIRTUAL + VTKM_DEPRECATED_SUPPRESS_BEGIN template void operator()(const vtkm::cont::ArrayHandleVirtual& originalArray, const vtkm::cont::CoordinateSystem& fileCoords) const { CheckSameField{}(originalArray, fileCoords); } + VTKM_DEPRECATED_SUPPRESS_END +#endif void operator()(const vtkm::cont::ArrayHandleUniformPointCoordinates& originalArray, const vtkm::cont::CoordinateSystem& fileCoords) const diff --git a/vtkm/worklet/Keys.h b/vtkm/worklet/Keys.h index ab9b7841a..de00c715f 100644 --- a/vtkm/worklet/Keys.h +++ b/vtkm/worklet/Keys.h @@ -17,7 +17,6 @@ #include #include #include -#include #include #include @@ -444,10 +443,6 @@ struct Transport::BuildArrays( \ const vtkm::cont::ArrayHandle& keys, \ vtkm::worklet::KeysSortType sort, \ - vtkm::cont::DeviceAdapterId device); \ - extern template VTKM_WORKLET_TEMPLATE_EXPORT VTKM_CONT void vtkm::worklet::Keys::BuildArrays( \ - const vtkm::cont::ArrayHandleVirtual& keys, \ - vtkm::worklet::KeysSortType sort, \ vtkm::cont::DeviceAdapterId device) VTK_M_KEYS_EXPORT(vtkm::UInt8); diff --git a/vtkm/worklet/KeysSignedTypes.cxx b/vtkm/worklet/KeysSignedTypes.cxx index d3cbc7f53..f3b170edc 100644 --- a/vtkm/worklet/KeysSignedTypes.cxx +++ b/vtkm/worklet/KeysSignedTypes.cxx @@ -17,10 +17,6 @@ template VTKM_WORKLET_EXPORT VTKM_CONT void vtkm::worklet::Keys::BuildArrays( \ const vtkm::cont::ArrayHandle& keys, \ vtkm::worklet::KeysSortType sort, \ - vtkm::cont::DeviceAdapterId device); \ - template VTKM_WORKLET_EXPORT VTKM_CONT void vtkm::worklet::Keys::BuildArrays( \ - const vtkm::cont::ArrayHandleVirtual& keys, \ - vtkm::worklet::KeysSortType sort, \ vtkm::cont::DeviceAdapterId device) VTK_M_KEYS_EXPORT(vtkm::Id); diff --git a/vtkm/worklet/KeysUnsignedTypes.cxx b/vtkm/worklet/KeysUnsignedTypes.cxx index a20755050..b68a8acae 100644 --- a/vtkm/worklet/KeysUnsignedTypes.cxx +++ b/vtkm/worklet/KeysUnsignedTypes.cxx @@ -17,10 +17,6 @@ template VTKM_WORKLET_EXPORT VTKM_CONT void vtkm::worklet::Keys::BuildArrays( \ const vtkm::cont::ArrayHandle& keys, \ vtkm::worklet::KeysSortType sort, \ - vtkm::cont::DeviceAdapterId device); \ - template VTKM_WORKLET_EXPORT VTKM_CONT void vtkm::worklet::Keys::BuildArrays( \ - const vtkm::cont::ArrayHandleVirtual& keys, \ - vtkm::worklet::KeysSortType sort, \ vtkm::cont::DeviceAdapterId device) VTK_M_KEYS_EXPORT(vtkm::HashType); diff --git a/vtkm/worklet/PointMerge.h b/vtkm/worklet/PointMerge.h index ce897a203..9b173b36a 100644 --- a/vtkm/worklet/PointMerge.h +++ b/vtkm/worklet/PointMerge.h @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include @@ -440,7 +439,7 @@ public: Run(delta, fastCheck, bounds, concretePoints); - // Make sure that the modified points are reflected back in the virtual array. + // Make sure that the modified points are reflected back in the variant array. points = concretePoints; } diff --git a/vtkm/worklet/testing/UnitTestOrientNormals.cxx b/vtkm/worklet/testing/UnitTestOrientNormals.cxx index 490753940..8a1e84939 100644 --- a/vtkm/worklet/testing/UnitTestOrientNormals.cxx +++ b/vtkm/worklet/testing/UnitTestOrientNormals.cxx @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -82,8 +81,8 @@ vtkm::cont::DataSet CreateDataSet(bool pointNormals, bool cellNormals) struct ValidateNormals { using CellSetType = vtkm::cont::CellSetSingleType<>; - using NormalType = vtkm::Vec; - using NormalsArrayType = vtkm::cont::ArrayHandleVirtual; + using NormalType = vtkm::Vec3f; + using NormalsArrayType = vtkm::cont::ArrayHandle; using NormalsPortalType = decltype(std::declval().ReadPortal()); using PointsType = decltype(std::declval().GetDataAsMultiplexer()); @@ -154,12 +153,12 @@ struct ValidateNormals if (this->CheckPoints) { - this->PointNormalsArray = pointNormalsField.GetData().AsVirtual(); + pointNormalsField.GetData().AsArrayHandle(this->PointNormalsArray); this->PointNormals = this->PointNormalsArray.ReadPortal(); } if (this->CheckCells) { - this->CellNormalsArray = cellNormalsField.GetData().AsVirtual(); + cellNormalsField.GetData().AsArrayHandle(this->CellNormalsArray); this->CellNormals = this->CellNormalsArray.ReadPortal(); } }