Merge topic 'remove-deprecated'
3e1339f9a Remove deprecated features from VTK-m Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Li-Ta Lo <ollie@lanl.gov> Merge-request: !2925
This commit is contained in:
commit
b47eb4999c
8
docs/changelog/remove-deprecated.md
Normal file
8
docs/changelog/remove-deprecated.md
Normal file
@ -0,0 +1,8 @@
|
||||
# Remove deprecated features from VTK-m
|
||||
|
||||
With the major revision 2.0 of VTK-m, many items previously marked as
|
||||
deprecated were removed. If updating to a new version of VTK-m, it is
|
||||
recommended to first update to VTK-m 1.9, which will include the deprecated
|
||||
features but provide warnings (with the right compiler) that will point to
|
||||
the replacement code. Once the deprecations have been fixed, updating to
|
||||
2.0 should be smoother.
|
@ -64,7 +64,6 @@
|
||||
#include <vtkm/cont/ArrayHandle.h>
|
||||
#include <vtkm/cont/DataSet.h>
|
||||
#include <vtkm/cont/DataSetBuilderUniform.h>
|
||||
#include <vtkm/cont/DataSetFieldAdd.h>
|
||||
#include <vtkm/cont/DeviceAdapterTag.h>
|
||||
#include <vtkm/cont/Initialize.h>
|
||||
#include <vtkm/cont/RuntimeDeviceTracker.h>
|
||||
|
@ -138,7 +138,7 @@ struct UploadData
|
||||
bool operator()(DeviceAdapterTag device)
|
||||
{
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec4ui_8> colors;
|
||||
this->Colors.GetData().CopyTo(colors);
|
||||
this->Colors.GetData().AsArrayHandle(colors);
|
||||
vtkm::interop::TransferToOpenGL(colors, *this->ColorState, device);
|
||||
return true;
|
||||
}
|
||||
@ -316,8 +316,8 @@ int main(int argc, char** argv)
|
||||
vtkm::cont::DataSetBuilderUniform builder;
|
||||
vtkm::cont::DataSet data = builder.Create(vtkm::Id2(x, y));
|
||||
|
||||
auto stateField =
|
||||
vtkm::cont::make_Field("state", vtkm::cont::Field::Association::Points, input_state);
|
||||
auto stateField = vtkm::cont::make_FieldMove(
|
||||
"state", vtkm::cont::Field::Association::Points, std::move(input_state));
|
||||
data.AddField(stateField);
|
||||
|
||||
GameOfLife filter;
|
||||
|
@ -313,7 +313,9 @@ int main(int argc, char** argv)
|
||||
if (generateOutput)
|
||||
{
|
||||
vtkm::cont::ArrayHandleBasic<vtkm::Float64> tmp;
|
||||
rdata.GetField("oscillating", vtkm::cont::Field::Association::Points).GetData().CopyTo(tmp);
|
||||
rdata.GetField("oscillating", vtkm::cont::Field::Association::Points)
|
||||
.GetData()
|
||||
.AsArrayHandle(tmp);
|
||||
const double* values = tmp.GetReadPointer();
|
||||
writeData(outputDirectory, count++, sizeX, sizeY, sizeZ, values);
|
||||
}
|
||||
|
@ -1,79 +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_Algorithms_h
|
||||
#define vtk_m_Algorithms_h
|
||||
|
||||
#include <vtkm/Deprecated.h>
|
||||
#include <vtkm/LowerBound.h>
|
||||
#include <vtkm/UpperBound.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
|
||||
VTKM_DEPRECATED(1.7, "Use LowerBound.h, or UpperBound.h instead of Algorithms.h.")
|
||||
inline void Algorithms_h_deprecated() {}
|
||||
|
||||
inline void ActivateAlgorithms_h_deprecated_warning()
|
||||
{
|
||||
Algorithms_h_deprecated();
|
||||
}
|
||||
|
||||
template <typename IterT, typename T, typename Comp>
|
||||
VTKM_DEPRECATED(1.7, "Use LowerBound or UpperBound instead of BinarySearch.")
|
||||
VTKM_EXEC_CONT IterT BinarySearch(IterT first, IterT last, const T& val, Comp comp)
|
||||
{
|
||||
IterT found = vtkm::LowerBound(first, last, val, comp);
|
||||
if ((found == last) || comp(val, *found) || comp(*found, val))
|
||||
{
|
||||
// Element is not actually in the array
|
||||
return last;
|
||||
}
|
||||
else
|
||||
{
|
||||
return found;
|
||||
}
|
||||
}
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
|
||||
template <typename IterT, typename T>
|
||||
VTKM_DEPRECATED(1.7, "Use LowerBound or UpperBound instead of BinarySearch.")
|
||||
VTKM_EXEC_CONT IterT BinarySearch(IterT first, IterT last, const T& val)
|
||||
{
|
||||
return vtkm::BinarySearch(first, last, val, vtkm::SortLess{});
|
||||
}
|
||||
|
||||
template <typename PortalT, typename T, typename Comp>
|
||||
VTKM_DEPRECATED(1.7, "Use LowerBound or UpperBound instead of BinarySearch.")
|
||||
VTKM_EXEC_CONT vtkm::Id BinarySearch(const PortalT& portal, const T& val, Comp comp)
|
||||
{
|
||||
auto first = vtkm::cont::ArrayPortalToIteratorBegin(portal);
|
||||
auto last = vtkm::cont::ArrayPortalToIteratorEnd(portal);
|
||||
auto result = vtkm::BinarySearch(first, last, val, comp);
|
||||
return result == last ? static_cast<vtkm::Id>(-1) : static_cast<vtkm::Id>(result - first);
|
||||
}
|
||||
|
||||
// Return -1 if not found
|
||||
template <typename PortalT, typename T>
|
||||
VTKM_DEPRECATED(1.7, "Use LowerBound or UpperBound instead of BinarySearch.")
|
||||
VTKM_EXEC_CONT vtkm::Id BinarySearch(const PortalT& portal, const T& val)
|
||||
{
|
||||
auto first = vtkm::cont::ArrayPortalToIteratorBegin(portal);
|
||||
auto last = vtkm::cont::ArrayPortalToIteratorEnd(portal);
|
||||
auto result = vtkm::BinarySearch(first, last, val, vtkm::SortLess{});
|
||||
return result == last ? static_cast<vtkm::Id>(-1) : static_cast<vtkm::Id>(result - first);
|
||||
}
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
|
||||
} // end namespace vtkm
|
||||
|
||||
#endif // vtk_m_Algorithms_h
|
@ -17,7 +17,6 @@ vtkm_install_headers(
|
||||
vtkm ${VTKm_BINARY_INCLUDE_DIR}/${kit_dir}/Version.h)
|
||||
|
||||
set(headers
|
||||
Algorithms.h # Deprecated, split into LowerBound.h, UpperBound.h
|
||||
Assert.h
|
||||
Atomic.h
|
||||
BinaryPredicates.h
|
||||
@ -34,7 +33,6 @@ set(headers
|
||||
Hash.h
|
||||
ImplicitFunction.h
|
||||
List.h
|
||||
ListTag.h # Deprecated, replaced by List.h
|
||||
LowerBound.h
|
||||
Math.h
|
||||
Matrix.h
|
||||
@ -51,7 +49,6 @@ set(headers
|
||||
Transform3D.h
|
||||
Tuple.h
|
||||
TypeList.h
|
||||
TypeListTag.h # Deprecated, replaced by TypeList.h
|
||||
Types.h
|
||||
TypeTraits.h
|
||||
VecAxisAlignedPointCoordinates.h
|
||||
|
@ -10,7 +10,6 @@
|
||||
#ifndef vtk_m_CellClassification_h
|
||||
#define vtk_m_CellClassification_h
|
||||
|
||||
#include <vtkm/Deprecated.h>
|
||||
#include <vtkm/Types.h>
|
||||
|
||||
namespace vtkm
|
||||
@ -45,15 +44,6 @@ public:
|
||||
Unused3 = 1 << 4,
|
||||
Unused4 = 1 << 5,
|
||||
Unused5 = 1 << 6,
|
||||
|
||||
NORMAL VTKM_DEPRECATED(1.8, "Use vtkm::CellClassification::Normal") = Normal,
|
||||
GHOST VTKM_DEPRECATED(1.8, "Use vtkm::CellClassification::Ghost") = Ghost,
|
||||
INVALID VTKM_DEPRECATED(1.8, "Use vtkm::CellClassification::Invalid") = Invalid,
|
||||
UNUSED0 VTKM_DEPRECATED(1.8) = Unused0,
|
||||
BLANKED VTKM_DEPRECATED(1.8, "Use vtkm::CellClassification::Blanked") = Blanked,
|
||||
UNUSED3 VTKM_DEPRECATED(1.8) = Unused3,
|
||||
UNUSED4 VTKM_DEPRECATED(1.8) = Unused4,
|
||||
UNUSED5 VTKM_DEPRECATED(1.8) = Unused5,
|
||||
};
|
||||
|
||||
VTKM_EXEC constexpr CellClassification(vtkm::UInt8 flags = vtkm::UInt8{ Normal })
|
||||
@ -64,16 +54,6 @@ public:
|
||||
VTKM_EXEC constexpr operator vtkm::UInt8() const { return this->Flags; }
|
||||
};
|
||||
|
||||
// Deprecated scoping.
|
||||
VTKM_DEPRECATED(1.8, "Use vtkm::CellClassification::Normal.")
|
||||
constexpr vtkm::CellClassification NORMAL = vtkm::CellClassification::Normal;
|
||||
VTKM_DEPRECATED(1.8, "Use vtkm::CellClassification::Ghost.")
|
||||
constexpr vtkm::CellClassification GHOST = vtkm::CellClassification::Ghost;
|
||||
VTKM_DEPRECATED(1.8, "Use vtkm::CellClassification::Invalid.")
|
||||
constexpr vtkm::CellClassification INVALID = vtkm::CellClassification::Invalid;
|
||||
VTKM_DEPRECATED(1.8, "Use vtkm::CellClassification::Blanked.")
|
||||
constexpr vtkm::CellClassification BLANKED = vtkm::CellClassification::Blanked;
|
||||
|
||||
} // namespace vtkm
|
||||
|
||||
#endif // vtk_m_CellClassification_h
|
||||
|
@ -11,7 +11,6 @@
|
||||
#define vtk_m_ImplicitFunction_h
|
||||
|
||||
#include <vtkm/Bounds.h>
|
||||
#include <vtkm/Deprecated.h>
|
||||
#include <vtkm/Math.h>
|
||||
#include <vtkm/VectorAnalysis.h>
|
||||
|
||||
@ -373,11 +372,6 @@ public:
|
||||
return normal;
|
||||
}
|
||||
|
||||
VTKM_DEPRECATED(1.6, "ImplicitFunctions are no longer pointers. Use . operator.")
|
||||
VTKM_EXEC Box* operator->() { return this; }
|
||||
VTKM_DEPRECATED(1.6, "ImplicitFunctions are no longer pointers. Use . operator.")
|
||||
VTKM_EXEC const Box* operator->() const { return this; }
|
||||
|
||||
private:
|
||||
Vector MinPoint;
|
||||
Vector MaxPoint;
|
||||
@ -441,11 +435,6 @@ public:
|
||||
return (point - closestPoint) * FloatDefault(2);
|
||||
}
|
||||
|
||||
VTKM_DEPRECATED(1.6, "ImplicitFunctions are no longer pointers. Use . operator.")
|
||||
VTKM_EXEC Cylinder* operator->() { return this; }
|
||||
VTKM_DEPRECATED(1.6, "ImplicitFunctions are no longer pointers. Use . operator.")
|
||||
VTKM_EXEC const Cylinder* operator->() const { return this; }
|
||||
|
||||
private:
|
||||
Vector Center;
|
||||
Vector Axis;
|
||||
@ -554,11 +543,6 @@ public:
|
||||
return this->Normals[maxValIdx];
|
||||
}
|
||||
|
||||
VTKM_DEPRECATED(1.6, "ImplicitFunctions are no longer pointers. Use . operator.")
|
||||
VTKM_EXEC Frustum* operator->() { return this; }
|
||||
VTKM_DEPRECATED(1.6, "ImplicitFunctions are no longer pointers. Use . operator.")
|
||||
VTKM_EXEC const Frustum* operator->() const { return this; }
|
||||
|
||||
private:
|
||||
Vector Points[6] = { { -0.5f, 0.0f, 0.0f }, { 0.5f, 0.0f, 0.0f }, { 0.0f, -0.5f, 0.0f },
|
||||
{ 0.0f, 0.5f, 0.0f }, { 0.0f, 0.0f, -0.5f }, { 0.0f, 0.0f, 0.5f } };
|
||||
@ -611,11 +595,6 @@ public:
|
||||
|
||||
VTKM_EXEC_CONT Vector Gradient(const Vector&) const { return this->Normal; }
|
||||
|
||||
VTKM_DEPRECATED(1.6, "ImplicitFunctions are no longer pointers. Use . operator.")
|
||||
VTKM_EXEC Plane* operator->() { return this; }
|
||||
VTKM_DEPRECATED(1.6, "ImplicitFunctions are no longer pointers. Use . operator.")
|
||||
VTKM_EXEC const Plane* operator->() const { return this; }
|
||||
|
||||
private:
|
||||
Vector Origin;
|
||||
Vector Normal;
|
||||
@ -670,11 +649,6 @@ public:
|
||||
return Scalar(2) * (point - this->Center);
|
||||
}
|
||||
|
||||
VTKM_DEPRECATED(1.6, "ImplicitFunctions are no longer pointers. Use . operator.")
|
||||
VTKM_EXEC Sphere* operator->() { return this; }
|
||||
VTKM_DEPRECATED(1.6, "ImplicitFunctions are no longer pointers. Use . operator.")
|
||||
VTKM_EXEC const Sphere* operator->() const { return this; }
|
||||
|
||||
private:
|
||||
Scalar Radius;
|
||||
Vector Center;
|
||||
|
105
vtkm/List.h
105
vtkm/List.h
@ -36,23 +36,13 @@ struct List
|
||||
VTKM_CHECK_LIST_SIZE(sizeof...(Ts));
|
||||
};
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
// This prototype is here to detect deprecated ListTag objects. When ListTags are removed, then
|
||||
// this should be removed too.
|
||||
struct ListRoot;
|
||||
}
|
||||
|
||||
namespace internal
|
||||
{
|
||||
|
||||
template <typename T>
|
||||
struct IsListImpl
|
||||
{
|
||||
// This prototype is here to detect deprecated ListTag objects. When ListTags are removed, then
|
||||
// this should be changed to be just std::false_type.
|
||||
using type = std::is_base_of<vtkm::detail::ListRoot, T>;
|
||||
using type = std::false_type;
|
||||
};
|
||||
|
||||
template <typename... Ts>
|
||||
@ -88,25 +78,6 @@ struct UniversalTypeTag
|
||||
|
||||
} // namespace detail
|
||||
|
||||
namespace internal
|
||||
{
|
||||
|
||||
// This is here so that the old (deprecated) `ListTag`s can convert themselves to the new
|
||||
// `List` style and be operated on. When that deprecated functionality goes away, we can
|
||||
// probably remove `AsList` and just operate directly on the `List`s.
|
||||
template <typename T>
|
||||
struct AsListImpl;
|
||||
|
||||
template <typename... Ts>
|
||||
struct AsListImpl<vtkm::List<Ts...>>
|
||||
{
|
||||
using type = vtkm::List<Ts...>;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
using AsList = typename AsListImpl<T>::type;
|
||||
}
|
||||
|
||||
/// A special tag for an empty list.
|
||||
///
|
||||
using ListEmpty = vtkm::List<>;
|
||||
@ -134,7 +105,7 @@ struct ListSizeImpl<vtkm::List<Ts...>>
|
||||
/// Becomes an std::integral_constant containing the number of types in a list.
|
||||
///
|
||||
template <typename List>
|
||||
using ListSize = typename detail::ListSizeImpl<internal::AsList<List>>::type;
|
||||
using ListSize = typename detail::ListSizeImpl<List>::type;
|
||||
|
||||
namespace detail
|
||||
{
|
||||
@ -158,7 +129,7 @@ struct ListApplyImpl<vtkm::ListUniversal, Target>;
|
||||
/// represented by the ListTag.
|
||||
///
|
||||
template <typename List, template <typename...> class Target>
|
||||
using ListApply = typename detail::ListApplyImpl<internal::AsList<List>, Target>::type;
|
||||
using ListApply = typename detail::ListApplyImpl<List, Target>::type;
|
||||
|
||||
namespace detail
|
||||
{
|
||||
@ -301,7 +272,7 @@ struct ListAppendImpl<vtkm::List<T0s...>,
|
||||
///
|
||||
/// Note that this does not work correctly with `vtkm::ListUniversal`.
|
||||
template <typename... Lists>
|
||||
using ListAppend = typename detail::ListAppendImpl<internal::AsList<Lists>...>::type;
|
||||
using ListAppend = typename detail::ListAppendImpl<Lists...>::type;
|
||||
|
||||
namespace detail
|
||||
{
|
||||
@ -370,7 +341,7 @@ struct ListAtImpl<vtkm::List<Ts...>, Index>
|
||||
/// This becomes the type of the list at the given index.
|
||||
///
|
||||
template <typename List, vtkm::IdComponent Index>
|
||||
using ListAt = typename detail::ListAtImpl<internal::AsList<List>, Index>::type;
|
||||
using ListAt = typename detail::ListAtImpl<List, Index>::type;
|
||||
|
||||
namespace detail
|
||||
{
|
||||
@ -573,7 +544,7 @@ struct ListIndexOfImpl<vtkm::ListUniversal, Target>
|
||||
/// given type is not in the list, the value is set to -1.
|
||||
///
|
||||
template <typename List, typename T>
|
||||
using ListIndexOf = typename detail::ListIndexOfImpl<internal::AsList<List>, T>::type;
|
||||
using ListIndexOf = typename detail::ListIndexOfImpl<List, T>::type;
|
||||
|
||||
namespace detail
|
||||
{
|
||||
@ -597,7 +568,7 @@ struct ListHasImpl<vtkm::ListUniversal, T>
|
||||
/// Becomes `std::true_type` if the `T` is in `List`. `std::false_type` otherwise.
|
||||
///
|
||||
template <typename List, typename T>
|
||||
using ListHas = typename detail::ListHasImpl<internal::AsList<List>, T>::type;
|
||||
using ListHas = typename detail::ListHasImpl<List, T>::type;
|
||||
|
||||
namespace detail
|
||||
{
|
||||
@ -618,7 +589,7 @@ struct ListTransformImpl<vtkm::ListUniversal, Target>;
|
||||
/// Constructs a list containing all types in a source list applied to a transform template.
|
||||
///
|
||||
template <typename List, template <typename> class Transform>
|
||||
using ListTransform = typename detail::ListTransformImpl<internal::AsList<List>, Transform>::type;
|
||||
using ListTransform = typename detail::ListTransformImpl<List, Transform>::type;
|
||||
|
||||
namespace detail
|
||||
{
|
||||
@ -700,7 +671,7 @@ struct ListRemoveIfImpl<vtkm::List<Ts...>, Predicate>
|
||||
/// `std::is_integral<float>` and `std::is_integral<double>` resolve to `std::false_type`.
|
||||
///
|
||||
template <typename List, template <typename> class Predicate>
|
||||
using ListRemoveIf = typename detail::ListRemoveIfImpl<internal::AsList<List>, Predicate>::type;
|
||||
using ListRemoveIf = typename detail::ListRemoveIfImpl<List, Predicate>::type;
|
||||
|
||||
namespace detail
|
||||
{
|
||||
@ -738,50 +709,27 @@ struct ListIntersectImpl<vtkm::ListUniversal, vtkm::ListUniversal>
|
||||
/// Constructs a list containing types present in all lists.
|
||||
///
|
||||
template <typename List1, typename List2>
|
||||
using ListIntersect =
|
||||
typename detail::ListIntersectImpl<internal::AsList<List1>, internal::AsList<List2>>::type;
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
// We want to use an initializer list as a trick to call a function once for each type, but
|
||||
// an initializer list needs a type, so create wrapper function that returns a value.
|
||||
VTKM_SUPPRESS_EXEC_WARNINGS
|
||||
template <typename Functor, typename... Args>
|
||||
VTKM_EXEC_CONT inline bool ListForEachCallThrough(Functor&& f, Args&&... args)
|
||||
{
|
||||
f(std::forward<Args>(args)...);
|
||||
return false; // Return value does not matter. Hopefully just thrown away.
|
||||
}
|
||||
|
||||
VTKM_SUPPRESS_EXEC_WARNINGS
|
||||
template <typename Functor, typename... Ts, typename... Args>
|
||||
VTKM_EXEC_CONT void ListForEachImpl(Functor&& f, vtkm::List<Ts...>, Args&&... args)
|
||||
{
|
||||
VTKM_STATIC_ASSERT_MSG((!std::is_same<vtkm::List<Ts...>, vtkm::ListUniversal>::value),
|
||||
"Cannot call ListFor on vtkm::ListUniversal.");
|
||||
auto init_list = { ListForEachCallThrough(
|
||||
std::forward<Functor>(f), Ts{}, std::forward<Args>(args)...)... };
|
||||
(void)init_list;
|
||||
}
|
||||
|
||||
template <typename Functor, typename... Args>
|
||||
VTKM_EXEC_CONT void ListForEachImpl(Functor&&, vtkm::ListEmpty, Args&&...)
|
||||
{
|
||||
// No types to run functor on.
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
using ListIntersect = typename detail::ListIntersectImpl<List1, List2>::type;
|
||||
|
||||
///@{
|
||||
/// For each typename represented by the list, call the functor with a
|
||||
/// default instance of that type.
|
||||
///
|
||||
template <typename Functor, typename List, typename... Args>
|
||||
VTKM_EXEC_CONT void ListForEach(Functor&& f, List, Args&&... args)
|
||||
VTKM_SUPPRESS_EXEC_WARNINGS
|
||||
template <typename Functor, typename... Ts, typename... Args>
|
||||
VTKM_EXEC_CONT void ListForEach(Functor&& f, vtkm::List<Ts...>, Args&&... args)
|
||||
{
|
||||
detail::ListForEachImpl(
|
||||
std::forward<Functor>(f), internal::AsList<List>{}, std::forward<Args>(args)...);
|
||||
VTKM_STATIC_ASSERT_MSG((!std::is_same<vtkm::List<Ts...>, vtkm::ListUniversal>::value),
|
||||
"Cannot call ListFor on vtkm::ListUniversal.");
|
||||
auto init_list = { (f(Ts{}, std::forward<Args>(args)...), false)... };
|
||||
(void)init_list;
|
||||
}
|
||||
template <typename Functor, typename... Args>
|
||||
VTKM_EXEC_CONT void ListForEach(Functor&&, vtkm::ListEmpty, Args&&...)
|
||||
{
|
||||
// No types to run functor on.
|
||||
}
|
||||
///@}
|
||||
|
||||
namespace detail
|
||||
{
|
||||
@ -808,8 +756,7 @@ struct ListCrossImpl<vtkm::List<T0s...>, vtkm::List<T1s...>>
|
||||
/// The resulting list has the form of `vtkm::List<vtkm::List<A1,B1>, vtkm::List<A1,B2>,...>`
|
||||
///
|
||||
template <typename List1, typename List2>
|
||||
using ListCross =
|
||||
typename detail::ListCrossImpl<internal::AsList<List1>, internal::AsList<List2>>::type;
|
||||
using ListCross = typename detail::ListCrossImpl<List1, List2>::type;
|
||||
|
||||
namespace detail
|
||||
{
|
||||
@ -865,7 +812,7 @@ struct ListReduceImpl<vtkm::List<T0, T1, T2, T3, T4, T5, T6, T7, T8, Ts...>, Ope
|
||||
/// This continues until a single value is left.
|
||||
///
|
||||
template <typename List, template <typename T1, typename T2> class Operator, typename Initial>
|
||||
using ListReduce = typename detail::ListReduceImpl<internal::AsList<List>, Operator, Initial>::type;
|
||||
using ListReduce = typename detail::ListReduceImpl<List, Operator, Initial>::type;
|
||||
|
||||
/// \brief Determines whether all the types in the list are "true."
|
||||
///
|
||||
|
327
vtkm/ListTag.h
327
vtkm/ListTag.h
@ -1,327 +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_ListTag_h
|
||||
#define vtk_m_ListTag_h
|
||||
|
||||
#include <vtkm/Deprecated.h>
|
||||
|
||||
#include <vtkm/List.h>
|
||||
|
||||
#include <vtkm/StaticAssert.h>
|
||||
#include <vtkm/internal/ExportMacros.h>
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
struct VTKM_DEPRECATED(1.6, "ListTag.h is deprecated. Include List.h and use vtkm::List instead.")
|
||||
VTKmListTagHeaderDeprecationWarning
|
||||
{
|
||||
};
|
||||
|
||||
inline VTKmListTagHeaderDeprecationWarning IssueVTKmListTagHeaderDeprecationWarning()
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
/// Base class that all ListTag classes inherit from. Helps identify lists
|
||||
/// in macros like VTKM_IS_LIST_TAG.
|
||||
///
|
||||
struct ListRoot
|
||||
{
|
||||
};
|
||||
|
||||
template <class... T>
|
||||
using ListBase = vtkm::List<T...>;
|
||||
|
||||
/// list value that is used to represent a list actually matches all values
|
||||
struct UniversalTag
|
||||
{
|
||||
//We never want this tag constructed, and by deleting the constructor
|
||||
//we get an error when trying to use this class with ForEach.
|
||||
UniversalTag() = delete;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/// A basic tag for a list of typenames. This struct can be subclassed
|
||||
/// and still behave like a list tag.
|
||||
/// @cond NONE
|
||||
template <typename... ArgTypes>
|
||||
struct VTKM_DEPRECATED(1.6, "ListTagBase replace by List. Note that List cannot be subclassed.")
|
||||
ListTagBase : detail::ListRoot
|
||||
{
|
||||
using list = detail::ListBase<ArgTypes...>;
|
||||
};
|
||||
/// @endcond
|
||||
|
||||
/// A special tag for a list that represents holding all potential values
|
||||
///
|
||||
/// Note: Can not be used with ForEach for obvious reasons.
|
||||
/// @cond NONE
|
||||
struct VTKM_DEPRECATED(
|
||||
1.6,
|
||||
"ListTagUniversal replaced by ListUniversal. Note that ListUniversal cannot be subclassed.")
|
||||
ListTagUniversal : detail::ListRoot
|
||||
{
|
||||
using list = vtkm::detail::ListBase<vtkm::detail::UniversalTag>;
|
||||
};
|
||||
/// @endcond
|
||||
|
||||
namespace internal
|
||||
{
|
||||
|
||||
/// @cond NONE
|
||||
template <typename ListTag>
|
||||
struct ListTagCheck : std::is_base_of<vtkm::detail::ListRoot, ListTag>
|
||||
{
|
||||
static constexpr bool Valid = std::is_base_of<vtkm::detail::ListRoot, ListTag>::value;
|
||||
};
|
||||
/// @endcond
|
||||
|
||||
} // namespace internal
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
/// @cond NONE
|
||||
template <typename ListTag>
|
||||
struct VTKM_DEPRECATED(1.6, "VTKM_IS_LIST_TAG replaced with VTKM_IS_LIST.") ListTagAssert
|
||||
: internal::IsList<ListTag>
|
||||
{
|
||||
};
|
||||
/// @endcond
|
||||
|
||||
} // namespace detal
|
||||
|
||||
/// Checks that the argument is a proper list tag. This is a handy concept
|
||||
/// check for functions and classes to make sure that a template argument is
|
||||
/// actually a device adapter tag. (You can get weird errors elsewhere in the
|
||||
/// code when a mistake is made.)
|
||||
///
|
||||
#define VTKM_IS_LIST_TAG(tag) \
|
||||
VTKM_STATIC_ASSERT_MSG((::vtkm::detail::ListTagAssert<tag>::value), \
|
||||
"Provided type is not a valid VTK-m list tag.")
|
||||
|
||||
namespace internal
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
/// @cond NONE
|
||||
template <typename ListTag>
|
||||
struct ListTagAsListImpl
|
||||
{
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
VTKM_IS_LIST_TAG(ListTag);
|
||||
using type = typename ListTag::list;
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
};
|
||||
/// @endcond
|
||||
|
||||
} // namespace detail
|
||||
|
||||
/// Converts a ListTag to a vtkm::List.
|
||||
///
|
||||
template <typename ListTag>
|
||||
using ListTagAsList = typename detail::ListTagAsListImpl<ListTag>::type;
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
namespace detail
|
||||
{
|
||||
|
||||
// Could use ListApply instead, but that causes deprecation warnings.
|
||||
template <typename List>
|
||||
struct ListAsListTagImpl;
|
||||
template <typename... Ts>
|
||||
struct ListAsListTagImpl<vtkm::List<Ts...>>
|
||||
{
|
||||
using type = vtkm::ListTagBase<Ts...>;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template <typename List>
|
||||
using ListAsListTag = typename detail::ListAsListTagImpl<List>::type;
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
|
||||
// This allows the new `List` operations work on `ListTag`s.
|
||||
template <typename T>
|
||||
struct AsListImpl
|
||||
{
|
||||
VTKM_STATIC_ASSERT_MSG(ListTagCheck<T>::value,
|
||||
"Attempted to use something that is not a List with a List operation.");
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
using type = typename std::conditional<std::is_base_of<vtkm::ListTagUniversal, T>::value,
|
||||
vtkm::ListUniversal,
|
||||
ListTagAsList<T>>::type;
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
};
|
||||
|
||||
} // namespace internal
|
||||
|
||||
|
||||
/// \brief Applies the list of types to a template.
|
||||
///
|
||||
/// Given a ListTag and a templated class, returns the class instantiated with the types
|
||||
/// represented by the ListTag.
|
||||
///
|
||||
template <typename ListTag, template <typename...> class Target>
|
||||
using ListTagApply VTKM_DEPRECATED(1.6, "ListTagApply replaced by ListApply.") =
|
||||
vtkm::ListApply<ListTag, Target>;
|
||||
|
||||
/// A special tag for an empty list.
|
||||
///
|
||||
/// @cond NONE
|
||||
struct VTKM_DEPRECATED(
|
||||
1.6,
|
||||
"ListTagEmpty replaced by ListEmpty. Note that ListEmpty cannot be subclassed.") ListTagEmpty
|
||||
: detail::ListRoot
|
||||
{
|
||||
using list = vtkm::detail::ListBase<>;
|
||||
};
|
||||
/// @endcond
|
||||
|
||||
/// A tag that is a construction of two other tags joined together. This struct
|
||||
/// can be subclassed and still behave like a list tag.
|
||||
/// @cond NONE
|
||||
template <typename... ListTags>
|
||||
struct VTKM_DEPRECATED(
|
||||
1.6,
|
||||
"ListTagJoin replaced by ListAppend. Note that ListAppend cannot be subclassed.") ListTagJoin
|
||||
: vtkm::internal::ListAsListTag<vtkm::ListAppend<ListTags...>>
|
||||
{
|
||||
};
|
||||
/// @endcond
|
||||
|
||||
|
||||
/// A tag that is constructed by appending \c Type to \c ListTag.
|
||||
/// @cond NONE
|
||||
template <typename ListTag, typename Type>
|
||||
struct VTKM_DEPRECATED(1.6,
|
||||
"ListTagAppend<List, Type> replaced by ListAppend<List, vtkm::List<Type>. "
|
||||
"Note that ListAppend cannot be subclassed.") ListTagAppend
|
||||
: vtkm::internal::ListAsListTag<vtkm::ListAppend<ListTag, vtkm::List<Type>>>
|
||||
{
|
||||
};
|
||||
/// @endcond
|
||||
|
||||
/// Append \c Type to \c ListTag only if \c ListTag does not already contain \c Type.
|
||||
/// No checks are performed to see if \c ListTag itself has only unique elements.
|
||||
/// @cond NONE
|
||||
template <typename ListTag, typename Type>
|
||||
struct VTKM_DEPRECATED(1.6) ListTagAppendUnique
|
||||
: std::conditional<
|
||||
vtkm::ListHas<ListTag, Type>::value,
|
||||
vtkm::internal::ListAsListTag<vtkm::internal::AsList<ListTag>>,
|
||||
vtkm::internal::ListAsListTag<vtkm::ListAppend<ListTag, vtkm::List<Type>>>>::type
|
||||
{
|
||||
};
|
||||
/// @endcond
|
||||
|
||||
/// A tag that consists of elements that are found in both tags. This struct
|
||||
/// can be subclassed and still behave like a list tag.
|
||||
/// @cond NONE
|
||||
template <typename ListTag1, typename ListTag2>
|
||||
struct VTKM_DEPRECATED(
|
||||
1.6,
|
||||
"ListTagIntersect replaced by ListIntersect. Note that ListIntersect cannot be subclassed.")
|
||||
ListTagIntersect : vtkm::internal::ListAsListTag<vtkm::ListIntersect<ListTag1, ListTag2>>
|
||||
{
|
||||
};
|
||||
/// @endcond
|
||||
|
||||
/// A list tag that consists of each item in another list tag fed into a template that takes
|
||||
/// a single parameter.
|
||||
/// @cond NONE
|
||||
template <typename ListTag, template <typename> class Transform>
|
||||
struct VTKM_DEPRECATED(
|
||||
1.6,
|
||||
"ListTagTransform replaced by ListTransform. Note that ListTransform cannot be subclassed.")
|
||||
ListTagTransform : vtkm::internal::ListAsListTag<vtkm::ListTransform<ListTag, Transform>>
|
||||
{
|
||||
};
|
||||
/// @endcond
|
||||
|
||||
/// A list tag that takes an existing ListTag and a predicate template that is applied to
|
||||
/// each type in the ListTag. Any type in the ListTag that has a value element equal to true
|
||||
/// (the equivalent of std::true_type), that item will be removed from the list. For example
|
||||
/// the following type
|
||||
///
|
||||
/// ```cpp
|
||||
/// vtkm::ListTagRemoveIf<vtkm::ListTagBase<int, float, long long, double>, std::is_integral>
|
||||
/// ```
|
||||
///
|
||||
/// resolves to a ListTag that is equivalent to `vtkm::ListTag<float, double>` because
|
||||
/// `std::is_integral<int>` and `std::is_integral<long long>` resolve to `std::true_type`
|
||||
/// whereas `std::is_integral<float>` and `std::is_integral<double>` resolve to
|
||||
/// `std::false_type`.
|
||||
/// @cond NONE
|
||||
template <typename ListTag, template <typename> class Predicate>
|
||||
struct VTKM_DEPRECATED(
|
||||
1.6,
|
||||
"ListTagRemoveIf replaced by ListRemoveIf. Note that ListRemoveIf cannot be subclassed.")
|
||||
ListTagRemoveIf : vtkm::internal::ListAsListTag<vtkm::ListRemoveIf<ListTag, Predicate>>
|
||||
{
|
||||
};
|
||||
/// @endcond
|
||||
|
||||
/// Generate a tag that is the cross product of two other tags. The resulting
|
||||
/// tag has the form of Tag< vtkm::List<A1,B1>, vtkm::List<A1,B2> .... >
|
||||
///
|
||||
/// Note that as of VTK-m 1.8, the behavior of this (already depreciated) operation
|
||||
/// was changed to return pairs in vtkm::List instead of brigand::list.
|
||||
///
|
||||
/// @cond NONE
|
||||
template <typename ListTag1, typename ListTag2>
|
||||
struct VTKM_DEPRECATED(
|
||||
1.6,
|
||||
"ListCrossProduct replaced by ListCross. Note that ListCross cannot be subclassed.")
|
||||
ListCrossProduct : vtkm::internal::ListAsListTag<vtkm::ListCross<ListTag1, ListTag2>>
|
||||
{
|
||||
};
|
||||
/// @endcond
|
||||
|
||||
/// \brief Checks to see if the given \c Type is in the list pointed to by \c ListTag.
|
||||
///
|
||||
/// There is a static boolean named \c value that is set to true if the type is
|
||||
/// contained in the list and false otherwise.
|
||||
///
|
||||
/// @cond NONE
|
||||
template <typename ListTag, typename Type>
|
||||
struct VTKM_DEPRECATED(1.6, "ListContains replaced by ListHas.") ListContains
|
||||
: vtkm::ListHas<ListTag, Type>
|
||||
{
|
||||
};
|
||||
/// @endcond
|
||||
|
||||
/// \brief Finds the type at the given index.
|
||||
///
|
||||
/// This struct contains subtype \c type that resolves to the type at the given index.
|
||||
///
|
||||
template <typename ListTag, vtkm::IdComponent Index>
|
||||
struct VTKM_DEPRECATED(1.6, "ListTypeAt::type replaced by ListAt.") ListTypeAt
|
||||
{
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
VTKM_IS_LIST_TAG(ListTag);
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
using type = vtkm::ListAt<ListTag, Index>;
|
||||
};
|
||||
|
||||
} // namespace vtkm
|
||||
|
||||
#endif //vtk_m_ListTag_h
|
@ -1,115 +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_TypeListTag_h
|
||||
#define vtk_m_TypeListTag_h
|
||||
|
||||
// Everything in this header file is deprecated and movded to TypeList.h.
|
||||
#include <vtkm/Deprecated.h>
|
||||
|
||||
struct VTKM_DEPRECATED(1.6, "TypeListTag.h is deprecated. Include TypeList.h and use vtkm::TypeList* instead.")
|
||||
VTKmTypeListTagHeaderDeprecationWarning
|
||||
{
|
||||
};
|
||||
|
||||
inline VTKmTypeListTagHeaderDeprecationWarning IssueVTKmTypeListTagHeaderDeprecationWarning()
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
#ifndef VTKM_DEFAULT_TYPE_LIST_TAG
|
||||
#define VTKM_DEFAULT_TYPE_LIST_TAG ::vtkm::internal::TypeListTagDefault
|
||||
#endif
|
||||
|
||||
#include <vtkm/ListTag.h>
|
||||
#include <vtkm/TypeList.h>
|
||||
|
||||
#define VTK_M_OLD_TYPE_LIST_DEFINITION(name) \
|
||||
struct VTKM_ALWAYS_EXPORT \
|
||||
VTKM_DEPRECATED( \
|
||||
1.6, \
|
||||
"TypeListTag" #name " replaced by TypeList" #name ". " \
|
||||
"Note that the new TypeList" #name " cannot be subclassed.") \
|
||||
TypeListTag ## name : vtkm::internal::ListAsListTag<TypeList ## name> \
|
||||
{ \
|
||||
}
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
|
||||
VTK_M_OLD_TYPE_LIST_DEFINITION(Id);
|
||||
VTK_M_OLD_TYPE_LIST_DEFINITION(Id2);
|
||||
VTK_M_OLD_TYPE_LIST_DEFINITION(Id3);
|
||||
VTK_M_OLD_TYPE_LIST_DEFINITION(IdComponent);
|
||||
VTK_M_OLD_TYPE_LIST_DEFINITION(Index);
|
||||
VTK_M_OLD_TYPE_LIST_DEFINITION(FieldScalar);
|
||||
VTK_M_OLD_TYPE_LIST_DEFINITION(FieldVec2);
|
||||
VTK_M_OLD_TYPE_LIST_DEFINITION(FieldVec3);
|
||||
VTK_M_OLD_TYPE_LIST_DEFINITION(FieldVec4);
|
||||
VTK_M_OLD_TYPE_LIST_DEFINITION(FloatVec);
|
||||
VTK_M_OLD_TYPE_LIST_DEFINITION(Field);
|
||||
VTK_M_OLD_TYPE_LIST_DEFINITION(ScalarAll);
|
||||
VTK_M_OLD_TYPE_LIST_DEFINITION(VecCommon);
|
||||
VTK_M_OLD_TYPE_LIST_DEFINITION(VecAll);
|
||||
VTK_M_OLD_TYPE_LIST_DEFINITION(All);
|
||||
VTK_M_OLD_TYPE_LIST_DEFINITION(Common);
|
||||
|
||||
namespace internal
|
||||
{
|
||||
|
||||
VTK_M_OLD_TYPE_LIST_DEFINITION(VecUncommon);
|
||||
|
||||
// Special definition of TypeListTagCommon to give descriptive warning when
|
||||
// VTKM_DEFAULT_TYPE_LIST_TAG is used.
|
||||
/// @cond NONE
|
||||
struct VTKM_ALWAYS_EXPORT
|
||||
VTKM_DEPRECATED(
|
||||
1.6,
|
||||
"VTKM_DEFAULT_TYPE_LIST_TAG replaced by VTKM_DEFAULT_TYPE_LIST. "
|
||||
"Note that the new VTKM_DEFAULT_TYPE_LIST cannot be subclassed.")
|
||||
TypeListTagDefault : vtkm::internal::ListAsListTag<vtkm::TypeListCommon>
|
||||
{
|
||||
};
|
||||
/// @endcond
|
||||
|
||||
} // namespace internal
|
||||
|
||||
// Special implementation of ListContains for TypeListTagAll to always be
|
||||
// true. Although TypeListTagAll is necessarily finite, the point is to
|
||||
// be all inclusive. Besides, this should speed up the compilation when
|
||||
// checking a list that should contain everything.
|
||||
template<typename Type>
|
||||
struct ListContains<vtkm::TypeListTagAll, Type>
|
||||
{
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
|
||||
// Special implementation of ListHas for TypeListTagAll to always be
|
||||
// true. Although TypeListTagAll is necessarily finite, the point is to
|
||||
// be all inclusive. Besides, this should speed up the compilation when
|
||||
// checking a list that should contain everything.
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template<typename Type>
|
||||
struct ListHasImpl<vtkm::TypeListTagAll, Type>
|
||||
{
|
||||
using type = std::true_type;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
} // namespace vtkm
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
#undef VTK_M_OLD_TYPE_LIST_DEFINITION
|
||||
|
||||
#endif //vtk_m_TypeListTag_h
|
@ -17,8 +17,6 @@
|
||||
#include <vtkm/cont/Logging.h>
|
||||
#include <vtkm/cont/UnknownArrayHandle.h>
|
||||
|
||||
#include <vtkm/cont/internal/ArrayHandleDeprecated.h>
|
||||
|
||||
#include <vtkm/cont/vtkm_cont_export.h>
|
||||
|
||||
// TODO: When virtual arrays are available, compile the implementation in a .cxx/.cu file. Common
|
||||
@ -32,62 +30,20 @@ namespace cont
|
||||
namespace detail
|
||||
{
|
||||
|
||||
// Element-wise copy.
|
||||
template <typename InArrayType, typename OutArrayType>
|
||||
void ArrayCopyWithAlgorithm(const InArrayType& source, OutArrayType& destination)
|
||||
template <typename T1, typename S1, typename T2, typename S2>
|
||||
VTKM_CONT void ArrayCopyImpl(const vtkm::cont::ArrayHandle<T1, S1>& source,
|
||||
vtkm::cont::ArrayHandle<T2, S2>& destination)
|
||||
{
|
||||
VTKM_STATIC_ASSERT((!std::is_same<T1, T2>::value || !std::is_same<S1, S2>::value));
|
||||
|
||||
// Current implementation of Algorithm::Copy will first try to copy on devices where the
|
||||
// data is already available.
|
||||
vtkm::cont::Algorithm::Copy(source, destination);
|
||||
}
|
||||
|
||||
// TODO: Remove last argument once ArryHandleNewStyle becomes ArrayHandle
|
||||
template <typename InArrayType, typename OutArrayType>
|
||||
void ArrayCopyOldImpl(const InArrayType& in, OutArrayType& out, std::false_type /* Copy storage */)
|
||||
{
|
||||
ArrayCopyWithAlgorithm(in, out);
|
||||
}
|
||||
|
||||
// Copy storage for implicit arrays, must be of same type:
|
||||
// TODO: This will go away once ArrayHandleNewStyle becomes ArrayHandle.
|
||||
template <typename ArrayType>
|
||||
void ArrayCopyOldImpl(const ArrayType& in, ArrayType& out, std::true_type /* Copy storage */)
|
||||
{
|
||||
// This is only called if in/out are the same type and the handle is not
|
||||
// writable. This allows read-only implicit array handles to be copied.
|
||||
auto newStorage = in.GetStorage();
|
||||
out = ArrayType(newStorage);
|
||||
}
|
||||
|
||||
// TODO: This will go away once ArrayHandleNewStyle becomes ArrayHandle.
|
||||
template <typename InArrayType, typename OutArrayType>
|
||||
VTKM_CONT void ArrayCopyImpl(const InArrayType& source,
|
||||
OutArrayType& destination,
|
||||
std::false_type /* New style */)
|
||||
{
|
||||
using SameTypes = std::is_same<InArrayType, OutArrayType>;
|
||||
using IsWritable = vtkm::cont::internal::IsWritableArrayHandle<OutArrayType>;
|
||||
using JustCopyStorage = std::integral_constant<bool, SameTypes::value && !IsWritable::value>;
|
||||
ArrayCopyOldImpl(source, destination, JustCopyStorage{});
|
||||
}
|
||||
|
||||
// TODO: ArrayHandleNewStyle will eventually become ArrayHandle, in which case this
|
||||
// will become ArrayCopyWithAlgorithm
|
||||
template <typename T1, typename S1, typename T2, typename S2>
|
||||
VTKM_CONT void ArrayCopyImpl(const vtkm::cont::ArrayHandle<T1, S1>& source,
|
||||
vtkm::cont::ArrayHandle<T2, S2>& destination,
|
||||
std::true_type /* New style */)
|
||||
{
|
||||
VTKM_STATIC_ASSERT((!std::is_same<T1, T2>::value || !std::is_same<S1, S2>::value));
|
||||
ArrayCopyWithAlgorithm(source, destination);
|
||||
}
|
||||
|
||||
// TODO: ArrayHandleNewStyle will eventually become ArrayHandle, in which case this
|
||||
// will become the only version with the same array types.
|
||||
template <typename T, typename S>
|
||||
VTKM_CONT void ArrayCopyImpl(const vtkm::cont::ArrayHandle<T, S>& source,
|
||||
vtkm::cont::ArrayHandle<T, S>& destination,
|
||||
std::true_type /* New style */)
|
||||
vtkm::cont::ArrayHandle<T, S>& destination)
|
||||
{
|
||||
destination.DeepCopyFrom(source);
|
||||
}
|
||||
@ -137,12 +93,8 @@ VTKM_CONT void ArrayCopyDevice(const vtkm::cont::ArrayHandle<InValueType, InStor
|
||||
"Cannot copy to a read-only array with a different "
|
||||
"type than the source.");
|
||||
|
||||
using IsOldStyle =
|
||||
std::is_base_of<vtkm::cont::internal::ArrayHandleDeprecated<InValueType, InStorage>,
|
||||
InArrayType>;
|
||||
|
||||
// Static dispatch cases 1 & 2
|
||||
detail::ArrayCopyImpl(source, destination, std::integral_constant<bool, !IsOldStyle::value>{});
|
||||
detail::ArrayCopyImpl(source, destination);
|
||||
}
|
||||
|
||||
/// @}
|
||||
|
@ -43,45 +43,3 @@ VTKM_CONT bool ArrayHandleIsOnDevice(const std::vector<vtkm::cont::internal::Buf
|
||||
}
|
||||
}
|
||||
} // namespace vtkm::cont::detail
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
struct DeviceCheckFunctor
|
||||
{
|
||||
vtkm::cont::DeviceAdapterId FoundDevice = vtkm::cont::DeviceAdapterTagUndefined{};
|
||||
|
||||
VTKM_CONT void operator()(vtkm::cont::DeviceAdapterId device,
|
||||
const std::vector<vtkm::cont::internal::Buffer>& buffers)
|
||||
{
|
||||
if (this->FoundDevice == vtkm::cont::DeviceAdapterTagUndefined{})
|
||||
{
|
||||
if (vtkm::cont::detail::ArrayHandleIsOnDevice(buffers, device))
|
||||
{
|
||||
this->FoundDevice = device;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
|
||||
VTKM_CONT vtkm::cont::DeviceAdapterId ArrayHandleGetDeviceAdapterId(
|
||||
const std::vector<vtkm::cont::internal::Buffer>& buffers)
|
||||
{
|
||||
DeviceCheckFunctor functor;
|
||||
|
||||
vtkm::ListForEach(functor, VTKM_DEFAULT_DEVICE_ADAPTER_LIST{}, buffers);
|
||||
|
||||
return functor.FoundDevice;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace vtkm::cont::detail
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include <vtkm/cont/vtkm_cont_export.h>
|
||||
|
||||
#include <vtkm/Assert.h>
|
||||
#include <vtkm/Deprecated.h>
|
||||
#include <vtkm/Flags.h>
|
||||
#include <vtkm/Types.h>
|
||||
|
||||
@ -260,9 +259,6 @@ VTKM_CONT_EXPORT VTKM_CONT bool ArrayHandleIsOnDevice(
|
||||
const std::vector<vtkm::cont::internal::Buffer>& buffers,
|
||||
vtkm::cont::DeviceAdapterId device);
|
||||
|
||||
VTKM_CONT_EXPORT VTKM_CONT vtkm::cont::DeviceAdapterId ArrayHandleGetDeviceAdapterId(
|
||||
const std::vector<vtkm::cont::internal::Buffer>& buffers);
|
||||
|
||||
} // namespace detail
|
||||
|
||||
/// \brief Manages an array-worth of data.
|
||||
@ -298,19 +294,6 @@ public:
|
||||
using ReadPortalType = typename StorageType::ReadPortalType;
|
||||
using WritePortalType = typename StorageType::WritePortalType;
|
||||
|
||||
// TODO: Deprecate this
|
||||
template <typename Device>
|
||||
struct VTKM_DEPRECATED(1.6, "Use ReadPortalType and WritePortalType.") ExecutionTypes
|
||||
{
|
||||
using Portal = WritePortalType;
|
||||
using PortalConst = ReadPortalType;
|
||||
};
|
||||
|
||||
using PortalControl VTKM_DEPRECATED(1.6, "Use ArrayHandle::WritePortalType instead.") =
|
||||
WritePortalType;
|
||||
using PortalConstControl VTKM_DEPRECATED(1.6, "Use ArrayHandle::ReadPortalType instead.") =
|
||||
ReadPortalType;
|
||||
|
||||
/// Constructs an empty ArrayHandle.
|
||||
///
|
||||
VTKM_CONT ArrayHandle()
|
||||
@ -413,45 +396,10 @@ public:
|
||||
return true; // different valuetype and/or storage
|
||||
}
|
||||
|
||||
VTKM_DEPRECATED(1.9, "Use the size of the std::vector returned from GetBuffers.")
|
||||
VTKM_CONT constexpr vtkm::IdComponent GetNumberOfBuffers()
|
||||
{
|
||||
return static_cast<vtkm::IdComponent>(this->GetBuffers().size());
|
||||
}
|
||||
|
||||
/// Get the storage.
|
||||
///
|
||||
VTKM_CONT StorageType GetStorage() const { return StorageType{}; }
|
||||
|
||||
/// Get the array portal of the control array.
|
||||
/// Since worklet invocations are asynchronous and this routine is a synchronization point,
|
||||
/// exceptions maybe thrown for errors from previously executed worklets.
|
||||
///
|
||||
/// \deprecated Use `WritePortal` instead.
|
||||
///
|
||||
VTKM_CONT
|
||||
VTKM_DEPRECATED(1.6,
|
||||
"Use ArrayHandle::WritePortal() instead. "
|
||||
"Note that the returned portal will lock the array while it is in scope.")
|
||||
|
||||
/// \cond NOPE
|
||||
WritePortalType GetPortalControl() const { return this->WritePortal(); }
|
||||
/// \endcond
|
||||
|
||||
/// Get the array portal of the control array.
|
||||
/// Since worklet invocations are asynchronous and this routine is a synchronization point,
|
||||
/// exceptions maybe thrown for errors from previously executed worklets.
|
||||
///
|
||||
/// \deprecated Use `ReadPortal` instead.
|
||||
///
|
||||
VTKM_CONT
|
||||
VTKM_DEPRECATED(1.6,
|
||||
"Use ArrayHandle::ReadPortal() instead. "
|
||||
"Note that the returned portal will lock the array while it is in scope.")
|
||||
/// \cond NOPE
|
||||
ReadPortalType GetPortalConstControl() const { return this->ReadPortal(); }
|
||||
/// \endcond
|
||||
|
||||
///@{
|
||||
/// \brief Get an array portal that can be used in the control environment.
|
||||
///
|
||||
@ -572,12 +520,6 @@ public:
|
||||
}
|
||||
///@}
|
||||
|
||||
VTKM_DEPRECATED(1.6, "Use Allocate(n, vtkm::CopyFlag::On) instead of Shrink(n).")
|
||||
VTKM_CONT void Shrink(vtkm::Id numberOfValues)
|
||||
{
|
||||
this->Allocate(numberOfValues, vtkm::CopyFlag::On);
|
||||
}
|
||||
|
||||
/// @{
|
||||
/// \brief Fills the array with a given value.
|
||||
///
|
||||
@ -676,25 +618,6 @@ public:
|
||||
return StorageType::CreateWritePortal(this->GetBuffers(), device, token);
|
||||
}
|
||||
|
||||
VTKM_CONT VTKM_DEPRECATED(1.6, "PrepareForInput now requires a vtkm::cont::Token object.")
|
||||
ReadPortalType PrepareForInput(vtkm::cont::DeviceAdapterId device) const
|
||||
{
|
||||
vtkm::cont::Token token;
|
||||
return this->PrepareForInput(device, token);
|
||||
}
|
||||
VTKM_CONT VTKM_DEPRECATED(1.6, "PrepareForOutput now requires a vtkm::cont::Token object.")
|
||||
WritePortalType PrepareForOutput(vtkm::Id numberOfValues, vtkm::cont::DeviceAdapterId device)
|
||||
{
|
||||
vtkm::cont::Token token;
|
||||
return this->PrepareForOutput(numberOfValues, device, token);
|
||||
}
|
||||
VTKM_CONT VTKM_DEPRECATED(1.6, "PrepareForInPlace now requires a vtkm::cont::Token object.")
|
||||
WritePortalType PrepareForInPlace(vtkm::cont::DeviceAdapterId device) const
|
||||
{
|
||||
vtkm::cont::Token token;
|
||||
return this->PrepareForInPlace(device, token);
|
||||
}
|
||||
|
||||
/// Returns true if the ArrayHandle's data is on the given device. If the data are on the given
|
||||
/// device, then preparing for that device should not require any data movement.
|
||||
///
|
||||
@ -711,19 +634,6 @@ public:
|
||||
return this->IsOnDevice(vtkm::cont::DeviceAdapterTagUndefined{});
|
||||
}
|
||||
|
||||
/// Returns a DeviceAdapterId for a device currently allocated on. If there is no device
|
||||
/// with an up-to-date copy of the data, VTKM_DEVICE_ADAPTER_UNDEFINED is
|
||||
/// returned.
|
||||
///
|
||||
/// Note that in a multithreaded environment the validity of this result can
|
||||
/// change.
|
||||
///
|
||||
VTKM_CONT
|
||||
VTKM_DEPRECATED(1.7, "Use ArrayHandle::IsOnDevice.") DeviceAdapterId GetDeviceAdapterId() const
|
||||
{
|
||||
return detail::ArrayHandleGetDeviceAdapterId(this->Buffers);
|
||||
}
|
||||
|
||||
/// Synchronizes the control array with the execution array. If either the
|
||||
/// user array or control array is already valid, this method does nothing
|
||||
/// (because the data is already available in the control environment).
|
||||
|
@ -232,13 +232,6 @@ VTKM_CONT vtkm::cont::ArrayHandleBasic<T> make_ArrayHandle(const T* array,
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
VTKM_DEPRECATED(1.6, "Specify a vtkm::CopyFlag or use a move version of make_ArrayHandle.")
|
||||
VTKM_CONT vtkm::cont::ArrayHandleBasic<T> make_ArrayHandle(const T* array, vtkm::Id numberOfValues)
|
||||
{
|
||||
return make_ArrayHandle(array, numberOfValues, vtkm::CopyFlag::Off);
|
||||
}
|
||||
|
||||
/// A convenience function to move a user-allocated array into an `ArrayHandle`.
|
||||
/// The provided array pointer will be reset to `nullptr`.
|
||||
/// If the array was not allocated with the `new[]` operator, then deleter and reallocater
|
||||
@ -273,13 +266,6 @@ VTKM_CONT vtkm::cont::ArrayHandleBasic<T> make_ArrayHandle(const std::vector<T,
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T, typename Allocator>
|
||||
VTKM_DEPRECATED(1.6, "Specify a vtkm::CopyFlag or use a move version of make_ArrayHandle.")
|
||||
VTKM_CONT vtkm::cont::ArrayHandleBasic<T> make_ArrayHandle(const std::vector<T, Allocator>& array)
|
||||
{
|
||||
return make_ArrayHandle(array, vtkm::CopyFlag::Off);
|
||||
}
|
||||
|
||||
/// Move an std::vector into an ArrayHandle.
|
||||
///
|
||||
template <typename T, typename Allocator>
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include <vtkm/cont/ArrayExtractComponent.h>
|
||||
#include <vtkm/cont/ArrayHandle.h>
|
||||
|
||||
#include <vtkm/Deprecated.h>
|
||||
#include <vtkm/StaticAssert.h>
|
||||
#include <vtkm/Tuple.h>
|
||||
#include <vtkm/VecTraits.h>
|
||||
|
@ -10,7 +10,6 @@
|
||||
#ifndef vtk_m_cont_ArrayHandleConcatenate_h
|
||||
#define vtk_m_cont_ArrayHandleConcatenate_h
|
||||
|
||||
#include <vtkm/Deprecated.h>
|
||||
#include <vtkm/StaticAssert.h>
|
||||
|
||||
#include <vtkm/cont/ArrayHandle.h>
|
||||
@ -117,57 +116,14 @@ class VTKM_ALWAYS_EXPORT StorageTagConcatenate
|
||||
namespace internal
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template <typename T, typename ArrayOrStorage, bool IsArrayType>
|
||||
struct ConcatinateTypeArgImpl;
|
||||
|
||||
template <typename T, typename StorageTag_>
|
||||
struct ConcatinateTypeArgImpl<T, StorageTag_, false>
|
||||
{
|
||||
using StorageTag = StorageTag_;
|
||||
using Storage = vtkm::cont::internal::Storage<T, StorageTag>;
|
||||
using ArrayHandle = vtkm::cont::ArrayHandle<T, StorageTag>;
|
||||
};
|
||||
|
||||
template <typename T, typename Array>
|
||||
struct ConcatinateTypeArgImpl<T, Array, true>
|
||||
{
|
||||
VTKM_STATIC_ASSERT_MSG((std::is_same<T, typename Array::ValueType>::value),
|
||||
"Used array with wrong type in ArrayHandleConcatinate.");
|
||||
using StorageTag VTKM_DEPRECATED(
|
||||
1.6,
|
||||
"Use storage tags instead of array handles in StorageTagConcatenate.") =
|
||||
typename Array::StorageTag;
|
||||
using Storage VTKM_DEPRECATED(
|
||||
1.6,
|
||||
"Use storage tags instead of array handles in StorageTagConcatenate.") =
|
||||
vtkm::cont::internal::Storage<T, typename Array::StorageTag>;
|
||||
using ArrayHandle VTKM_DEPRECATED(
|
||||
1.6,
|
||||
"Use storage tags instead of array handles in StorageTagConcatenate.") =
|
||||
vtkm::cont::ArrayHandle<T, typename Array::StorageTag>;
|
||||
};
|
||||
|
||||
template <typename T, typename ArrayOrStorage>
|
||||
struct ConcatinateTypeArg
|
||||
: ConcatinateTypeArgImpl<T,
|
||||
ArrayOrStorage,
|
||||
vtkm::cont::internal::ArrayHandleCheck<ArrayOrStorage>::type::value>
|
||||
{
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template <typename T, typename ST1, typename ST2>
|
||||
class Storage<T, StorageTagConcatenate<ST1, ST2>>
|
||||
{
|
||||
using SourceStorage1 = typename detail::ConcatinateTypeArg<T, ST1>::Storage;
|
||||
using SourceStorage2 = typename detail::ConcatinateTypeArg<T, ST2>::Storage;
|
||||
using SourceStorage1 = vtkm::cont::internal::Storage<T, ST1>;
|
||||
using SourceStorage2 = vtkm::cont::internal::Storage<T, ST2>;
|
||||
|
||||
using ArrayHandleType1 = typename detail::ConcatinateTypeArg<T, ST1>::ArrayHandle;
|
||||
using ArrayHandleType2 = typename detail::ConcatinateTypeArg<T, ST2>::ArrayHandle;
|
||||
using ArrayHandleType1 = vtkm::cont::ArrayHandle<T, ST1>;
|
||||
using ArrayHandleType2 = vtkm::cont::ArrayHandle<T, ST2>;
|
||||
|
||||
struct Info
|
||||
{
|
||||
@ -338,9 +294,8 @@ struct SerializableTypeString<vtkm::cont::ArrayHandleConcatenate<AH1, AH2>>
|
||||
template <typename T, typename ST1, typename ST2>
|
||||
struct SerializableTypeString<
|
||||
vtkm::cont::ArrayHandle<T, vtkm::cont::StorageTagConcatenate<ST1, ST2>>>
|
||||
: SerializableTypeString<vtkm::cont::ArrayHandleConcatenate<
|
||||
typename internal::detail::ConcatinateTypeArg<T, ST1>::ArrayHandle,
|
||||
typename internal::detail::ConcatinateTypeArg<T, ST2>::ArrayHandle>>
|
||||
: SerializableTypeString<vtkm::cont::ArrayHandleConcatenate<vtkm::cont::ArrayHandle<T, ST1>,
|
||||
vtkm::cont::ArrayHandle<T, ST2>>>
|
||||
{
|
||||
};
|
||||
}
|
||||
@ -378,11 +333,11 @@ public:
|
||||
|
||||
template <typename T, typename ST1, typename ST2>
|
||||
struct Serialization<vtkm::cont::ArrayHandle<T, vtkm::cont::StorageTagConcatenate<ST1, ST2>>>
|
||||
: Serialization<vtkm::cont::ArrayHandleConcatenate<
|
||||
typename vtkm::cont::internal::detail::ConcatinateTypeArg<T, ST1>::ArrayHandle,
|
||||
typename vtkm::cont::internal::detail::ConcatinateTypeArg<T, ST2>::ArrayHandle>>
|
||||
: Serialization<vtkm::cont::ArrayHandleConcatenate<vtkm::cont::ArrayHandle<T, ST1>,
|
||||
vtkm::cont::ArrayHandle<T, ST2>>>
|
||||
{
|
||||
};
|
||||
|
||||
} // diy
|
||||
/// @endcond SERIALIZATION
|
||||
|
||||
|
@ -433,20 +433,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
/// \brief Converts a \c vtkm::ListTag to an \c ArrayHandleMultiplexer
|
||||
///
|
||||
/// The argument of this template must be a vtkm::ListTag and furthermore all the types in
|
||||
/// the list tag must be some type of \c ArrayHandle. The templated type gets aliased to
|
||||
/// an \c ArrayHandleMultiplexer that can store any of these ArrayHandle types.
|
||||
///
|
||||
/// Deprecated. Use `ArrayHandleMultiplexerFromList` instead.
|
||||
///
|
||||
template <typename ListTag>
|
||||
using ArrayHandleMultiplexerFromListTag VTKM_DEPRECATED(
|
||||
1.6,
|
||||
"vtkm::ListTag is no longer supported. Use vtkm::List instead.") =
|
||||
vtkm::ListApply<ListTag, ArrayHandleMultiplexer>;
|
||||
|
||||
/// \brief Converts a`vtkm::List` to an `ArrayHandleMultiplexer`
|
||||
///
|
||||
/// The argument of this template must be a `vtkm::List` and furthermore all the types in
|
||||
|
@ -16,8 +16,6 @@
|
||||
#include <vtkm/cont/ErrorBadType.h>
|
||||
#include <vtkm/cont/ErrorBadValue.h>
|
||||
|
||||
#include <vtkm/Deprecated.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
@ -81,50 +79,13 @@ class VTKM_ALWAYS_EXPORT StorageTagReverse
|
||||
namespace internal
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template <typename T, typename ArrayOrStorage, bool IsArrayType>
|
||||
struct ReverseTypeArgImpl;
|
||||
|
||||
template <typename T, typename Storage>
|
||||
struct ReverseTypeArgImpl<T, Storage, false>
|
||||
{
|
||||
using StorageTag = Storage;
|
||||
using ArrayHandle = vtkm::cont::ArrayHandle<T, StorageTag>;
|
||||
};
|
||||
|
||||
template <typename T, typename Array>
|
||||
struct ReverseTypeArgImpl<T, Array, true>
|
||||
{
|
||||
VTKM_STATIC_ASSERT_MSG((std::is_same<T, typename Array::ValueType>::value),
|
||||
"Used array with wrong type in ArrayHandleReverse.");
|
||||
using StorageTag VTKM_DEPRECATED(
|
||||
1.6,
|
||||
"Use storage tag instead of array handle in StorageTagReverse.") = typename Array::StorageTag;
|
||||
using ArrayHandle VTKM_DEPRECATED(
|
||||
1.6,
|
||||
"Use storage tag instead of array handle in StorageTagReverse.") =
|
||||
vtkm::cont::ArrayHandle<T, typename Array::StorageTag>;
|
||||
};
|
||||
|
||||
template <typename T, typename ArrayOrStorage>
|
||||
struct ReverseTypeArg
|
||||
: ReverseTypeArgImpl<T,
|
||||
ArrayOrStorage,
|
||||
vtkm::cont::internal::ArrayHandleCheck<ArrayOrStorage>::type::value>
|
||||
{
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template <typename T, typename ST>
|
||||
class Storage<T, StorageTagReverse<ST>>
|
||||
{
|
||||
using SourceStorage = Storage<T, typename detail::ReverseTypeArg<T, ST>::StorageTag>;
|
||||
using SourceStorage = Storage<T, ST>;
|
||||
|
||||
public:
|
||||
using ArrayHandleType = typename detail::ReverseTypeArg<T, ST>::ArrayHandle;
|
||||
using ArrayHandleType = vtkm::cont::ArrayHandle<T, ST>;
|
||||
using ReadPortalType = ArrayPortalReverse<typename ArrayHandleType::ReadPortalType>;
|
||||
using WritePortalType = ArrayPortalReverse<typename ArrayHandleType::WritePortalType>;
|
||||
|
||||
|
@ -328,24 +328,6 @@ public:
|
||||
VTKM_STATIC_ASSERT(sizeof...(RemainingVectors) + 1 == NUM_COMPONENTS);
|
||||
}
|
||||
|
||||
// This only works if all the templated arguments are of type std::vector<ComponentType>.
|
||||
template <typename... RemainingVectors>
|
||||
#ifndef VTKM_MSVC
|
||||
// For some reason, having VTKM_DEPRECATED here is causing a syntax error in some MSVC
|
||||
// compilers.
|
||||
VTKM_DEPRECATED(1.6, "Specify a vtkm::CopyFlag or use a move version of make_ArrayHandle.")
|
||||
#endif
|
||||
ArrayHandleSOA(const std::vector<ComponentType>& vector0,
|
||||
const RemainingVectors&... componentVectors)
|
||||
: Superclass(std::vector<vtkm::cont::internal::Buffer>{
|
||||
vtkm::cont::make_ArrayHandle(vector0, vtkm::CopyFlag::Off).GetBuffers()[0],
|
||||
vtkm::cont::make_ArrayHandle(std::forward<RemainingVectors>(componentVectors),
|
||||
vtkm::CopyFlag::Off)
|
||||
.GetBuffers()[0]... })
|
||||
{
|
||||
VTKM_STATIC_ASSERT(sizeof...(RemainingVectors) + 1 == NUM_COMPONENTS);
|
||||
}
|
||||
|
||||
ArrayHandleSOA(std::initializer_list<const ComponentType*> componentArrays,
|
||||
vtkm::Id length,
|
||||
vtkm::CopyFlag copy)
|
||||
@ -360,20 +342,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
VTKM_DEPRECATED(1.6, "Specify a vtkm::CopyFlag or use a move version of make_ArrayHandle.")
|
||||
ArrayHandleSOA(std::initializer_list<const ComponentType*> componentArrays, vtkm::Id length)
|
||||
{
|
||||
VTKM_ASSERT(componentArrays.size() == NUM_COMPONENTS);
|
||||
vtkm::IdComponent componentIndex = 0;
|
||||
for (auto&& vectorIter = componentArrays.begin(); vectorIter != componentArrays.end();
|
||||
++vectorIter)
|
||||
{
|
||||
this->SetArray(componentIndex,
|
||||
vtkm::cont::make_ArrayHandle(*vectorIter, length, vtkm::CopyFlag::Off));
|
||||
++componentIndex;
|
||||
}
|
||||
}
|
||||
|
||||
// This only works if all the templated arguments are of type std::vector<ComponentType>.
|
||||
template <typename... RemainingArrays>
|
||||
ArrayHandleSOA(vtkm::Id length,
|
||||
@ -387,24 +355,6 @@ public:
|
||||
VTKM_STATIC_ASSERT(sizeof...(RemainingArrays) + 1 == NUM_COMPONENTS);
|
||||
}
|
||||
|
||||
// This only works if all the templated arguments are of type std::vector<ComponentType>.
|
||||
template <typename... RemainingArrays>
|
||||
#ifndef VTKM_MSVC
|
||||
// For some reason, having VTKM_DEPRECATED here is causing a syntax error in some MSVC
|
||||
// compilers.
|
||||
VTKM_DEPRECATED(1.6, "Specify a vtkm::CopyFlag or use a move version of make_ArrayHandle.")
|
||||
#endif
|
||||
ArrayHandleSOA(vtkm::Id length,
|
||||
const ComponentType* array0,
|
||||
const RemainingArrays&... componentArrays)
|
||||
: Superclass(std::vector<vtkm::cont::internal::Buffer>{
|
||||
vtkm::cont::make_ArrayHandle(array0, length, vtkm::CopyFlag::Off).GetBuffers()[0],
|
||||
vtkm::cont::make_ArrayHandle(componentArrays, length, vtkm::CopyFlag::Off)
|
||||
.GetBuffers()[0]... })
|
||||
{
|
||||
VTKM_STATIC_ASSERT(sizeof...(RemainingArrays) + 1 == NUM_COMPONENTS);
|
||||
}
|
||||
|
||||
VTKM_CONT vtkm::cont::ArrayHandleBasic<ComponentType> GetArray(vtkm::IdComponent index) const
|
||||
{
|
||||
return ComponentArrayType({ this->GetBuffers()[index] });
|
||||
@ -471,19 +421,6 @@ VTKM_CONT
|
||||
vtkm::cont::make_ArrayHandle(std::forward<RemainingVectors>(componentVectors), copy)...);
|
||||
}
|
||||
|
||||
template <typename ComponentType, typename... RemainingVectors>
|
||||
VTKM_DEPRECATED(1.6, "Specify a vtkm::CopyFlag or use a move version of make_ArrayHandle.")
|
||||
VTKM_CONT ArrayHandleSOA<
|
||||
vtkm::Vec<ComponentType,
|
||||
vtkm::IdComponent(sizeof...(RemainingVectors) +
|
||||
1)>> make_ArrayHandleSOA(const std::vector<ComponentType>& vector0,
|
||||
const RemainingVectors&... componentVectors)
|
||||
{
|
||||
return ArrayHandleSOA<
|
||||
vtkm::Vec<ComponentType, vtkm::IdComponent(sizeof...(RemainingVectors) + 1)>>(
|
||||
vector0, componentVectors...);
|
||||
}
|
||||
|
||||
// This only works if all the templated arguments are rvalues of std::vector<ComponentType>.
|
||||
template <typename ComponentType, typename... RemainingVectors>
|
||||
VTKM_CONT
|
||||
@ -505,16 +442,6 @@ VTKM_CONT ArrayHandleSOA<ValueType> make_ArrayHandleSOA(
|
||||
return ArrayHandleSOA<ValueType>(std::move(componentVectors), length, copy);
|
||||
}
|
||||
|
||||
template <typename ValueType>
|
||||
VTKM_DEPRECATED(1.6, "Specify a vtkm::CopyFlag or use a move version of make_ArrayHandle.")
|
||||
VTKM_CONT ArrayHandleSOA<ValueType> make_ArrayHandleSOA(
|
||||
std::initializer_list<const typename vtkm::VecTraits<ValueType>::ComponentType*>&&
|
||||
componentVectors,
|
||||
vtkm::Id length)
|
||||
{
|
||||
return vtkm::cont::make_ArrayHandleSOA(std::move(componentVectors), length, vtkm::CopyFlag::Off);
|
||||
}
|
||||
|
||||
// This only works if all the templated arguments are of type std::vector<ComponentType>.
|
||||
template <typename ComponentType, typename... RemainingArrays>
|
||||
VTKM_CONT
|
||||
@ -529,20 +456,6 @@ VTKM_CONT
|
||||
length, copy, array0, componentArrays...);
|
||||
}
|
||||
|
||||
template <typename ComponentType, typename... RemainingArrays>
|
||||
VTKM_DEPRECATED(1.6, "Specify a vtkm::CopyFlag or use a move version of make_ArrayHandle.")
|
||||
VTKM_CONT ArrayHandleSOA<
|
||||
vtkm::Vec<ComponentType,
|
||||
vtkm::IdComponent(sizeof...(RemainingArrays) +
|
||||
1)>> make_ArrayHandleSOA(vtkm::Id length,
|
||||
const ComponentType* array0,
|
||||
const RemainingArrays*... componentArrays)
|
||||
{
|
||||
return ArrayHandleSOA<
|
||||
vtkm::Vec<ComponentType, vtkm::IdComponent(sizeof...(RemainingArrays) + 1)>>(
|
||||
length, array0, componentArrays...);
|
||||
}
|
||||
|
||||
namespace internal
|
||||
{
|
||||
|
||||
|
@ -11,7 +11,6 @@
|
||||
#define vtk_m_cont_ArrayHandleView_h
|
||||
|
||||
#include <vtkm/Assert.h>
|
||||
#include <vtkm/Deprecated.h>
|
||||
|
||||
#include <vtkm/cont/ArrayExtractComponent.h>
|
||||
#include <vtkm/cont/ArrayHandle.h>
|
||||
@ -101,46 +100,10 @@ struct VTKM_ALWAYS_EXPORT StorageTagView
|
||||
namespace internal
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template <typename T, typename ArrayOrStorage, bool IsArrayType>
|
||||
struct ViewTypeArgImpl;
|
||||
|
||||
template <typename T, typename Storage>
|
||||
struct ViewTypeArgImpl<T, Storage, false>
|
||||
{
|
||||
using StorageTag = Storage;
|
||||
using ArrayHandle = vtkm::cont::ArrayHandle<T, StorageTag>;
|
||||
};
|
||||
|
||||
template <typename T, typename Array>
|
||||
struct ViewTypeArgImpl<T, Array, true>
|
||||
{
|
||||
VTKM_STATIC_ASSERT_MSG((std::is_same<T, typename Array::ValueType>::value),
|
||||
"Used array with wrong type in ArrayHandleView.");
|
||||
using StorageTag VTKM_DEPRECATED(1.6,
|
||||
"Use storage tag instead of array handle in StorageTagView.") =
|
||||
typename Array::StorageTag;
|
||||
using ArrayHandle VTKM_DEPRECATED(1.6,
|
||||
"Use storage tag instead of array handle in StorageTagView.") =
|
||||
vtkm::cont::ArrayHandle<T, typename Array::StorageTag>;
|
||||
};
|
||||
|
||||
template <typename T, typename ArrayOrStorage>
|
||||
struct ViewTypeArg
|
||||
: ViewTypeArgImpl<T,
|
||||
ArrayOrStorage,
|
||||
vtkm::cont::internal::ArrayHandleCheck<ArrayOrStorage>::type::value>
|
||||
{
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template <typename T, typename ST>
|
||||
class Storage<T, StorageTagView<ST>>
|
||||
{
|
||||
using ArrayHandleType = typename detail::ViewTypeArg<T, ST>::ArrayHandle;
|
||||
using ArrayHandleType = vtkm::cont::ArrayHandle<T, ST>;
|
||||
using SourceStorage = Storage<T, ST>;
|
||||
|
||||
static std::vector<vtkm::cont::internal::Buffer> SourceBuffers(
|
||||
|
@ -1,29 +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_ArrayRangeCompute_hxx
|
||||
#define vtk_m_cont_ArrayRangeCompute_hxx
|
||||
|
||||
#include <vtkm/Deprecated.h>
|
||||
#include <vtkm/cont/ArrayRangeComputeTemplate.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
|
||||
VTKM_DEPRECATED(1.6, "Use ArrayRangeComputeTemplate.h instead of ArrayRangeCompute.hxx.")
|
||||
inline void ArrayRangeCompute_hxx_deprecated() {}
|
||||
|
||||
inline void ActivateArrayRangeCompute_hxx_deprecated_warning()
|
||||
{
|
||||
ArrayRangeCompute_hxx_deprecated();
|
||||
}
|
||||
|
||||
} // namespace vtkm
|
||||
|
||||
#endif //vtk_m_cont_ArrayRangeCompute_hxx
|
@ -10,7 +10,6 @@
|
||||
#ifndef vtk_m_cont_AtomicArray_h
|
||||
#define vtk_m_cont_AtomicArray_h
|
||||
|
||||
#include <vtkm/Deprecated.h>
|
||||
#include <vtkm/List.h>
|
||||
#include <vtkm/StaticAssert.h>
|
||||
#include <vtkm/cont/ArrayHandle.h>
|
||||
@ -18,11 +17,6 @@
|
||||
#include <vtkm/cont/ExecutionObjectBase.h>
|
||||
#include <vtkm/exec/AtomicArrayExecutionObject.h>
|
||||
|
||||
// Support deprecated features
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
#include <vtkm/ListTag.h>
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
@ -33,13 +27,6 @@ namespace cont
|
||||
/// @cond NONE
|
||||
using AtomicArrayTypeList =
|
||||
vtkm::List<vtkm::UInt32, vtkm::Int32, vtkm::UInt64, vtkm::Int64, vtkm::Float32, vtkm::Float64>;
|
||||
|
||||
struct VTKM_DEPRECATED(1.6,
|
||||
"AtomicArrayTypeListTag replaced by AtomicArrayTypeList. Note that the "
|
||||
"new AtomicArrayTypeList cannot be subclassed.") AtomicArrayTypeListTag
|
||||
: vtkm::internal::ListAsListTag<AtomicArrayTypeList>
|
||||
{
|
||||
};
|
||||
/// @endcond
|
||||
|
||||
|
||||
@ -86,14 +73,6 @@ public:
|
||||
return vtkm::exec::AtomicArrayExecutionObject<T>(this->Handle, device, token);
|
||||
}
|
||||
|
||||
template <typename Device>
|
||||
VTKM_CONT VTKM_DEPRECATED(1.6, "PrepareForExecution now requires a vtkm::cont::Token object.")
|
||||
vtkm::exec::AtomicArrayExecutionObject<T, Device> PrepareForExecution(Device device) const
|
||||
{
|
||||
vtkm::cont::Token token;
|
||||
return this->PrepareForExecution(device, token);
|
||||
}
|
||||
|
||||
private:
|
||||
/// @cond NONE
|
||||
vtkm::cont::ArrayHandle<T> Handle;
|
||||
|
@ -11,28 +11,6 @@
|
||||
#include <vtkm/cont/BitField.h>
|
||||
#include <vtkm/cont/Logging.h>
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
struct DeviceCheckFunctor
|
||||
{
|
||||
vtkm::cont::DeviceAdapterId FoundDevice = vtkm::cont::DeviceAdapterTagUndefined{};
|
||||
|
||||
VTKM_CONT void operator()(vtkm::cont::DeviceAdapterId device,
|
||||
const vtkm::cont::internal::Buffer& buffer)
|
||||
{
|
||||
if (this->FoundDevice == vtkm::cont::DeviceAdapterTagUndefined{})
|
||||
{
|
||||
if (buffer.IsAllocatedOnDevice(device))
|
||||
{
|
||||
this->FoundDevice = device;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
@ -100,13 +78,6 @@ bool BitField::IsOnDevice(vtkm::cont::DeviceAdapterId device) const
|
||||
return this->Buffer.IsAllocatedOnDevice(device);
|
||||
}
|
||||
|
||||
vtkm::cont::DeviceAdapterId BitField::GetDeviceAdapterId() const
|
||||
{
|
||||
DeviceCheckFunctor functor;
|
||||
vtkm::ListForEach(functor, VTKM_DEFAULT_DEVICE_ADAPTER_LIST{}, this->Buffer);
|
||||
return functor.FoundDevice;
|
||||
}
|
||||
|
||||
BitField::WritePortalType BitField::WritePortal() const
|
||||
{
|
||||
vtkm::cont::Token token;
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include <vtkm/cont/vtkm_cont_export.h>
|
||||
|
||||
#include <vtkm/Atomic.h>
|
||||
#include <vtkm/Deprecated.h>
|
||||
#include <vtkm/List.h>
|
||||
#include <vtkm/Types.h>
|
||||
|
||||
@ -458,13 +457,6 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
VTKM_DEPRECATED(1.6, "Use CompareExchangeBitAtomic. (Note the changed interface.)")
|
||||
VTKM_EXEC_CONT bool CompareAndSwapBitAtomic(vtkm::Id bitIdx, bool newBit, bool expectedBit) const
|
||||
{
|
||||
this->CompareExchangeBitAtomic(bitIdx, &expectedBit, newBit);
|
||||
return expectedBit;
|
||||
}
|
||||
|
||||
/// Perform an atomic compare-exchange operation on the word at @a wordIdx.
|
||||
/// If the word in memory is equal to @a oldWord, it is replaced with
|
||||
/// the value of @a newWord and true returned. If the word in memory is not
|
||||
@ -484,15 +476,6 @@ public:
|
||||
return vtkm::AtomicCompareExchange(addr, oldWord, newWord);
|
||||
}
|
||||
|
||||
template <typename WordType = WordTypePreferred>
|
||||
VTKM_DEPRECATED(1.6, "Use CompareExchangeWordAtomic. (Note the changed interface.)")
|
||||
VTKM_EXEC_CONT WordType
|
||||
CompareAndSwapWordAtomic(vtkm::Id wordIdx, WordType newWord, WordType expected) const
|
||||
{
|
||||
this->CompareExchangeWordAtomic(wordIdx, &expected, newWord);
|
||||
return expected;
|
||||
}
|
||||
|
||||
private:
|
||||
template <typename WordType>
|
||||
VTKM_EXEC_CONT MaybeConstPointer<WordType> GetWordAddress(vtkm::Id wordId) const noexcept
|
||||
@ -509,21 +492,6 @@ using BitPortal = BitPortalBase<false>;
|
||||
|
||||
using BitPortalConst = BitPortalBase<true>;
|
||||
|
||||
template <typename WordType, typename Device>
|
||||
struct IsValidWordTypeDeprecated
|
||||
{
|
||||
using type VTKM_DEPRECATED(
|
||||
1.6,
|
||||
"BitField::IsValidWordTypeAtomic no longer takes a second Device parameter.") =
|
||||
detail::BitFieldTraits::IsValidWordTypeAtomic<WordType>;
|
||||
};
|
||||
|
||||
template <typename WordType>
|
||||
struct IsValidWordTypeDeprecated<WordType, void>
|
||||
{
|
||||
using type = detail::BitFieldTraits::IsValidWordTypeAtomic<WordType>;
|
||||
};
|
||||
|
||||
} // end namespace detail
|
||||
|
||||
class VTKM_CONT_EXPORT BitField
|
||||
@ -531,21 +499,12 @@ class VTKM_CONT_EXPORT BitField
|
||||
static constexpr vtkm::Id BlockSize = detail::BitFieldTraits::BlockSize;
|
||||
|
||||
public:
|
||||
/// The type array handle used to store the bit data internally:
|
||||
using ArrayHandleType VTKM_DEPRECATED(1.6, "BitField now uses a Buffer to store data.") =
|
||||
ArrayHandle<vtkm::WordTypeDefault, StorageTagBasic>;
|
||||
|
||||
/// The BitPortal used in the control environment.
|
||||
using WritePortalType = detail::BitPortal;
|
||||
|
||||
/// A read-only BitPortal used in the control environment.
|
||||
using ReadPortalType = detail::BitPortalConst;
|
||||
|
||||
using PortalControl VTKM_DEPRECATED(1.6,
|
||||
"Use BitField::WritePortalType instead.") = detail::BitPortal;
|
||||
using PortalConstControl VTKM_DEPRECATED(1.6, "Use ArrayBitField::ReadPortalType instead.") =
|
||||
detail::BitPortalConst;
|
||||
|
||||
using WordTypePreferred = vtkm::AtomicTypePreferred;
|
||||
|
||||
template <typename Device>
|
||||
@ -569,12 +528,6 @@ public:
|
||||
template <typename WordType, typename Device = void>
|
||||
using IsValidWordTypeAtomic = detail::BitFieldTraits::IsValidWordTypeAtomic<WordType>;
|
||||
|
||||
/// Check whether a word type is valid for atomic operations from the control
|
||||
/// environment.
|
||||
template <typename WordType>
|
||||
using IsValidWordTypeAtomicControl VTKM_DEPRECATED(1.6, "Use IsValidWordTypeAtomic instead.") =
|
||||
detail::BitFieldTraits::IsValidWordTypeAtomic<WordType>;
|
||||
|
||||
VTKM_CONT BitField();
|
||||
VTKM_CONT BitField(const BitField&) = default;
|
||||
VTKM_CONT BitField(BitField&&) noexcept = default;
|
||||
@ -591,14 +544,6 @@ public:
|
||||
/// Return the internal `Buffer` used to store the `BitField`.
|
||||
VTKM_CONT vtkm::cont::internal::Buffer GetBuffer() const { return this->Buffer; }
|
||||
|
||||
/// Return the internal ArrayHandle used to store the BitField.
|
||||
VTKM_CONT VTKM_DEPRECATED(1.6, "BitField now uses a Buffer to store data.")
|
||||
ArrayHandle<vtkm::WordTypeDefault, StorageTagBasic> GetData() const
|
||||
{
|
||||
return vtkm::cont::ArrayHandle<vtkm::WordTypeDefault, StorageTagBasic>(
|
||||
std::vector<vtkm::cont::internal::Buffer>(1, this->Buffer));
|
||||
}
|
||||
|
||||
/// Return the number of bits stored by this BitField.
|
||||
VTKM_CONT vtkm::Id GetNumberOfBits() const;
|
||||
|
||||
@ -672,13 +617,6 @@ public:
|
||||
this->Fill(value, token);
|
||||
}
|
||||
|
||||
/// Shrink the bit field to the requested number of bits.
|
||||
VTKM_CONT VTKM_DEPRECATED(1.6,
|
||||
"Use Allocate with preserve = On.") void Shrink(vtkm::Id numberOfBits)
|
||||
{
|
||||
this->Allocate(numberOfBits, vtkm::CopyFlag::On);
|
||||
}
|
||||
|
||||
/// Release all execution-side resources held by this BitField.
|
||||
VTKM_CONT void ReleaseResourcesExecution();
|
||||
|
||||
@ -701,9 +639,6 @@ public:
|
||||
return this->IsOnDevice(vtkm::cont::DeviceAdapterTagUndefined{});
|
||||
}
|
||||
|
||||
VTKM_CONT VTKM_DEPRECATED(1.6, "Data can be on multiple devices. Use IsOnDevice.")
|
||||
vtkm::cont::DeviceAdapterId GetDeviceAdapterId() const;
|
||||
|
||||
/// \brief Get a portal to the data that is usable from the control environment.
|
||||
///
|
||||
/// As long as this portal is in scope, no one else will be able to read or write the BitField.
|
||||
@ -714,20 +649,6 @@ public:
|
||||
/// As long as this portal is in scope, no one else will be able to write in the BitField.
|
||||
VTKM_CONT ReadPortalType ReadPortal() const;
|
||||
|
||||
VTKM_CONT
|
||||
VTKM_DEPRECATED(1.6,
|
||||
"Use BitField::WritePortal() instead. "
|
||||
"Note that the returned portal will lock the array while it is in scope.")
|
||||
detail::BitPortal GetPortalControl() { return this->WritePortal(); }
|
||||
|
||||
/// Get a read-only portal to the data that is usable from the control
|
||||
/// environment.
|
||||
VTKM_CONT
|
||||
VTKM_DEPRECATED(1.6,
|
||||
"Use BitField::ReadPortal() instead. "
|
||||
"Note that the returned portal will lock the array while it is in scope.")
|
||||
detail::BitPortalConst GetPortalConstControl() const { return this->ReadPortal(); }
|
||||
|
||||
/// Prepares this BitField to be used as an input to an operation in the
|
||||
/// execution environment. If necessary, copies data to the execution
|
||||
/// environment. Can throw an exception if this BitField does not yet contain
|
||||
@ -736,15 +657,6 @@ public:
|
||||
VTKM_CONT ReadPortalType PrepareForInput(vtkm::cont::DeviceAdapterId device,
|
||||
vtkm::cont::Token& token) const;
|
||||
|
||||
template <typename DeviceAdapterTag>
|
||||
VTKM_CONT VTKM_DEPRECATED(1.6, "PrepareForInput now requires a vtkm::cont::Token object.")
|
||||
typename ExecutionTypes<DeviceAdapterTag>::PortalConst
|
||||
PrepareForInput(DeviceAdapterTag device) const
|
||||
{
|
||||
vtkm::cont::Token token;
|
||||
return this->PrepareForInput(device, token);
|
||||
}
|
||||
|
||||
/// Prepares (allocates) this BitField to be used as an output from an
|
||||
/// operation in the execution environment. The internal state of this class
|
||||
/// is set to have valid data in the execution BitField with the assumption
|
||||
@ -755,15 +667,6 @@ public:
|
||||
vtkm::cont::DeviceAdapterId device,
|
||||
vtkm::cont::Token& token) const;
|
||||
|
||||
template <typename DeviceAdapterTag>
|
||||
VTKM_CONT VTKM_DEPRECATED(1.6, "PrepareForOutput now requires a vtkm::cont::Token object.")
|
||||
typename ExecutionTypes<DeviceAdapterTag>::Portal
|
||||
PrepareForOutput(vtkm::Id numBits, DeviceAdapterTag device) const
|
||||
{
|
||||
vtkm::cont::Token token;
|
||||
return this->PrepareForOutput(numBits, device, token);
|
||||
}
|
||||
|
||||
/// Prepares this BitField to be used in an in-place operation (both as input
|
||||
/// and output) in the execution environment. If necessary, copies data to
|
||||
/// the execution environment. Can throw an exception if this BitField does
|
||||
@ -772,15 +675,6 @@ public:
|
||||
VTKM_CONT WritePortalType PrepareForInPlace(vtkm::cont::DeviceAdapterId device,
|
||||
vtkm::cont::Token& token) const;
|
||||
|
||||
template <typename DeviceAdapterTag>
|
||||
VTKM_CONT VTKM_DEPRECATED(1.6, "PrepareForInPlace now requires a vtkm::cont::Token object.")
|
||||
typename ExecutionTypes<DeviceAdapterTag>::Portal
|
||||
PrepareForInPlace(DeviceAdapterTag device) const
|
||||
{
|
||||
vtkm::cont::Token token;
|
||||
return this->PrepareForInPlace(device, token);
|
||||
}
|
||||
|
||||
private:
|
||||
mutable vtkm::cont::internal::Buffer Buffer;
|
||||
};
|
||||
|
@ -62,13 +62,11 @@ set(headers
|
||||
CellLocatorPartitioned.h
|
||||
CellLocatorRectilinearGrid.h
|
||||
CellLocatorTwoLevel.h
|
||||
CellLocatorUniformBins.h
|
||||
CellLocatorUniformGrid.h
|
||||
CellSet.h
|
||||
CellSetExplicit.h
|
||||
CellSetExtrude.h
|
||||
CellSetList.h
|
||||
CellSetListTag.h
|
||||
CellSetPermutation.h
|
||||
CellSetSingleType.h
|
||||
CellSetStructured.h
|
||||
@ -82,13 +80,10 @@ set(headers
|
||||
DataSetBuilderExplicit.h
|
||||
DataSetBuilderRectilinear.h
|
||||
DataSetBuilderUniform.h
|
||||
DataSetFieldAdd.h
|
||||
DeviceAdapter.h
|
||||
DeviceAdapterAlgorithm.h
|
||||
DeviceAdapterList.h
|
||||
DeviceAdapterListTag.h
|
||||
DeviceAdapterTag.h
|
||||
DynamicCellSet.h # Deprecated, replaced by Unknown/UncertainCellSet.h
|
||||
EnvironmentTracker.h
|
||||
Error.h
|
||||
ErrorBadAllocation.h
|
||||
@ -109,15 +104,12 @@ set(headers
|
||||
MergePartitionedDataSet.h
|
||||
ParticleArrayCopy.h
|
||||
PartitionedDataSet.h
|
||||
PointLocatorUniformGrid.h
|
||||
PointLocatorSparseGrid.h
|
||||
RuntimeDeviceInformation.h
|
||||
RuntimeDeviceTracker.h
|
||||
Serialization.h
|
||||
Storage.h
|
||||
StorageImplicit.h # Deprecated, rolled into ArrayHandleImplicit.h
|
||||
StorageList.h
|
||||
StorageListTag.h
|
||||
Timer.h
|
||||
Token.h
|
||||
TryExecute.h
|
||||
@ -127,11 +119,9 @@ set(headers
|
||||
UnknownArrayHandle.h
|
||||
UnknownCellSet.h
|
||||
Variant.h
|
||||
VariantArrayHandle.h # Deprecated, replaces with Unknown/UncertainArrayHandle.h
|
||||
)
|
||||
|
||||
set(template_sources
|
||||
ArrayRangeCompute.hxx # Deprecated, replaced with ArrayRangeComputeTemplate.h
|
||||
CellSetExplicit.hxx
|
||||
ParticleArrayCopy.hxx
|
||||
)
|
||||
@ -182,18 +172,6 @@ set(sources
|
||||
UnknownCellSet.cxx
|
||||
)
|
||||
|
||||
if(VTKm_ENABLE_TESTING_LIBRARY)
|
||||
list(APPEND sources
|
||||
# This file should really be part of the vtkm_cont_testing library (in the testing
|
||||
# subdirectory) It supports external code using deprecated functionality. In particular,
|
||||
# testing/MakeTestDataSet.h now needs symbols compiled in MakeTestDataSet.cxx, but the
|
||||
# deprecated behavior expects to only need to include vtkm_cont. As a workaround, add the code
|
||||
# to vtkm_cont for now. This should probably be changed back to be in vtkm_cont_testing for the
|
||||
# 2.0 release.
|
||||
testlib/MakeTestDataSet.cxx
|
||||
)
|
||||
endif()
|
||||
|
||||
# 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
|
||||
|
@ -1,30 +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_CellLocatorUniformBins_h
|
||||
#define vtk_m_cont_CellLocatorUniformBins_h
|
||||
|
||||
#include <vtkm/Deprecated.h>
|
||||
|
||||
#include <vtkm/cont/CellLocatorTwoLevel.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
{
|
||||
|
||||
struct VTKM_ALWAYS_EXPORT VTKM_DEPRECATED(1.6, "Replaced with CellLocatorTwoLevel.")
|
||||
CellLocatorUniformBins : vtkm::cont::CellLocatorTwoLevel
|
||||
{
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace vtkm::cont
|
||||
|
||||
#endif //vtk_m_cont_CellLocatorUniformBins_h
|
@ -11,7 +11,6 @@
|
||||
#define vtk_m_cont_CellSetExplicit_h
|
||||
|
||||
#include <vtkm/CellShape.h>
|
||||
#include <vtkm/Deprecated.h>
|
||||
#include <vtkm/TopologyElementTag.h>
|
||||
#include <vtkm/cont/ArrayGetValues.h>
|
||||
#include <vtkm/cont/ArrayHandleCast.h>
|
||||
@ -164,32 +163,6 @@ public:
|
||||
const vtkm::cont::ArrayHandle<vtkm::Id, ConnectivityStorageTag>& connectivity,
|
||||
const vtkm::cont::ArrayHandle<vtkm::Id, OffsetsStorageTag>& offsets);
|
||||
|
||||
template <typename Device, typename VisitTopology, typename IncidentTopology>
|
||||
struct VTKM_DEPRECATED(
|
||||
1.6,
|
||||
"Replace ExecutionTypes<D, V, I>::ExecObjectType with ExecConnectivityType<V, I>.")
|
||||
ExecutionTypes
|
||||
{
|
||||
private:
|
||||
VTKM_IS_DEVICE_ADAPTER_TAG(Device);
|
||||
VTKM_IS_TOPOLOGY_ELEMENT_TAG(VisitTopology);
|
||||
VTKM_IS_TOPOLOGY_ELEMENT_TAG(IncidentTopology);
|
||||
|
||||
using Chooser = ConnectivityChooser<VisitTopology, IncidentTopology>;
|
||||
|
||||
using ShapesAT = typename Chooser::ShapesArrayType;
|
||||
using ConnAT = typename Chooser::ConnectivityArrayType;
|
||||
using OffsetsAT = typename Chooser::OffsetsArrayType;
|
||||
|
||||
public:
|
||||
using ShapesPortalType = typename ShapesAT::ReadPortalType;
|
||||
using ConnectivityPortalType = typename ConnAT::ReadPortalType;
|
||||
using OffsetsPortalType = typename OffsetsAT::ReadPortalType;
|
||||
|
||||
using ExecObjectType =
|
||||
vtkm::exec::ConnectivityExplicit<ShapesPortalType, ConnectivityPortalType, OffsetsPortalType>;
|
||||
};
|
||||
|
||||
template <typename VisitTopology, typename IncidentTopology>
|
||||
using ExecConnectivityType =
|
||||
typename ConnectivityChooser<VisitTopology, IncidentTopology>::ExecConnectivityType;
|
||||
@ -201,17 +174,6 @@ public:
|
||||
IncidentTopology,
|
||||
vtkm::cont::Token&) const;
|
||||
|
||||
template <typename VisitTopology, typename IncidentTopology>
|
||||
VTKM_DEPRECATED(1.6, "Provide a vtkm::cont::Token object when calling PrepareForInput.")
|
||||
VTKM_CONT ExecConnectivityType<VisitTopology, IncidentTopology> PrepareForInput(
|
||||
vtkm::cont::DeviceAdapterId device,
|
||||
VisitTopology visitTopology,
|
||||
IncidentTopology incidentTopology) const
|
||||
{
|
||||
vtkm::cont::Token token;
|
||||
return this->PrepareForInput(device, visitTopology, incidentTopology, token);
|
||||
}
|
||||
|
||||
template <typename VisitTopology, typename IncidentTopology>
|
||||
VTKM_CONT const typename ConnectivityChooser<VisitTopology, IncidentTopology>::ShapesArrayType&
|
||||
GetShapesArray(VisitTopology, IncidentTopology) const;
|
||||
|
@ -14,6 +14,8 @@
|
||||
#include <vtkm/cont/ArrayGetValues.h>
|
||||
#include <vtkm/cont/Logging.h>
|
||||
|
||||
#include <vtkm/Deprecated.h>
|
||||
|
||||
// This file uses a lot of very verbose identifiers and the clang formatted
|
||||
// code quickly becomes unreadable. Stick with manual formatting for now.
|
||||
//
|
||||
|
@ -110,15 +110,6 @@ public:
|
||||
typename detail::CellSetExtrudeConnectivityChooser<VisitTopology,
|
||||
IncidentTopology>::ExecConnectivityType;
|
||||
|
||||
template <typename DeviceAdapter, typename VisitTopology, typename IncidentTopology>
|
||||
struct VTKM_DEPRECATED(
|
||||
1.6,
|
||||
"Replace ExecutionTypes<D, V, I>::ExecObjectType with ExecConnectivityType<V, I>.")
|
||||
ExecutionTypes
|
||||
{
|
||||
using ExecObjectType = ExecConnectivityType<VisitTopology, IncidentTopology>;
|
||||
};
|
||||
|
||||
vtkm::exec::ConnectivityExtrude PrepareForInput(vtkm::cont::DeviceAdapterId,
|
||||
vtkm::TopologyElementTagCell,
|
||||
vtkm::TopologyElementTagPoint,
|
||||
@ -129,26 +120,6 @@ public:
|
||||
vtkm::TopologyElementTagCell,
|
||||
vtkm::cont::Token&) const;
|
||||
|
||||
VTKM_DEPRECATED(1.6, "Provide a vtkm::cont::Token object when calling PrepareForInput.")
|
||||
vtkm::exec::ConnectivityExtrude PrepareForInput(
|
||||
vtkm::cont::DeviceAdapterId device,
|
||||
vtkm::TopologyElementTagCell visitTopology,
|
||||
vtkm::TopologyElementTagPoint incidentTopology) const
|
||||
{
|
||||
vtkm::cont::Token token;
|
||||
return this->PrepareForInput(device, visitTopology, incidentTopology, token);
|
||||
}
|
||||
|
||||
VTKM_DEPRECATED(1.6, "Provide a vtkm::cont::Token object when calling PrepareForInput.")
|
||||
vtkm::exec::ReverseConnectivityExtrude PrepareForInput(
|
||||
vtkm::cont::DeviceAdapterId device,
|
||||
vtkm::TopologyElementTagPoint visitTopology,
|
||||
vtkm::TopologyElementTagCell incidentTopology) const
|
||||
{
|
||||
vtkm::cont::Token token;
|
||||
return this->PrepareForInput(device, visitTopology, incidentTopology, token);
|
||||
}
|
||||
|
||||
private:
|
||||
void BuildReverseConnectivity();
|
||||
|
||||
|
@ -1,78 +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_CellSetListTag_h
|
||||
#define vtk_m_cont_CellSetListTag_h
|
||||
|
||||
// Everything in this header file is deprecated and movded to CellSetList.h.
|
||||
|
||||
#ifndef VTKM_DEFAULT_CELL_SET_LIST_TAG
|
||||
#define VTKM_DEFAULT_CELL_SET_LIST_TAG ::vtkm::cont::detail::CellSetListTagDefault
|
||||
#endif
|
||||
|
||||
#include <vtkm/ListTag.h>
|
||||
|
||||
#include <vtkm/cont/CellSetList.h>
|
||||
|
||||
#define VTK_M_OLD_CELL_LIST_DEFINITION(name) \
|
||||
struct VTKM_ALWAYS_EXPORT VTKM_DEPRECATED( \
|
||||
1.6, \
|
||||
"CellSetListTag" #name " replaced by CellSetList" #name ". " \
|
||||
"Note that the new CellSetList" #name " cannot be subclassed.") CellSetListTag##name \
|
||||
: vtkm::internal::ListAsListTag<CellSetList##name> \
|
||||
{ \
|
||||
}
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
{
|
||||
|
||||
VTK_M_OLD_CELL_LIST_DEFINITION(Structured1D);
|
||||
VTK_M_OLD_CELL_LIST_DEFINITION(Structured2D);
|
||||
VTK_M_OLD_CELL_LIST_DEFINITION(Structured3D);
|
||||
VTK_M_OLD_CELL_LIST_DEFINITION(ExplicitDefault);
|
||||
VTK_M_OLD_CELL_LIST_DEFINITION(Common);
|
||||
VTK_M_OLD_CELL_LIST_DEFINITION(Structured);
|
||||
VTK_M_OLD_CELL_LIST_DEFINITION(Unstructured);
|
||||
|
||||
/// @cond NONE
|
||||
template <typename ShapesStorageTag = VTKM_DEFAULT_SHAPES_STORAGE_TAG,
|
||||
typename ConnectivityStorageTag = VTKM_DEFAULT_CONNECTIVITY_STORAGE_TAG,
|
||||
typename OffsetsStorageTag = VTKM_DEFAULT_OFFSETS_STORAGE_TAG>
|
||||
struct VTKM_ALWAYS_EXPORT VTKM_DEPRECATED(
|
||||
1.6,
|
||||
"CellSetListTagExplicit replaced by CellSetListExplicit. "
|
||||
"Note that the new CellSetListExplicit cannot be subclassed.") CellSetListTagExplicit
|
||||
: vtkm::internal::ListAsListTag<
|
||||
CellSetListExplicit<ShapesStorageTag, ConnectivityStorageTag, OffsetsStorageTag>>
|
||||
{
|
||||
};
|
||||
/// @endcond
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
/// @cond NONE
|
||||
struct VTKM_ALWAYS_EXPORT VTKM_DEPRECATED(
|
||||
1.6,
|
||||
"VTKM_DEFAULT_CELL_SET_LIST_TAG replaced by VTKM_DEFAULT_CELL_SET_LIST. "
|
||||
"Note that the new VTKM_DEFAULT_CELL_SET_LIST cannot be subclassed.") CellSetListTagDefault
|
||||
: vtkm::internal::ListAsListTag<VTKM_DEFAULT_CELL_SET_LIST>
|
||||
{
|
||||
};
|
||||
/// @endcond
|
||||
|
||||
} // namespace detail
|
||||
}
|
||||
} // namespace vtkm::cont
|
||||
|
||||
#undef VTK_M_OLD_CELL_LIST_DEFINITION
|
||||
|
||||
#endif //vtk_m_cont_CellSetListTag_h
|
@ -12,6 +12,7 @@
|
||||
|
||||
#include <vtkm/CellShape.h>
|
||||
#include <vtkm/CellTraits.h>
|
||||
#include <vtkm/Deprecated.h>
|
||||
#include <vtkm/cont/ArrayCopy.h>
|
||||
#include <vtkm/cont/ArrayHandleCast.h>
|
||||
#include <vtkm/cont/ArrayHandleGroupVecVariable.h>
|
||||
@ -451,15 +452,6 @@ public:
|
||||
OriginalCellSetType,
|
||||
PermutationArrayHandleType>::ExecConnectivityType;
|
||||
|
||||
template <typename Device, typename VisitTopology, typename IncidentTopology>
|
||||
struct VTKM_DEPRECATED(
|
||||
1.6,
|
||||
"Replace ExecutionTypes<D, V, I>::ExecObjectType with ExecConnectivityType<V, I>.")
|
||||
ExecutionTypes
|
||||
{
|
||||
using ExecObjectType = ExecConnectivityType<VisitTopology, IncidentTopology>;
|
||||
};
|
||||
|
||||
VTKM_CONT ExecConnectivityType<vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint>
|
||||
PrepareForInput(vtkm::cont::DeviceAdapterId device,
|
||||
vtkm::TopologyElementTagCell visitTopology,
|
||||
@ -492,17 +484,6 @@ public:
|
||||
this->VisitPointsWithCells.Offsets.PrepareForInput(device, token));
|
||||
}
|
||||
|
||||
template <typename VisitTopology, typename IncidentTopology>
|
||||
VTKM_CONT VTKM_DEPRECATED(1.6, "Provide a vtkm::cont::Token object when calling PrepareForInput.")
|
||||
ExecConnectivityType<VisitTopology, IncidentTopology> PrepareForInput(
|
||||
vtkm::cont::DeviceAdapterId device,
|
||||
VisitTopology visitTopology,
|
||||
IncidentTopology incidentTopology)
|
||||
{
|
||||
vtkm::cont::Token token;
|
||||
return this->PrepareForInput(device, visitTopology, incidentTopology, token);
|
||||
}
|
||||
|
||||
VTKM_CONT
|
||||
void PrintSummary(std::ostream& out) const override
|
||||
{
|
||||
|
@ -126,18 +126,6 @@ public:
|
||||
using ExecConnectivityType =
|
||||
vtkm::exec::ConnectivityStructured<VisitTopology, IncidentTopology, Dimension>;
|
||||
|
||||
template <typename DeviceAdapter, typename VisitTopology, typename IncidentTopology>
|
||||
struct VTKM_DEPRECATED(
|
||||
1.6,
|
||||
"Replace ExecutionTypes<D, V, I>::ExecObjectType with ExecConnectivityType<V, I>.")
|
||||
ExecutionTypes
|
||||
{
|
||||
VTKM_IS_DEVICE_ADAPTER_TAG(DeviceAdapter);
|
||||
VTKM_IS_TOPOLOGY_ELEMENT_TAG(VisitTopology);
|
||||
VTKM_IS_TOPOLOGY_ELEMENT_TAG(IncidentTopology);
|
||||
using ExecObjectType = ExecConnectivityType<VisitTopology, IncidentTopology>;
|
||||
};
|
||||
|
||||
template <typename VisitTopology, typename IncidentTopology>
|
||||
ExecConnectivityType<VisitTopology, IncidentTopology> PrepareForInput(vtkm::cont::DeviceAdapterId,
|
||||
VisitTopology,
|
||||
@ -147,17 +135,6 @@ public:
|
||||
return ExecConnectivityType<VisitTopology, IncidentTopology>(this->Structure);
|
||||
}
|
||||
|
||||
template <typename VisitTopology, typename IncidentTopology>
|
||||
VTKM_DEPRECATED(1.6, "Provide a vtkm::cont::Token object when calling PrepareForInput.")
|
||||
ExecConnectivityType<VisitTopology, IncidentTopology> PrepareForInput(
|
||||
vtkm::cont::DeviceAdapterId device,
|
||||
VisitTopology visitTopology,
|
||||
IncidentTopology incidentTopology) const
|
||||
{
|
||||
vtkm::cont::Token token;
|
||||
return this->PrepareForInput(device, visitTopology, incidentTopology, token);
|
||||
}
|
||||
|
||||
void PrintSummary(std::ostream& out) const override
|
||||
{
|
||||
out << " StructuredCellSet:\n";
|
||||
|
@ -1271,12 +1271,6 @@ vtkm::exec::ColorTable ColorTable::PrepareForExecution(vtkm::cont::DeviceAdapter
|
||||
return execTable;
|
||||
}
|
||||
|
||||
vtkm::exec::ColorTable ColorTable::PrepareForExecution(vtkm::cont::DeviceAdapterId device) const
|
||||
{
|
||||
vtkm::cont::Token token;
|
||||
return this->PrepareForExecution(device, token);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
vtkm::Id ColorTable::GetModifiedCount() const
|
||||
{
|
||||
|
@ -33,15 +33,6 @@ namespace detail
|
||||
struct ColorTableInternals;
|
||||
}
|
||||
|
||||
struct VTKM_DEPRECATED(1.6, "Use vtkm::ColorSpace.") ColorSpace
|
||||
{
|
||||
static constexpr vtkm::ColorSpace RGB = vtkm::ColorSpace::RGB;
|
||||
static constexpr vtkm::ColorSpace HSV = vtkm::ColorSpace::HSV;
|
||||
static constexpr vtkm::ColorSpace HSV_WRAP = vtkm::ColorSpace::HSVWrap;
|
||||
static constexpr vtkm::ColorSpace LAB = vtkm::ColorSpace::Lab;
|
||||
static constexpr vtkm::ColorSpace DIVERGING = vtkm::ColorSpace::Diverging;
|
||||
};
|
||||
|
||||
/// \brief Color Table for coloring arbitrary fields
|
||||
///
|
||||
///
|
||||
@ -120,25 +111,6 @@ public:
|
||||
RainbowUniform,
|
||||
Jet,
|
||||
RainbowDesaturated,
|
||||
|
||||
DEFAULT VTKM_DEPRECATED(1.6, "Use vtkm::ColorTable::Preset::Default."),
|
||||
COOL_TO_WARM VTKM_DEPRECATED(1.6, "Use vtkm::ColorTable::Preset::CoolToWarm."),
|
||||
COOL_TO_WARM_EXTENDED VTKM_DEPRECATED(1.6, "Use vtkm::ColorTable::Preset::CoolToWarmExtended."),
|
||||
VIRIDIS VTKM_DEPRECATED(1.6, "Use vtkm::ColorTable::Preset::Viridis."),
|
||||
INFERNO VTKM_DEPRECATED(1.6, "Use vtkm::ColorTable::Preset::Inferno."),
|
||||
PLASMA VTKM_DEPRECATED(1.6, "Use vtkm::ColorTable::Preset::Plasma."),
|
||||
BLACK_BODY_RADIATION VTKM_DEPRECATED(1.6, "Use vtkm::ColorTable::Preset::BlackBodyRadiation."),
|
||||
X_RAY VTKM_DEPRECATED(1.6, "Use vtkm::ColorTable::Preset::XRay."),
|
||||
GREEN VTKM_DEPRECATED(1.6, "Use vtkm::ColorTable::Preset::Green."),
|
||||
BLACK_BLUE_WHITE VTKM_DEPRECATED(1.6, "Use vtkm::ColorTable::Preset::BlackBlueWhite."),
|
||||
BLUE_TO_ORANGE VTKM_DEPRECATED(1.6, "Use vtkm::ColorTable::Preset::BlueToOrange."),
|
||||
GRAY_TO_RED VTKM_DEPRECATED(1.6, "Use vtkm::ColorTable::Preset::GrayToRed."),
|
||||
COLD_AND_HOT VTKM_DEPRECATED(1.6, "Use vtkm::ColorTable::Preset::ColdAndHot."),
|
||||
BLUE_GREEN_ORANGE VTKM_DEPRECATED(1.6, "Use vtkm::ColorTable::Preset::BlueGreenOrange."),
|
||||
YELLOW_GRAY_BLUE VTKM_DEPRECATED(1.6, "Use vtkm::ColorTable::Preset::YellowGrayBlue."),
|
||||
RAINBOW_UNIFORM VTKM_DEPRECATED(1.6, "Use vtkm::ColorTable::Preset::RainbowUniform."),
|
||||
JET VTKM_DEPRECATED(1.6, "Use vtkm::ColorTable::Preset::Jet."),
|
||||
RAINBOW_DESATURATED VTKM_DEPRECATED(1.6, "Use vtkm::ColorTable::Preset::RainbowDesaturated.")
|
||||
};
|
||||
|
||||
/// \brief Construct a color table from a preset
|
||||
@ -599,9 +571,6 @@ public:
|
||||
vtkm::exec::ColorTable PrepareForExecution(vtkm::cont::DeviceAdapterId deviceId,
|
||||
vtkm::cont::Token& token) const;
|
||||
|
||||
VTKM_DEPRECATED(1.6, "PrepareForExecution now requires a vtkm::cont::Token object")
|
||||
inline vtkm::exec::ColorTable PrepareForExecution(vtkm::cont::DeviceAdapterId deviceId) const;
|
||||
|
||||
/// \brief Returns the modified count for changes of the color table
|
||||
///
|
||||
/// The `ModifiedCount` of the color table starts at 1 and gets incremented
|
||||
|
@ -1371,51 +1371,9 @@ bool LoadColorTablePreset(vtkm::cont::ColorTable::Preset preset, vtkm::cont::Col
|
||||
}
|
||||
}
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
// Handle deprecated names
|
||||
switch (preset)
|
||||
{
|
||||
case vtkm::cont::ColorTable::Preset::DEFAULT:
|
||||
return LoadColorTablePreset(vtkm::cont::ColorTable::Preset::Default, table);
|
||||
case vtkm::cont::ColorTable::Preset::COOL_TO_WARM:
|
||||
return LoadColorTablePreset(vtkm::cont::ColorTable::Preset::CoolToWarm, table);
|
||||
case vtkm::cont::ColorTable::Preset::COOL_TO_WARM_EXTENDED:
|
||||
return LoadColorTablePreset(vtkm::cont::ColorTable::Preset::CoolToWarmExtended, table);
|
||||
case vtkm::cont::ColorTable::Preset::VIRIDIS:
|
||||
return LoadColorTablePreset(vtkm::cont::ColorTable::Preset::Viridis, table);
|
||||
case vtkm::cont::ColorTable::Preset::INFERNO:
|
||||
return LoadColorTablePreset(vtkm::cont::ColorTable::Preset::Inferno, table);
|
||||
case vtkm::cont::ColorTable::Preset::PLASMA:
|
||||
return LoadColorTablePreset(vtkm::cont::ColorTable::Preset::Plasma, table);
|
||||
case vtkm::cont::ColorTable::Preset::BLACK_BODY_RADIATION:
|
||||
return LoadColorTablePreset(vtkm::cont::ColorTable::Preset::BlackBodyRadiation, table);
|
||||
case vtkm::cont::ColorTable::Preset::X_RAY:
|
||||
return LoadColorTablePreset(vtkm::cont::ColorTable::Preset::XRay, table);
|
||||
case vtkm::cont::ColorTable::Preset::GREEN:
|
||||
return LoadColorTablePreset(vtkm::cont::ColorTable::Preset::Green, table);
|
||||
case vtkm::cont::ColorTable::Preset::BLACK_BLUE_WHITE:
|
||||
return LoadColorTablePreset(vtkm::cont::ColorTable::Preset::BlackBlueWhite, table);
|
||||
case vtkm::cont::ColorTable::Preset::BLUE_TO_ORANGE:
|
||||
return LoadColorTablePreset(vtkm::cont::ColorTable::Preset::BlueToOrange, table);
|
||||
case vtkm::cont::ColorTable::Preset::GRAY_TO_RED:
|
||||
return LoadColorTablePreset(vtkm::cont::ColorTable::Preset::GrayToRed, table);
|
||||
case vtkm::cont::ColorTable::Preset::COLD_AND_HOT:
|
||||
return LoadColorTablePreset(vtkm::cont::ColorTable::Preset::ColdAndHot, table);
|
||||
case vtkm::cont::ColorTable::Preset::BLUE_GREEN_ORANGE:
|
||||
return LoadColorTablePreset(vtkm::cont::ColorTable::Preset::BlueGreenOrange, table);
|
||||
case vtkm::cont::ColorTable::Preset::YELLOW_GRAY_BLUE:
|
||||
return LoadColorTablePreset(vtkm::cont::ColorTable::Preset::YellowGrayBlue, table);
|
||||
case vtkm::cont::ColorTable::Preset::RAINBOW_UNIFORM:
|
||||
return LoadColorTablePreset(vtkm::cont::ColorTable::Preset::RainbowUniform, table);
|
||||
case vtkm::cont::ColorTable::Preset::JET:
|
||||
return LoadColorTablePreset(vtkm::cont::ColorTable::Preset::Jet, table);
|
||||
case vtkm::cont::ColorTable::Preset::RAINBOW_DESATURATED:
|
||||
return LoadColorTablePreset(vtkm::cont::ColorTable::Preset::RainbowDesaturated, table);
|
||||
default:
|
||||
// Should not get here.
|
||||
return false;
|
||||
}
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
// Should not get here.
|
||||
VTKM_LOG_S(vtkm::cont::LogLevel::Warn, "Missing ColorTable preset.");
|
||||
return false;
|
||||
}
|
||||
|
||||
VTKM_CONT_EXPORT std::set<std::string> GetPresetNames()
|
||||
|
@ -11,7 +11,6 @@
|
||||
#define vtk_m_cont_CoordinateSystem_h
|
||||
|
||||
#include <vtkm/Bounds.h>
|
||||
#include <vtkm/Deprecated.h>
|
||||
|
||||
#include <vtkm/cont/ArrayHandleCast.h>
|
||||
#include <vtkm/cont/CastAndCall.h>
|
||||
|
@ -68,32 +68,6 @@ public:
|
||||
const std::vector<vtkm::Id>& connectivity,
|
||||
const std::string& coordsNm = "coords");
|
||||
|
||||
template <typename T>
|
||||
VTKM_DEPRECATED(1.6,
|
||||
"Combine point coordinate arrays using most appropriate array (e.g. "
|
||||
"ArrayHandleCompositeVector, ArrayHandleSOA, ArrayHandleCartesianProduct")
|
||||
VTKM_CONT static vtkm::cont::DataSet
|
||||
Create(const vtkm::cont::ArrayHandle<T>& xVals,
|
||||
const vtkm::cont::ArrayHandle<T>& yVals,
|
||||
const vtkm::cont::ArrayHandle<T>& zVals,
|
||||
const vtkm::cont::ArrayHandle<vtkm::UInt8>& shapes,
|
||||
const vtkm::cont::ArrayHandle<vtkm::IdComponent>& numIndices,
|
||||
const vtkm::cont::ArrayHandle<vtkm::Id>& connectivity,
|
||||
const std::string& coordsNm = "coords")
|
||||
{
|
||||
VTKM_ASSERT(xVals.GetNumberOfValues() == yVals.GetNumberOfValues());
|
||||
VTKM_ASSERT(xVals.GetNumberOfValues() == zVals.GetNumberOfValues());
|
||||
|
||||
auto offsets = vtkm::cont::ConvertNumComponentsToOffsets(numIndices);
|
||||
|
||||
return DataSetBuilderExplicit::BuildDataSet(
|
||||
vtkm::cont::make_ArrayHandleCompositeVector(xVals, yVals, zVals),
|
||||
shapes,
|
||||
offsets,
|
||||
connectivity,
|
||||
coordsNm);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
VTKM_CONT static vtkm::cont::DataSet Create(const std::vector<vtkm::Vec<T, 3>>& coords,
|
||||
const std::vector<vtkm::UInt8>& shapes,
|
||||
|
@ -1,105 +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_DataSetFieldAdd_h
|
||||
#define vtk_m_cont_DataSetFieldAdd_h
|
||||
|
||||
#include <vtkm/Deprecated.h>
|
||||
#include <vtkm/cont/DataSet.h>
|
||||
#include <vtkm/cont/Field.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
{
|
||||
|
||||
class VTKM_DEPRECATED(1.6,
|
||||
"The AddPointField and AddCellField methods should now be called "
|
||||
"directly on the vtkm::cont::DataSet object") DataSetFieldAdd
|
||||
{
|
||||
public:
|
||||
VTKM_CONT
|
||||
DataSetFieldAdd() {}
|
||||
|
||||
//Point centered fields.
|
||||
VTKM_CONT
|
||||
static void AddPointField(vtkm::cont::DataSet& dataSet,
|
||||
const std::string& fieldName,
|
||||
const vtkm::cont::UnknownArrayHandle& field)
|
||||
{
|
||||
dataSet.AddField(make_FieldPoint(fieldName, field));
|
||||
}
|
||||
|
||||
template <typename T, typename Storage>
|
||||
VTKM_CONT static void AddPointField(vtkm::cont::DataSet& dataSet,
|
||||
const std::string& fieldName,
|
||||
const vtkm::cont::ArrayHandle<T, Storage>& field)
|
||||
{
|
||||
dataSet.AddField(make_FieldPoint(fieldName, field));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
VTKM_CONT static void AddPointField(vtkm::cont::DataSet& dataSet,
|
||||
const std::string& fieldName,
|
||||
const std::vector<T>& field)
|
||||
{
|
||||
dataSet.AddField(
|
||||
make_Field(fieldName, vtkm::cont::Field::Association::Points, field, vtkm::CopyFlag::On));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
VTKM_CONT static void AddPointField(vtkm::cont::DataSet& dataSet,
|
||||
const std::string& fieldName,
|
||||
const T* field,
|
||||
const vtkm::Id& n)
|
||||
{
|
||||
dataSet.AddField(
|
||||
make_Field(fieldName, vtkm::cont::Field::Association::Points, field, n, vtkm::CopyFlag::On));
|
||||
}
|
||||
|
||||
//Cell centered field
|
||||
VTKM_CONT
|
||||
static void AddCellField(vtkm::cont::DataSet& dataSet,
|
||||
const std::string& fieldName,
|
||||
const vtkm::cont::UnknownArrayHandle& field)
|
||||
{
|
||||
dataSet.AddField(make_FieldCell(fieldName, field));
|
||||
}
|
||||
|
||||
template <typename T, typename Storage>
|
||||
VTKM_CONT static void AddCellField(vtkm::cont::DataSet& dataSet,
|
||||
const std::string& fieldName,
|
||||
const vtkm::cont::ArrayHandle<T, Storage>& field)
|
||||
{
|
||||
dataSet.AddField(make_FieldCell(fieldName, field));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
VTKM_CONT static void AddCellField(vtkm::cont::DataSet& dataSet,
|
||||
const std::string& fieldName,
|
||||
const std::vector<T>& field)
|
||||
{
|
||||
dataSet.AddField(
|
||||
make_Field(fieldName, vtkm::cont::Field::Association::Cells, field, vtkm::CopyFlag::On));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
VTKM_CONT static void AddCellField(vtkm::cont::DataSet& dataSet,
|
||||
const std::string& fieldName,
|
||||
const T* field,
|
||||
const vtkm::Id& n)
|
||||
{
|
||||
dataSet.AddField(
|
||||
make_Field(fieldName, vtkm::cont::Field::Association::Cells, field, n, vtkm::CopyFlag::On));
|
||||
}
|
||||
};
|
||||
}
|
||||
} //namespace vtkm::cont
|
||||
|
||||
#endif //vtk_m_cont_DataSetFieldAdd_h
|
@ -1,54 +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_DeviceAdapterListTag_h
|
||||
#define vtk_m_cont_DeviceAdapterListTag_h
|
||||
|
||||
// Everything in this header file is deprecated and movded to DeviceAdapterList.h.
|
||||
|
||||
#ifndef VTKM_DEFAULT_DEVICE_ADAPTER_LIST_TAG
|
||||
#define VTKM_DEFAULT_DEVICE_ADAPTER_LIST_TAG ::vtkm::cont::detail::DeviceAdapterListTagDefault
|
||||
#endif
|
||||
|
||||
#include <vtkm/List.h>
|
||||
|
||||
#include <vtkm/cont/DeviceAdapterList.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
{
|
||||
|
||||
/// @cond NONE
|
||||
struct VTKM_DEPRECATED(1.6,
|
||||
"DeviceAdapterListTagCommon replaced by DeviceAdapterListCommon. "
|
||||
"Note that the new DeviceAdapterListCommon cannot be subclassed.")
|
||||
DeviceAdapterListTagCommon : vtkm::internal::ListAsListTag<DeviceAdapterListCommon>
|
||||
{
|
||||
};
|
||||
/// @endcond
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
/// @cond NONE
|
||||
struct VTKM_DEPRECATED(
|
||||
1.6,
|
||||
"VTKM_DEFAULT_DEVICE_ADAPTER_LIST_TAG replaced by VTKM_DEFAULT_DEVICE_ADAPTER_LIST. "
|
||||
"Note that the new VTKM_DEFAULT_DEVICE_ADAPTER_LIST cannot be subclassed.")
|
||||
DeviceAdapterListTagDefault : vtkm::internal::ListAsListTag<VTKM_DEFAULT_DEVICE_ADAPTER_LIST>
|
||||
{
|
||||
};
|
||||
/// @endcond
|
||||
|
||||
} // namespace detail
|
||||
}
|
||||
} // namespace vtkm::cont
|
||||
|
||||
#endif //vtk_m_cont_DeviceAdapterListTag_h
|
@ -1,27 +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_DynamicCellSet_h
|
||||
#define vtk_m_cont_DynamicCellSet_h
|
||||
|
||||
#include <vtkm/cont/UncertainCellSet.h>
|
||||
|
||||
struct VTKM_DEPRECATED(1.8, "Use UnknownCellSet.h or UncertainCellSet.h.")
|
||||
DynamicCellSet_h_header_is_deprecated
|
||||
{
|
||||
int x;
|
||||
};
|
||||
|
||||
inline void EmitDynamicCellSetHDeprecationWarning()
|
||||
{
|
||||
static DynamicCellSet_h_header_is_deprecated x;
|
||||
++x.x;
|
||||
}
|
||||
|
||||
#endif //vtk_m_cont_DynamicCellSet_h
|
@ -61,8 +61,7 @@ struct HasPrepareForControl
|
||||
#define VTKM_IS_EXECUTION_AND_CONTROL_OBJECT(execObject) \
|
||||
static_assert(::vtkm::cont::internal::IsExecutionAndControlObjectBase<execObject>::value, \
|
||||
"Provided type is not a subclass of vtkm::cont::ExecutionAndControlObjectBase."); \
|
||||
static_assert(::vtkm::cont::internal::HasPrepareForExecution<execObject>::value || \
|
||||
::vtkm::cont::internal::HasPrepareForExecutionDeprecated<execObject>::value, \
|
||||
static_assert(::vtkm::cont::internal::HasPrepareForExecution<execObject>::value, \
|
||||
"Provided type does not have requisite PrepareForExecution method."); \
|
||||
static_assert(::vtkm::cont::internal::HasPrepareForControl<execObject>::value, \
|
||||
"Provided type does not have requisite PrepareForControl method.")
|
||||
|
@ -10,7 +10,6 @@
|
||||
#ifndef vtk_m_cont_ExecutionObjectBase_h
|
||||
#define vtk_m_cont_ExecutionObjectBase_h
|
||||
|
||||
#include <vtkm/Deprecated.h>
|
||||
#include <vtkm/Types.h>
|
||||
|
||||
#include <vtkm/cont/Token.h>
|
||||
@ -50,18 +49,6 @@ struct CheckPrepareForExecution
|
||||
static auto check(...) -> std::false_type;
|
||||
};
|
||||
|
||||
struct CheckPrepareForExecutionDeprecated
|
||||
{
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
template <typename T>
|
||||
static auto check(T* p)
|
||||
-> decltype(p->PrepareForExecution(vtkm::cont::DeviceAdapterTagSerial{}), std::true_type());
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
|
||||
template <typename T>
|
||||
static auto check(...) -> std::false_type;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template <typename T>
|
||||
@ -74,20 +61,12 @@ struct HasPrepareForExecution
|
||||
{
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct HasPrepareForExecutionDeprecated
|
||||
: decltype(
|
||||
detail::CheckPrepareForExecutionDeprecated::check<typename std::decay<T>::type>(nullptr))
|
||||
{
|
||||
};
|
||||
|
||||
/// Checks that the argument is a proper execution object.
|
||||
///
|
||||
#define VTKM_IS_EXECUTION_OBJECT(execObject) \
|
||||
static_assert(::vtkm::cont::internal::IsExecutionObjectBase<execObject>::value, \
|
||||
"Provided type is not a subclass of vtkm::cont::ExecutionObjectBase."); \
|
||||
static_assert(::vtkm::cont::internal::HasPrepareForExecution<execObject>::value || \
|
||||
::vtkm::cont::internal::HasPrepareForExecutionDeprecated<execObject>::value, \
|
||||
#define VTKM_IS_EXECUTION_OBJECT(execObject) \
|
||||
static_assert(::vtkm::cont::internal::IsExecutionObjectBase<execObject>::value, \
|
||||
"Provided type is not a subclass of vtkm::cont::ExecutionObjectBase."); \
|
||||
static_assert(::vtkm::cont::internal::HasPrepareForExecution<execObject>::value, \
|
||||
"Provided type does not have requisite PrepareForExecution method.")
|
||||
|
||||
///@{
|
||||
@ -120,30 +99,6 @@ VTKM_CONT auto CallPrepareForExecution(T&& execObject,
|
||||
}
|
||||
///@}
|
||||
|
||||
// If you get a deprecation warning at this function, it means that an ExecutionObject is using the
|
||||
// old style PrepareForExecution. Update its PrepareForExecution method to accept both a device and
|
||||
// a token.
|
||||
//
|
||||
// Developer note: the third template argument, TokenType, is expected to be a vtkm::cont::Token
|
||||
// (which is ignored). The reason why it is a template argument instead of just the type expected
|
||||
// is so that ExecObjects that implement both versions of PrepareForExecution (for backward
|
||||
// compatibility) will match the non-deprecated version instead of being ambiguous.
|
||||
template <typename T, typename Device, typename TokenType>
|
||||
VTKM_CONT VTKM_DEPRECATED(
|
||||
1.6,
|
||||
"ExecutionObjects now require a PrepareForExecution that takes a vtkm::cont::Token object. "
|
||||
"PrepareForExecution(Device) is deprecated. Implement PrepareForExecution(Device, "
|
||||
"Token).") auto CallPrepareForExecution(T&& execObject, Device device, TokenType&)
|
||||
-> decltype(execObject.PrepareForExecution(device))
|
||||
{
|
||||
VTKM_IS_EXECUTION_OBJECT(T);
|
||||
VTKM_IS_DEVICE_ADAPTER_TAG(Device);
|
||||
VTKM_STATIC_ASSERT(
|
||||
(std::is_same<vtkm::cont::Token, typename std::decay<TokenType>::type>::value));
|
||||
|
||||
return execObject.PrepareForExecution(device);
|
||||
}
|
||||
|
||||
/// \brief Gets the type of the execution-side object for an ExecutionObject.
|
||||
///
|
||||
/// An execution object (that is, an object inheriting from `vtkm::cont::ExecutionObjectBase`) is
|
||||
|
@ -39,13 +39,6 @@ public:
|
||||
Cells,
|
||||
Partitions,
|
||||
Global,
|
||||
ANY VTKM_DEPRECATED(1.8, "Use vtkm::cont::Field::Association::Any.") = Any,
|
||||
WHOLE_MESH VTKM_DEPRECATED(1.8, "Use vtkm::cont::Field::Association::WholeDataSet.") =
|
||||
WholeDataSet,
|
||||
POINTS VTKM_DEPRECATED(1.8, "Use vtkm::cont::Field::Association::Points.") = Points,
|
||||
CELL_SET VTKM_DEPRECATED(1.8, "Use vtkm::cont::Field::Association::Cells.") = Cells,
|
||||
WholeMesh VTKM_DEPRECATED(1.9, "Use vtkm::cont::Field::Association::WholeDataSet.") =
|
||||
WholeDataSet
|
||||
};
|
||||
|
||||
VTKM_CONT
|
||||
@ -82,16 +75,6 @@ public:
|
||||
}
|
||||
VTKM_CONT bool IsGlobalField() const { return this->FieldAssociation == Association::Global; }
|
||||
|
||||
VTKM_DEPRECATED(1.9, "Use IsCellField.")
|
||||
VTKM_CONT bool IsFieldCell() const { return this->IsCellField(); }
|
||||
VTKM_DEPRECATED(1.9, "Use IsPointField.")
|
||||
VTKM_CONT bool IsFieldPoint() const { return this->IsPointField(); }
|
||||
VTKM_DEPRECATED(1.9, "Use IsWholeDataSetField. Note that meaning of `Global` has changed!")
|
||||
VTKM_CONT bool IsFieldGlobal() const
|
||||
{
|
||||
return this->FieldAssociation == Association::WholeDataSet;
|
||||
}
|
||||
|
||||
/// Returns true if the array of the field has a value type that matches something in
|
||||
/// `VTKM_FIELD_TYPE_LIST` and a storage that matches something in `VTKM_FIELD_STORAGE_LIST`.
|
||||
VTKM_CONT bool IsSupportedType() const;
|
||||
@ -157,20 +140,6 @@ public:
|
||||
///
|
||||
VTKM_CONT void ConvertToExpected();
|
||||
|
||||
template <typename TypeList>
|
||||
VTKM_DEPRECATED(1.6, "TypeList no longer supported in Field::GetRange.")
|
||||
VTKM_CONT void GetRange(vtkm::Range* range, TypeList) const
|
||||
{
|
||||
this->GetRange(range);
|
||||
}
|
||||
|
||||
template <typename TypeList>
|
||||
VTKM_DEPRECATED(1.6, "TypeList no longer supported in Field::GetRange.")
|
||||
VTKM_CONT const vtkm::cont::ArrayHandle<vtkm::Range>& GetRange(TypeList) const
|
||||
{
|
||||
return this->GetRange();
|
||||
}
|
||||
|
||||
VTKM_CONT void SetData(const vtkm::cont::UnknownArrayHandle& newdata);
|
||||
|
||||
template <typename T, typename StorageTag>
|
||||
@ -217,14 +186,6 @@ vtkm::cont::Field make_Field(std::string name,
|
||||
return vtkm::cont::Field(name, association, vtkm::cont::make_ArrayHandle(data, size, copy));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
VTKM_DEPRECATED(1.6, "Specify a vtkm::CopyFlag or use a move version of make_Field.")
|
||||
vtkm::cont::Field
|
||||
make_Field(std::string name, Field::Association association, const T* data, vtkm::Id size)
|
||||
{
|
||||
return make_Field(name, association, data, size, vtkm::CopyFlag::Off);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
vtkm::cont::Field make_Field(std::string name,
|
||||
Field::Association association,
|
||||
@ -234,20 +195,12 @@ vtkm::cont::Field make_Field(std::string name,
|
||||
return vtkm::cont::Field(name, association, vtkm::cont::make_ArrayHandle(data, copy));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
VTKM_DEPRECATED(1.6, "Specify a vtkm::CopyFlag or use a move version of make_Field.")
|
||||
vtkm::cont::Field
|
||||
make_Field(std::string name, Field::Association association, const std::vector<T>& data)
|
||||
{
|
||||
return make_Field(name, association, data, vtkm::CopyFlag::Off);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
vtkm::cont::Field make_FieldMove(std::string name,
|
||||
Field::Association association,
|
||||
std::vector<T>&& data)
|
||||
{
|
||||
return vtkm::cont::Field(name, association, vtkm::cont::make_ArrayHandleMove(data));
|
||||
return vtkm::cont::Field(name, association, vtkm::cont::make_ArrayHandleMove(std::move(data)));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
@ -320,24 +273,6 @@ struct DynamicTransformTraits<vtkm::cont::Field>
|
||||
//=============================================================================
|
||||
// Specializations of serialization related classes
|
||||
/// @cond SERIALIZATION
|
||||
namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
{
|
||||
template <typename TypeList = VTKM_DEFAULT_TYPE_LIST>
|
||||
struct VTKM_DEPRECATED(1.6, "You can now directly serialize Field.") SerializableField
|
||||
{
|
||||
SerializableField() = default;
|
||||
|
||||
explicit SerializableField(const vtkm::cont::Field& field)
|
||||
: Field(field)
|
||||
{
|
||||
}
|
||||
|
||||
vtkm::cont::Field Field;
|
||||
};
|
||||
} // namespace cont
|
||||
} // namespace vtkm
|
||||
|
||||
namespace mangled_diy_namespace
|
||||
{
|
||||
@ -349,27 +284,6 @@ struct VTKM_CONT_EXPORT Serialization<vtkm::cont::Field>
|
||||
static VTKM_CONT void load(BinaryBuffer& bb, vtkm::cont::Field& field);
|
||||
};
|
||||
|
||||
// Implement deprecated code
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
template <typename TypeList>
|
||||
struct Serialization<vtkm::cont::SerializableField<TypeList>>
|
||||
{
|
||||
private:
|
||||
using Type = vtkm::cont::SerializableField<TypeList>;
|
||||
|
||||
public:
|
||||
static VTKM_CONT void save(BinaryBuffer& bb, const Type& serializable)
|
||||
{
|
||||
Serialization<vtkm::cont::Field>::save(bb, serializable.Field);
|
||||
}
|
||||
|
||||
static VTKM_CONT void load(BinaryBuffer& bb, Type& serializable)
|
||||
{
|
||||
Serialization<vtkm::cont::Field>::load(bb, serializable.Field);
|
||||
}
|
||||
};
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
|
||||
} // diy
|
||||
/// @endcond SERIALIZATION
|
||||
|
||||
|
@ -37,32 +37,6 @@ vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeCompute(
|
||||
const vtkm::cont::DataSet& dataset,
|
||||
const std::string& name,
|
||||
vtkm::cont::Field::Association assoc = vtkm::cont::Field::Association::Any);
|
||||
|
||||
template <typename TypeList>
|
||||
VTKM_DEPRECATED(1.6, "FieldRangeCompute no longer supports TypeList.")
|
||||
VTKM_CONT vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeCompute(
|
||||
const vtkm::cont::DataSet& dataset,
|
||||
const std::string& name,
|
||||
vtkm::cont::Field::Association assoc,
|
||||
TypeList)
|
||||
{
|
||||
VTKM_IS_LIST(TypeList);
|
||||
vtkm::cont::Field field;
|
||||
try
|
||||
{
|
||||
field = dataset.GetField(name, assoc);
|
||||
}
|
||||
catch (vtkm::cont::ErrorBadValue&)
|
||||
{
|
||||
// field missing, return empty range.
|
||||
return vtkm::cont::ArrayHandle<vtkm::Range>();
|
||||
}
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
return field.GetRange(TypeList());
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
}
|
||||
|
||||
//@}
|
||||
|
||||
//{@
|
||||
@ -80,48 +54,8 @@ vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeCompute(
|
||||
const vtkm::cont::PartitionedDataSet& pds,
|
||||
const std::string& name,
|
||||
vtkm::cont::Field::Association assoc = vtkm::cont::Field::Association::Any);
|
||||
|
||||
template <typename TypeList>
|
||||
VTKM_DEPRECATED(1.6, "FieldRangeCompute no longer supports TypeList.")
|
||||
VTKM_CONT vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeCompute(
|
||||
const vtkm::cont::PartitionedDataSet& pds,
|
||||
const std::string& name,
|
||||
vtkm::cont::Field::Association assoc,
|
||||
TypeList)
|
||||
{
|
||||
VTKM_IS_LIST(TypeList);
|
||||
VTKM_STATIC_ASSERT_MSG((!std::is_same<TypeList, vtkm::ListUniversal>::value),
|
||||
"Cannot use vtkm::ListUniversal with FieldRangeCompute.");
|
||||
std::vector<vtkm::Range> result_vector = std::accumulate(
|
||||
pds.begin(),
|
||||
pds.end(),
|
||||
std::vector<vtkm::Range>(),
|
||||
[&](const std::vector<vtkm::Range>& accumulated_value, const vtkm::cont::DataSet& dataset) {
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
vtkm::cont::ArrayHandle<vtkm::Range> partition_range =
|
||||
vtkm::cont::FieldRangeCompute(dataset, name, assoc, TypeList());
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
|
||||
std::vector<vtkm::Range> result = accumulated_value;
|
||||
|
||||
// if the current partition has more components than we have seen so far,
|
||||
// resize the result to fit all components.
|
||||
result.resize(
|
||||
std::max(result.size(), static_cast<size_t>(partition_range.GetNumberOfValues())));
|
||||
|
||||
auto portal = partition_range.ReadPortal();
|
||||
std::transform(vtkm::cont::ArrayPortalToIteratorBegin(portal),
|
||||
vtkm::cont::ArrayPortalToIteratorEnd(portal),
|
||||
result.begin(),
|
||||
result.begin(),
|
||||
std::plus<vtkm::Range>());
|
||||
return result;
|
||||
});
|
||||
|
||||
return vtkm::cont::make_ArrayHandleMove(std::move(result_vector));
|
||||
}
|
||||
|
||||
//@}
|
||||
|
||||
}
|
||||
} // namespace vtkm::cont
|
||||
|
||||
|
@ -42,22 +42,6 @@ vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeGlobalCompute(
|
||||
const vtkm::cont::DataSet& dataset,
|
||||
const std::string& name,
|
||||
vtkm::cont::Field::Association assoc = vtkm::cont::Field::Association::Any);
|
||||
|
||||
template <typename TypeList>
|
||||
VTKM_DEPRECATED(1.6, "FieldRangeGlobalCompute no longer supports TypeList.")
|
||||
VTKM_CONT vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeGlobalCompute(
|
||||
const vtkm::cont::DataSet& dataset,
|
||||
const std::string& name,
|
||||
vtkm::cont::Field::Association assoc,
|
||||
TypeList)
|
||||
{
|
||||
VTKM_IS_LIST(TypeList);
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
auto lrange = vtkm::cont::FieldRangeCompute(dataset, name, assoc, TypeList());
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
return vtkm::cont::detail::MergeRangesGlobal(lrange);
|
||||
}
|
||||
|
||||
//@}
|
||||
|
||||
//{@
|
||||
@ -74,22 +58,8 @@ vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeGlobalCompute(
|
||||
const vtkm::cont::PartitionedDataSet& pds,
|
||||
const std::string& name,
|
||||
vtkm::cont::Field::Association assoc = vtkm::cont::Field::Association::Any);
|
||||
|
||||
template <typename TypeList>
|
||||
VTKM_DEPRECATED(1.6, "FieldRangeGlobalCompute no longer supports TypeList.")
|
||||
VTKM_CONT vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeGlobalCompute(
|
||||
const vtkm::cont::PartitionedDataSet& pds,
|
||||
const std::string& name,
|
||||
vtkm::cont::Field::Association assoc,
|
||||
TypeList)
|
||||
{
|
||||
VTKM_IS_LIST(TypeList);
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
auto lrange = vtkm::cont::FieldRangeCompute(pds, name, assoc, TypeList());
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
return vtkm::cont::detail::MergeRangesGlobal(lrange);
|
||||
}
|
||||
//@}
|
||||
|
||||
}
|
||||
} // namespace vtkm::cont
|
||||
|
||||
|
@ -177,21 +177,6 @@ InitializeResult Initialize(int& argc, char* argv[], InitializeOptions opts)
|
||||
opt::VtkmArg::Required,
|
||||
loggingHelp.c_str() });
|
||||
|
||||
// TODO: remove deprecated options on next vtk-m release
|
||||
usage.push_back({ opt::OptionIndex::DEPRECATED_DEVICE,
|
||||
0,
|
||||
"d",
|
||||
"device",
|
||||
VtkmDeviceArg::IsDevice,
|
||||
" --device, -d <dev> \tDEPRECATED: use --vtkm-device to set the device" });
|
||||
usage.push_back({ opt::OptionIndex::DEPRECATED_LOGLEVEL,
|
||||
0,
|
||||
"v",
|
||||
"",
|
||||
opt::VtkmArg::Required,
|
||||
" -v <#|INFO|WARNING|ERROR|FATAL|OFF> \tDEPRECATED: use --vtkm-log-level to "
|
||||
"set the log level" });
|
||||
|
||||
// Bring in extra args used by the runtime device configuration options
|
||||
vtkm::cont::internal::RuntimeDeviceConfigurationOptions runtimeDeviceOptions(usage);
|
||||
|
||||
@ -240,32 +225,9 @@ InitializeResult Initialize(int& argc, char* argv[], InitializeOptions opts)
|
||||
vtkm::cont::DeviceAdapterTagAny{}, runtimeDeviceOptions, argc, argv);
|
||||
}
|
||||
|
||||
if (options[opt::OptionIndex::DEPRECATED_LOGLEVEL])
|
||||
if (options[opt::OptionIndex::DEVICE])
|
||||
{
|
||||
VTKM_LOG_S(vtkm::cont::LogLevel::Error,
|
||||
"Supplied Deprecated log level flag: "
|
||||
<< std::string{ options[opt::OptionIndex::DEPRECATED_LOGLEVEL].name } << ", use "
|
||||
<< loggingFlag << " instead.");
|
||||
#ifdef VTKM_ENABLE_LOGGING
|
||||
vtkm::cont::SetStderrLogLevel(options[opt::OptionIndex::DEPRECATED_LOGLEVEL].arg);
|
||||
#endif // VTKM_ENABLE_LOGGING
|
||||
}
|
||||
|
||||
if (options[opt::OptionIndex::DEVICE] || options[opt::OptionIndex::DEPRECATED_DEVICE])
|
||||
{
|
||||
const char* arg = nullptr;
|
||||
if (options[opt::OptionIndex::DEPRECATED_DEVICE])
|
||||
{
|
||||
VTKM_LOG_S(vtkm::cont::LogLevel::Error,
|
||||
"Supplied Deprecated device flag "
|
||||
<< std::string{ options[opt::OptionIndex::DEPRECATED_DEVICE].name }
|
||||
<< ", use --vtkm-device instead");
|
||||
arg = options[opt::OptionIndex::DEPRECATED_DEVICE].arg;
|
||||
}
|
||||
if (options[opt::OptionIndex::DEVICE])
|
||||
{
|
||||
arg = options[opt::OptionIndex::DEVICE].arg;
|
||||
}
|
||||
const char* arg = options[opt::OptionIndex::DEVICE].arg;
|
||||
auto id = vtkm::cont::make_DeviceAdapterId(arg);
|
||||
if (id != vtkm::cont::DeviceAdapterTagAny{})
|
||||
{
|
||||
|
@ -374,16 +374,6 @@ LogScope::~LogScope() = default;
|
||||
|
||||
} // namespace detail
|
||||
|
||||
VTKM_CONT
|
||||
void LogScope(LogLevel level, const char* file, unsigned line, const char* format...)
|
||||
{
|
||||
// This does not scope right, but neither did the deprecated method this is replacing.
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
detail::LogScope scopedVar{ level, file, line, format, args };
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
VTKM_CONT
|
||||
void LogCond(LogLevel level, bool cond, const char* file, unsigned line, const char* format...)
|
||||
{
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include <vtkm/internal/Configure.h>
|
||||
#include <vtkm/internal/ExportMacros.h>
|
||||
|
||||
#include <vtkm/Deprecated.h>
|
||||
#include <vtkm/Types.h>
|
||||
|
||||
#include <vtkm/cont/vtkm_cont_export.h>
|
||||
@ -215,9 +214,6 @@
|
||||
#define VTKM_LOG_SCOPE_FUNCTION(level) VTKM_LOG_SCOPE(level, __func__)
|
||||
#define VTKM_LOG_ALWAYS_S(level, ...) VTKM_LOG_S(level, __VA_ARGS__)
|
||||
|
||||
// VTKM_LOG_ERROR_CONTEXT is disabled as it is deprecated
|
||||
#define VTKM_LOG_ERROR_CONTEXT(desc, data)
|
||||
|
||||
|
||||
// Convenience macros:
|
||||
|
||||
@ -536,11 +532,6 @@ public:
|
||||
|
||||
} // namespace detail
|
||||
|
||||
VTKM_DEPRECATED(1.9, "Use VTKM_LOG_SCOPE macro.")
|
||||
VTKM_CONT_EXPORT
|
||||
VTKM_CONT
|
||||
void LogScope(LogLevel level, const char* file, unsigned line, const char* format...);
|
||||
|
||||
/**
|
||||
* \brief Conditionally logs a message with a stream-like interface.
|
||||
*
|
||||
|
@ -47,12 +47,6 @@ public:
|
||||
VTKM_CONT
|
||||
PartitionedDataSet() = default;
|
||||
|
||||
VTKM_DEPRECATED(1.9, "Renamed to GetFieldFromPartition.")
|
||||
VTKM_CONT vtkm::cont::Field GetField(const std::string& field_name, int partition_index) const
|
||||
{
|
||||
return this->GetFieldFromPartition(field_name, partition_index);
|
||||
}
|
||||
|
||||
/// Get the field @a field_name from partition @a partition_index.
|
||||
VTKM_CONT
|
||||
vtkm::cont::Field GetFieldFromPartition(const std::string& field_name, int partition_index) const;
|
||||
|
@ -1,30 +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_PointLocatorUniformGrid_h
|
||||
#define vtk_m_cont_PointLocatorUniformGrid_h
|
||||
|
||||
#include <vtkm/Deprecated.h>
|
||||
|
||||
#include <vtkm/cont/PointLocatorSparseGrid.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
{
|
||||
|
||||
struct VTKM_ALWAYS_EXPORT VTKM_DEPRECATED(1.6, "Replaced with PointLocatorSparseGrid.")
|
||||
PointLocatorUniformGrid : vtkm::cont::PointLocatorSparseGrid
|
||||
{
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif //vtk_m_cont_PointLocatorUniformGrid_h
|
@ -1,29 +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_StorageImplicit_h
|
||||
#define vtk_m_cont_StorageImplicit_h
|
||||
|
||||
#include <vtkm/Deprecated.h>
|
||||
#include <vtkm/cont/ArrayHandleImplicit.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
|
||||
VTKM_DEPRECATED(1.6, "Use ArrayHandleImplicit.h instead of StorageImplicit.h.")
|
||||
inline void StorageImplicit_h_deprecated() {}
|
||||
|
||||
inline void ActivateStorageImplicit_h_deprecated_warning()
|
||||
{
|
||||
StorageImplicit_h_deprecated();
|
||||
}
|
||||
|
||||
} // namespace vtkm
|
||||
|
||||
#endif //vtk_m_cont_StorageImplicit_h
|
@ -1,80 +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_StorageListTag_h
|
||||
#define vtk_m_cont_StorageListTag_h
|
||||
|
||||
// Everything in this header file is deprecated and moved to StorageList.h.
|
||||
#include <vtkm/Deprecated.h>
|
||||
|
||||
struct VTKM_DEPRECATED(
|
||||
1.6,
|
||||
"TypeListTag.h is deprecated. Include TypeList.h and use vtkm::TypeList* instead.")
|
||||
VTKmTypeListTagHeaderDeprecationWarning
|
||||
{
|
||||
};
|
||||
|
||||
inline VTKmTypeListTagHeaderDeprecationWarning IssueVTKmTypeListTagHeaderDeprecationWarning()
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
#ifndef VTKM_DEFAULT_STORAGE_LIST_TAG
|
||||
#define VTKM_DEFAULT_STORAGE_LIST_TAG ::vtkm::cont::detail::StorageListTagDefault
|
||||
#endif
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
#include <vtkm/ListTag.h>
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
|
||||
#include <vtkm/cont/StorageList.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
{
|
||||
|
||||
struct VTKM_ALWAYS_EXPORT VTKM_DEPRECATED(
|
||||
1.6,
|
||||
"StorageListTagBasic replaced by StorageListBasic. "
|
||||
"Note that the new StorageListBasic cannot be subclassed.") StorageListTagBasic
|
||||
: vtkm::internal::ListAsListTag<StorageListBasic>
|
||||
{
|
||||
/// @cond NONE
|
||||
};
|
||||
/// @endcond
|
||||
|
||||
struct VTKM_ALWAYS_EXPORT VTKM_DEPRECATED(
|
||||
1.6,
|
||||
"StorageListTagSupported replaced by StorageListBasic. "
|
||||
"Note that the new StorageListSupported cannot be subclassed.") StorageListTagSupported
|
||||
: vtkm::internal::ListAsListTag<StorageListBasic>
|
||||
{
|
||||
/// @cond NONE
|
||||
};
|
||||
/// @endcond
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
struct VTKM_ALWAYS_EXPORT VTKM_DEPRECATED(
|
||||
1.6,
|
||||
"VTKM_DEFAULT_STORAGE_LIST_TAG replaced by VTKM_DEFAULT_STORAGE_LIST. "
|
||||
"Note that the new VTKM_DEFAULT_STORAGE_LIST cannot be subclassed.") StorageListTagDefault
|
||||
: vtkm::internal::ListAsListTag<vtkm::cont::StorageListBasic>
|
||||
{
|
||||
/// @cond NONE
|
||||
};
|
||||
/// @endcond
|
||||
|
||||
} // namespace detail
|
||||
}
|
||||
} // namespace vtkm::cont
|
||||
|
||||
#endif //vtk_m_cont_StorageListTag_h
|
@ -201,142 +201,4 @@ public:
|
||||
|
||||
/// @endcond SERIALIZATION
|
||||
|
||||
// Implement the deprecated functionality of DynamicCellSetBase, which was replaced
|
||||
// by UnknownCellSet/UncertainCellSet. Everything below this line (up to the #endif
|
||||
// for the include guard) can be deleted once the deprecated functionality is removed.
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
{
|
||||
|
||||
// This is a deprecated class. Don't warn about deprecation while implementing
|
||||
// deprecated functionality.
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
|
||||
template <typename CellSetList>
|
||||
class VTKM_ALWAYS_EXPORT VTKM_DEPRECATED(1.8,
|
||||
"Use vtkm::cont::UncertainCellSet.") DynamicCellSetBase
|
||||
: public vtkm::cont::UncertainCellSet<CellSetList>
|
||||
{
|
||||
using Superclass = vtkm::cont::UncertainCellSet<CellSetList>;
|
||||
|
||||
public:
|
||||
using Superclass::Superclass;
|
||||
|
||||
VTKM_CONT DynamicCellSetBase<CellSetList> NewInstance() const
|
||||
{
|
||||
return DynamicCellSetBase<CellSetList>(this->Superclass::NewInstance());
|
||||
}
|
||||
|
||||
template <typename NewCellSetList>
|
||||
VTKM_CONT vtkm::cont::DynamicCellSetBase<NewCellSetList> ResetCellSetList(NewCellSetList) const
|
||||
{
|
||||
return vtkm::cont::DynamicCellSetBase<NewCellSetList>(*this);
|
||||
}
|
||||
template <typename NewCellSetList>
|
||||
VTKM_CONT vtkm::cont::DynamicCellSetBase<NewCellSetList> ResetCellSetList() const
|
||||
{
|
||||
return vtkm::cont::DynamicCellSetBase<NewCellSetList>(*this);
|
||||
}
|
||||
};
|
||||
|
||||
inline DynamicCellSet::operator vtkm::cont::DynamicCellSetBase<VTKM_DEFAULT_CELL_SET_LIST>() const
|
||||
{
|
||||
return vtkm::cont::DynamicCellSetBase<VTKM_DEFAULT_CELL_SET_LIST>{ *this };
|
||||
}
|
||||
|
||||
namespace internal
|
||||
{
|
||||
|
||||
template <typename CellSetList>
|
||||
struct DynamicTransformTraits<vtkm::cont::DynamicCellSetBase<CellSetList>>
|
||||
{
|
||||
using DynamicTag = vtkm::cont::internal::DynamicTransformTagCastAndCall;
|
||||
};
|
||||
|
||||
} // namespace internal
|
||||
|
||||
}
|
||||
} // namespace vtkm::cont
|
||||
|
||||
//=============================================================================
|
||||
// Specializations of serialization related classes
|
||||
/// @cond SERIALIZATION
|
||||
namespace mangled_diy_namespace
|
||||
{
|
||||
|
||||
namespace internal
|
||||
{
|
||||
|
||||
struct DynamicCellSetSerializeFunctor
|
||||
{
|
||||
template <typename CellSetType>
|
||||
void operator()(const CellSetType& cs, BinaryBuffer& bb) const
|
||||
{
|
||||
vtkmdiy::save(bb, vtkm::cont::SerializableTypeString<CellSetType>::Get());
|
||||
vtkmdiy::save(bb, cs);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename CellSetTypes>
|
||||
struct DynamicCellSetDeserializeFunctor
|
||||
{
|
||||
template <typename CellSetType>
|
||||
void operator()(CellSetType,
|
||||
vtkm::cont::DynamicCellSetBase<CellSetTypes>& dh,
|
||||
const std::string& typeString,
|
||||
bool& success,
|
||||
BinaryBuffer& bb) const
|
||||
{
|
||||
if (!success && (typeString == vtkm::cont::SerializableTypeString<CellSetType>::Get()))
|
||||
{
|
||||
CellSetType cs;
|
||||
vtkmdiy::load(bb, cs);
|
||||
dh = vtkm::cont::DynamicCellSetBase<CellSetTypes>(cs);
|
||||
success = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
} // internal
|
||||
|
||||
template <typename CellSetTypes>
|
||||
struct Serialization<vtkm::cont::DynamicCellSetBase<CellSetTypes>>
|
||||
{
|
||||
private:
|
||||
using Type = vtkm::cont::DynamicCellSetBase<CellSetTypes>;
|
||||
|
||||
public:
|
||||
static VTKM_CONT void save(BinaryBuffer& bb, const Type& obj)
|
||||
{
|
||||
obj.CastAndCall(internal::DynamicCellSetSerializeFunctor{}, bb);
|
||||
}
|
||||
|
||||
static VTKM_CONT void load(BinaryBuffer& bb, Type& obj)
|
||||
{
|
||||
std::string typeString;
|
||||
vtkmdiy::load(bb, typeString);
|
||||
|
||||
bool success = false;
|
||||
vtkm::ListForEach(internal::DynamicCellSetDeserializeFunctor<CellSetTypes>{},
|
||||
CellSetTypes{},
|
||||
obj,
|
||||
typeString,
|
||||
success,
|
||||
bb);
|
||||
|
||||
if (!success)
|
||||
{
|
||||
throw vtkm::cont::ErrorBadType("Error deserializing DynamicCellSet. Message TypeString: " +
|
||||
typeString);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
} // diy
|
||||
/// @endcond SERIALIZATION
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
|
||||
#endif //vtk_m_cont_UncertainCellSet_h
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <vtkm/cont/ArrayHandleStride.h>
|
||||
#include <vtkm/cont/StorageList.h>
|
||||
|
||||
#include <vtkm/Deprecated.h>
|
||||
#include <vtkm/TypeList.h>
|
||||
|
||||
#include <memory>
|
||||
@ -550,15 +551,6 @@ public:
|
||||
NewValueTypeList = NewValueTypeList{},
|
||||
NewStorageTypeList = NewStorageTypeList{}) const;
|
||||
|
||||
template <typename NewValueTypeList>
|
||||
VTKM_DEPRECATED(1.6, "Specify both value types and storage types.")
|
||||
VTKM_CONT
|
||||
vtkm::cont::UncertainArrayHandle<NewValueTypeList, vtkm::cont::StorageListCommon> ResetTypes(
|
||||
NewValueTypeList = NewValueTypeList{}) const
|
||||
{
|
||||
return this->ResetTypes<NewValueTypeList, vtkm::cont::StorageListCommon>();
|
||||
}
|
||||
|
||||
/// \brief Returns the number of values in the array.
|
||||
///
|
||||
VTKM_CONT vtkm::Id GetNumberOfValues() const;
|
||||
@ -659,32 +651,6 @@ public:
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
#endif
|
||||
|
||||
// For code still expecting a VariantArrayHandle
|
||||
template <typename ArrayHandleType>
|
||||
VTKM_DEPRECATED(1.6, "Use AsArrayHandle.")
|
||||
VTKM_CONT ArrayHandleType Cast() const
|
||||
{
|
||||
return this->AsArrayHandle<ArrayHandleType>();
|
||||
}
|
||||
template <typename ArrayHandleType>
|
||||
VTKM_DEPRECATED(1.6, "Use AsArrayHandle.")
|
||||
VTKM_CONT void CopyTo(ArrayHandleType& array) const
|
||||
{
|
||||
this->AsArrayHandle(array);
|
||||
}
|
||||
template <typename MultiplexerType>
|
||||
VTKM_DEPRECATED(1.6, "Use AsArrayHandle.")
|
||||
VTKM_CONT MultiplexerType AsMultiplexer() const
|
||||
{
|
||||
return this->AsArrayHandle<MultiplexerType>();
|
||||
}
|
||||
template <typename MultiplexerType>
|
||||
VTKM_DEPRECATED(1.6, "Use AsArrayHandle.")
|
||||
VTKM_CONT void AsMultiplexer(MultiplexerType& result) const
|
||||
{
|
||||
result = this->AsArrayHandle<MultiplexerType>();
|
||||
}
|
||||
|
||||
/// \brief Deep copies data from another `UnknownArrayHandle`.
|
||||
///
|
||||
/// This method takes an `UnknownArrayHandle` and deep copies data from it.
|
||||
@ -884,16 +850,6 @@ public:
|
||||
template <typename Functor, typename... Args>
|
||||
VTKM_CONT void CastAndCallWithExtractedArray(Functor&& functor, Args&&... args) const;
|
||||
|
||||
template <typename FunctorOrStorageList, typename... Args>
|
||||
VTKM_CONT VTKM_DEPRECATED(1.6, "Use CastAndCallForTypes.") void CastAndCall(
|
||||
FunctorOrStorageList&& functorOrStorageList,
|
||||
Args&&... args) const
|
||||
{
|
||||
this->CastAndCallImpl(vtkm::internal::IsList<FunctorOrStorageList>{},
|
||||
std::forward<FunctorOrStorageList>(functorOrStorageList),
|
||||
std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
/// Releases any resources being used in the execution environment (that are
|
||||
/// not being shared by the control environment).
|
||||
///
|
||||
@ -904,20 +860,6 @@ public:
|
||||
VTKM_CONT void ReleaseResources() const;
|
||||
|
||||
VTKM_CONT void PrintSummary(std::ostream& out, bool full = false) const;
|
||||
|
||||
private:
|
||||
// Remove this when deprecated CastAndCall is removed.
|
||||
template <typename... Args>
|
||||
VTKM_CONT void CastAndCallImpl(std::false_type, Args&&... args) const
|
||||
{
|
||||
this->CastAndCallForTypes<vtkm::TypeListCommon, vtkm::cont::StorageListCommon>(
|
||||
std::forward<Args>(args)...);
|
||||
}
|
||||
template <typename StorageList, typename... Args>
|
||||
VTKM_CONT void CastAndCallImpl(std::true_type, StorageList, Args&&... args) const
|
||||
{
|
||||
this->CastAndCallForTypes<vtkm::TypeListCommon, StorageList>(std::forward<Args>(args)...);
|
||||
}
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
|
@ -14,8 +14,6 @@
|
||||
#include <vtkm/cont/CellSet.h>
|
||||
#include <vtkm/cont/DefaultTypes.h>
|
||||
|
||||
#include <vtkm/Deprecated.h>
|
||||
|
||||
#include <vtkm/cont/vtkm_cont_export.h>
|
||||
|
||||
#include <memory>
|
||||
@ -223,47 +221,6 @@ public:
|
||||
///
|
||||
template <typename CellSetList, typename Functor, typename... Args>
|
||||
VTKM_CONT void CastAndCallForTypes(Functor&& functor, Args&&... args) const;
|
||||
|
||||
// Support for deprecated DynamicCellSet features
|
||||
|
||||
template <typename CellSetType>
|
||||
VTKM_DEPRECATED(1.8, "Use CanConvert<decltype(cellset)>() (or IsType).")
|
||||
VTKM_CONT bool IsSameType(const CellSetType&) const
|
||||
{
|
||||
return this->IsType<CellSetType>();
|
||||
}
|
||||
|
||||
template <typename CellSetType>
|
||||
VTKM_DEPRECATED(1.8, "Use AsCellSet<CellSetType>().")
|
||||
VTKM_CONT CellSetType& Cast() const
|
||||
{
|
||||
VTKM_IS_CELL_SET(CellSetType);
|
||||
CellSetType* cellSetPointer = dynamic_cast<CellSetType*>(this->Container.get());
|
||||
if (cellSetPointer == nullptr)
|
||||
{
|
||||
VTKM_LOG_CAST_FAIL(*this, CellSetType);
|
||||
throwFailedDynamicCast(this->GetCellSetName(), vtkm::cont::TypeToString<CellSetType>());
|
||||
}
|
||||
VTKM_LOG_CAST_SUCC(*this, *cellSetPointer);
|
||||
return *cellSetPointer;
|
||||
}
|
||||
|
||||
template <typename CellSetType>
|
||||
VTKM_DEPRECATED(1.8, "Use AsCellSet(cellSet).")
|
||||
VTKM_CONT void CopyTo(CellSetType& cellSet) const
|
||||
{
|
||||
return this->AsCellSet(cellSet);
|
||||
}
|
||||
|
||||
template <typename Functor, typename... Args>
|
||||
VTKM_DEPRECATED(1.8,
|
||||
"Use the vtkm::cont::CastAndCall free function4 or use CastAndCallForTypes or "
|
||||
"use ResetCellList and then CastAndCall.")
|
||||
VTKM_CONT void CastAndCall(Functor&& f, Args&&... args) const
|
||||
{
|
||||
this->CastAndCallForTypes<VTKM_DEFAULT_CELL_SET_LIST>(std::forward<Functor>(f),
|
||||
std::forward<Args>(args)...);
|
||||
}
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
@ -285,7 +242,7 @@ VTKM_CONT inline bool IsType(const vtkm::cont::UnknownCellSet& unknownCellSet)
|
||||
template <typename CellSetType>
|
||||
VTKM_CONT inline CellSetType Cast(const vtkm::cont::UnknownCellSet& unknownCellSet)
|
||||
{
|
||||
return unknownCellSet.Cast<CellSetType>();
|
||||
return unknownCellSet.AsCellSet<CellSetType>();
|
||||
}
|
||||
|
||||
namespace internal
|
||||
@ -394,121 +351,6 @@ public:
|
||||
|
||||
/// @endcond SERIALIZATION
|
||||
|
||||
// Implement the deprecated functionality of DynamicCellSet, which was replaced
|
||||
// by UnknownCellSet/UncertainCellSet. Everything below this line (up to the #endif
|
||||
// for the include guard) can be deleted once the deprecated functionality is removed.
|
||||
|
||||
// Headers originally included from DynamicCellSet.h but not UnknownCellSet.h
|
||||
#include <vtkm/cont/CellSetList.h>
|
||||
#include <vtkm/cont/ErrorBadValue.h>
|
||||
#include <vtkm/cont/Logging.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
{
|
||||
|
||||
// This is a deprecated class. Don't warn about deprecation while implementing
|
||||
// deprecated functionality.
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
|
||||
// Forward declaration
|
||||
template <typename CellSetList>
|
||||
class DynamicCellSetBase;
|
||||
|
||||
/// \brief Holds a cell set without having to specify concrete type.
|
||||
///
|
||||
/// \c DynamicCellSet holds a \c CellSet object using runtime polymorphism to
|
||||
/// manage different subclass types and template parameters of the subclasses
|
||||
/// rather than compile-time templates. This adds a programming convenience
|
||||
/// that helps avoid a proliferation of templates. It also provides the
|
||||
/// management necessary to interface VTK-m with data sources where types will
|
||||
/// not be known until runtime.
|
||||
///
|
||||
/// To interface between the runtime polymorphism and the templated algorithms
|
||||
/// in VTK-m, \c DynamicCellSet contains a method named \c CastAndCall that
|
||||
/// will determine the correct type from some known list of cell set types.
|
||||
/// This mechanism is used internally by VTK-m's worklet invocation mechanism
|
||||
/// to determine the type when running algorithms.
|
||||
///
|
||||
/// By default, \c DynamicCellSet will assume that the value type in the array
|
||||
/// matches one of the types specified by \c VTKM_DEFAULT_CELL_SET_LIST.
|
||||
/// This list can be changed by using the \c ResetCellSetList method. It is
|
||||
/// worthwhile to match these lists closely to the possible types that might be
|
||||
/// used. If a type is missing you will get a runtime error. If there are more
|
||||
/// types than necessary, then the template mechanism will create a lot of
|
||||
/// object code that is never used, and keep in mind that the number of
|
||||
/// combinations grows exponentially when using multiple \c Dynamic* objects.
|
||||
///
|
||||
/// The actual implementation of \c DynamicCellSet is in a templated class
|
||||
/// named \c DynamicCellSetBase, which is templated on the list of cell set
|
||||
/// types. \c DynamicCellSet is really just a typedef of \c DynamicCellSetBase
|
||||
/// with the default cell set list.
|
||||
///
|
||||
struct VTKM_ALWAYS_EXPORT VTKM_DEPRECATED(1.8, "Use vtkm::cont::UnknownCellSet.") DynamicCellSet
|
||||
: public vtkm::cont::UnknownCellSet
|
||||
{
|
||||
using UnknownCellSet::UnknownCellSet;
|
||||
|
||||
DynamicCellSet() = default;
|
||||
|
||||
DynamicCellSet(const vtkm::cont::UnknownCellSet& src)
|
||||
: UnknownCellSet(src)
|
||||
{
|
||||
}
|
||||
|
||||
operator vtkm::cont::DynamicCellSetBase<VTKM_DEFAULT_CELL_SET_LIST>() const;
|
||||
|
||||
VTKM_CONT vtkm::cont::DynamicCellSet NewInstance() const
|
||||
{
|
||||
return vtkm::cont::DynamicCellSet(this->UnknownCellSet::NewInstance());
|
||||
}
|
||||
|
||||
template <typename NewCellSetList>
|
||||
VTKM_CONT vtkm::cont::DynamicCellSetBase<NewCellSetList> ResetCellSetList(NewCellSetList) const
|
||||
{
|
||||
return vtkm::cont::DynamicCellSetBase<NewCellSetList>(*this);
|
||||
}
|
||||
template <typename NewCellSetList>
|
||||
VTKM_CONT vtkm::cont::DynamicCellSetBase<NewCellSetList> ResetCellSetList() const
|
||||
{
|
||||
return vtkm::cont::DynamicCellSetBase<NewCellSetList>(*this);
|
||||
}
|
||||
};
|
||||
|
||||
namespace internal
|
||||
{
|
||||
|
||||
template <>
|
||||
struct DynamicTransformTraits<vtkm::cont::DynamicCellSet>
|
||||
{
|
||||
using DynamicTag = vtkm::cont::internal::DynamicTransformTagCastAndCall;
|
||||
};
|
||||
|
||||
/// Checks to see if the given object is a dynamic cell set. It contains a
|
||||
/// typedef named \c type that is either std::true_type or std::false_type.
|
||||
/// Both of these have a typedef named value with the respective boolean value.
|
||||
///
|
||||
template <typename T>
|
||||
struct DynamicCellSetCheck
|
||||
{
|
||||
using type = vtkm::cont::internal::UnknownCellSetCheck<T>;
|
||||
};
|
||||
|
||||
#define VTKM_IS_DYNAMIC_CELL_SET(T) \
|
||||
VTKM_STATIC_ASSERT(::vtkm::cont::internal::DynamicCellSetCheck<T>::type::value)
|
||||
|
||||
#define VTKM_IS_DYNAMIC_OR_STATIC_CELL_SET(T) \
|
||||
VTKM_STATIC_ASSERT(::vtkm::cont::internal::CellSetCheck<T>::type::value || \
|
||||
::vtkm::cont::internal::DynamicCellSetCheck<T>::type::value)
|
||||
|
||||
} // namespace internal
|
||||
|
||||
}
|
||||
} // namespace vtkm::cont
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
|
||||
// Include the implementation of UncertainCellSet. This should be included because there
|
||||
// are methods in UnknownCellSet that produce objects of this type. It has to be included
|
||||
// at the end to resolve the circular dependency.
|
||||
|
@ -1,382 +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_VariantArrayHandle_h
|
||||
#define vtk_m_cont_VariantArrayHandle_h
|
||||
|
||||
#include <vtkm/cont/vtkm_cont_export.h>
|
||||
|
||||
#include <vtkm/TypeList.h>
|
||||
#include <vtkm/VecTraits.h>
|
||||
|
||||
#include <vtkm/cont/ArrayHandleMultiplexer.h>
|
||||
#include <vtkm/cont/ArrayHandleTransform.h>
|
||||
#include <vtkm/cont/CastAndCall.h>
|
||||
#include <vtkm/cont/DefaultTypes.h>
|
||||
#include <vtkm/cont/ErrorBadType.h>
|
||||
#include <vtkm/cont/Logging.h>
|
||||
#include <vtkm/cont/StorageList.h>
|
||||
#include <vtkm/cont/UncertainArrayHandle.h>
|
||||
#include <vtkm/cont/UnknownArrayHandle.h>
|
||||
|
||||
#include <sstream>
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
{
|
||||
|
||||
struct VTKM_DEPRECATED(1.8, "Use UnknownCellSet.h or UncertainCellSet.h.")
|
||||
VariantArrayHandle_h_header_is_deprecated
|
||||
{
|
||||
int x;
|
||||
};
|
||||
|
||||
inline void EmitVariantArrayHandleHDeprecationWarning()
|
||||
{
|
||||
static VariantArrayHandle_h_header_is_deprecated x;
|
||||
++x.x;
|
||||
}
|
||||
|
||||
// This is a deprecated class. Don't warn about deprecation while implementing
|
||||
// deprecated functionality.
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
|
||||
/// \brief VariantArrayHandle superclass holding common operations.
|
||||
///
|
||||
/// `VariantArrayHandleCommon` is a superclass to all `VariantArrayHandleBase`
|
||||
/// and `VariantArrayHandle` classes. It contains all operations that are
|
||||
/// independent of the type lists defined for these templated class or has
|
||||
/// versions of methods that allow you to specify type lists.
|
||||
///
|
||||
/// See the documentation of `VariantArrayHandleBase` for more information.
|
||||
///
|
||||
class VTKM_ALWAYS_EXPORT VTKM_DEPRECATED(
|
||||
1.7,
|
||||
"VariantArrayHandle classes replaced with UnknownArrayHandle and UncertainArrayHandle.")
|
||||
VariantArrayHandleCommon : public vtkm::cont::UnknownArrayHandle
|
||||
{
|
||||
using Superclass = vtkm::cont::UnknownArrayHandle;
|
||||
|
||||
public:
|
||||
using Superclass::Superclass;
|
||||
|
||||
VTKM_CONT VariantArrayHandleCommon() = default;
|
||||
|
||||
VTKM_CONT VariantArrayHandleCommon(const vtkm::cont::UnknownArrayHandle& array)
|
||||
: Superclass(array)
|
||||
{
|
||||
}
|
||||
|
||||
/// Returns this array cast to the given \c ArrayHandle type. Throws \c
|
||||
/// ErrorBadType if the cast does not work. Use \c IsType
|
||||
/// to check if the cast can happen.
|
||||
///
|
||||
template <typename ArrayHandleType>
|
||||
VTKM_CONT ArrayHandleType Cast() const
|
||||
{
|
||||
return this->AsArrayHandle<ArrayHandleType>();
|
||||
}
|
||||
|
||||
/// \brief Call a functor using the underlying array type.
|
||||
///
|
||||
/// `CastAndCall` attempts to cast the held array to a specific value type,
|
||||
/// and then calls the given functor with the cast array. You must specify
|
||||
/// the `TypeList` and `StorageList` as template arguments. (Note that this
|
||||
/// calling differs from that of the `CastAndCall` methods of subclasses.)
|
||||
///
|
||||
template <typename TypeList, typename StorageList, typename Functor, typename... Args>
|
||||
VTKM_CONT void CastAndCall(Functor&& functor, Args&&... args) const
|
||||
{
|
||||
this->CastAndCallForTypes<TypeList, StorageList>(std::forward<Functor>(functor),
|
||||
std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
/// Returns this array cast to a `ArrayHandleMultiplexer` of the given type.
|
||||
/// This will attempt to cast the internal array to each supported type of
|
||||
/// the multiplexer. If none are supported, an invalid ArrayHandleMultiplexer
|
||||
/// is returned.
|
||||
///
|
||||
/// As a special case, if one of the arrays in the `ArrayHandleMultiplexer`'s
|
||||
/// type list is an `ArrayHandleCast`, then the multiplexer will look for type
|
||||
/// type of array being cast rather than an actual cast array.
|
||||
///
|
||||
///@{
|
||||
template <typename... T>
|
||||
VTKM_CONT void AsMultiplexer(vtkm::cont::ArrayHandleMultiplexer<T...>& result) const
|
||||
{
|
||||
this->AsArrayHandle(result);
|
||||
}
|
||||
|
||||
template <typename ArrayHandleMultiplexerType>
|
||||
VTKM_CONT ArrayHandleMultiplexerType AsMultiplexer() const
|
||||
{
|
||||
ArrayHandleMultiplexerType result;
|
||||
this->AsMultiplexer(result);
|
||||
return result;
|
||||
}
|
||||
///@}
|
||||
|
||||
/// Given a references to an ArrayHandle object, casts this array to the
|
||||
/// ArrayHandle's type and sets the given ArrayHandle to this array. Throws
|
||||
/// `ErrorBadType` if the cast does not work. Use `IsType` to check
|
||||
/// if the cast can happen.
|
||||
///
|
||||
/// Note that this is a shallow copy. The data are not copied and a change
|
||||
/// in the data in one array will be reflected in the other.
|
||||
///
|
||||
template <typename ArrayHandleType>
|
||||
VTKM_CONT void CopyTo(ArrayHandleType& array) const
|
||||
{
|
||||
VTKM_IS_ARRAY_HANDLE(ArrayHandleType);
|
||||
array = this->Cast<ArrayHandleType>();
|
||||
}
|
||||
|
||||
/// \brief Create a new array of the same type as this array.
|
||||
///
|
||||
/// This method creates a new array that is the same type as this one and
|
||||
/// returns a new variant array handle for it. This method is convenient when
|
||||
/// creating output arrays that should be the same type as some input array.
|
||||
///
|
||||
VTKM_CONT VariantArrayHandleCommon NewInstance() const
|
||||
{
|
||||
return VariantArrayHandleCommon(this->Superclass::NewInstance());
|
||||
}
|
||||
};
|
||||
|
||||
/// \brief Holds an array handle without having to specify template parameters.
|
||||
///
|
||||
/// `VariantArrayHandle` holds an `ArrayHandle`
|
||||
/// object using runtime polymorphism to manage different value types and
|
||||
/// storage rather than compile-time templates. This adds a programming
|
||||
/// convenience that helps avoid a proliferation of templates. It also provides
|
||||
/// the management necessary to interface VTK-m with data sources where types
|
||||
/// will not be known until runtime.
|
||||
///
|
||||
/// To interface between the runtime polymorphism and the templated algorithms
|
||||
/// in VTK-m, `VariantArrayHandle` contains a method named `CastAndCall` that
|
||||
/// will determine the correct type from some known list of types.
|
||||
/// This mechanism is used internally by VTK-m's worklet invocation
|
||||
/// mechanism to determine the type when running algorithms.
|
||||
///
|
||||
/// By default, `VariantArrayHandle` will assume that the value type in the
|
||||
/// array matches one of the types specified by `VTKM_DEFAULT_TYPE_LIST`
|
||||
/// This list can be changed by using the `ResetTypes`. It is
|
||||
/// worthwhile to match these lists closely to the possible types that might be
|
||||
/// used. If a type is missing you will get a runtime error. If there are more
|
||||
/// types than necessary, then the template mechanism will create a lot of
|
||||
/// object code that is never used, and keep in mind that the number of
|
||||
/// combinations grows exponentially when using multiple `VariantArrayHandle`
|
||||
/// objects.
|
||||
///
|
||||
/// The actual implementation of `VariantArrayHandle` is in a templated class
|
||||
/// named `VariantArrayHandleBase`, which is templated on the list of
|
||||
/// component types.
|
||||
///
|
||||
template <typename TypeList>
|
||||
class VTKM_ALWAYS_EXPORT VTKM_DEPRECATED(
|
||||
1.7,
|
||||
"VariantArrayHandle classes replaced with UnknownArrayHandle and UncertainArrayHandle.")
|
||||
VariantArrayHandleBase : public VariantArrayHandleCommon
|
||||
{
|
||||
VTKM_STATIC_ASSERT_MSG((!std::is_same<TypeList, vtkm::ListUniversal>::value),
|
||||
"Cannot use vtkm::ListUniversal with VariantArrayHandle.");
|
||||
|
||||
using Superclass = VariantArrayHandleCommon;
|
||||
|
||||
public:
|
||||
VTKM_CONT
|
||||
VariantArrayHandleBase() = default;
|
||||
|
||||
template <typename T, typename Storage>
|
||||
VTKM_CONT VariantArrayHandleBase(const vtkm::cont::ArrayHandle<T, Storage>& array)
|
||||
: Superclass(array)
|
||||
{
|
||||
}
|
||||
|
||||
VTKM_CONT explicit VariantArrayHandleBase(const VariantArrayHandleCommon& src)
|
||||
: Superclass(src)
|
||||
{
|
||||
}
|
||||
|
||||
VTKM_CONT VariantArrayHandleBase(const vtkm::cont::UnknownArrayHandle& src)
|
||||
: Superclass(src)
|
||||
{
|
||||
}
|
||||
|
||||
VTKM_CONT VariantArrayHandleBase(const VariantArrayHandleBase&) = default;
|
||||
VTKM_CONT VariantArrayHandleBase(VariantArrayHandleBase&&) noexcept = default;
|
||||
|
||||
VTKM_CONT
|
||||
~VariantArrayHandleBase() {}
|
||||
|
||||
VTKM_CONT
|
||||
VariantArrayHandleBase<TypeList>& operator=(const VariantArrayHandleBase<TypeList>&) = default;
|
||||
|
||||
VTKM_CONT
|
||||
VariantArrayHandleBase<TypeList>& operator=(VariantArrayHandleBase<TypeList>&&) noexcept =
|
||||
default;
|
||||
|
||||
VTKM_CONT operator vtkm::cont::UncertainArrayHandle<TypeList, VTKM_DEFAULT_STORAGE_LIST>() const
|
||||
{
|
||||
return vtkm::cont::UncertainArrayHandle<TypeList, VTKM_DEFAULT_STORAGE_LIST>(*this);
|
||||
}
|
||||
|
||||
|
||||
/// 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++
|
||||
/// does not allow you to actually change the template arguments, this method
|
||||
/// returns a new variant array object. This method is particularly useful to
|
||||
/// narrow down (or expand) the types when using an array of particular
|
||||
/// constraints.
|
||||
///
|
||||
template <typename NewTypeList>
|
||||
VTKM_CONT VariantArrayHandleBase<NewTypeList> ResetTypes(NewTypeList = NewTypeList()) const
|
||||
{
|
||||
VTKM_IS_LIST(NewTypeList);
|
||||
return VariantArrayHandleBase<NewTypeList>(*this);
|
||||
}
|
||||
|
||||
///@{
|
||||
/// \brief Call a functor using the underlying array type.
|
||||
///
|
||||
/// `CastAndCall` attempts to cast the held array to a specific value type,
|
||||
/// then call the given functor with the cast array. The types
|
||||
/// tried in the cast are those in the lists defined by the TypeList.
|
||||
/// By default `VariantArrayHandle` set this to `VTKM_DEFAULT_TYPE_LIST`.
|
||||
///
|
||||
/// In addition to the value type, an `ArrayHandle` also requires a storage tag.
|
||||
/// By default, `CastAndCall` attempts to cast the array using the storage tags
|
||||
/// listed in `VTKM_DEFAULT_STORAGE_LIST`. You can optionally give a custom
|
||||
/// list of storage tags as the second argument.
|
||||
///
|
||||
/// As previous stated, if a storage tag list is provided, it is given in the
|
||||
/// first argument. The functor to call with the cast array is given as the next
|
||||
/// argument (or the first argument if a storage tag list is not provided).
|
||||
/// The remaning arguments, if any, are passed to the functor.
|
||||
///
|
||||
/// The functor will be called with the cast array as its first argument. Any
|
||||
/// remaining arguments are passed from the arguments to `CastAndCall`.
|
||||
///
|
||||
template <typename FunctorOrStorageList, typename... Args>
|
||||
VTKM_CONT void CastAndCall(FunctorOrStorageList&& functorOrStorageList, Args&&... args) const
|
||||
{
|
||||
this->CastAndCallImpl(vtkm::internal::IsList<FunctorOrStorageList>(),
|
||||
std::forward<FunctorOrStorageList>(functorOrStorageList),
|
||||
std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
template <typename Functor>
|
||||
VTKM_CONT void CastAndCall(Functor&& f) const
|
||||
{
|
||||
this->CastAndCallImpl(std::false_type(), std::forward<Functor>(f));
|
||||
}
|
||||
///@}
|
||||
|
||||
/// \brief Create a new array of the same type as this array.
|
||||
///
|
||||
/// This method creates a new array that is the same type as this one and
|
||||
/// returns a new variant array handle for it. This method is convenient when
|
||||
/// creating output arrays that should be the same type as some input array.
|
||||
///
|
||||
VTKM_CONT VariantArrayHandleBase<TypeList> NewInstance() const
|
||||
{
|
||||
return VariantArrayHandleBase<TypeList>(this->Superclass::NewInstance());
|
||||
}
|
||||
|
||||
private:
|
||||
template <typename Functor, typename... Args>
|
||||
VTKM_CONT void CastAndCallImpl(std::false_type, Functor&& f, Args&&... args) const
|
||||
{
|
||||
this->Superclass::CastAndCall<TypeList, VTKM_DEFAULT_STORAGE_LIST>(std::forward<Functor>(f),
|
||||
std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
template <typename StorageList, typename Functor, typename... Args>
|
||||
VTKM_CONT void CastAndCallImpl(std::true_type, StorageList, Functor&& f, Args&&... args) const
|
||||
{
|
||||
this->Superclass::CastAndCall<TypeList, StorageList>(std::forward<Functor>(f),
|
||||
std::forward<Args>(args)...);
|
||||
}
|
||||
};
|
||||
|
||||
using VariantArrayHandle VTKM_DEPRECATED(
|
||||
1.7,
|
||||
"VariantArrayHandle classes replaced with UnknownArrayHandle and UncertainArrayHandle.") =
|
||||
vtkm::cont::VariantArrayHandleBase<VTKM_DEFAULT_TYPE_LIST>;
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// Free function casting helpers
|
||||
|
||||
/// Returns true if \c variant matches the type of ArrayHandleType.
|
||||
///
|
||||
template <typename ArrayHandleType, typename Ts>
|
||||
VTKM_CONT inline bool IsType(const vtkm::cont::VariantArrayHandleBase<Ts>& variant)
|
||||
{
|
||||
return variant.template IsType<ArrayHandleType>();
|
||||
}
|
||||
|
||||
/// Returns \c variant cast to the given \c ArrayHandle type. Throws \c
|
||||
/// ErrorBadType if the cast does not work. Use \c IsType
|
||||
/// to check if the cast can happen.
|
||||
///
|
||||
template <typename ArrayHandleType, typename Ts>
|
||||
VTKM_CONT inline ArrayHandleType Cast(const vtkm::cont::VariantArrayHandleBase<Ts>& variant)
|
||||
{
|
||||
return variant.template Cast<ArrayHandleType>();
|
||||
}
|
||||
|
||||
namespace internal
|
||||
{
|
||||
|
||||
template <typename TypeList>
|
||||
struct DynamicTransformTraits<vtkm::cont::VariantArrayHandleBase<TypeList>>
|
||||
{
|
||||
using DynamicTag = vtkm::cont::internal::DynamicTransformTagCastAndCall;
|
||||
};
|
||||
|
||||
} // namespace internal
|
||||
} // namespace cont
|
||||
} // namespace vtkm
|
||||
|
||||
//=============================================================================
|
||||
// Specializations of serialization related classes
|
||||
/// @cond SERIALIZATION
|
||||
namespace mangled_diy_namespace
|
||||
{
|
||||
|
||||
template <typename TypeList>
|
||||
struct Serialization<vtkm::cont::VariantArrayHandleBase<TypeList>>
|
||||
{
|
||||
private:
|
||||
using Type = vtkm::cont::VariantArrayHandleBase<TypeList>;
|
||||
using ImplObject = vtkm::cont::UncertainArrayHandle<TypeList, VTKM_DEFAULT_STORAGE_LIST>;
|
||||
|
||||
public:
|
||||
static VTKM_CONT void save(BinaryBuffer& bb, const Type& obj)
|
||||
{
|
||||
vtkmdiy::save(bb, ImplObject(obj));
|
||||
}
|
||||
|
||||
static VTKM_CONT void load(BinaryBuffer& bb, Type& obj)
|
||||
{
|
||||
ImplObject implObj;
|
||||
vtkmdiy::load(bb, implObj);
|
||||
obj = implObj;
|
||||
}
|
||||
};
|
||||
|
||||
} // diy
|
||||
/// @endcond SERIALIZATION
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
|
||||
|
||||
#endif //vtk_m_virts_VariantArrayHandle_h
|
@ -10,6 +10,7 @@
|
||||
#ifndef vtk_m_cont_arg_TransportTagArrayIn_h
|
||||
#define vtk_m_cont_arg_TransportTagArrayIn_h
|
||||
|
||||
#include <vtkm/Deprecated.h>
|
||||
#include <vtkm/Types.h>
|
||||
|
||||
#include <vtkm/cont/ArrayHandle.h>
|
||||
|
@ -10,6 +10,7 @@
|
||||
#ifndef vtk_m_cont_arg_TransportTagArrayInOut_h
|
||||
#define vtk_m_cont_arg_TransportTagArrayInOut_h
|
||||
|
||||
#include <vtkm/Deprecated.h>
|
||||
#include <vtkm/Types.h>
|
||||
|
||||
#include <vtkm/cont/ArrayHandle.h>
|
||||
|
@ -10,6 +10,7 @@
|
||||
#ifndef vtk_m_cont_arg_TransportTagArrayOut_h
|
||||
#define vtk_m_cont_arg_TransportTagArrayOut_h
|
||||
|
||||
#include <vtkm/Deprecated.h>
|
||||
#include <vtkm/Types.h>
|
||||
|
||||
#include <vtkm/cont/ArrayHandle.h>
|
||||
|
@ -10,6 +10,7 @@
|
||||
#ifndef vtk_m_cont_arg_TransportTagWholeArrayIn_h
|
||||
#define vtk_m_cont_arg_TransportTagWholeArrayIn_h
|
||||
|
||||
#include <vtkm/Deprecated.h>
|
||||
#include <vtkm/Types.h>
|
||||
|
||||
#include <vtkm/cont/ArrayHandle.h>
|
||||
|
@ -10,6 +10,7 @@
|
||||
#ifndef vtk_m_cont_arg_TransportTagWholeArrayInOut_h
|
||||
#define vtk_m_cont_arg_TransportTagWholeArrayInOut_h
|
||||
|
||||
#include <vtkm/Deprecated.h>
|
||||
#include <vtkm/Types.h>
|
||||
|
||||
#include <vtkm/cont/ArrayHandle.h>
|
||||
|
@ -10,6 +10,7 @@
|
||||
#ifndef vtk_m_cont_arg_TransportTagWholeArrayOut_h
|
||||
#define vtk_m_cont_arg_TransportTagWholeArrayOut_h
|
||||
|
||||
#include <vtkm/Deprecated.h>
|
||||
#include <vtkm/Types.h>
|
||||
|
||||
#include <vtkm/cont/ArrayHandle.h>
|
||||
|
@ -126,22 +126,6 @@ static void SetFastestDeviceId()
|
||||
.SetDeviceInstance(deviceId);
|
||||
}
|
||||
|
||||
//choose a cuda compute device. This can't be used if you are setting
|
||||
//up open gl interop
|
||||
VTKM_DEPRECATED(1.7,
|
||||
"Use "
|
||||
"RuntimeInformation{}.GetRuntimeConfiguration(vtkm::cont::DeviceAdapterTagCuda)."
|
||||
"SetDeviceInstance(id) instead")
|
||||
static void SetCudaDevice(int id)
|
||||
{
|
||||
cudaError_t cError = cudaSetDevice(id);
|
||||
if (cError != cudaSuccess)
|
||||
{
|
||||
std::string cuda_error_msg("Unable to bind to the given cuda device. Error: ");
|
||||
cuda_error_msg.append(cudaGetErrorString(cError));
|
||||
throw vtkm::cont::ErrorExecution(cuda_error_msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} //namespace
|
||||
|
@ -139,8 +139,8 @@ void RunEdgeCases()
|
||||
sanevalues.push_back(range(rng));
|
||||
}
|
||||
|
||||
auto bad = vtkm::cont::make_ArrayHandle(badvalues);
|
||||
auto sane = vtkm::cont::make_ArrayHandle(sanevalues);
|
||||
auto bad = vtkm::cont::make_ArrayHandle(badvalues, vtkm::CopyFlag::On);
|
||||
auto sane = vtkm::cont::make_ArrayHandle(sanevalues, vtkm::CopyFlag::On);
|
||||
decltype(sane) result;
|
||||
vtkm::worklet::DispatcherMapField<TriggerICE> dispatcher;
|
||||
dispatcher.SetDevice(Device());
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,81 +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_internal_AtomicInterfaceControl_h
|
||||
#define vtk_m_cont_internal_AtomicInterfaceControl_h
|
||||
|
||||
#include <vtkm/Atomic.h>
|
||||
#include <vtkm/Deprecated.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
{
|
||||
namespace internal
|
||||
{
|
||||
|
||||
struct VTKM_DEPRECATED(1.6, "Use the functions in vtkm/Atomic.h.") AtomicInterfaceControl
|
||||
{
|
||||
using WordTypes = vtkm::AtomicTypesSupported;
|
||||
using WordTypePreferred = vtkm::AtomicTypePreferred;
|
||||
|
||||
template <typename T>
|
||||
VTKM_EXEC_CONT static T Load(const T* addr)
|
||||
{
|
||||
return vtkm::AtomicLoad(addr);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
VTKM_EXEC_CONT static void Store(T* addr, T value)
|
||||
{
|
||||
vtkm::AtomicStore(addr, value);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
VTKM_EXEC_CONT static T Add(T* addr, T arg)
|
||||
{
|
||||
return vtkm::AtomicAdd(addr, arg);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
VTKM_EXEC_CONT static T Not(T* addr)
|
||||
{
|
||||
return vtkm::AtomicNot(addr);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
VTKM_EXEC_CONT static T And(T* addr, T mask)
|
||||
{
|
||||
return vtkm::AtomicAnd(addr, mask);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
VTKM_EXEC_CONT static T Or(T* addr, T mask)
|
||||
{
|
||||
return vtkm::AtomicOr(addr, mask);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
VTKM_EXEC_CONT static T Xor(T* addr, T mask)
|
||||
{
|
||||
return vtkm::AtomicXor(addr, mask);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
VTKM_EXEC_CONT static T CompareAndSwap(T* addr, T newWord, T expected)
|
||||
{
|
||||
vtkm::AtomicCompareExchange(addr, &expected, newWord);
|
||||
return expected;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
} // end namespace vtkm::cont::internal
|
||||
|
||||
#endif // vtk_m_cont_internal_AtomicInterfaceControl_h
|
@ -1,82 +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_internal_AtomicInterfaceExecution_h
|
||||
#define vtk_m_cont_internal_AtomicInterfaceExecution_h
|
||||
|
||||
#include <vtkm/Atomic.h>
|
||||
#include <vtkm/Deprecated.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
{
|
||||
namespace internal
|
||||
{
|
||||
|
||||
template <typename DeviceTag>
|
||||
struct VTKM_DEPRECATED(1.6, "Use the functions in vtkm/Atomic.h.") AtomicInterfaceExecution
|
||||
{
|
||||
using WordTypes = vtkm::AtomicTypesSupported;
|
||||
using WordTypePreferred = vtkm::AtomicTypePreferred;
|
||||
|
||||
template <typename T>
|
||||
VTKM_EXEC_CONT static T Load(const T* addr)
|
||||
{
|
||||
return vtkm::AtomicLoad(addr);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
VTKM_EXEC_CONT static void Store(T* addr, T value)
|
||||
{
|
||||
vtkm::AtomicStore(addr, value);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
VTKM_EXEC_CONT static T Add(T* addr, T arg)
|
||||
{
|
||||
return vtkm::AtomicAdd(addr, arg);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
VTKM_EXEC_CONT static T Not(T* addr)
|
||||
{
|
||||
return vtkm::AtomicNot(addr);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
VTKM_EXEC_CONT static T And(T* addr, T mask)
|
||||
{
|
||||
return vtkm::AtomicAnd(addr, mask);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
VTKM_EXEC_CONT static T Or(T* addr, T mask)
|
||||
{
|
||||
return vtkm::AtomicOr(addr, mask);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
VTKM_EXEC_CONT static T Xor(T* addr, T mask)
|
||||
{
|
||||
return vtkm::AtomicXor(addr, mask);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
VTKM_EXEC_CONT static T CompareAndSwap(T* addr, T newWord, T expected)
|
||||
{
|
||||
vtkm::AtomicCompareExchange(addr, &expected, newWord);
|
||||
return expected;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
} // end namespace vtkm::cont::internal
|
||||
|
||||
#endif // vtk_m_cont_internal_AtomicInterfaceExecution_h
|
@ -10,12 +10,9 @@
|
||||
|
||||
set(headers
|
||||
ArrayCopyUnknown.h
|
||||
ArrayHandleDeprecated.h
|
||||
ArrayHandleExecutionManager.h
|
||||
ArrayPortalFromIterators.h
|
||||
ArrayTransfer.h
|
||||
AtomicInterfaceControl.h
|
||||
AtomicInterfaceExecution.h
|
||||
Buffer.h
|
||||
CastInvalidValue.h
|
||||
CellLocatorBase.h
|
||||
@ -39,7 +36,6 @@ set(headers
|
||||
RuntimeDeviceConfiguration.h
|
||||
RuntimeDeviceConfigurationOptions.h
|
||||
RuntimeDeviceOption.h
|
||||
StorageDeprecated.h
|
||||
StorageError.h
|
||||
)
|
||||
|
||||
|
@ -63,15 +63,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
template <typename Device>
|
||||
VTKM_CONT VTKM_DEPRECATED(1.6, "PrepareForExecution now requires a vtkm::cont::Token object.")
|
||||
vtkm::cont::internal::ExecutionObjectType<Derived, Device> PrepareForExecution(
|
||||
Device device) const
|
||||
{
|
||||
vtkm::cont::Token token;
|
||||
return this->PrepareForExecution(device, token);
|
||||
}
|
||||
|
||||
protected:
|
||||
void SetModified() { this->Modified = true; }
|
||||
bool GetModified() const { return this->Modified; }
|
||||
|
@ -33,10 +33,6 @@ enum OptionIndex
|
||||
DEVICE,
|
||||
LOGLEVEL, // not parsed by this parser, but by loguru
|
||||
|
||||
// TODO: remove deprecated arguments on next vtk-m release
|
||||
DEPRECATED_DEVICE,
|
||||
DEPRECATED_LOGLEVEL,
|
||||
|
||||
// All RuntimeDeviceConfiguration specific options
|
||||
NUM_THREADS,
|
||||
NUMA_REGIONS,
|
||||
|
@ -49,15 +49,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
template <typename Device>
|
||||
VTKM_CONT VTKM_DEPRECATED(1.6, "PrepareForExecution now requires a vtkm::cont::Token object")
|
||||
const vtkm::cont::internal::ExecutionObjectType<Derived, Device> PrepareForExecution(
|
||||
Device device) const
|
||||
{
|
||||
vtkm::cont::Token token;
|
||||
return this->PrepareForExecution(device, token);
|
||||
}
|
||||
|
||||
protected:
|
||||
void SetModified() { this->Modified = true; }
|
||||
bool GetModified() const { return this->Modified; }
|
||||
|
@ -1,226 +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_internal_StorageDeprecated_h
|
||||
#define vtk_m_cont_internal_StorageDeprecated_h
|
||||
|
||||
#include <vtkm/cont/ErrorBadDevice.h>
|
||||
#include <vtkm/cont/ErrorBadType.h>
|
||||
#include <vtkm/cont/Storage.h>
|
||||
#include <vtkm/cont/Token.h>
|
||||
#include <vtkm/cont/TryExecute.h>
|
||||
|
||||
#include <vtkm/cont/internal/Buffer.h>
|
||||
|
||||
#include <vtkm/internal/ArrayPortalHelpers.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
{
|
||||
|
||||
namespace internal
|
||||
{
|
||||
|
||||
template <typename T, typename S>
|
||||
class ArrayHandleDeprecated;
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
struct TryPrepareInput
|
||||
{
|
||||
template <typename Device, typename ArrayType>
|
||||
VTKM_CONT bool operator()(Device device,
|
||||
ArrayType&& array,
|
||||
vtkm::cont::Token& token,
|
||||
typename ArrayType::ReadPortalType& portal,
|
||||
bool& created) const
|
||||
{
|
||||
if (!created)
|
||||
{
|
||||
portal = array.PrepareForInput(device, token);
|
||||
created = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
struct TryPrepareInPlace
|
||||
{
|
||||
template <typename Device, typename ArrayType>
|
||||
VTKM_CONT bool operator()(Device device,
|
||||
ArrayType&& array,
|
||||
vtkm::cont::Token& token,
|
||||
typename ArrayType::WritePortalType& portal,
|
||||
bool& created) const
|
||||
{
|
||||
if (!created)
|
||||
{
|
||||
portal = array.PrepareForInPlace(device, token);
|
||||
created = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename StorageType>
|
||||
struct StorageTemplateParams;
|
||||
|
||||
template <typename T, typename S>
|
||||
struct StorageTemplateParams<vtkm::cont::internal::Storage<T, S>>
|
||||
{
|
||||
using ValueType = T;
|
||||
using StorageTag = S;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
/// \brief `Storage` handler for `ArrayHandle` types still using old `ArrayHandle` style.
|
||||
///
|
||||
/// A recent change to `ArrayHandle` moved from using the `ArrayTransfer` method for
|
||||
/// moving data from control to execution environments to using `Buffer` objects. One
|
||||
/// feature of the `Buffer` objects is that if you have a new style `ArrayHandle` that
|
||||
/// deprecates other `ArrayHandle`s, they both have to use `Buffer`.
|
||||
///
|
||||
/// All old-style `ArrayHandle`s that still use `ArrayTransfer` should have a
|
||||
/// `VTKM_STORAGE_OLD_STYLE;` declaration at the bottom of the `Storage` class.
|
||||
///
|
||||
template <typename StorageType, typename ReadPortalType, typename WritePortalType>
|
||||
class StorageDeprecated
|
||||
{
|
||||
using T = typename detail::StorageTemplateParams<StorageType>::ValueType;
|
||||
using StorageTag = typename detail::StorageTemplateParams<StorageType>::StorageTag;
|
||||
|
||||
using ArrayType = vtkm::cont::internal::ArrayHandleDeprecated<T, StorageTag>;
|
||||
|
||||
VTKM_CONT static ArrayType GetArray(const std::vector<vtkm::cont::internal::Buffer>& buffers)
|
||||
{
|
||||
return buffers[0].GetMetaData<ArrayType>();
|
||||
}
|
||||
|
||||
public:
|
||||
VTKM_CONT static vtkm::Id GetNumberOfValues(
|
||||
const std::vector<vtkm::cont::internal::Buffer>& buffers)
|
||||
{
|
||||
return GetArray(buffers).GetNumberOfValues();
|
||||
}
|
||||
|
||||
VTKM_CONT static void ResizeBuffers(vtkm::Id numValues,
|
||||
const std::vector<vtkm::cont::internal::Buffer>& buffers,
|
||||
vtkm::CopyFlag preserve,
|
||||
vtkm::cont::Token& token)
|
||||
{
|
||||
switch (preserve)
|
||||
{
|
||||
case vtkm::CopyFlag::Off:
|
||||
GetArray(buffers).Allocate(numValues, token);
|
||||
break;
|
||||
case vtkm::CopyFlag::On:
|
||||
GetArray(buffers).Shrink(numValues, token);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
VTKM_CONT static ReadPortalType CreateReadPortal(
|
||||
const std::vector<vtkm::cont::internal::Buffer>& buffers,
|
||||
vtkm::cont::DeviceAdapterId device,
|
||||
vtkm::cont::Token& token)
|
||||
{
|
||||
if (device == vtkm::cont::DeviceAdapterTagUndefined{})
|
||||
{
|
||||
return GetArray(buffers).ReadPortal();
|
||||
}
|
||||
else
|
||||
{
|
||||
ReadPortalType portal;
|
||||
bool created = false;
|
||||
vtkm::cont::TryExecuteOnDevice(
|
||||
device, detail::TryPrepareInput{}, GetArray(buffers), token, portal, created);
|
||||
if (!created)
|
||||
{
|
||||
throw vtkm::cont::ErrorBadDevice("Failed to create input portal for device " +
|
||||
device.GetName());
|
||||
}
|
||||
return portal;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
VTKM_CONT static WritePortalType CreateWritePortalImpl(
|
||||
const std::vector<vtkm::cont::internal::Buffer>& buffers,
|
||||
vtkm::cont::DeviceAdapterId device,
|
||||
vtkm::cont::Token& token,
|
||||
std::true_type)
|
||||
{
|
||||
if (device == vtkm::cont::DeviceAdapterTagUndefined{})
|
||||
{
|
||||
return GetArray(buffers).WritePortal();
|
||||
}
|
||||
else
|
||||
{
|
||||
WritePortalType portal;
|
||||
bool created = false;
|
||||
vtkm::cont::TryExecuteOnDevice(
|
||||
device, detail::TryPrepareInPlace{}, GetArray(buffers), token, portal, created);
|
||||
if (!created)
|
||||
{
|
||||
throw vtkm::cont::ErrorBadDevice("Failed to create in place portal for device " +
|
||||
device.GetName());
|
||||
}
|
||||
return portal;
|
||||
}
|
||||
}
|
||||
|
||||
VTKM_CONT static WritePortalType CreateWritePortalImpl(
|
||||
const std::vector<vtkm::cont::internal::Buffer>&,
|
||||
vtkm::cont::DeviceAdapterId,
|
||||
vtkm::cont::Token&,
|
||||
std::false_type)
|
||||
{
|
||||
throw vtkm::cont::ErrorBadType("Attempted to get a writable portal to a read-only array.");
|
||||
}
|
||||
|
||||
using SupportsWrite = vtkm::internal::PortalSupportsSets<WritePortalType>;
|
||||
|
||||
public:
|
||||
VTKM_CONT static WritePortalType CreateWritePortal(
|
||||
const std::vector<vtkm::cont::internal::Buffer>& buffers,
|
||||
vtkm::cont::DeviceAdapterId device,
|
||||
vtkm::cont::Token& token)
|
||||
{
|
||||
return CreateWritePortalImpl(buffers, device, token, SupportsWrite{});
|
||||
}
|
||||
};
|
||||
|
||||
#define VTKM_STORAGE_OLD_STYLE \
|
||||
public: \
|
||||
using HasOldBridge = std::true_type; \
|
||||
using ReadPortalType = PortalConstType; \
|
||||
using WritePortalType = PortalType; \
|
||||
\
|
||||
private: \
|
||||
using StorageDeprecated = \
|
||||
vtkm::cont::internal::StorageDeprecated<Storage, ReadPortalType, WritePortalType>; \
|
||||
\
|
||||
public: \
|
||||
VTKM_CONT static vtkm::Id GetNumberOfValues( \
|
||||
const std::vector<vtkm::cont::internal::Buffer>& buffers) \
|
||||
{ \
|
||||
return StorageDeprecated::GetNumberOfValues(buffers); \
|
||||
} \
|
||||
static constexpr auto& ResizeBuffers = StorageDeprecated::ResizeBuffers; \
|
||||
static constexpr auto& CreateReadPortal = StorageDeprecated::CreateReadPortal; \
|
||||
static constexpr auto& CreateWritePortal = StorageDeprecated::CreateWritePortal
|
||||
|
||||
}
|
||||
}
|
||||
} // namespace vtkm::cont::internal
|
||||
|
||||
#endif //vtk_m_cont_internal_StorageDeprecated_h
|
@ -43,7 +43,6 @@ set(unit_tests
|
||||
UnitTestDataSetUniform.cxx
|
||||
UnitTestDeviceAdapterAlgorithmGeneral.cxx
|
||||
UnitTestDeviceSelectOnThreads.cxx
|
||||
UnitTestDynamicCellSet.cxx
|
||||
UnitTestError.cxx
|
||||
UnitTestFieldRangeCompute.cxx
|
||||
UnitTestInitialize.cxx
|
||||
@ -58,7 +57,6 @@ set(unit_tests
|
||||
UnitTestRuntimeDeviceNames.cxx
|
||||
UnitTestScopedRuntimeDeviceTracker.cxx
|
||||
UnitTestStorageList.cxx
|
||||
UnitTestStorageListTag.cxx
|
||||
UnitTestTimer.cxx
|
||||
UnitTestToken.cxx
|
||||
UnitTestTryExecute.cxx
|
||||
@ -68,7 +66,6 @@ set(unit_tests
|
||||
UnitTestTypeCheckKeys.cxx
|
||||
UnitTestUnknownArrayHandle.cxx
|
||||
UnitTestUnknownCellSet.cxx
|
||||
UnitTestVariantArrayHandle.cxx
|
||||
)
|
||||
|
||||
set(unit_tests_device
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include <vtkm/cont/DataSet.h>
|
||||
#include <vtkm/cont/testing/Testing.h>
|
||||
|
||||
#include <vtkm/cont/vtkm_cont_export.h>
|
||||
#include <vtkm/cont/testlib/vtkm_cont_testing_export.h>
|
||||
|
||||
#include <numeric>
|
||||
|
||||
@ -25,7 +25,7 @@ namespace cont
|
||||
namespace testing
|
||||
{
|
||||
|
||||
class VTKM_CONT_EXPORT MakeTestDataSet
|
||||
class VTKM_CONT_TESTING_EXPORT MakeTestDataSet
|
||||
{
|
||||
public:
|
||||
// 1D uniform datasets.
|
||||
|
@ -20,84 +20,6 @@
|
||||
#include <vtkm/cont/ConvertNumComponentsToOffsets.h>
|
||||
#include <vtkm/cont/testing/Testing.h>
|
||||
|
||||
// Make sure deprecated types still work (while applicable)
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
VTKM_STATIC_ASSERT(
|
||||
(std::is_same<typename vtkm::cont::CellSetStructured<3>::
|
||||
ExecConnectivityType<vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell>,
|
||||
typename vtkm::cont::CellSetStructured<3>::ExecutionTypes<
|
||||
vtkm::cont::DeviceAdapterTagSerial,
|
||||
vtkm::TopologyElementTagPoint,
|
||||
vtkm::TopologyElementTagCell>::ExecObjectType>::value));
|
||||
VTKM_STATIC_ASSERT(
|
||||
(std::is_same<typename vtkm::cont::CellSetStructured<3>::
|
||||
ExecConnectivityType<vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint>,
|
||||
typename vtkm::cont::CellSetStructured<3>::ExecutionTypes<
|
||||
vtkm::cont::DeviceAdapterTagSerial,
|
||||
vtkm::TopologyElementTagCell,
|
||||
vtkm::TopologyElementTagPoint>::ExecObjectType>::value));
|
||||
|
||||
VTKM_STATIC_ASSERT(
|
||||
(std::is_same<typename vtkm::cont::CellSetExplicit<>::
|
||||
ExecConnectivityType<vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell>,
|
||||
typename vtkm::cont::CellSetExplicit<>::ExecutionTypes<
|
||||
vtkm::cont::DeviceAdapterTagSerial,
|
||||
vtkm::TopologyElementTagPoint,
|
||||
vtkm::TopologyElementTagCell>::ExecObjectType>::value));
|
||||
VTKM_STATIC_ASSERT(
|
||||
(std::is_same<typename vtkm::cont::CellSetExplicit<>::
|
||||
ExecConnectivityType<vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint>,
|
||||
typename vtkm::cont::CellSetExplicit<>::ExecutionTypes<
|
||||
vtkm::cont::DeviceAdapterTagSerial,
|
||||
vtkm::TopologyElementTagCell,
|
||||
vtkm::TopologyElementTagPoint>::ExecObjectType>::value));
|
||||
|
||||
VTKM_STATIC_ASSERT(
|
||||
(std::is_same<typename vtkm::cont::CellSetSingleType<>::
|
||||
ExecConnectivityType<vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell>,
|
||||
typename vtkm::cont::CellSetSingleType<>::ExecutionTypes<
|
||||
vtkm::cont::DeviceAdapterTagSerial,
|
||||
vtkm::TopologyElementTagPoint,
|
||||
vtkm::TopologyElementTagCell>::ExecObjectType>::value));
|
||||
VTKM_STATIC_ASSERT(
|
||||
(std::is_same<typename vtkm::cont::CellSetSingleType<>::
|
||||
ExecConnectivityType<vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint>,
|
||||
typename vtkm::cont::CellSetSingleType<>::ExecutionTypes<
|
||||
vtkm::cont::DeviceAdapterTagSerial,
|
||||
vtkm::TopologyElementTagCell,
|
||||
vtkm::TopologyElementTagPoint>::ExecObjectType>::value));
|
||||
|
||||
VTKM_STATIC_ASSERT(
|
||||
(std::is_same<typename vtkm::cont::CellSetPermutation<vtkm::cont::CellSetExplicit<>>::
|
||||
ExecConnectivityType<vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell>,
|
||||
typename vtkm::cont::CellSetPermutation<vtkm::cont::CellSetExplicit<>>::
|
||||
ExecutionTypes<vtkm::cont::DeviceAdapterTagSerial,
|
||||
vtkm::TopologyElementTagPoint,
|
||||
vtkm::TopologyElementTagCell>::ExecObjectType>::value));
|
||||
VTKM_STATIC_ASSERT(
|
||||
(std::is_same<typename vtkm::cont::CellSetPermutation<vtkm::cont::CellSetExplicit<>>::
|
||||
ExecConnectivityType<vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint>,
|
||||
typename vtkm::cont::CellSetPermutation<vtkm::cont::CellSetExplicit<>>::
|
||||
ExecutionTypes<vtkm::cont::DeviceAdapterTagSerial,
|
||||
vtkm::TopologyElementTagCell,
|
||||
vtkm::TopologyElementTagPoint>::ExecObjectType>::value));
|
||||
|
||||
VTKM_STATIC_ASSERT(
|
||||
(std::is_same<typename vtkm::cont::CellSetExtrude::
|
||||
ExecConnectivityType<vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell>,
|
||||
typename vtkm::cont::CellSetExtrude::ExecutionTypes<
|
||||
vtkm::cont::DeviceAdapterTagSerial,
|
||||
vtkm::TopologyElementTagPoint,
|
||||
vtkm::TopologyElementTagCell>::ExecObjectType>::value));
|
||||
VTKM_STATIC_ASSERT(
|
||||
(std::is_same<typename vtkm::cont::CellSetExtrude::
|
||||
ExecConnectivityType<vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint>,
|
||||
typename vtkm::cont::CellSetExtrude::ExecutionTypes<
|
||||
vtkm::cont::DeviceAdapterTagSerial,
|
||||
vtkm::TopologyElementTagCell,
|
||||
vtkm::TopologyElementTagPoint>::ExecObjectType>::value));
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
|
@ -1,179 +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 <vtkm/Deprecated.h>
|
||||
|
||||
// This is testing a deprecated functionality. Remove this test once VariantArrayHandle
|
||||
// is completely removed from VTK-m.
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
|
||||
#include <vtkm/cont/DynamicCellSet.h>
|
||||
|
||||
#include <vtkm/cont/ArrayHandleConstant.h>
|
||||
|
||||
#include <vtkm/cont/testing/Testing.h>
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
using NonDefaultCellSetList =
|
||||
vtkm::List<vtkm::cont::CellSetStructured<1>,
|
||||
vtkm::cont::CellSetExplicit<vtkm::cont::ArrayHandleConstant<vtkm::UInt8>::StorageTag>>;
|
||||
|
||||
template <typename ExpectedCellType>
|
||||
struct CheckFunctor
|
||||
{
|
||||
void operator()(const ExpectedCellType&, bool& called) const { called = true; }
|
||||
|
||||
template <typename UnexpectedType>
|
||||
void operator()(const UnexpectedType&, bool& called) const
|
||||
{
|
||||
VTKM_TEST_FAIL("CastAndCall functor called with wrong type.");
|
||||
called = false;
|
||||
}
|
||||
};
|
||||
|
||||
class DummyCellSet : public vtkm::cont::CellSet
|
||||
{
|
||||
};
|
||||
|
||||
void CheckEmptyDynamicCellSet()
|
||||
{
|
||||
vtkm::cont::DynamicCellSet empty;
|
||||
|
||||
VTKM_TEST_ASSERT(empty.GetNumberOfCells() == 0, "DynamicCellSet should have no cells");
|
||||
VTKM_TEST_ASSERT(empty.GetNumberOfFaces() == 0, "DynamicCellSet should have no faces");
|
||||
VTKM_TEST_ASSERT(empty.GetNumberOfEdges() == 0, "DynamicCellSet should have no edges");
|
||||
VTKM_TEST_ASSERT(empty.GetNumberOfPoints() == 0, "DynamicCellSet should have no points");
|
||||
|
||||
empty.PrintSummary(std::cout);
|
||||
|
||||
using CellSet2D = vtkm::cont::CellSetStructured<2>;
|
||||
using CellSet3D = vtkm::cont::CellSetStructured<3>;
|
||||
VTKM_TEST_ASSERT(!empty.template IsType<CellSet2D>(), "DynamicCellSet reports wrong type.");
|
||||
VTKM_TEST_ASSERT(!empty.template IsType<CellSet3D>(), "DynamicCellSet reports wrong type.");
|
||||
VTKM_TEST_ASSERT(!empty.template IsType<DummyCellSet>(), "DynamicCellSet reports wrong type.");
|
||||
|
||||
CellSet2D instance;
|
||||
VTKM_TEST_ASSERT(!empty.IsSameType(instance), "DynamicCellSet reports wrong type.");
|
||||
|
||||
bool gotException = false;
|
||||
try
|
||||
{
|
||||
instance = empty.Cast<CellSet2D>();
|
||||
}
|
||||
catch (vtkm::cont::ErrorBadType&)
|
||||
{
|
||||
gotException = true;
|
||||
}
|
||||
VTKM_TEST_ASSERT(gotException, "Empty DynamicCellSet should have thrown on casting");
|
||||
|
||||
auto empty2 = empty.NewInstance();
|
||||
VTKM_TEST_ASSERT(empty.GetCellSetBase() == nullptr, "DynamicCellSet should contain a nullptr");
|
||||
VTKM_TEST_ASSERT(empty2.GetCellSetBase() == nullptr, "DynamicCellSet should contain a nullptr");
|
||||
}
|
||||
|
||||
template <typename CellSetType, typename CellSetList>
|
||||
void CheckDynamicCellSet(const CellSetType& cellSet,
|
||||
vtkm::cont::DynamicCellSetBase<CellSetList> dynamicCellSet)
|
||||
{
|
||||
VTKM_TEST_ASSERT(dynamicCellSet.template IsType<CellSetType>(),
|
||||
"DynamicCellSet reports wrong type.");
|
||||
VTKM_TEST_ASSERT(dynamicCellSet.IsSameType(cellSet), "DynamicCellSet reports wrong type.");
|
||||
VTKM_TEST_ASSERT(!dynamicCellSet.template IsType<DummyCellSet>(),
|
||||
"DynamicCellSet reports wrong type.");
|
||||
|
||||
dynamicCellSet.template Cast<CellSetType>();
|
||||
|
||||
bool called = false;
|
||||
dynamicCellSet.CastAndCall(CheckFunctor<CellSetType>(), called);
|
||||
|
||||
VTKM_TEST_ASSERT(
|
||||
called, "The functor was never called (and apparently a bad value exception not thrown).");
|
||||
|
||||
called = false;
|
||||
CastAndCall(dynamicCellSet, CheckFunctor<CellSetType>(), called);
|
||||
|
||||
VTKM_TEST_ASSERT(
|
||||
called, "The functor was never called (and apparently a bad value exception not thrown).");
|
||||
}
|
||||
|
||||
template <typename CellSetType, typename CellSetList>
|
||||
void TryNewInstance(CellSetType, vtkm::cont::DynamicCellSetBase<CellSetList> originalCellSet)
|
||||
{
|
||||
vtkm::cont::DynamicCellSetBase<CellSetList> newCellSet = originalCellSet.NewInstance();
|
||||
|
||||
VTKM_TEST_ASSERT(newCellSet.template IsType<CellSetType>(), "New cell set wrong type.");
|
||||
|
||||
VTKM_TEST_ASSERT(originalCellSet.GetCellSetBase() != newCellSet.GetCellSetBase(),
|
||||
"NewInstance did not make a copy.");
|
||||
}
|
||||
|
||||
template <typename CellSetType, typename CellSetList>
|
||||
void TryCellSet(CellSetType cellSet, vtkm::cont::DynamicCellSetBase<CellSetList> dynamicCellSet)
|
||||
{
|
||||
CheckDynamicCellSet(cellSet, dynamicCellSet);
|
||||
|
||||
CheckDynamicCellSet(cellSet, dynamicCellSet.ResetCellSetList(vtkm::List<CellSetType>()));
|
||||
|
||||
TryNewInstance(cellSet, dynamicCellSet);
|
||||
}
|
||||
|
||||
template <typename CellSetType>
|
||||
void TryCellSet(CellSetType cellSet, vtkm::cont::DynamicCellSet dynamicCellSet)
|
||||
{
|
||||
TryCellSet(cellSet, dynamicCellSet.ResetCellSetList<VTKM_DEFAULT_CELL_SET_LIST>());
|
||||
}
|
||||
|
||||
template <typename CellSetType>
|
||||
void TryDefaultCellSet(CellSetType cellSet)
|
||||
{
|
||||
vtkm::cont::DynamicCellSet dynamicCellSet(cellSet);
|
||||
|
||||
TryCellSet(cellSet, dynamicCellSet);
|
||||
}
|
||||
|
||||
template <typename CellSetType>
|
||||
void TryNonDefaultCellSet(CellSetType cellSet)
|
||||
{
|
||||
vtkm::cont::DynamicCellSetBase<NonDefaultCellSetList> dynamicCellSet(cellSet);
|
||||
|
||||
TryCellSet(cellSet, dynamicCellSet);
|
||||
}
|
||||
|
||||
void TestDynamicCellSet()
|
||||
{
|
||||
std::cout << "Try default types with default type lists." << std::endl;
|
||||
std::cout << "*** 2D Structured Grid ******************" << std::endl;
|
||||
TryDefaultCellSet(vtkm::cont::CellSetStructured<2>());
|
||||
std::cout << "*** 3D Structured Grid ******************" << std::endl;
|
||||
TryDefaultCellSet(vtkm::cont::CellSetStructured<3>());
|
||||
std::cout << "*** Explicit Grid ***********************" << std::endl;
|
||||
TryDefaultCellSet(vtkm::cont::CellSetExplicit<>());
|
||||
|
||||
std::cout << std::endl << "Try non-default types." << std::endl;
|
||||
std::cout << "*** 1D Structured Grid ******************" << std::endl;
|
||||
TryNonDefaultCellSet(vtkm::cont::CellSetStructured<1>());
|
||||
std::cout << "*** Explicit Grid Constant Shape ********" << std::endl;
|
||||
TryNonDefaultCellSet(
|
||||
vtkm::cont::CellSetExplicit<vtkm::cont::ArrayHandleConstant<vtkm::UInt8>::StorageTag>());
|
||||
|
||||
std::cout << std::endl << "Try empty DynamicCellSet." << std::endl;
|
||||
CheckEmptyDynamicCellSet();
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
int UnitTestDynamicCellSet(int argc, char* argv[])
|
||||
{
|
||||
return vtkm::cont::testing::Testing::Run(TestDynamicCellSet, argc, argv);
|
||||
}
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
@ -142,45 +142,13 @@ void InitializeCustomOptionsWithArgs()
|
||||
CheckArgs(argc, argv, "--foo", "bar", "--baz");
|
||||
}
|
||||
|
||||
void InitializeDeprecatedOptionsWithArgs()
|
||||
{
|
||||
std::cout << "Calling program has option --foo that takes arg bar." << std::endl;
|
||||
|
||||
int argc;
|
||||
char** argv;
|
||||
vtkm::cont::testing::Testing::MakeArgsAddProgramName(
|
||||
argc, argv, "--device", "Any", "--foo=bar", "--baz");
|
||||
vtkm::cont::Initialize(argc, argv);
|
||||
CheckArgs(argc, argv, "--foo=bar", "--baz");
|
||||
|
||||
vtkm::cont::testing::Testing::MakeArgsAddProgramName(
|
||||
argc, argv, "--foo=bar", "--baz", "--device", "Any");
|
||||
vtkm::cont::Initialize(argc, argv);
|
||||
CheckArgs(argc, argv, "--foo=bar", "--baz");
|
||||
|
||||
vtkm::cont::testing::Testing::MakeArgsAddProgramName(
|
||||
argc, argv, "-d", "Any", "--foo", "bar", "--baz");
|
||||
vtkm::cont::Initialize(argc, argv);
|
||||
CheckArgs(argc, argv, "--foo", "bar", "--baz");
|
||||
|
||||
vtkm::cont::testing::Testing::MakeArgsAddProgramName(
|
||||
argc, argv, "--foo", "bar", "--baz", "-d", "Any");
|
||||
vtkm::cont::Initialize(argc, argv);
|
||||
CheckArgs(argc, argv, "--foo", "bar", "--baz");
|
||||
|
||||
vtkm::cont::testing::Testing::MakeArgsAddProgramName(
|
||||
argc, argv, "--foo", "-v", "OFF", "--", "--device", "Any", "--bar", "baz");
|
||||
vtkm::cont::Initialize(argc, argv);
|
||||
CheckArgs(argc, argv, "--foo", "--", "--device", "Any", "--bar", "baz");
|
||||
}
|
||||
|
||||
void InitializeRuntimeDeviceConfigurationWithArgs()
|
||||
{
|
||||
int argc;
|
||||
char** argv;
|
||||
vtkm::cont::testing::Testing::MakeArgsAddProgramName(argc,
|
||||
argv,
|
||||
"--device",
|
||||
"--vtkm-device",
|
||||
"Any",
|
||||
"--vtkm-num-threads",
|
||||
"100",
|
||||
@ -217,7 +185,6 @@ void DoInitializeTests()
|
||||
InitializeCustomOptions();
|
||||
InitializeMixedOptions();
|
||||
InitializeCustomOptionsWithArgs();
|
||||
InitializeDeprecatedOptionsWithArgs();
|
||||
InitializeRuntimeDeviceConfigurationWithArgs();
|
||||
|
||||
// This should be the last function called as it should exit with a zero status.
|
||||
|
@ -45,22 +45,6 @@ void Scopes(int level = 0)
|
||||
}
|
||||
}
|
||||
|
||||
// VTKM_LOG_ERROR_CONTEXT is no longer implemented as it is
|
||||
// deprecated
|
||||
void ErrorContext()
|
||||
{
|
||||
// These variables are only logged if a crash occurs.
|
||||
// Only supports POD by default, but can be extended (see loguru docs)
|
||||
VTKM_LOG_ERROR_CONTEXT("Some Int", 3);
|
||||
VTKM_LOG_ERROR_CONTEXT("A Double", 236.7521);
|
||||
VTKM_LOG_ERROR_CONTEXT("A C-String", "Hiya!");
|
||||
|
||||
// The error-tracking should work automatically on linux (maybe mac?) but on
|
||||
// windows it doesn't trigger automatically (see loguru #74). But we can
|
||||
// manually dump the error context log like so:
|
||||
std::cerr << vtkm::cont::GetLogErrorContext() << "\n";
|
||||
}
|
||||
|
||||
void UserDefined()
|
||||
{
|
||||
VTKM_DEFINE_USER_LOG_LEVEL(CustomLevel, 0);
|
||||
@ -87,9 +71,6 @@ void RunTests()
|
||||
VTKM_LOG_S(vtkm::cont::LogLevel::Info, "Running Scopes test...");
|
||||
Scopes();
|
||||
|
||||
VTKM_LOG_S(vtkm::cont::LogLevel::Info, "Running ErrorContext test...");
|
||||
ErrorContext();
|
||||
|
||||
VTKM_LOG_S(vtkm::cont::LogLevel::Info, "Running UserDefined test...");
|
||||
UserDefined();
|
||||
}
|
||||
|
@ -1,78 +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.
|
||||
//============================================================================
|
||||
|
||||
// This tests deprecated code until it is deleted.
|
||||
#include <vtkm/Deprecated.h>
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
|
||||
#include <vtkm/cont/StorageListTag.h>
|
||||
|
||||
#include <vtkm/cont/testing/Testing.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
enum TypeId
|
||||
{
|
||||
BASIC
|
||||
};
|
||||
|
||||
TypeId GetTypeId(vtkm::cont::StorageTagBasic)
|
||||
{
|
||||
return BASIC;
|
||||
}
|
||||
|
||||
struct TestFunctor
|
||||
{
|
||||
std::vector<TypeId> FoundTypes;
|
||||
|
||||
template <typename T>
|
||||
VTKM_CONT void operator()(T)
|
||||
{
|
||||
this->FoundTypes.push_back(GetTypeId(T()));
|
||||
}
|
||||
};
|
||||
|
||||
template <vtkm::IdComponent N>
|
||||
void CheckSame(const vtkm::Vec<TypeId, N>& expected, const std::vector<TypeId>& found)
|
||||
{
|
||||
VTKM_TEST_ASSERT(static_cast<vtkm::IdComponent>(found.size()) == N, "Got wrong number of items.");
|
||||
|
||||
for (vtkm::IdComponent index = 0; index < N; index++)
|
||||
{
|
||||
vtkm::UInt32 i = static_cast<vtkm::UInt32>(index);
|
||||
VTKM_TEST_ASSERT(expected[index] == found[i], "Got wrong type.");
|
||||
}
|
||||
}
|
||||
|
||||
template <vtkm::IdComponent N, typename ListTag>
|
||||
void TryList(const vtkm::Vec<TypeId, N>& expected, ListTag)
|
||||
{
|
||||
TestFunctor functor;
|
||||
vtkm::ListForEach(functor, ListTag());
|
||||
CheckSame(expected, functor.FoundTypes);
|
||||
}
|
||||
|
||||
void TestLists()
|
||||
{
|
||||
std::cout << "StorageListTagBasic" << std::endl;
|
||||
TryList(vtkm::Vec<TypeId, 1>(BASIC), vtkm::cont::StorageListTagBasic());
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
int UnitTestStorageListTag(int argc, char* argv[])
|
||||
{
|
||||
return vtkm::cont::testing::Testing::Run(TestLists, argc, argv);
|
||||
}
|
||||
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
@ -1,455 +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 <vtkm/Deprecated.h>
|
||||
|
||||
// This is testing a deprecated functionality. Remove this test once VariantArrayHandle
|
||||
// is completely removed from VTK-m.
|
||||
VTKM_DEPRECATED_SUPPRESS_BEGIN
|
||||
|
||||
#include <vtkm/cont/VariantArrayHandle.h>
|
||||
|
||||
#include <vtkm/TypeTraits.h>
|
||||
|
||||
#include <vtkm/cont/ArrayHandleCast.h>
|
||||
#include <vtkm/cont/ArrayHandleCompositeVector.h>
|
||||
#include <vtkm/cont/ArrayHandleConstant.h>
|
||||
#include <vtkm/cont/ArrayHandleCounting.h>
|
||||
#include <vtkm/cont/ArrayHandleGroupVec.h>
|
||||
#include <vtkm/cont/ArrayHandleImplicit.h>
|
||||
#include <vtkm/cont/ArrayHandleIndex.h>
|
||||
#include <vtkm/cont/ArrayHandlePermutation.h>
|
||||
#include <vtkm/cont/ArrayHandleTransform.h>
|
||||
#include <vtkm/cont/ArrayHandleUniformPointCoordinates.h>
|
||||
#include <vtkm/cont/ArrayHandleZip.h>
|
||||
|
||||
#include <vtkm/cont/internal/IteratorFromArrayPortal.h>
|
||||
|
||||
#include <vtkm/cont/testing/Testing.h>
|
||||
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <typeinfo>
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
// Make an "unusual" type to use in the test. This is simply a type that
|
||||
// is sure not to be declared elsewhere.
|
||||
struct UnusualType
|
||||
{
|
||||
using T = vtkm::Id;
|
||||
T X;
|
||||
UnusualType() = default;
|
||||
UnusualType(T x)
|
||||
: X(x)
|
||||
{
|
||||
}
|
||||
UnusualType& operator=(T x)
|
||||
{
|
||||
this->X = x;
|
||||
return *this;
|
||||
}
|
||||
operator T() const { return this->X; }
|
||||
};
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
|
||||
// VariantArrayHandle requires its value type to have a defined VecTraits
|
||||
// class. One of the tests is to use an "unusual" array.
|
||||
// Make an implementation here. Because I am lazy, this is only a partial
|
||||
// implementation.
|
||||
template <>
|
||||
struct VecTraits<UnusualType> : VecTraits<UnusualType::T>
|
||||
{
|
||||
using ComponentType = UnusualType;
|
||||
using BaseComponentType = UnusualType;
|
||||
};
|
||||
|
||||
} // namespace vtkm
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
const vtkm::Id ARRAY_SIZE = 10;
|
||||
|
||||
template <typename T>
|
||||
struct TestValueFunctor
|
||||
{
|
||||
T operator()(vtkm::Id index) const { return TestValue(index, T()); }
|
||||
};
|
||||
|
||||
struct CheckFunctor
|
||||
{
|
||||
template <typename T, typename S>
|
||||
static void CheckArray(const vtkm::cont::ArrayHandle<T, S>& array)
|
||||
{
|
||||
VTKM_TEST_ASSERT(array.GetNumberOfValues() == ARRAY_SIZE, "Unexpected array size.");
|
||||
CheckPortal(array.ReadPortal());
|
||||
}
|
||||
|
||||
template <typename S>
|
||||
static void CheckArray(const vtkm::cont::ArrayHandle<UnusualType, S>& array)
|
||||
{
|
||||
VTKM_TEST_ASSERT(array.GetNumberOfValues() == ARRAY_SIZE, "Unexpected array size.");
|
||||
auto portal = array.ReadPortal();
|
||||
for (vtkm::Id index = 0; index < array.GetNumberOfValues(); ++index)
|
||||
{
|
||||
VTKM_TEST_ASSERT(portal.Get(index) == TestValue(index, UnusualType::T{}));
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void operator()(const vtkm::cont::ArrayHandle<T>& array,
|
||||
bool& calledBasic,
|
||||
bool& vtkmNotUsed(calledVirtual)) const
|
||||
{
|
||||
calledBasic = true;
|
||||
std::cout << " Checking for basic array type: " << typeid(T).name() << std::endl;
|
||||
|
||||
CheckArray(array);
|
||||
}
|
||||
|
||||
template <typename T, typename S>
|
||||
void operator()(const vtkm::cont::ArrayHandle<T, S>&, bool&, bool&) const
|
||||
{
|
||||
VTKM_TEST_FAIL("Array resolved to unexpected type.");
|
||||
}
|
||||
};
|
||||
|
||||
template <typename TypeList>
|
||||
void BasicArrayVariantChecks(const vtkm::cont::VariantArrayHandleBase<TypeList>& array,
|
||||
vtkm::IdComponent numComponents)
|
||||
{
|
||||
VTKM_TEST_ASSERT(array.GetNumberOfValues() == ARRAY_SIZE,
|
||||
"Dynamic array reports unexpected size.");
|
||||
std::cout << "array.GetNumberOfComponents() = " << array.GetNumberOfComponentsFlat() << ", "
|
||||
<< "numComponents = " << numComponents << "\n";
|
||||
VTKM_TEST_ASSERT(array.GetNumberOfComponentsFlat() == numComponents,
|
||||
"Dynamic array reports unexpected number of components.");
|
||||
}
|
||||
|
||||
template <typename TypeList>
|
||||
void CheckArrayVariant(const vtkm::cont::VariantArrayHandleBase<TypeList>& array,
|
||||
vtkm::IdComponent numComponents,
|
||||
bool isBasicArray)
|
||||
{
|
||||
BasicArrayVariantChecks(array, numComponents);
|
||||
|
||||
std::cout << " CastAndCall with default storage" << std::endl;
|
||||
bool calledBasic = false;
|
||||
bool calledVirtual = false;
|
||||
CastAndCall(array, CheckFunctor(), calledBasic, calledVirtual);
|
||||
|
||||
VTKM_TEST_ASSERT(
|
||||
calledBasic || calledVirtual,
|
||||
"The functor was never called (and apparently a bad value exception not thrown).");
|
||||
if (isBasicArray)
|
||||
{
|
||||
VTKM_TEST_ASSERT(calledBasic, "The functor was never called with the basic array fast path");
|
||||
VTKM_TEST_ASSERT(!calledVirtual, "The functor was somehow called with the virtual path");
|
||||
}
|
||||
else
|
||||
{
|
||||
VTKM_TEST_ASSERT(!calledBasic, "The array somehow got cast to a basic storage.");
|
||||
}
|
||||
|
||||
// Work around apparent bug in some versions of GCC that give a warning about
|
||||
// StorageVirtualImpl<>::GetNumberOfValues() being "declared 'static' but never defined"
|
||||
// (even though nothing about this method is declared static). See the following
|
||||
// stackoverflow discussion for more details:
|
||||
//
|
||||
// https://stackoverflow.com/questions/56615695/how-to-fix-declared-static-but-never-defined-on-member-function
|
||||
#if !defined(VTKM_GCC) || (__GNUC__ >= 9)
|
||||
std::cout << " CastAndCall with extra storage" << std::endl;
|
||||
calledBasic = false;
|
||||
calledVirtual = false;
|
||||
array.CastAndCall(vtkm::List<vtkm::cont::StorageTagBasic, vtkm::cont::StorageTagConstant>{},
|
||||
CheckFunctor(),
|
||||
calledBasic,
|
||||
calledVirtual);
|
||||
VTKM_TEST_ASSERT(
|
||||
calledBasic || calledVirtual,
|
||||
"The functor was never called (and apparently a bad value exception not thrown).");
|
||||
if (isBasicArray)
|
||||
{
|
||||
VTKM_TEST_ASSERT(calledBasic, "The functor was never called with the basic array fast path");
|
||||
VTKM_TEST_ASSERT(!calledVirtual, "The functor was somehow called with the virtual path");
|
||||
}
|
||||
else
|
||||
{
|
||||
VTKM_TEST_ASSERT(!calledBasic, "The array somehow got cast to a basic storage.");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
vtkm::cont::VariantArrayHandle CreateArrayVariant(T)
|
||||
{
|
||||
vtkm::cont::ArrayHandle<T> array;
|
||||
array.Allocate(ARRAY_SIZE);
|
||||
SetPortal(array.WritePortal());
|
||||
return vtkm::cont::VariantArrayHandle(array);
|
||||
}
|
||||
|
||||
vtkm::cont::VariantArrayHandle CreateArrayVariant(UnusualType)
|
||||
{
|
||||
vtkm::cont::ArrayHandle<UnusualType> array;
|
||||
array.Allocate(ARRAY_SIZE);
|
||||
auto portal = array.WritePortal();
|
||||
for (vtkm::Id index = 0; index < ARRAY_SIZE; ++index)
|
||||
{
|
||||
portal.Set(index, TestValue(index, UnusualType::T{}));
|
||||
}
|
||||
return vtkm::cont::VariantArrayHandle(array);
|
||||
}
|
||||
|
||||
template <typename ArrayHandleType>
|
||||
void CheckCastToArrayHandle(const ArrayHandleType& array)
|
||||
{
|
||||
VTKM_IS_ARRAY_HANDLE(ArrayHandleType);
|
||||
|
||||
vtkm::cont::VariantArrayHandle arrayVariant = array;
|
||||
VTKM_TEST_ASSERT(!arrayVariant.IsType<vtkm::cont::ArrayHandle<UnusualType>>(),
|
||||
"Dynamic array reporting is wrong type.");
|
||||
|
||||
ArrayHandleType castArray1;
|
||||
arrayVariant.CopyTo(castArray1);
|
||||
VTKM_TEST_ASSERT(arrayVariant.CanConvert<ArrayHandleType>(), "Did not query handle correctly.");
|
||||
//VTKM_TEST_ASSERT(array == castArray1, "Did not get back same array.");
|
||||
auto result = test_equal_ArrayHandles(array, castArray1);
|
||||
VTKM_TEST_ASSERT(result, result.GetMergedMessage());
|
||||
|
||||
|
||||
ArrayHandleType castArray2 = arrayVariant.Cast<ArrayHandleType>();
|
||||
//VTKM_TEST_ASSERT(array == castArray2, "Did not get back same array.");
|
||||
VTKM_TEST_ASSERT(test_equal_ArrayHandles(array, castArray2));
|
||||
}
|
||||
|
||||
// A vtkm::Vec if NumComps > 1, otherwise a scalar
|
||||
template <typename T, vtkm::IdComponent NumComps>
|
||||
using VecOrScalar = typename std::conditional<(NumComps > 1), vtkm::Vec<T, NumComps>, T>::type;
|
||||
|
||||
template <typename T, typename ArrayVariantType>
|
||||
void TryNewInstance(T, ArrayVariantType originalArray)
|
||||
{
|
||||
// This check should already have been performed by caller, but just in case.
|
||||
CheckArrayVariant(originalArray, vtkm::VecTraits<T>::NUM_COMPONENTS, true);
|
||||
|
||||
std::cout << "Create new instance of array." << std::endl;
|
||||
ArrayVariantType newArray = originalArray.NewInstance();
|
||||
|
||||
std::cout << "Get a static instance of the new array (which checks the type)." << std::endl;
|
||||
vtkm::cont::ArrayHandle<T> staticArray;
|
||||
newArray.CopyTo(staticArray);
|
||||
|
||||
std::cout << "Fill the new array with invalid values and make sure the original" << std::endl
|
||||
<< "is uneffected." << std::endl;
|
||||
staticArray.Allocate(ARRAY_SIZE);
|
||||
for (vtkm::Id index = 0; index < ARRAY_SIZE; index++)
|
||||
{
|
||||
staticArray.WritePortal().Set(index, TestValue(index + 100, T()));
|
||||
}
|
||||
CheckArrayVariant(originalArray, vtkm::VecTraits<T>::NUM_COMPONENTS, true);
|
||||
|
||||
std::cout << "Set the new static array to expected values and make sure the new" << std::endl
|
||||
<< "dynamic array points to the same new values." << std::endl;
|
||||
for (vtkm::Id index = 0; index < ARRAY_SIZE; index++)
|
||||
{
|
||||
staticArray.WritePortal().Set(index, TestValue(index, T()));
|
||||
}
|
||||
CheckArrayVariant(newArray, vtkm::VecTraits<T>::NUM_COMPONENTS, true);
|
||||
}
|
||||
|
||||
template <typename T, typename ArrayVariantType>
|
||||
void TryAsMultiplexer(T, ArrayVariantType sourceArray)
|
||||
{
|
||||
auto originalArray = sourceArray.template Cast<vtkm::cont::ArrayHandle<T>>();
|
||||
|
||||
{
|
||||
std::cout << "Get multiplex array through direct type." << std::endl;
|
||||
using MultiplexerType = vtkm::cont::ArrayHandleMultiplexer<vtkm::cont::ArrayHandle<T>,
|
||||
vtkm::cont::ArrayHandleConstant<T>>;
|
||||
MultiplexerType multiplexArray = sourceArray.template AsMultiplexer<MultiplexerType>();
|
||||
|
||||
VTKM_TEST_ASSERT(multiplexArray.IsValid());
|
||||
VTKM_TEST_ASSERT(test_equal_portals(multiplexArray.ReadPortal(), originalArray.ReadPortal()));
|
||||
}
|
||||
|
||||
{
|
||||
std::cout << "Get multiplex array through cast type." << std::endl;
|
||||
using CastT = typename vtkm::VecTraits<T>::template ReplaceBaseComponentType<vtkm::Float64>;
|
||||
using MultiplexerType = vtkm::cont::ArrayHandleMultiplexer<
|
||||
vtkm::cont::ArrayHandle<CastT>,
|
||||
vtkm::cont::ArrayHandleCast<CastT, vtkm::cont::ArrayHandle<T>>>;
|
||||
MultiplexerType multiplexArray = sourceArray.template AsMultiplexer<MultiplexerType>();
|
||||
|
||||
VTKM_TEST_ASSERT(multiplexArray.IsValid());
|
||||
VTKM_TEST_ASSERT(test_equal_portals(multiplexArray.ReadPortal(), originalArray.ReadPortal()));
|
||||
}
|
||||
|
||||
{
|
||||
std::cout << "Make sure multiplex array prefers direct array (1st arg)" << std::endl;
|
||||
using MultiplexerType = vtkm::cont::ArrayHandleMultiplexer<
|
||||
vtkm::cont::ArrayHandle<T>,
|
||||
vtkm::cont::ArrayHandleCast<T, vtkm::cont::ArrayHandle<T>>>;
|
||||
MultiplexerType multiplexArray = sourceArray.template AsMultiplexer<MultiplexerType>();
|
||||
|
||||
VTKM_TEST_ASSERT(multiplexArray.IsValid());
|
||||
VTKM_TEST_ASSERT(multiplexArray.GetArrayHandleVariant().GetIndex() == 0);
|
||||
VTKM_TEST_ASSERT(test_equal_portals(multiplexArray.ReadPortal(), originalArray.ReadPortal()));
|
||||
}
|
||||
|
||||
{
|
||||
std::cout << "Make sure multiplex array prefers direct array (2nd arg)" << std::endl;
|
||||
using MultiplexerType =
|
||||
vtkm::cont::ArrayHandleMultiplexer<vtkm::cont::ArrayHandleCast<T, vtkm::cont::ArrayHandle<T>>,
|
||||
vtkm::cont::ArrayHandle<T>>;
|
||||
MultiplexerType multiplexArray = sourceArray.template AsMultiplexer<MultiplexerType>();
|
||||
|
||||
VTKM_TEST_ASSERT(multiplexArray.IsValid());
|
||||
VTKM_TEST_ASSERT(multiplexArray.GetArrayHandleVariant().GetIndex() == 1);
|
||||
VTKM_TEST_ASSERT(test_equal_portals(multiplexArray.ReadPortal(), originalArray.ReadPortal()));
|
||||
}
|
||||
}
|
||||
|
||||
struct TryDefaultType
|
||||
{
|
||||
template <typename T>
|
||||
void operator()(T) const
|
||||
{
|
||||
vtkm::cont::VariantArrayHandle array = CreateArrayVariant(T());
|
||||
|
||||
CheckArrayVariant(array, vtkm::VecTraits<T>::NUM_COMPONENTS, true);
|
||||
|
||||
TryNewInstance(T(), array);
|
||||
|
||||
TryAsMultiplexer(T(), array);
|
||||
}
|
||||
};
|
||||
|
||||
struct TryBasicVTKmType
|
||||
{
|
||||
template <typename T>
|
||||
void operator()(T) const
|
||||
{
|
||||
vtkm::cont::VariantArrayHandle array = CreateArrayVariant(T());
|
||||
|
||||
CheckArrayVariant(
|
||||
array.ResetTypes(vtkm::TypeListAll()), vtkm::VecTraits<T>::NUM_COMPONENTS, true);
|
||||
|
||||
TryNewInstance(T(), array.ResetTypes(vtkm::TypeListAll()));
|
||||
}
|
||||
};
|
||||
|
||||
void TryUnusualType()
|
||||
{
|
||||
// A string is an unlikely type to be declared elsewhere in VTK-m.
|
||||
vtkm::cont::VariantArrayHandle array = CreateArrayVariant(UnusualType{});
|
||||
|
||||
try
|
||||
{
|
||||
CheckArrayVariant(array, 1, true);
|
||||
VTKM_TEST_FAIL("CastAndCall failed to error for unrecognized type.");
|
||||
}
|
||||
catch (vtkm::cont::ErrorBadType&)
|
||||
{
|
||||
std::cout << " Caught exception for unrecognized type." << std::endl;
|
||||
}
|
||||
CheckArrayVariant(array.ResetTypes(vtkm::List<UnusualType>()), 1, true);
|
||||
std::cout << " Found type when type list was reset." << std::endl;
|
||||
}
|
||||
template <typename ArrayHandleType>
|
||||
void TryCastToArrayHandle(const ArrayHandleType& array)
|
||||
{
|
||||
CheckCastToArrayHandle(array);
|
||||
}
|
||||
|
||||
void TryCastToArrayHandle()
|
||||
{
|
||||
std::cout << " Normal array handle." << std::endl;
|
||||
vtkm::FloatDefault buffer[ARRAY_SIZE];
|
||||
for (vtkm::Id index = 0; index < ARRAY_SIZE; index++)
|
||||
{
|
||||
buffer[index] = TestValue(index, vtkm::FloatDefault());
|
||||
}
|
||||
|
||||
vtkm::cont::ArrayHandle<vtkm::FloatDefault> array =
|
||||
vtkm::cont::make_ArrayHandle(buffer, ARRAY_SIZE, vtkm::CopyFlag::On);
|
||||
TryCastToArrayHandle(array);
|
||||
|
||||
std::cout << " Cast array handle." << std::endl;
|
||||
TryCastToArrayHandle(vtkm::cont::make_ArrayHandleCast<vtkm::Id>(array));
|
||||
|
||||
std::cout << " Composite vector array handle." << std::endl;
|
||||
TryCastToArrayHandle(vtkm::cont::make_ArrayHandleCompositeVector(array, array));
|
||||
|
||||
std::cout << " Constant array handle." << std::endl;
|
||||
TryCastToArrayHandle(vtkm::cont::make_ArrayHandleConstant(5, ARRAY_SIZE));
|
||||
|
||||
std::cout << " Counting array handle." << std::endl;
|
||||
vtkm::cont::ArrayHandleCounting<vtkm::Id> countingArray(ARRAY_SIZE - 1, -1, ARRAY_SIZE);
|
||||
TryCastToArrayHandle(countingArray);
|
||||
|
||||
std::cout << " Group vec array handle" << std::endl;
|
||||
vtkm::cont::ArrayHandleGroupVec<vtkm::cont::ArrayHandle<vtkm::FloatDefault>, 2> groupVecArray(
|
||||
array);
|
||||
TryCastToArrayHandle(groupVecArray);
|
||||
|
||||
std::cout << " Implicit array handle." << std::endl;
|
||||
TryCastToArrayHandle(
|
||||
vtkm::cont::make_ArrayHandleImplicit(TestValueFunctor<vtkm::FloatDefault>(), ARRAY_SIZE));
|
||||
|
||||
std::cout << " Index array handle." << std::endl;
|
||||
TryCastToArrayHandle(vtkm::cont::ArrayHandleIndex(ARRAY_SIZE));
|
||||
|
||||
std::cout << " Permutation array handle." << std::endl;
|
||||
TryCastToArrayHandle(vtkm::cont::make_ArrayHandlePermutation(countingArray, array));
|
||||
|
||||
std::cout << " Transform array handle." << std::endl;
|
||||
TryCastToArrayHandle(
|
||||
vtkm::cont::make_ArrayHandleTransform(countingArray, TestValueFunctor<vtkm::FloatDefault>()));
|
||||
|
||||
std::cout << " Uniform point coordinates array handle." << std::endl;
|
||||
TryCastToArrayHandle(vtkm::cont::ArrayHandleUniformPointCoordinates(vtkm::Id3(ARRAY_SIZE)));
|
||||
|
||||
// std::cout << " Zip array handle." << std::endl;
|
||||
// CheckCastToArrayHandle(vtkm::cont::make_ArrayHandleZip(countingArray, array));
|
||||
}
|
||||
|
||||
void TestVariantArrayHandle()
|
||||
{
|
||||
std::cout << "Try common types with default type lists." << std::endl;
|
||||
vtkm::testing::Testing::TryTypes(TryDefaultType{}, VTKM_DEFAULT_TYPE_LIST{});
|
||||
|
||||
std::cout << "Try exemplar VTK-m types." << std::endl;
|
||||
vtkm::testing::Testing::TryTypes(TryBasicVTKmType());
|
||||
|
||||
std::cout << "Try unusual type." << std::endl;
|
||||
TryUnusualType();
|
||||
|
||||
std::cout << "Try CastToArrayHandle" << std::endl;
|
||||
TryCastToArrayHandle();
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
int UnitTestVariantArrayHandle(int argc, char* argv[])
|
||||
{
|
||||
return vtkm::cont::testing::Testing::Run(TestVariantArrayHandle, argc, argv);
|
||||
}
|
||||
|
||||
// The MSVC compiler is sometimes complaining about use of deprecated VariantArrayHandle at the
|
||||
// end of this file. This is the end of the translation unit, so just keep the suppression on.
|
||||
//VTKM_DEPRECATED_SUPPRESS_END
|
@ -20,7 +20,7 @@ set(testing_library_headers
|
||||
)
|
||||
|
||||
set(testing_library_sources
|
||||
# MakeTestDataSet.cxx Currently in vtkm_cont. Should be moved to testlib in VTK-m 2.0
|
||||
MakeTestDataSet.cxx
|
||||
TestEqualArrayHandles.cxx
|
||||
Testing.cxx
|
||||
)
|
||||
|
@ -16,12 +16,9 @@ namespace
|
||||
enum TestOptionsIndex
|
||||
{
|
||||
TEST_UNKNOWN,
|
||||
DATADIR, // base dir containing test data files
|
||||
BASELINEDIR, // base dir for regression test images
|
||||
WRITEDIR, // base dir for generated regression test images
|
||||
DEPRECATED_DATADIR, // base dir containing test data files
|
||||
DEPRECATED_BASELINEDIR, // base dir for regression test images
|
||||
DEPRECATED_WRITEDIR // base dir for generated regression test images
|
||||
DATADIR, // base dir containing test data files
|
||||
BASELINEDIR, // base dir for regression test images
|
||||
WRITEDIR, // base dir for generated regression test images
|
||||
};
|
||||
|
||||
} // anonymous namespace
|
||||
@ -178,30 +175,6 @@ void Testing::ParseAdditionalTestArgs(int& argc, char* argv[])
|
||||
"\tPath to the write dir "
|
||||
"to store generated "
|
||||
"regression test images" });
|
||||
usage.push_back({ DEPRECATED_DATADIR,
|
||||
0,
|
||||
"D",
|
||||
"data-dir",
|
||||
opt::VtkmArg::Required,
|
||||
" --data-dir "
|
||||
"<data-dir-path> "
|
||||
"\tDEPRECATED: use --vtkm-data-dir instead" });
|
||||
usage.push_back({ DEPRECATED_BASELINEDIR,
|
||||
0,
|
||||
"B",
|
||||
"baseline-dir",
|
||||
opt::VtkmArg::Required,
|
||||
" --baseline-dir "
|
||||
"<baseline-dir-path> "
|
||||
"\tDEPRECATED: use --vtkm-baseline-dir instead" });
|
||||
usage.push_back({ WRITEDIR,
|
||||
0,
|
||||
"",
|
||||
"write-dir",
|
||||
opt::VtkmArg::Required,
|
||||
" --write-dir "
|
||||
"<write-dir-path> "
|
||||
"\tDEPRECATED: use --vtkm-write-dir instead" });
|
||||
|
||||
// Required to collect unknown arguments when help is off.
|
||||
usage.push_back({ TEST_UNKNOWN, 0, "", "", opt::VtkmArg::UnknownOption, "" });
|
||||
@ -223,33 +196,6 @@ void Testing::ParseAdditionalTestArgs(int& argc, char* argv[])
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (options[DEPRECATED_DATADIR])
|
||||
{
|
||||
VTKM_LOG_S(vtkm::cont::LogLevel::Error,
|
||||
"Supplied deprecated datadir flag: "
|
||||
<< std::string{ options[DEPRECATED_DATADIR].name }
|
||||
<< ", use --vtkm-data-dir instead");
|
||||
SetAndGetTestDataBasePath(options[DEPRECATED_DATADIR].arg);
|
||||
}
|
||||
|
||||
if (options[DEPRECATED_BASELINEDIR])
|
||||
{
|
||||
VTKM_LOG_S(vtkm::cont::LogLevel::Error,
|
||||
"Supplied deprecated baselinedir flag: "
|
||||
<< std::string{ options[DEPRECATED_BASELINEDIR].name }
|
||||
<< ", use --vtkm-baseline-dir instead");
|
||||
SetAndGetRegressionImageBasePath(options[DEPRECATED_BASELINEDIR].arg);
|
||||
}
|
||||
|
||||
if (options[DEPRECATED_WRITEDIR])
|
||||
{
|
||||
VTKM_LOG_S(vtkm::cont::LogLevel::Error,
|
||||
"Supplied deprecated writedir flag: "
|
||||
<< std::string{ options[DEPRECATED_WRITEDIR].name }
|
||||
<< ", use --vtkm-write-dir instead");
|
||||
SetAndGetWriteDirBasePath(options[DEPRECATED_WRITEDIR].arg);
|
||||
}
|
||||
|
||||
if (options[DATADIR])
|
||||
{
|
||||
SetAndGetTestDataBasePath(options[DATADIR].arg);
|
||||
|
@ -77,46 +77,8 @@ struct ArithType<vtkm::Float64>
|
||||
};
|
||||
}
|
||||
|
||||
template <typename T, typename... MaybeDevice>
|
||||
class AtomicArrayExecutionObject;
|
||||
|
||||
template <typename T, typename Device>
|
||||
class VTKM_DEPRECATED(1.6, "AtomicArrayExecutionObject no longer uses Device template parameter.")
|
||||
AtomicArrayExecutionObject<T, Device> : public AtomicArrayExecutionObject<T>
|
||||
{
|
||||
using Superclass = AtomicArrayExecutionObject<T>;
|
||||
|
||||
public:
|
||||
AtomicArrayExecutionObject() = default;
|
||||
|
||||
// This constructor is deprecated in VTK-m 1.6.
|
||||
VTKM_DEPRECATED(1.6, "AtomicArrayExecutionObject no longer uses Device template parameter.")
|
||||
AtomicArrayExecutionObject(vtkm::cont::ArrayHandle<T> handle)
|
||||
: Superclass(handle, Device{})
|
||||
{
|
||||
}
|
||||
|
||||
VTKM_DEPRECATED(1.6, "AtomicArrayExecutionObject no longer uses Device template parameter.")
|
||||
AtomicArrayExecutionObject(vtkm::cont::ArrayHandle<T> handle, vtkm::cont::Token& token)
|
||||
: Superclass(handle, Device{}, token)
|
||||
{
|
||||
}
|
||||
|
||||
// How does this even work?
|
||||
template <typename PortalType>
|
||||
#ifndef VTKM_MSVC
|
||||
// Some versions of visual studio seem to have a bug that causes an error with the
|
||||
// deprecated attribute at this location.
|
||||
VTKM_DEPRECATED(1.6, "AtomicArrayExecutionObject no longer uses Device template parameter.")
|
||||
#endif
|
||||
AtomicArrayExecutionObject(const PortalType& portal)
|
||||
: Superclass(portal)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class AtomicArrayExecutionObject<T>
|
||||
class AtomicArrayExecutionObject
|
||||
{
|
||||
// Checks if PortalType has a GetIteratorBegin() method that returns a
|
||||
// pointer.
|
||||
@ -131,19 +93,6 @@ public:
|
||||
|
||||
AtomicArrayExecutionObject() = default;
|
||||
|
||||
// This constructor is deprecated in VTK-m 1.6.
|
||||
VTKM_CONT VTKM_DEPRECATED(1.6, "AtomicArrayExecutionObject constructor needs token.")
|
||||
AtomicArrayExecutionObject(vtkm::cont::ArrayHandle<T> handle,
|
||||
vtkm::cont::DeviceAdapterId device)
|
||||
: Data{ handle.PrepareForInPlace(device).GetIteratorBegin() }
|
||||
, NumberOfValues{ handle.GetNumberOfValues() }
|
||||
{
|
||||
using PortalType = decltype(handle.PrepareForInPlace(device));
|
||||
VTKM_STATIC_ASSERT_MSG(HasPointerAccess<PortalType>::value,
|
||||
"Source portal must return a pointer from "
|
||||
"GetIteratorBegin().");
|
||||
}
|
||||
|
||||
VTKM_CONT AtomicArrayExecutionObject(vtkm::cont::ArrayHandle<T> handle,
|
||||
vtkm::cont::DeviceAdapterId device,
|
||||
vtkm::cont::Token& token)
|
||||
@ -285,15 +234,6 @@ public:
|
||||
static_cast<APIType>(newValue));
|
||||
}
|
||||
|
||||
VTKM_DEPRECATED(1.6, "Use CompareExchange. (Note the changed interface.)")
|
||||
VTKM_EXEC ValueType CompareAndSwap(vtkm::Id index,
|
||||
const ValueType& newValue,
|
||||
ValueType oldValue) const
|
||||
{
|
||||
this->CompareExchange(index, &oldValue, newValue);
|
||||
return oldValue;
|
||||
}
|
||||
|
||||
private:
|
||||
ValueType* Data{ nullptr };
|
||||
vtkm::Id NumberOfValues{ 0 };
|
||||
|
@ -11,7 +11,6 @@
|
||||
#define vtk_m_exec_Derivative_h
|
||||
|
||||
#include <vtkm/CellShape.h>
|
||||
#include <vtkm/Deprecated.h>
|
||||
#include <vtkm/ErrorCode.h>
|
||||
#include <vtkm/VecAxisAlignedPointCoordinates.h>
|
||||
#include <vtkm/VecTraits.h>
|
||||
@ -202,28 +201,6 @@ VTKM_EXEC vtkm::ErrorCode CellDerivative(const FieldVecType& pointFieldValues,
|
||||
return status;
|
||||
}
|
||||
|
||||
template <typename FieldVecType,
|
||||
typename WorldCoordType,
|
||||
typename ParametricCoordType,
|
||||
typename CellShapeTag>
|
||||
VTKM_DEPRECATED(
|
||||
1.6,
|
||||
"Call signature has changed to CellDerivative(field, wCoords, pcoords, shape, result).")
|
||||
VTKM_EXEC vtkm::Vec<typename FieldVecType::ComponentType, 3> CellDerivative(
|
||||
const FieldVecType& field,
|
||||
const WorldCoordType& wCoords,
|
||||
const vtkm::Vec<ParametricCoordType, 3>& pcoords,
|
||||
CellShapeTag shape,
|
||||
const vtkm::exec::FunctorBase& worklet)
|
||||
{
|
||||
vtkm::Vec<typename FieldVecType::ComponentType, 3> result;
|
||||
vtkm::ErrorCode status = CellDerivative(field, wCoords, pcoords, shape, result);
|
||||
if (status != vtkm::ErrorCode::Success)
|
||||
{
|
||||
worklet.RaiseError(vtkm::ErrorString(status));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
} // namespace vtkm::exec
|
||||
|
||||
|
@ -12,7 +12,6 @@
|
||||
|
||||
#include <vtkm/CellShape.h>
|
||||
#include <vtkm/CellTraits.h>
|
||||
#include <vtkm/Deprecated.h>
|
||||
#include <vtkm/ErrorCode.h>
|
||||
#include <vtkm/Types.h>
|
||||
#include <vtkm/exec/FunctorBase.h>
|
||||
@ -174,22 +173,6 @@ static inline VTKM_EXEC vtkm::ErrorCode CellEdgeNumberOfEdges(vtkm::IdComponent
|
||||
}
|
||||
}
|
||||
|
||||
template <typename CellShapeTag>
|
||||
VTKM_DEPRECATED(1.6, "Signature changed to CellEdgeNumberOfEdges(numPoints, shape, result).")
|
||||
static inline VTKM_EXEC vtkm::IdComponent
|
||||
CellEdgeNumberOfEdges(vtkm::IdComponent numPoints,
|
||||
CellShapeTag shape,
|
||||
const vtkm::exec::FunctorBase& worklet)
|
||||
{
|
||||
vtkm::IdComponent numEdges;
|
||||
vtkm::ErrorCode status = CellEdgeNumberOfEdges(numPoints, shape, numEdges);
|
||||
if (status != vtkm::ErrorCode::Success)
|
||||
{
|
||||
worklet.RaiseError(vtkm::ErrorString(status));
|
||||
}
|
||||
return numEdges;
|
||||
}
|
||||
|
||||
template <typename CellShapeTag>
|
||||
static inline VTKM_EXEC vtkm::ErrorCode CellEdgeLocalIndex(vtkm::IdComponent numPoints,
|
||||
vtkm::IdComponent pointIndex,
|
||||
@ -290,25 +273,6 @@ static inline VTKM_EXEC vtkm::ErrorCode CellEdgeLocalIndex(vtkm::IdComponent num
|
||||
}
|
||||
}
|
||||
|
||||
template <typename CellShapeTag>
|
||||
VTKM_DEPRECATED(
|
||||
1.6,
|
||||
"Signature changed to CellEdgeLocalIndex(numPoints, pointIndex, edgeIndex, shape, result).")
|
||||
static inline VTKM_EXEC vtkm::IdComponent CellEdgeLocalIndex(vtkm::IdComponent numPoints,
|
||||
vtkm::IdComponent pointIndex,
|
||||
vtkm::IdComponent edgeIndex,
|
||||
CellShapeTag shape,
|
||||
const vtkm::exec::FunctorBase& worklet)
|
||||
{
|
||||
vtkm::IdComponent result;
|
||||
vtkm::ErrorCode status = CellEdgeLocalIndex(numPoints, pointIndex, edgeIndex, shape, result);
|
||||
if (status != vtkm::ErrorCode::Success)
|
||||
{
|
||||
worklet.RaiseError(vtkm::ErrorString(status));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// \brief Returns a canonical identifier for a cell edge
|
||||
///
|
||||
/// Given information about a cell edge and the global point indices for that cell, returns a
|
||||
@ -345,26 +309,6 @@ static inline VTKM_EXEC vtkm::ErrorCode CellEdgeCanonicalId(
|
||||
return vtkm::ErrorCode::Success;
|
||||
}
|
||||
|
||||
template <typename CellShapeTag, typename GlobalPointIndicesVecType>
|
||||
VTKM_DEPRECATED(
|
||||
1.6,
|
||||
"Signature changed to CellEdgeCononicalId(numPoints, edgeIndex, shape, globalIds, result).")
|
||||
static inline VTKM_EXEC vtkm::Id2
|
||||
CellEdgeCanonicalId(vtkm::IdComponent numPoints,
|
||||
vtkm::IdComponent edgeIndex,
|
||||
CellShapeTag shape,
|
||||
const GlobalPointIndicesVecType& globalPointIndicesVec,
|
||||
const vtkm::exec::FunctorBase& worklet)
|
||||
{
|
||||
vtkm::Id2 result;
|
||||
vtkm::ErrorCode status =
|
||||
CellEdgeCanonicalId(numPoints, edgeIndex, shape, globalPointIndicesVec, result);
|
||||
if (status != vtkm::ErrorCode::Success)
|
||||
{
|
||||
worklet.RaiseError(vtkm::ErrorString(status));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
} // namespace vtkm::exec
|
||||
|
||||
|
@ -11,7 +11,6 @@
|
||||
#define vtk_m_exec_CellFace_h
|
||||
|
||||
#include <vtkm/CellShape.h>
|
||||
#include <vtkm/Deprecated.h>
|
||||
#include <vtkm/ErrorCode.h>
|
||||
#include <vtkm/Types.h>
|
||||
#include <vtkm/exec/FunctorBase.h>
|
||||
@ -149,20 +148,6 @@ static inline VTKM_EXEC vtkm::ErrorCode CellFaceNumberOfFaces(CellShapeTag shape
|
||||
return vtkm::ErrorCode::Success;
|
||||
}
|
||||
|
||||
template <typename CellShapeTag>
|
||||
VTKM_DEPRECATED(1.6, "Signature changed to CellFaceNumberOfFaces(shape, result).")
|
||||
static inline VTKM_EXEC vtkm::IdComponent
|
||||
CellFaceNumberOfFaces(CellShapeTag shape, const vtkm::exec::FunctorBase& worklet)
|
||||
{
|
||||
vtkm::IdComponent result;
|
||||
vtkm::ErrorCode status = CellFaceNumberOfFaces(shape, result);
|
||||
if (status != vtkm::ErrorCode::Success)
|
||||
{
|
||||
worklet.RaiseError(vtkm::ErrorString(status));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename CellShapeTag>
|
||||
static inline VTKM_EXEC vtkm::ErrorCode CellFaceNumberOfPoints(vtkm::IdComponent faceIndex,
|
||||
CellShapeTag shape,
|
||||
@ -186,22 +171,6 @@ static inline VTKM_EXEC vtkm::ErrorCode CellFaceNumberOfPoints(vtkm::IdComponent
|
||||
return vtkm::ErrorCode::Success;
|
||||
}
|
||||
|
||||
template <typename CellShapeTag>
|
||||
VTKM_DEPRECATED(1.6, "Signature changed to CellFaceNumberOfPoints(faceIndex, shape, result).")
|
||||
static inline VTKM_EXEC vtkm::IdComponent
|
||||
CellFaceNumberOfPoints(vtkm::IdComponent faceIndex,
|
||||
CellShapeTag shape,
|
||||
const vtkm::exec::FunctorBase& worklet)
|
||||
{
|
||||
vtkm::IdComponent result;
|
||||
vtkm::ErrorCode status = CellFaceNumberOfPoints(faceIndex, shape, result);
|
||||
if (status != vtkm::ErrorCode::Success)
|
||||
{
|
||||
worklet.RaiseError(vtkm::ErrorString(status));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename CellShapeTag>
|
||||
static inline VTKM_EXEC vtkm::ErrorCode CellFaceShape(vtkm::IdComponent faceIndex,
|
||||
CellShapeTag shape,
|
||||
@ -231,21 +200,6 @@ static inline VTKM_EXEC vtkm::ErrorCode CellFaceShape(vtkm::IdComponent faceInde
|
||||
return vtkm::ErrorCode::Success;
|
||||
}
|
||||
|
||||
template <typename CellShapeTag>
|
||||
VTKM_DEPRECATED(1.6, "Signature changed to CellFaceShape(faceIndex, shape, result).")
|
||||
static inline VTKM_EXEC vtkm::UInt8 CellFaceShape(vtkm::IdComponent faceIndex,
|
||||
CellShapeTag shape,
|
||||
const vtkm::exec::FunctorBase& worklet)
|
||||
{
|
||||
vtkm::UInt8 result;
|
||||
vtkm::ErrorCode status = CellFaceShape(faceIndex, shape, result);
|
||||
if (status != vtkm::ErrorCode::Success)
|
||||
{
|
||||
worklet.RaiseError(vtkm::ErrorString(status));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename CellShapeTag>
|
||||
static inline VTKM_EXEC vtkm::ErrorCode CellFaceLocalIndex(vtkm::IdComponent pointIndex,
|
||||
vtkm::IdComponent faceIndex,
|
||||
@ -267,23 +221,6 @@ static inline VTKM_EXEC vtkm::ErrorCode CellFaceLocalIndex(vtkm::IdComponent poi
|
||||
return vtkm::ErrorCode::Success;
|
||||
}
|
||||
|
||||
template <typename CellShapeTag>
|
||||
VTKM_DEPRECATED(1.6,
|
||||
"Signature changed to CellFaceLocalIndex(pointIndex, faceIndex, shape, result).")
|
||||
static inline VTKM_EXEC vtkm::IdComponent CellFaceLocalIndex(vtkm::IdComponent pointIndex,
|
||||
vtkm::IdComponent faceIndex,
|
||||
CellShapeTag shape,
|
||||
const vtkm::exec::FunctorBase& worklet)
|
||||
{
|
||||
vtkm::IdComponent result;
|
||||
vtkm::ErrorCode status = CellFaceLocalIndex(pointIndex, faceIndex, shape, result);
|
||||
if (status != vtkm::ErrorCode::Success)
|
||||
{
|
||||
worklet.RaiseError(vtkm::ErrorString(status));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// \brief Returns a canonical identifier for a cell face
|
||||
///
|
||||
/// Given information about a cell face and the global point indices for that cell, returns a
|
||||
@ -369,23 +306,6 @@ static inline VTKM_EXEC vtkm::ErrorCode CellFaceCanonicalId(
|
||||
return vtkm::ErrorCode::Success;
|
||||
}
|
||||
|
||||
template <typename CellShapeTag, typename GlobalPointIndicesVecType>
|
||||
VTKM_DEPRECATED(1.6,
|
||||
"Signature changed to CellFaceCononicalId(faceIndex, shape, globalIds, result).")
|
||||
static inline VTKM_EXEC vtkm::Id3
|
||||
CellFaceCanonicalId(vtkm::IdComponent faceIndex,
|
||||
CellShapeTag shape,
|
||||
const GlobalPointIndicesVecType& globalPointIndicesVec,
|
||||
const vtkm::exec::FunctorBase& worklet)
|
||||
{
|
||||
vtkm::Id3 result;
|
||||
vtkm::ErrorCode status = CellFaceCanonicalId(faceIndex, shape, globalPointIndicesVec, result);
|
||||
if (status != vtkm::ErrorCode::Success)
|
||||
{
|
||||
worklet.RaiseError(vtkm::ErrorString(status));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
} // namespace vtkm::exec
|
||||
|
||||
|
@ -11,7 +11,6 @@
|
||||
#define vtk_m_exec_Interpolate_h
|
||||
|
||||
#include <vtkm/CellShape.h>
|
||||
#include <vtkm/Deprecated.h>
|
||||
#include <vtkm/ErrorCode.h>
|
||||
#include <vtkm/VecAxisAlignedPointCoordinates.h>
|
||||
#include <vtkm/exec/FunctorBase.h>
|
||||
@ -177,24 +176,6 @@ VTKM_EXEC vtkm::ErrorCode CellInterpolate(const FieldVecType& pointFieldValues,
|
||||
return status;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename FieldVecType, typename ParametricCoordType, typename CellShapeTag>
|
||||
VTKM_DEPRECATED(1.6,
|
||||
"Signature changed to CellInterpolate(pointFieldValues, pcoords, shape, result).")
|
||||
VTKM_EXEC typename FieldVecType::ComponentType
|
||||
CellInterpolate(const FieldVecType& pointFieldValues,
|
||||
const vtkm::Vec<ParametricCoordType, 3>& pcoords,
|
||||
CellShapeTag shape,
|
||||
const vtkm::exec::FunctorBase& worklet)
|
||||
{
|
||||
typename FieldVecType::ComponentType result;
|
||||
vtkm::ErrorCode status = CellInterpolate(pointFieldValues, pcoords, shape, result);
|
||||
if (status != vtkm::ErrorCode::Success)
|
||||
{
|
||||
worklet.RaiseError(vtkm::ErrorString(status));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
} // namespace vtkm::exec
|
||||
|
||||
|
@ -176,11 +176,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
VTKM_DEPRECATED(1.6, "Locators are no longer pointers. Use . operator.")
|
||||
VTKM_EXEC CellLocatorBoundingIntervalHierarchy* operator->() { return this; }
|
||||
VTKM_DEPRECATED(1.6, "Locators are no longer pointers. Use . operator.")
|
||||
VTKM_EXEC const CellLocatorBoundingIntervalHierarchy* operator->() const { return this; }
|
||||
|
||||
private:
|
||||
enum struct FindCellState
|
||||
{
|
||||
|
@ -83,11 +83,6 @@ public:
|
||||
return this->Locators.CastAndCall(
|
||||
detail::FindCellFunctor{}, point, cellId, parametric, lastCell);
|
||||
}
|
||||
|
||||
VTKM_DEPRECATED(1.6, "Locators are no longer pointers. Use . operator.")
|
||||
VTKM_EXEC CellLocatorMultiplexer* operator->() { return this; }
|
||||
VTKM_DEPRECATED(1.6, "Locators are no longer pointers. Use . operator.")
|
||||
VTKM_EXEC const CellLocatorMultiplexer* operator->() const { return this; }
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -157,11 +157,6 @@ public:
|
||||
return vtkm::ErrorCode::Success;
|
||||
}
|
||||
|
||||
VTKM_DEPRECATED(1.6, "Locators are no longer pointers. Use . operator.")
|
||||
VTKM_EXEC CellLocatorRectilinearGrid* operator->() { return this; }
|
||||
VTKM_DEPRECATED(1.6, "Locators are no longer pointers. Use . operator.")
|
||||
VTKM_EXEC const CellLocatorRectilinearGrid* operator->() const { return this; }
|
||||
|
||||
private:
|
||||
vtkm::Id PlaneSize;
|
||||
vtkm::Id RowSize;
|
||||
|
@ -195,11 +195,6 @@ public:
|
||||
return this->FindCellImpl(point, cellId, parametric, lastCell);
|
||||
}
|
||||
|
||||
VTKM_DEPRECATED(1.6, "Locators are no longer pointers. Use . operator.")
|
||||
VTKM_EXEC CellLocatorTwoLevel* operator->() { return this; }
|
||||
VTKM_DEPRECATED(1.6, "Locators are no longer pointers. Use . operator.")
|
||||
VTKM_EXEC const CellLocatorTwoLevel* operator->() const { return this; }
|
||||
|
||||
private:
|
||||
VTKM_EXEC
|
||||
vtkm::ErrorCode PointInCell(const vtkm::Vec3f& point,
|
||||
|
@ -95,11 +95,6 @@ public:
|
||||
return vtkm::ErrorCode::Success;
|
||||
}
|
||||
|
||||
VTKM_DEPRECATED(1.6, "Locators are no longer pointers. Use . operator.")
|
||||
VTKM_EXEC CellLocatorUniformGrid* operator->() { return this; }
|
||||
VTKM_DEPRECATED(1.6, "Locators are no longer pointers. Use . operator.")
|
||||
VTKM_EXEC const CellLocatorUniformGrid* operator->() const { return this; }
|
||||
|
||||
private:
|
||||
vtkm::Id3 CellDims;
|
||||
vtkm::Id3 MaxCellIds;
|
||||
|
@ -10,7 +10,6 @@
|
||||
#ifndef vtk_m_exec_ColorTable_h
|
||||
#define vtk_m_exec_ColorTable_h
|
||||
|
||||
#include <vtkm/Deprecated.h>
|
||||
#include <vtkm/Types.h>
|
||||
|
||||
namespace vtkm
|
||||
@ -88,44 +87,6 @@ private:
|
||||
vtkm::Float32 weight) const;
|
||||
};
|
||||
|
||||
class VTKM_ALWAYS_EXPORT VTKM_DEPRECATED(1.6, "Use vtkm::exec::ColorTable.") ColorTableBase
|
||||
: public vtkm::exec::ColorTable
|
||||
{
|
||||
};
|
||||
|
||||
class VTKM_ALWAYS_EXPORT VTKM_DEPRECATED(1.6, "Use vtkm::exec::ColorTable.") ColorTableRGB final
|
||||
: public ColorTable
|
||||
{
|
||||
public:
|
||||
ColorTableRGB() { this->Space = vtkm::ColorSpace::RGB; }
|
||||
};
|
||||
|
||||
class VTKM_ALWAYS_EXPORT VTKM_DEPRECATED(1.6, "Use vtkm::exec::ColorTable.") ColorTableHSV final
|
||||
: public ColorTable
|
||||
{
|
||||
public:
|
||||
ColorTableHSV() { this->Space = vtkm::ColorSpace::HSV; }
|
||||
};
|
||||
|
||||
class VTKM_ALWAYS_EXPORT VTKM_DEPRECATED(1.6, "Use vtkm::exec::ColorTable.") ColorTableHSVWrap final
|
||||
: public ColorTable
|
||||
{
|
||||
public:
|
||||
ColorTableHSVWrap() { this->Space = vtkm::ColorSpace::HSVWrap; }
|
||||
};
|
||||
|
||||
class VTKM_ALWAYS_EXPORT VTKM_DEPRECATED(1.6, "Use vtkm::exec::ColorTable.") ColorTableLab final
|
||||
: public ColorTable
|
||||
{
|
||||
public:
|
||||
ColorTableLab() { this->Space = vtkm::ColorSpace::Lab; }
|
||||
};
|
||||
|
||||
class VTKM_ALWAYS_EXPORT ColorTableDiverging final : public ColorTable
|
||||
{
|
||||
public:
|
||||
ColorTableDiverging() { this->Space = vtkm::ColorSpace::Diverging; }
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -136,39 +136,6 @@ static inline VTKM_EXEC vtkm::ErrorCode ParametricCoordinatesCenter(
|
||||
return status;
|
||||
}
|
||||
|
||||
template <typename ParametricCoordType, typename CellShapeTag>
|
||||
VTKM_DEPRECATED(1.6, "Signature changed to ParametricCoordinatesCenter(numPoints, shape, result).")
|
||||
static inline VTKM_EXEC void ParametricCoordinatesCenter(vtkm::IdComponent numPoints,
|
||||
vtkm::Vec<ParametricCoordType, 3>& pcoords,
|
||||
CellShapeTag shape,
|
||||
const vtkm::exec::FunctorBase& worklet)
|
||||
{
|
||||
vtkm::ErrorCode status = ParametricCoordinatesCenter(numPoints, shape, pcoords);
|
||||
if (status != vtkm::ErrorCode::Success)
|
||||
{
|
||||
worklet.RaiseError(vtkm::ErrorString(status));
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the parametric center of the given cell shape with the given number
|
||||
/// of points.
|
||||
///
|
||||
template <typename CellShapeTag>
|
||||
VTKM_DEPRECATED(1.6, "Signature changed to ParametricCoordinatesCenter(numPoints, shape, result).")
|
||||
static inline VTKM_EXEC vtkm::Vec3f
|
||||
ParametricCoordinatesCenter(vtkm::IdComponent numPoints,
|
||||
CellShapeTag shape,
|
||||
const vtkm::exec::FunctorBase& worklet)
|
||||
{
|
||||
vtkm::Vec3f pcoords(0.0f);
|
||||
vtkm::ErrorCode status = ParametricCoordinatesCenter(numPoints, shape, pcoords);
|
||||
if (status != vtkm::ErrorCode::Success)
|
||||
{
|
||||
worklet.RaiseError(vtkm::ErrorString(status));
|
||||
}
|
||||
return pcoords;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename ParametricCoordType, typename CellShapeTag>
|
||||
static inline VTKM_EXEC vtkm::ErrorCode ParametricCoordinatesPoint(
|
||||
@ -293,45 +260,6 @@ static inline VTKM_EXEC vtkm::ErrorCode ParametricCoordinatesPoint(
|
||||
return status;
|
||||
}
|
||||
|
||||
template <typename ParametricCoordType, typename CellShapeTag>
|
||||
VTKM_DEPRECATED(
|
||||
1.6,
|
||||
"Signature changed to ParametricCoordinatesPoint(numPoints, pointIndex, shape, result).")
|
||||
static inline VTKM_EXEC void ParametricCoordinatesPoint(vtkm::IdComponent numPoints,
|
||||
vtkm::IdComponent pointIndex,
|
||||
vtkm::Vec<ParametricCoordType, 3>& pcoords,
|
||||
CellShapeTag shape,
|
||||
const vtkm::exec::FunctorBase& worklet)
|
||||
{
|
||||
vtkm::ErrorCode status = ParametricCoordinatesPoint(numPoints, pointIndex, shape, pcoords);
|
||||
if (status != vtkm::ErrorCode::Success)
|
||||
{
|
||||
worklet.RaiseError(vtkm::ErrorString(status));
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the parametric coordinate of a cell point of the given shape with
|
||||
/// the given number of points.
|
||||
///
|
||||
template <typename CellShapeTag>
|
||||
VTKM_DEPRECATED(
|
||||
1.6,
|
||||
"Signature changed to ParametricCoordinatesPoint(numPoints, pointIndex, shape, result).")
|
||||
static inline VTKM_EXEC vtkm::Vec3f
|
||||
ParametricCoordinatesPoint(vtkm::IdComponent numPoints,
|
||||
vtkm::IdComponent pointIndex,
|
||||
CellShapeTag shape,
|
||||
const vtkm::exec::FunctorBase& worklet)
|
||||
{
|
||||
vtkm::Vec3f pcoords;
|
||||
vtkm::ErrorCode status = ParametricCoordinatesPoint(numPoints, pointIndex, shape, pcoords);
|
||||
if (status != vtkm::ErrorCode::Success)
|
||||
{
|
||||
worklet.RaiseError(vtkm::ErrorString(status));
|
||||
}
|
||||
return pcoords;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace internal
|
||||
{
|
||||
@ -447,26 +375,6 @@ static inline VTKM_EXEC vtkm::ErrorCode ParametricCoordinatesToWorldCoordinates(
|
||||
return status;
|
||||
}
|
||||
|
||||
template <typename WorldCoordVector, typename PCoordType, typename CellShapeTag>
|
||||
VTKM_DEPRECATED(1.6,
|
||||
"Signature changed to "
|
||||
"ParametricCoordinatesToWorldCoordinates(pointWCoords, pcoords, shape, result).")
|
||||
static inline VTKM_EXEC typename WorldCoordVector::ComponentType
|
||||
ParametricCoordinatesToWorldCoordinates(const WorldCoordVector& pointWCoords,
|
||||
const vtkm::Vec<PCoordType, 3>& pcoords,
|
||||
CellShapeTag shape,
|
||||
const vtkm::exec::FunctorBase& worklet)
|
||||
{
|
||||
typename WorldCoordVector::ComponentType result;
|
||||
vtkm::ErrorCode status =
|
||||
ParametricCoordinatesToWorldCoordinates(pointWCoords, pcoords, shape, result);
|
||||
if (status != vtkm::ErrorCode::Success)
|
||||
{
|
||||
worklet.RaiseError(vtkm::ErrorString(status));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace internal
|
||||
{
|
||||
@ -654,31 +562,6 @@ static inline VTKM_EXEC vtkm::ErrorCode WorldCoordinatesToParametricCoordinates(
|
||||
return status;
|
||||
}
|
||||
|
||||
template <typename WorldCoordVector, typename CellShapeTag>
|
||||
VTKM_DEPRECATED(1.6,
|
||||
"Signature changed to "
|
||||
"WorldCoordinatesToParametricCoordinates(pointWCoords, wcoords, shape, result).")
|
||||
static inline VTKM_EXEC typename WorldCoordVector::ComponentType
|
||||
WorldCoordinatesToParametricCoordinates(const WorldCoordVector& pointWCoords,
|
||||
const typename WorldCoordVector::ComponentType& wcoords,
|
||||
CellShapeTag shape,
|
||||
bool& success,
|
||||
const vtkm::exec::FunctorBase& worklet)
|
||||
{
|
||||
typename WorldCoordVector::ComponentType result;
|
||||
vtkm::ErrorCode status =
|
||||
WorldCoordinatesToParametricCoordinates(pointWCoords, wcoords, shape, result);
|
||||
if (status != vtkm::ErrorCode::Success)
|
||||
{
|
||||
success = false;
|
||||
worklet.RaiseError(vtkm::ErrorString(status));
|
||||
}
|
||||
else
|
||||
{
|
||||
success = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
} // namespace vtkm::exec
|
||||
|
||||
|
@ -12,7 +12,6 @@
|
||||
|
||||
#include <vtkm/cont/CoordinateSystem.h>
|
||||
|
||||
#include <vtkm/Deprecated.h>
|
||||
#include <vtkm/VectorAnalysis.h>
|
||||
|
||||
namespace vtkm
|
||||
@ -83,11 +82,6 @@ public:
|
||||
this->FindInBox(queryPoint, ijk, level, nearestNeighborId, distance2);
|
||||
}
|
||||
|
||||
VTKM_DEPRECATED(1.6, "Locators are no longer pointers. Use . operator.")
|
||||
VTKM_EXEC PointLocatorSparseGrid* operator->() { return this; }
|
||||
VTKM_DEPRECATED(1.6, "Locators are no longer pointers. Use . operator.")
|
||||
VTKM_EXEC const PointLocatorSparseGrid* operator->() const { return this; }
|
||||
|
||||
private:
|
||||
vtkm::Vec3f Min;
|
||||
vtkm::Id3 Dims;
|
||||
|
@ -274,7 +274,8 @@ void TestNormalFunctorInvoke()
|
||||
|
||||
vtkm::Id inputTestValues[3] = { 5, 5, 6 };
|
||||
|
||||
vtkm::cont::ArrayHandle<vtkm::Id> input = vtkm::cont::make_ArrayHandle(inputTestValues, 3);
|
||||
vtkm::cont::ArrayHandle<vtkm::Id> input =
|
||||
vtkm::cont::make_ArrayHandle(inputTestValues, 3, vtkm::CopyFlag::Off);
|
||||
vtkm::cont::ArrayHandle<vtkm::Id> output;
|
||||
|
||||
vtkm::internal::FunctionInterface<void(TestExecObject, TestExecObject)> execObjects =
|
||||
@ -331,8 +332,10 @@ void TestErrorFunctorInvoke()
|
||||
vtkm::Id inputTestValue = 5;
|
||||
vtkm::Id outputTestValue = static_cast<vtkm::Id>(0xDEADDEAD);
|
||||
|
||||
vtkm::cont::ArrayHandle<vtkm::Id> input = vtkm::cont::make_ArrayHandle(&inputTestValue, 1);
|
||||
vtkm::cont::ArrayHandle<vtkm::Id> output = vtkm::cont::make_ArrayHandle(&outputTestValue, 1);
|
||||
vtkm::cont::ArrayHandle<vtkm::Id> input =
|
||||
vtkm::cont::make_ArrayHandle(&inputTestValue, 1, vtkm::CopyFlag::Off);
|
||||
vtkm::cont::ArrayHandle<vtkm::Id> output =
|
||||
vtkm::cont::make_ArrayHandle(&outputTestValue, 1, vtkm::CopyFlag::Off);
|
||||
|
||||
vtkm::internal::FunctionInterface<void(TestExecObject, TestExecObject)> execObjects =
|
||||
vtkm::internal::make_FunctionInterface<void>(
|
||||
|
@ -1,32 +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_filter_AmrArrays_h
|
||||
#define vtk_m_filter_AmrArrays_h
|
||||
|
||||
#include <vtkm/Deprecated.h>
|
||||
#include <vtkm/filter/multi_block/AmrArrays.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace filter
|
||||
{
|
||||
|
||||
VTKM_DEPRECATED(1.8, "Use vtkm/filter/multi_block/AmrArrays.h instead of vtkm/filter/AmrArrays.h.")
|
||||
inline void AmrArrays_deprecated() {}
|
||||
|
||||
inline void AmrArrays_deprecated_warning()
|
||||
{
|
||||
AmrArrays_deprecated();
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace vtkm::filter
|
||||
|
||||
#endif //vtk_m_filter_AmrArrays_h
|
@ -8,92 +8,6 @@
|
||||
## PURPOSE. See the above copyright notice for more information.
|
||||
##============================================================================
|
||||
|
||||
set(deprecated_headers
|
||||
AmrArrays.h
|
||||
CellAverage.h
|
||||
CellMeasures.h
|
||||
CellSetConnectivity.h
|
||||
CleanGrid.h
|
||||
ClipWithField.h
|
||||
ClipWithImplicitFunction.h
|
||||
ComputeMoments.h
|
||||
Contour.h
|
||||
ContourTreeUniform.h
|
||||
ContourTreeUniformAugmented.h
|
||||
ContourTreeUniformDistributed.h
|
||||
CoordinateSystemTransform.h
|
||||
CreateResult.h
|
||||
CrossProduct.h
|
||||
DotProduct.h
|
||||
Entropy.h
|
||||
ExternalFaces.h
|
||||
ExtractGeometry.h
|
||||
ExtractPoints.h
|
||||
ExtractStructured.h
|
||||
FieldToColors.h
|
||||
FieldMetadata.h
|
||||
FilterCell.h
|
||||
FilterDataSet.h
|
||||
FilterDataSet.hxx
|
||||
FilterDataSetWithField.h
|
||||
FilterDataSetWithField.hxx
|
||||
FilterField.h
|
||||
FilterField.hxx
|
||||
Filter.h
|
||||
Filter.hxx
|
||||
FilterTraits.h
|
||||
GenerateIds.h
|
||||
GhostCellClassify.h
|
||||
GhostCellRemove.h
|
||||
Gradient.h
|
||||
Histogram.h
|
||||
ImageConnectivity.h
|
||||
ImageDifference.h
|
||||
ImageMedian.h
|
||||
Instantiations.h
|
||||
Lagrangian.h
|
||||
LagrangianStructures.h
|
||||
Mask.h
|
||||
MaskPoints.h
|
||||
MeshQuality.h
|
||||
MIRFilter.h
|
||||
NDEntropy.h
|
||||
NDHistogram.h
|
||||
ParticleAdvection.h
|
||||
ParticleDensityCloudInCell.h
|
||||
ParticleDensityNearestGridPoint.h
|
||||
Pathline.h
|
||||
PathParticle.h
|
||||
PointAverage.h
|
||||
PointElevation.h
|
||||
PointTransform.h
|
||||
PolicyBase.h
|
||||
PolicyDefault.h
|
||||
Probe.h
|
||||
Slice.h
|
||||
SplitSharpEdges.h
|
||||
Streamline.h
|
||||
StreamSurface.h
|
||||
SurfaceNormals.h
|
||||
Tetrahedralize.h
|
||||
Threshold.h
|
||||
ThresholdPoints.h
|
||||
Triangulate.h
|
||||
Tube.h
|
||||
VertexClustering.h
|
||||
VectorMagnitude.h
|
||||
WarpScalar.h
|
||||
WarpVector.h
|
||||
ZFPCompressor1D.h
|
||||
ZFPCompressor2D.h
|
||||
ZFPCompressor3D.h
|
||||
ZFPDecompressor1D.h
|
||||
ZFPDecompressor2D.h
|
||||
ZFPDecompressor3D.h
|
||||
)
|
||||
|
||||
vtkm_declare_headers(${deprecated_headers})
|
||||
|
||||
set(core_headers
|
||||
FieldSelection.h
|
||||
NewFilter.h
|
||||
@ -134,5 +48,3 @@ target_link_libraries(vtkm_filter PUBLIC INTERFACE
|
||||
)
|
||||
|
||||
install(TARGETS vtkm_filter EXPORT ${VTKm_EXPORT_NAME})
|
||||
|
||||
add_subdirectory(internal)
|
||||
|
@ -1,34 +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_filter_CellAverage_h
|
||||
#define vtk_m_filter_CellAverage_h
|
||||
|
||||
#include <vtkm/Deprecated.h>
|
||||
#include <vtkm/filter/field_conversion/CellAverage.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace filter
|
||||
{
|
||||
|
||||
VTKM_DEPRECATED(
|
||||
1.8,
|
||||
"Use vtkm/filter/field_conversion/CellAverage.h instead of vtkm/filter/CellAverage.h.")
|
||||
inline void CellAverage_deprecated() {}
|
||||
|
||||
inline void CellAverage_deprecated_warning()
|
||||
{
|
||||
CellAverage_deprecated();
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace vtkm::filter
|
||||
|
||||
#endif //vtk_m_filter_CellAverage_h
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user