mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-10-05 01:49:02 +00:00
Completely deprecate virtual methods
Deprecate `VirtualObjectHandle` and all other classes that are used to implement objects with virtual methods in the execution environment. Additionally, the code is updated so that if the `VTKm_NO_DEPRECATED_VIRTUAL` flag is set none of the code is compiled at all. This opens us up to opportunities that do not work with virtual methods such as backends that do not support virtual methods and dynamic libraries for CUDA.
This commit is contained in:
parent
8d7edb4615
commit
cb3bb43ff9
@ -153,9 +153,8 @@ vtkm_option(VTKm_NO_INSTALL_README_LICENSE "disable the installation of README a
|
||||
|
||||
# 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.
|
||||
# the code entirely. 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(
|
||||
|
@ -29,6 +29,7 @@ namespace vtkm
|
||||
|
||||
//============================================================================
|
||||
#ifndef VTKM_NO_DEPRECATED_VIRTUAL
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
class VTKM_DEPRECATED(1.6, "ImplicitFunction with virtual methods no longer supported.")
|
||||
VTKM_ALWAYS_EXPORT ImplicitFunction : public vtkm::VirtualObjectBase
|
||||
{
|
||||
@ -39,7 +40,6 @@ public:
|
||||
VTKM_EXEC_CONT virtual Scalar Value(const Vector& point) const = 0;
|
||||
VTKM_EXEC_CONT virtual Vector Gradient(const Vector& point) const = 0;
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
VTKM_EXEC_CONT Scalar Value(Scalar x, Scalar y, Scalar z) const
|
||||
{
|
||||
return this->Value(Vector(x, y, z));
|
||||
@ -49,8 +49,8 @@ public:
|
||||
{
|
||||
return this->Gradient(Vector(x, y, z));
|
||||
}
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
};
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
#endif // VTKM_NO_DEPRECATED_VIRTUAL
|
||||
|
||||
//============================================================================
|
||||
|
@ -10,8 +10,16 @@
|
||||
#ifndef vtk_m_VirtualObjectBase_h
|
||||
#define vtk_m_VirtualObjectBase_h
|
||||
|
||||
#include <vtkm/Deprecated.h>
|
||||
#include <vtkm/Types.h>
|
||||
|
||||
#ifndef VTKM_NO_DEPRECATED_VIRTUAL
|
||||
// Do not include this class at all if not compiling virtual methods.
|
||||
|
||||
// This is a deprecated class. Don't warn about deprecation while implementing
|
||||
// deprecated functionality.
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
|
||||
@ -29,7 +37,9 @@ namespace vtkm
|
||||
/// \c Modified on itself so the \c VirtualObjectHandle will know it update the object in the
|
||||
/// execution environment.
|
||||
///
|
||||
class VTKM_ALWAYS_EXPORT VirtualObjectBase
|
||||
class VTKM_ALWAYS_EXPORT VTKM_DEPRECATED(
|
||||
1.7,
|
||||
"Virtual methods are no longer supported in the execution environment.") VirtualObjectBase
|
||||
{
|
||||
public:
|
||||
VTKM_EXEC_CONT virtual ~VirtualObjectBase() noexcept
|
||||
@ -77,4 +87,8 @@ private:
|
||||
|
||||
} // namespace vtkm
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
|
||||
#endif //VTKM_NO_DEPRECATED_VIRTUAL
|
||||
|
||||
#endif //vtk_m_VirtualObjectBase_h
|
||||
|
@ -146,8 +146,6 @@ set(sources
|
||||
internal/Buffer.cxx
|
||||
internal/DeviceAdapterMemoryManager.cxx
|
||||
internal/DeviceAdapterMemoryManagerShared.cxx
|
||||
internal/TransferInfo.cxx
|
||||
internal/VirtualObjectTransfer.cxx
|
||||
Initialize.cxx
|
||||
Logging.cxx
|
||||
RuntimeDeviceTracker.cxx
|
||||
@ -206,6 +204,8 @@ if (NOT VTKm_NO_DEPRECATED_VIRTUAL)
|
||||
set(device_sources ${device_sources}
|
||||
ArrayHandleVirtual.cxx
|
||||
CellLocator.cxx
|
||||
internal/TransferInfo.cxx
|
||||
internal/VirtualObjectTransfer.cxx
|
||||
PointLocator.cxx
|
||||
StorageVirtual.cxx
|
||||
)
|
||||
|
@ -238,6 +238,7 @@ VTKM_CONT ImplicitFunctionValueHandle make_ImplicitFunctionValueHandle(Args&&...
|
||||
}
|
||||
} // vtkm::cont
|
||||
|
||||
#ifndef VTKM_NO_DEPRECATED_VIRTUAL
|
||||
// Cuda seems to have a bug where it expects the template class VirtualObjectTransfer
|
||||
// to be instantiated in a consistent order among all the translation units of an
|
||||
// executable. Failing to do so results in random crashes and incorrect results.
|
||||
@ -256,6 +257,7 @@ VTKM_EXPLICITLY_INSTANTIATE_TRANSFER(
|
||||
VTKM_EXPLICITLY_INSTANTIATE_TRANSFER(
|
||||
vtkm::cont::detail::ImplicitFunctionBaseExecWrapper<vtkm::Sphere>);
|
||||
#endif
|
||||
#endif //VTKM_NO_DEPRECATED_VIRTUAL
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
|
||||
|
@ -18,6 +18,14 @@
|
||||
#include <vtkm/cont/internal/VirtualObjectTransfer.h>
|
||||
#include <vtkm/cont/internal/VirtualObjectTransferShareWithControl.h>
|
||||
|
||||
#ifdef VTKM_NO_DEPRECATED_VIRTUAL
|
||||
#error "This header should not be included when VTKM_NO_DEPRECATED_VIRTUAL is set."
|
||||
#endif
|
||||
|
||||
// This is a deprecated class. Don't warn about deprecation while implementing
|
||||
// deprecated functionality.
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
@ -440,4 +448,6 @@ VTKM_DEPRECATED_SUPPRESS_END
|
||||
}
|
||||
} // namespace vtkm::cont::internal
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
|
||||
#endif // vtk_m_cont_StorageVirtual_hxx
|
||||
|
@ -15,6 +15,14 @@
|
||||
#include <vtkm/cont/internal/DeviceAdapterListHelpers.h>
|
||||
#include <vtkm/cont/internal/VirtualObjectTransfer.h>
|
||||
|
||||
#ifdef VTKM_NO_DEPRECATED_VIRTUAL
|
||||
#error "This header should not be included when VTKM_NO_DEPRECATED_VIRTUAL is set."
|
||||
#endif //VTKM_NO_DEPRECATED_VIRTUAL
|
||||
|
||||
// This is a deprecated class. Don't warn about deprecation while implementing
|
||||
// deprecated functionality.
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
|
||||
#include <array>
|
||||
#include <type_traits>
|
||||
|
||||
@ -59,7 +67,10 @@ struct CreateTransferInterface
|
||||
/// \sa vtkm::VirtualObjectBase
|
||||
///
|
||||
template <typename VirtualBaseType>
|
||||
class VTKM_ALWAYS_EXPORT VirtualObjectHandle : public vtkm::cont::ExecutionAndControlObjectBase
|
||||
class VTKM_ALWAYS_EXPORT VTKM_DEPRECATED(
|
||||
1.7,
|
||||
"Virtual methods are no longer supported in the execution environment.") VirtualObjectHandle
|
||||
: public vtkm::cont::ExecutionAndControlObjectBase
|
||||
{
|
||||
VTKM_STATIC_ASSERT_MSG((std::is_base_of<vtkm::VirtualObjectBase, VirtualBaseType>::value),
|
||||
"All virtual objects must be subclass of vtkm::VirtualObjectBase.");
|
||||
@ -166,4 +177,7 @@ private:
|
||||
}
|
||||
} // vtkm::cont
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
|
||||
|
||||
#endif // vtk_m_cont_VirtualObjectHandle_h
|
||||
|
@ -22,7 +22,9 @@
|
||||
|
||||
#include <vtkm/cont/cuda/internal/DeviceAdapterAlgorithmCuda.h>
|
||||
#include <vtkm/cont/cuda/internal/DeviceAdapterMemoryManagerCuda.h>
|
||||
#ifndef VTKM_NO_DEPRECATED_VIRTUAL
|
||||
#include <vtkm/cont/cuda/internal/VirtualObjectTransferCuda.h>
|
||||
#endif //VTKM_NO_DEPRECATED_VIRTUAL
|
||||
|
||||
#else // !VTKM_CUDA
|
||||
|
||||
|
@ -16,6 +16,12 @@
|
||||
#include <vtkm/cont/cuda/internal/DeviceAdapterTagCuda.h>
|
||||
#include <vtkm/cont/internal/VirtualObjectTransfer.h>
|
||||
|
||||
#ifdef VTKM_NO_DEPRECATED_VIRTUAL
|
||||
#error "This header should not be included when VTKM_NO_DEPRECATED_VIRTUAL is set."
|
||||
#endif //VTKM_NO_DEPRECATED_VIRTUAL
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
@ -146,4 +152,6 @@ private:
|
||||
}
|
||||
} // vtkm::cont::internal
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
|
||||
#endif // vtk_m_cont_cuda_internal_VirtualObjectTransferCuda_h
|
||||
|
@ -26,6 +26,12 @@ set(unit_tests
|
||||
UnitTestCudaMathEdgeCases.cu
|
||||
UnitTestCudaShareUserProvidedManagedMemory.cu
|
||||
UnitTestCudaPointLocatorSparseGrid.cu
|
||||
UnitTestCudaVirtualObjectHandle.cu
|
||||
)
|
||||
|
||||
if (NOT VTKm_NO_DEPRECATED_VIRTUAL)
|
||||
set(unit_tests ${unit_tests}
|
||||
UnitTestCudaVirtualObjectHandle.cu
|
||||
)
|
||||
endif()
|
||||
|
||||
vtkm_unit_tests(SOURCES ${unit_tests} LABEL "CUDA" LIBRARIES vtkm_worklet)
|
||||
|
@ -12,10 +12,19 @@
|
||||
|
||||
#include <vtkm/cont/vtkm_cont_export.h>
|
||||
|
||||
#include <vtkm/internal/Configure.h>
|
||||
#ifdef VTKM_NO_DEPRECATED_VIRTUAL
|
||||
#error "This header should not be included when VTKM_NO_DEPRECATED_VIRTUAL is set."
|
||||
#endif //VTKM_NO_DEPRECATED_VIRTUAL
|
||||
|
||||
#include <vtkm/Types.h>
|
||||
#include <vtkm/cont/DeviceAdapterTag.h>
|
||||
#include <vtkm/internal/ArrayPortalVirtual.h>
|
||||
|
||||
// This is a deprecated class. Don't warn about deprecation while implementing
|
||||
// deprecated functionality.
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace vtkm
|
||||
@ -61,4 +70,6 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
|
||||
#endif
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include <array>
|
||||
#include <memory>
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
@ -58,3 +59,5 @@ bool TransferState::DeviceIdIsValid(vtkm::cont::DeviceAdapterId deviceId) const
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
|
@ -12,9 +12,18 @@
|
||||
|
||||
#include <vtkm/cont/vtkm_cont_export.h>
|
||||
|
||||
#include <vtkm/Deprecated.h>
|
||||
#include <vtkm/VirtualObjectBase.h>
|
||||
#include <vtkm/cont/DeviceAdapterTag.h>
|
||||
|
||||
#ifdef VTKM_NO_DEPRECATED_VIRTUAL
|
||||
#error "This header should not be included when VTKM_NO_DEPRECATED_VIRTUAL is set."
|
||||
#endif //VTKM_NO_DEPRECATED_VIRTUAL
|
||||
|
||||
// This is a deprecated class. Don't warn about deprecation while implementing
|
||||
// deprecated functionality.
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
|
||||
#include <array>
|
||||
#include <memory>
|
||||
|
||||
@ -28,7 +37,8 @@ namespace internal
|
||||
struct CreateTransferInterface; //forward declare for friendship
|
||||
|
||||
template <typename VirtualDerivedType, typename DeviceAdapter>
|
||||
struct VirtualObjectTransfer
|
||||
struct VTKM_DEPRECATED(1.7, "Virtual methods are no longer supported in the execution environment.")
|
||||
VirtualObjectTransfer
|
||||
#ifdef VTKM_DOXYGEN_ONLY
|
||||
{
|
||||
/// A VirtualObjectTransfer is constructed with a pointer to the derived type that (eventually)
|
||||
@ -56,7 +66,9 @@ struct VirtualObjectTransfer
|
||||
#endif
|
||||
;
|
||||
|
||||
class VTKM_CONT_EXPORT TransferInterface
|
||||
class VTKM_CONT_EXPORT VTKM_DEPRECATED(
|
||||
1.7,
|
||||
"Virtual methods are no longer supported in the execution environment.") TransferInterface
|
||||
{
|
||||
public:
|
||||
VTKM_CONT virtual ~TransferInterface();
|
||||
@ -92,7 +104,9 @@ private:
|
||||
};
|
||||
|
||||
|
||||
struct VTKM_CONT_EXPORT TransferState
|
||||
struct VTKM_CONT_EXPORT VTKM_DEPRECATED(
|
||||
1.7,
|
||||
"Virtual methods are no longer supported in the execution environment.") TransferState
|
||||
{
|
||||
TransferState() = default;
|
||||
|
||||
@ -161,4 +175,6 @@ private:
|
||||
}
|
||||
} // vtkm::cont::internal
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
|
||||
#endif // vtkm_cont_internal_VirtualObjectTransfer_h
|
||||
|
@ -10,6 +10,12 @@
|
||||
#ifndef vtk_m_cont_internal_VirtualObjectTransferInstantiate_h
|
||||
#define vtk_m_cont_internal_VirtualObjectTransferInstantiate_h
|
||||
|
||||
#include <vtkm/internal/Configure.h>
|
||||
|
||||
#ifdef VTKM_NO_DEPRECATED_VIRTUAL
|
||||
#error "This header should not be included when VTKM_NO_DEPRECATED_VIRTUAL is set."
|
||||
#endif //VTKM_NO_DEPRECATED_VIRTUAL
|
||||
|
||||
#define VTKM_EXPLICITLY_INSTANTIATE_TRANSFER_FOR_DEVICE(DerivedType, DeviceDapterTagType) \
|
||||
template class vtkm::cont::internal::VirtualObjectTransfer<DerivedType, DeviceDapterTagType>
|
||||
|
||||
|
@ -13,6 +13,10 @@
|
||||
#include <vtkm/StaticAssert.h>
|
||||
#include <vtkm/VirtualObjectBase.h>
|
||||
|
||||
#ifdef VTKM_NO_DEPRECATED_VIRTUAL
|
||||
#error "This header should not be included when VTKM_NO_DEPRECATED_VIRTUAL is set."
|
||||
#endif //VTKM_NO_DEPRECATED_VIRTUAL
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
|
@ -19,7 +19,9 @@
|
||||
#include <vtkm/cont/kokkos/internal/DeviceAdapterAlgorithmKokkos.h>
|
||||
#include <vtkm/cont/kokkos/internal/DeviceAdapterMemoryManagerKokkos.h>
|
||||
#include <vtkm/cont/kokkos/internal/DeviceAdapterRuntimeDetectorKokkos.h>
|
||||
#ifndef VTKM_NO_DEPRECATED_VIRTUAL
|
||||
#include <vtkm/cont/kokkos/internal/VirtualObjectTransferKokkos.h>
|
||||
#endif //VTKM_NO_DEPRECATED_VIRTUAL
|
||||
|
||||
#else // !defined(VTKM_KOKKOS_CUDA) || defined(VTKM_CUDA)
|
||||
|
||||
|
@ -17,6 +17,12 @@
|
||||
#include <vtkm/cont/kokkos/internal/KokkosAlloc.h>
|
||||
#include <vtkm/cont/kokkos/internal/KokkosTypes.h>
|
||||
|
||||
#ifdef VTKM_NO_DEPRECATED_VIRTUAL
|
||||
#error "This header should not be included when VTKM_NO_DEPRECATED_VIRTUAL is set."
|
||||
#endif //VTKM_NO_DEPRECATED_VIRTUAL
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
@ -106,6 +112,9 @@ private:
|
||||
const VirtualDerivedType* ControlObject;
|
||||
VirtualDerivedType* ExecutionObject;
|
||||
};
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
|
||||
}
|
||||
}
|
||||
} // vtkm::cont::internal
|
||||
|
@ -23,8 +23,14 @@ set(unit_tests
|
||||
UnitTestKokkosDeviceAdapter.cxx
|
||||
UnitTestKokkosImplicitFunction.cxx
|
||||
UnitTestKokkosPointLocatorSparseGrid.cxx
|
||||
UnitTestKokkosVirtualObjectHandle.cxx
|
||||
)
|
||||
|
||||
if (NOT VTKm_NO_DEPRECATED_VIRTUAL)
|
||||
set(unit_tests ${unit_tests}
|
||||
UnitTestKokkosVirtualObjectHandle.cxx
|
||||
)
|
||||
endif()
|
||||
|
||||
vtkm_unit_tests(SOURCES ${unit_tests} LABEL "KOKKOS" LIBRARIES vtkm_worklet)
|
||||
|
||||
if (TARGET vtkm::kokkos_cuda)
|
||||
|
@ -17,7 +17,9 @@
|
||||
#ifdef VTKM_ENABLE_OPENMP
|
||||
#include <vtkm/cont/openmp/internal/DeviceAdapterAlgorithmOpenMP.h>
|
||||
#include <vtkm/cont/openmp/internal/DeviceAdapterMemoryManagerOpenMP.h>
|
||||
#ifndef VTKM_NO_DEPRECATED_VIRTUAL
|
||||
#include <vtkm/cont/openmp/internal/VirtualObjectTransferOpenMP.h>
|
||||
#endif //VTKM_NO_DEPRECATED_VIRTUAL
|
||||
#endif
|
||||
|
||||
#endif //vtk_m_cont_openmp_DeviceAdapterOpenMP_h
|
||||
|
@ -15,6 +15,10 @@
|
||||
#include <vtkm/cont/internal/VirtualObjectTransferShareWithControl.h>
|
||||
#include <vtkm/cont/openmp/internal/DeviceAdapterTagOpenMP.h>
|
||||
|
||||
#ifdef VTKM_NO_DEPRECATED_VIRTUAL
|
||||
#error "This header should not be included when VTKM_NO_DEPRECATED_VIRTUAL is set."
|
||||
#endif //VTKM_NO_DEPRECATED_VIRTUAL
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
@ -22,6 +26,8 @@ namespace cont
|
||||
namespace internal
|
||||
{
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
|
||||
template <typename VirtualDerivedType>
|
||||
struct VirtualObjectTransfer<VirtualDerivedType, vtkm::cont::DeviceAdapterTagOpenMP> final
|
||||
: VirtualObjectTransferShareWithControl<VirtualDerivedType>
|
||||
@ -29,6 +35,9 @@ struct VirtualObjectTransfer<VirtualDerivedType, vtkm::cont::DeviceAdapterTagOpe
|
||||
using VirtualObjectTransferShareWithControl<
|
||||
VirtualDerivedType>::VirtualObjectTransferShareWithControl;
|
||||
};
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
|
||||
}
|
||||
}
|
||||
} // vtkm::cont::internal
|
||||
|
@ -23,8 +23,14 @@ set(unit_tests
|
||||
UnitTestOpenMPDeviceAdapter.cxx
|
||||
UnitTestOpenMPImplicitFunction.cxx
|
||||
UnitTestOpenMPPointLocatorSparseGrid.cxx
|
||||
UnitTestOpenMPVirtualObjectHandle.cxx
|
||||
)
|
||||
|
||||
if (NOT VTKm_NO_DEPRECATED_VIRTUAL)
|
||||
set(unit_tests ${unit_tests}
|
||||
UnitTestOpenMPVirtualObjectHandle.cxx
|
||||
)
|
||||
endif()
|
||||
|
||||
vtkm_unit_tests(SOURCES ${unit_tests}
|
||||
LABEL "OPENMP"
|
||||
DEFINES VTKM_NO_ERROR_ON_MIXED_CUDA_CXX_TAG
|
||||
|
@ -16,7 +16,9 @@
|
||||
#include <vtkm/cont/serial/internal/DeviceAdapterRuntimeDetectorSerial.h>
|
||||
#include <vtkm/cont/serial/internal/DeviceAdapterMemoryManagerSerial.h>
|
||||
#include <vtkm/cont/serial/internal/DeviceAdapterAlgorithmSerial.h>
|
||||
#ifndef VTKM_NO_DEPRECATED_VIRTUAL
|
||||
#include <vtkm/cont/serial/internal/VirtualObjectTransferSerial.h>
|
||||
#endif //VTKM_NO_DEPRECATED_VIRTUAL
|
||||
// clang-format on
|
||||
|
||||
#endif //vtk_m_cont_serial_DeviceAdapterSerial_h
|
||||
|
@ -14,6 +14,10 @@
|
||||
#include <vtkm/cont/internal/VirtualObjectTransferShareWithControl.h>
|
||||
#include <vtkm/cont/serial/internal/DeviceAdapterTagSerial.h>
|
||||
|
||||
#ifdef VTKM_NO_DEPRECATED_VIRTUAL
|
||||
#error "This header should not be included when VTKM_NO_DEPRECATED_VIRTUAL is set."
|
||||
#endif //VTKM_NO_DEPRECATED_VIRTUAL
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
@ -21,6 +25,7 @@ namespace cont
|
||||
namespace internal
|
||||
{
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
template <typename VirtualDerivedType>
|
||||
struct VirtualObjectTransfer<VirtualDerivedType, vtkm::cont::DeviceAdapterTagSerial> final
|
||||
: VirtualObjectTransferShareWithControl<VirtualDerivedType>
|
||||
@ -28,6 +33,8 @@ struct VirtualObjectTransfer<VirtualDerivedType, vtkm::cont::DeviceAdapterTagSer
|
||||
using VirtualObjectTransferShareWithControl<
|
||||
VirtualDerivedType>::VirtualObjectTransferShareWithControl;
|
||||
};
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
|
||||
}
|
||||
}
|
||||
} // vtkm::cont::internal
|
||||
|
@ -23,8 +23,14 @@ set(unit_tests
|
||||
UnitTestSerialDeviceAdapter.cxx
|
||||
UnitTestSerialImplicitFunction.cxx
|
||||
UnitTestSerialPointLocatorSparseGrid.cxx
|
||||
UnitTestSerialVirtualObjectHandle.cxx
|
||||
)
|
||||
|
||||
if (NOT VTKm_NO_DEPRECATED_VIRTUAL)
|
||||
set(unit_tests ${unit_tests}
|
||||
UnitTestSerialVirtualObjectHandle.cxx
|
||||
)
|
||||
endif()
|
||||
|
||||
vtkm_unit_tests(SOURCES ${unit_tests}
|
||||
LABEL "SERIAL"
|
||||
DEFINES VTKM_NO_ERROR_ON_MIXED_CUDA_CXX_TAG
|
||||
|
@ -16,7 +16,9 @@
|
||||
#ifdef VTKM_ENABLE_TBB
|
||||
#include <vtkm/cont/tbb/internal/DeviceAdapterAlgorithmTBB.h>
|
||||
#include <vtkm/cont/tbb/internal/DeviceAdapterMemoryManagerTBB.h>
|
||||
#ifndef VTKM_NO_DEPRECATED_VIRTUAL
|
||||
#include <vtkm/cont/tbb/internal/VirtualObjectTransferTBB.h>
|
||||
#endif //VTKM_NO_DEPRECATED_VIRTUAL
|
||||
#endif
|
||||
|
||||
#endif //vtk_m_cont_tbb_DeviceAdapterTBB_h
|
||||
|
@ -14,6 +14,12 @@
|
||||
#include <vtkm/cont/internal/VirtualObjectTransferShareWithControl.h>
|
||||
#include <vtkm/cont/tbb/internal/DeviceAdapterTagTBB.h>
|
||||
|
||||
#ifdef VTKM_NO_DEPRECATED_VIRTUAL
|
||||
#error "This header should not be included when VTKM_NO_DEPRECATED_VIRTUAL is set."
|
||||
#endif //VTKM_NO_DEPRECATED_VIRTUAL
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
@ -28,6 +34,9 @@ struct VirtualObjectTransfer<VirtualDerivedType, vtkm::cont::DeviceAdapterTagTBB
|
||||
using VirtualObjectTransferShareWithControl<
|
||||
VirtualDerivedType>::VirtualObjectTransferShareWithControl;
|
||||
};
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
|
||||
}
|
||||
}
|
||||
} // vtkm::cont::internal
|
||||
|
@ -23,9 +23,14 @@ set(unit_tests
|
||||
UnitTestTBBDeviceAdapter.cxx
|
||||
UnitTestTBBImplicitFunction.cxx
|
||||
UnitTestTBBPointLocatorSparseGrid.cxx
|
||||
UnitTestTBBVirtualObjectHandle.cxx
|
||||
)
|
||||
|
||||
if (NOT VTKm_NO_DEPRECATED_VIRTUAL)
|
||||
set(unit_tests ${unit_tests}
|
||||
UnitTestTBBVirtualObjectHandle.cxx
|
||||
)
|
||||
endif()
|
||||
|
||||
vtkm_unit_tests(SOURCES ${unit_tests}
|
||||
LABEL "TBB"
|
||||
DEFINES VTKM_NO_ERROR_ON_MIXED_CUDA_CXX_TAG
|
||||
|
@ -30,7 +30,10 @@
|
||||
#include <vtkm/cont/Timer.h>
|
||||
|
||||
#include <vtkm/cont/internal/ArrayPortalFromIterators.h>
|
||||
|
||||
#ifndef VTKM_NO_DEPRECATED_VIRTUAL
|
||||
#include <vtkm/cont/internal/VirtualObjectTransfer.h>
|
||||
#endif //VTKM_NO_DEPRECATED_VIRTUAL
|
||||
|
||||
#include <vtkm/cont/testing/Testing.h>
|
||||
|
||||
@ -337,6 +340,9 @@ public:
|
||||
vtkm::exec::AtomicArrayExecutionObject<T> AArray;
|
||||
};
|
||||
|
||||
#ifndef VTKM_NO_DEPRECATED_VIRTUAL
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
|
||||
class VirtualObjectTransferKernel
|
||||
{
|
||||
public:
|
||||
@ -370,6 +376,9 @@ public:
|
||||
IdPortalType Result;
|
||||
};
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
#endif //VTKM_NO_DEPRECATED_VIRTUAL
|
||||
|
||||
struct CustomPairOp
|
||||
{
|
||||
using ValueType = vtkm::Pair<vtkm::Id, vtkm::Float32>;
|
||||
@ -603,6 +612,9 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef VTKM_NO_DEPRECATED_VIRTUAL
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
|
||||
VTKM_CONT
|
||||
static void TestVirtualObjectTransfer()
|
||||
{
|
||||
@ -640,6 +652,9 @@ private:
|
||||
transfer.ReleaseResources();
|
||||
}
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
#endif //VTKM_NO_DEPRECATED_VIRTUAL
|
||||
|
||||
static VTKM_CONT void TestAlgorithmSchedule()
|
||||
{
|
||||
std::cout << "-------------------------------------------" << std::endl;
|
||||
@ -3011,7 +3026,10 @@ private:
|
||||
TestMemoryTransfer();
|
||||
TestOutOfMemory();
|
||||
TestTimer();
|
||||
|
||||
#ifndef VTKM_NO_DEPRECATED_VIRTUAL
|
||||
TestVirtualObjectTransfer();
|
||||
#endif //VTKM_NO_DEPRECATED_VIRTUAL
|
||||
|
||||
TestAlgorithmSchedule();
|
||||
TestErrorExecution();
|
||||
|
@ -30,7 +30,16 @@
|
||||
#include <vtkm/cont/ArrayHandleTransform.h>
|
||||
#include <vtkm/cont/ArrayHandleView.h>
|
||||
#include <vtkm/cont/ArrayHandleZip.h>
|
||||
|
||||
// MSVC is giving deprecation warnings in stupid places, so just disable the deprecated tests
|
||||
// for that compiler
|
||||
#if !defined(VTKM_NO_DEPRECATED_VIRTUAL) && defined(VTKM_MSVC)
|
||||
#define VTKM_NO_DEPRECATED_VIRTUAL
|
||||
#endif
|
||||
|
||||
#ifndef VTKM_NO_DEPRECATED_VIRTUAL
|
||||
#include <vtkm/cont/VirtualObjectHandle.h>
|
||||
#endif //VTKM_NO_DEPRECATED_VIRTUAL
|
||||
|
||||
#include <vtkm/worklet/DispatcherMapField.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
@ -129,6 +138,9 @@ private:
|
||||
vtkm::Float64 InverseFactor;
|
||||
};
|
||||
|
||||
#ifndef VTKM_NO_DEPRECATED_VIRTUAL
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
|
||||
template <typename ValueType>
|
||||
struct VirtualTransformFunctorBase : public vtkm::VirtualObjectBase
|
||||
{
|
||||
@ -201,6 +213,10 @@ struct TransformExecObject : public vtkm::cont::ExecutionAndControlObjectBase
|
||||
return FunctorWrapper(this->VirtualFunctor.Get());
|
||||
}
|
||||
};
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
#endif //VTKM_NO_DEPRECATED_VIRTUAL
|
||||
|
||||
}
|
||||
|
||||
namespace vtkm
|
||||
@ -770,6 +786,9 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
#ifndef VTKM_NO_DEPRECATED_VIRTUAL
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
|
||||
struct TestTransformVirtualAsInput
|
||||
{
|
||||
template <typename ValueType>
|
||||
@ -807,6 +826,9 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
#endif //VTKM_NO_DEPRECATED_VIRTUAL
|
||||
|
||||
struct TestCountingTransformAsInput
|
||||
{
|
||||
template <typename ValueType>
|
||||
@ -1378,6 +1400,9 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
#ifndef VTKM_NO_DEPRECATED_VIRTUAL
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
|
||||
struct TestTransformVirtualAsOutput
|
||||
{
|
||||
template <typename ValueType>
|
||||
@ -1421,6 +1446,9 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
#endif //VTKM_NO_DEPRECATED_VIRTUAL
|
||||
|
||||
struct TestZipAsOutput
|
||||
{
|
||||
template <typename KeyType, typename ValueType>
|
||||
@ -1553,11 +1581,13 @@ private:
|
||||
vtkm::testing::Testing::TryTypes(
|
||||
TestingFancyArrayHandles<DeviceAdapterTag>::TestTransformAsInput(), HandleTypesToTest());
|
||||
|
||||
#ifndef VTKM_NO_DEPRECATED_VIRTUAL
|
||||
std::cout << "-------------------------------------------" << std::endl;
|
||||
std::cout << "Testing ArrayHandleTransform with virtual as Input" << std::endl;
|
||||
vtkm::testing::Testing::TryTypes(
|
||||
TestingFancyArrayHandles<DeviceAdapterTag>::TestTransformVirtualAsInput(),
|
||||
HandleTypesToTest());
|
||||
#endif //VTKM_NO_DEPRECATED_VIRTUAL
|
||||
|
||||
std::cout << "-------------------------------------------" << std::endl;
|
||||
std::cout << "Testing ArrayHandleTransform with Counting as Input" << std::endl;
|
||||
@ -1648,11 +1678,13 @@ private:
|
||||
vtkm::testing::Testing::TryTypes(
|
||||
TestingFancyArrayHandles<DeviceAdapterTag>::TestTransformAsOutput(), HandleTypesToTest());
|
||||
|
||||
#ifndef VTKM_NO_DEPRECATED_VIRTUAL
|
||||
std::cout << "-------------------------------------------" << std::endl;
|
||||
std::cout << "Testing ArrayHandleTransform with virtual as Output" << std::endl;
|
||||
vtkm::testing::Testing::TryTypes(
|
||||
TestingFancyArrayHandles<DeviceAdapterTag>::TestTransformVirtualAsOutput(),
|
||||
HandleTypesToTest());
|
||||
#endif //VTKM_NO_DEPRECATED_VIRTUAL
|
||||
|
||||
std::cout << "-------------------------------------------" << std::endl;
|
||||
std::cout << "Testing ArrayHandleDiscard as Output" << std::endl;
|
||||
|
@ -17,6 +17,12 @@
|
||||
#include <vtkm/cont/VirtualObjectHandle.h>
|
||||
#include <vtkm/cont/testing/Testing.h>
|
||||
|
||||
#ifdef VTKM_NO_DEPRECATED_VIRTUAL
|
||||
#error "This test should be disabled if the VTKm_NO_DEPRECATED_VIRTUAL is true."
|
||||
#endif //VTKM_NO_DEPRECATED_VIRTUAL
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
|
||||
#define ARRAY_LEN 8
|
||||
|
||||
namespace vtkm
|
||||
@ -221,4 +227,6 @@ public:
|
||||
}
|
||||
} // vtkm::cont::testing
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
|
||||
#endif
|
||||
|
@ -18,9 +18,12 @@
|
||||
#include <vtkm/cont/ArrayHandle.h>
|
||||
#include <vtkm/cont/RuntimeDeviceTracker.h>
|
||||
#include <vtkm/cont/internal/DeviceAdapterAlgorithmGeneral.h>
|
||||
#include <vtkm/cont/internal/VirtualObjectTransferShareWithControl.h>
|
||||
#include <vtkm/cont/serial/DeviceAdapterSerial.h>
|
||||
|
||||
#ifndef VTKM_NO_DEPRECATED_VIRTUAL
|
||||
#include <vtkm/cont/internal/VirtualObjectTransferShareWithControl.h>
|
||||
#endif //VTKM_NO_DEPRECATED_VIRTUAL
|
||||
|
||||
#include <vtkm/cont/testing/TestingDeviceAdapter.h>
|
||||
|
||||
// Hijack the serial device id so that precompiled units (like memory management) still work.
|
||||
@ -80,12 +83,17 @@ class DeviceAdapterMemoryManager<vtkm::cont::DeviceAdapterTagTestAlgorithmGenera
|
||||
}
|
||||
};
|
||||
|
||||
#ifndef VTKM_NO_DEPRECATED_VIRTUAL
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
template <typename TargetClass>
|
||||
struct VirtualObjectTransfer<TargetClass, vtkm::cont::DeviceAdapterTagTestAlgorithmGeneral> final
|
||||
: public VirtualObjectTransferShareWithControl<TargetClass>
|
||||
{
|
||||
using VirtualObjectTransferShareWithControl<TargetClass>::VirtualObjectTransferShareWithControl;
|
||||
};
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
#endif //VTKM_NO_DEPRECATED_VIRTUAL
|
||||
|
||||
}
|
||||
}
|
||||
} // namespace vtkm::cont::internal
|
||||
|
@ -20,6 +20,8 @@
|
||||
#error "CellLocator with virtual methods is removed. Do not include CellLocator.h"
|
||||
#endif
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace exec
|
||||
@ -62,4 +64,6 @@ public:
|
||||
} // namespace exec
|
||||
} // namespace vtkm
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
|
||||
#endif // vtk_m_exec_CellLocator_h
|
||||
|
@ -16,6 +16,8 @@
|
||||
#error "PointLocator with virtual methods is removed. Do not include PointLocator.h"
|
||||
#endif
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace exec
|
||||
@ -42,4 +44,6 @@ public:
|
||||
} // vtkm::exec
|
||||
} // vtkm
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
|
||||
#endif // vtk_m_exec_PointLocator_h
|
||||
|
@ -10,6 +10,10 @@
|
||||
#ifndef vtk_m_internal_ArrayPortalVirtual_h
|
||||
#define vtk_m_internal_ArrayPortalVirtual_h
|
||||
|
||||
#include <vtkm/internal/Configure.h>
|
||||
#ifdef VTKM_NO_DEPRECATED_VIRTUAL
|
||||
#error "This header should not be included when VTKM_NO_DEPRECATED_VIRTUAL is set."
|
||||
#endif //VTKM_NO_DEPRECATED_VIRTUAL
|
||||
|
||||
#include <vtkm/VecTraits.h>
|
||||
#include <vtkm/VirtualObjectBase.h>
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include <sstream>
|
||||
#include <vtkm/CellShape.h>
|
||||
#include <vtkm/cont/ErrorBadValue.h>
|
||||
#include <vtkm/cont/VirtualObjectHandle.h>
|
||||
#include <vtkm/exec/internal/Variant.h>
|
||||
#include <vtkm/rendering/raytracing/BoundingVolumeHierarchy.h>
|
||||
#include <vtkm/rendering/raytracing/CellTables.h>
|
||||
|
@ -19,7 +19,6 @@
|
||||
#include <vtkm/cont/CellSetStructured.h>
|
||||
#include <vtkm/cont/DynamicCellSet.h>
|
||||
#include <vtkm/cont/ExecutionObjectBase.h>
|
||||
#include <vtkm/cont/VirtualObjectHandle.h>
|
||||
#include <vtkm/exec/CellInterpolate.h>
|
||||
|
||||
/*
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include <vtkm/VecVariable.h>
|
||||
#include <vtkm/cont/ArrayHandle.h>
|
||||
#include <vtkm/cont/ExecutionObjectBase.h>
|
||||
#include <vtkm/cont/VirtualObjectHandle.h>
|
||||
#include <vtkm/exec/CellInterpolate.h>
|
||||
|
||||
namespace vtkm
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include <vtkm/VectorAnalysis.h>
|
||||
|
||||
#include <vtkm/cont/DataSet.h>
|
||||
#include <vtkm/cont/VirtualObjectHandle.h>
|
||||
|
||||
#include <vtkm/worklet/particleadvection/GridEvaluators.h>
|
||||
#include <vtkm/worklet/particleadvection/IntegratorStatus.h>
|
||||
|
Loading…
Reference in New Issue
Block a user