Update lists in TypeListTag.h

A new header named TypeList.h and the type lists have been redefined in
this new file. All the types have been renamed from `TypeListTag*` to
`TypeList*`. TypeListTag.h has been gutted to provide deprecated
versions of the old type list names.

There were also some other type lists that were changed from using the
old `ListTagBase` to the new `List`.
This commit is contained in:
Kenneth Moreland 2019-12-05 10:55:57 -07:00
parent 6fc883213c
commit cd302effb3
100 changed files with 702 additions and 402 deletions

@ -40,13 +40,13 @@ static constexpr vtkm::Id NumWrites = 33554432; // 2^25
VTKM_MAKE_BENCHMARK(Name##1048576, Class, 1048576)
#define RUN_ATOMIC_BENCHMARKS(Name, id) \
VTKM_RUN_BENCHMARK(Name##1, vtkm::cont::AtomicArrayTypeListTag{}, id); \
VTKM_RUN_BENCHMARK(Name##8, vtkm::cont::AtomicArrayTypeListTag{}, id); \
VTKM_RUN_BENCHMARK(Name##32, vtkm::cont::AtomicArrayTypeListTag{}, id); \
VTKM_RUN_BENCHMARK(Name##512, vtkm::cont::AtomicArrayTypeListTag{}, id); \
VTKM_RUN_BENCHMARK(Name##2048, vtkm::cont::AtomicArrayTypeListTag{}, id); \
VTKM_RUN_BENCHMARK(Name##32768, vtkm::cont::AtomicArrayTypeListTag{}, id); \
VTKM_RUN_BENCHMARK(Name##1048576, vtkm::cont::AtomicArrayTypeListTag{}, id)
VTKM_RUN_BENCHMARK(Name##1, vtkm::cont::AtomicArrayTypeList{}, id); \
VTKM_RUN_BENCHMARK(Name##8, vtkm::cont::AtomicArrayTypeList{}, id); \
VTKM_RUN_BENCHMARK(Name##32, vtkm::cont::AtomicArrayTypeList{}, id); \
VTKM_RUN_BENCHMARK(Name##512, vtkm::cont::AtomicArrayTypeList{}, id); \
VTKM_RUN_BENCHMARK(Name##2048, vtkm::cont::AtomicArrayTypeList{}, id); \
VTKM_RUN_BENCHMARK(Name##32768, vtkm::cont::AtomicArrayTypeList{}, id); \
VTKM_RUN_BENCHMARK(Name##1048576, vtkm::cont::AtomicArrayTypeList{}, id)
class BenchmarkAtomicArray
{

@ -47,7 +47,7 @@ class HelloField : public vtkm::filter::FilterField<HelloField>
{
public:
// Specify that this filter operates on 3-vectors
using SupportedTypes = vtkm::TypeListTagFieldVec3;
using SupportedTypes = vtkm::TypeListFieldVec3;
template <typename FieldType, typename Policy>
VTKM_CONT vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& inDataSet,

@ -25,7 +25,7 @@ public:
//currently the HistogramMPI filter only works on scalar data.
//this mainly has to do with getting the ranges for each bin
//would require returning a more complex value type
using SupportedTypes = vtkm::TypeListTagScalarAll;
using SupportedTypes = vtkm::TypeListScalarAll;
//Construct a HistogramMPI with a default of 10 bins
VTKM_CONT

@ -44,6 +44,7 @@ set(headers
Swap.h
TopologyElementTag.h
Transform3D.h
TypeList.h
TypeListTag.h
Types.h
TypeTraits.h

176
vtkm/TypeList.h Normal file

@ -0,0 +1,176 @@
//============================================================================
// 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_TypeList_h
#define vtk_m_TypeList_h
#ifndef VTKM_DEFAULT_TYPE_LIST
#define VTKM_DEFAULT_TYPE_LIST ::vtkm::TypeListCommon
#endif
#include <vtkm/List.h>
#include <vtkm/Types.h>
namespace vtkm
{
/// A list containing the type vtkm::Id.
///
using TypeListId = vtkm::List<vtkm::Id>;
/// A list containing the type vtkm::Id2.
///
using TypeListId2 = vtkm::List<vtkm::Id2>;
/// A list containing the type vtkm::Id3.
///
using TypeListId3 = vtkm::List<vtkm::Id3>;
/// A list containing the type vtkm::Id4.
///
using TypeListId4 = vtkm::List<vtkm::Id4>;
/// A list containing the type vtkm::IdComponent
///
using TypeListIdComponent = vtkm::List<vtkm::IdComponent>;
/// A list containing types used to index arrays. Contains vtkm::Id, vtkm::Id2,
/// and vtkm::Id3.
///
using TypeListIndex = vtkm::List<vtkm::Id, vtkm::Id2, vtkm::Id3>;
/// A list containing types used for scalar fields. Specifically, contains
/// floating point numbers of different widths (i.e. vtkm::Float32 and
/// vtkm::Float64).
using TypeListFieldScalar = vtkm::List<vtkm::Float32, vtkm::Float64>;
/// A list containing types for values for fields with two dimensional
/// vectors.
///
using TypeListFieldVec2 = vtkm::List<vtkm::Vec2f_32, vtkm::Vec2f_64>;
/// A list containing types for values for fields with three dimensional
/// vectors.
///
using TypeListFieldVec3 = vtkm::List<vtkm::Vec3f_32, vtkm::Vec3f_64>;
/// A list containing types for values for fields with four dimensional
/// vectors.
///
using TypeListFieldVec4 = vtkm::List<vtkm::Vec4f_32, vtkm::Vec4f_64>;
/// A list containing common types for floating-point vectors. Specifically contains
/// floating point vectors of size 2, 3, and 4 with floating point components.
/// Scalars are not included.
///
using TypeListFloatVec = vtkm::List<vtkm::Vec2f_32,
vtkm::Vec2f_64,
vtkm::Vec3f_32,
vtkm::Vec3f_64,
vtkm::Vec4f_32,
vtkm::Vec4f_64>;
/// A list containing common types for values in fields. Specifically contains
/// floating point scalars and vectors of size 2, 3, and 4 with floating point
/// components.
///
using TypeListField = vtkm::List<vtkm::Float32,
vtkm::Float64,
vtkm::Vec2f_32,
vtkm::Vec2f_64,
vtkm::Vec3f_32,
vtkm::Vec3f_64,
vtkm::Vec4f_32,
vtkm::Vec4f_64>;
/// A list of all scalars defined in vtkm/Types.h. A scalar is a type that
/// holds a single number.
///
using TypeListScalarAll = vtkm::List<vtkm::Int8,
vtkm::UInt8,
vtkm::Int16,
vtkm::UInt16,
vtkm::Int32,
vtkm::UInt32,
vtkm::Int64,
vtkm::UInt64,
vtkm::Float32,
vtkm::Float64>;
/// A list of the most commonly use Vec classes. Specifically, these are
/// vectors of size 2, 3, or 4 containing either unsigned bytes, signed
/// integers of 32 or 64 bits, or floating point values of 32 or 64 bits.
///
using TypeListVecCommon = vtkm::List<vtkm::Vec2ui_8,
vtkm::Vec2i_32,
vtkm::Vec2i_64,
vtkm::Vec2f_32,
vtkm::Vec2f_64,
vtkm::Vec3ui_8,
vtkm::Vec3i_32,
vtkm::Vec3i_64,
vtkm::Vec3f_32,
vtkm::Vec3f_64,
vtkm::Vec4ui_8,
vtkm::Vec4i_32,
vtkm::Vec4i_64,
vtkm::Vec4f_32,
vtkm::Vec4f_64>;
namespace internal
{
/// A list of uncommon Vec classes with length up to 4. This is not much
/// use in general, but is used when joined with \c TypeListVecCommon
/// to get a list of all vectors up to size 4.
///
using TypeListVecUncommon = vtkm::List<vtkm::Vec2i_8,
vtkm::Vec2i_16,
vtkm::Vec2ui_16,
vtkm::Vec2ui_32,
vtkm::Vec2ui_64,
vtkm::Vec3i_8,
vtkm::Vec3i_16,
vtkm::Vec3ui_16,
vtkm::Vec3ui_32,
vtkm::Vec3ui_64,
vtkm::Vec4i_8,
vtkm::Vec4i_16,
vtkm::Vec4ui_16,
vtkm::Vec4ui_32,
vtkm::Vec4ui_64>;
} // namespace internal
/// A list of all vector classes with standard types as components and
/// lengths between 2 and 4.
///
using TypeListVecAll =
vtkm::ListAppend<vtkm::TypeListVecCommon, vtkm::internal::TypeListVecUncommon>;
/// A list of all basic types listed in vtkm/Types.h. Does not include all
/// possible VTK-m types like arbitrarily typed and sized Vecs (only up to
/// length 4) or math types like matrices.
///
using TypeListAll = vtkm::ListAppend<vtkm::TypeListScalarAll, vtkm::TypeListVecAll>;
/// A list of the most commonly used types across multiple domains. Includes
/// integers, floating points, and 3 dimensional vectors of floating points.
///
using TypeListCommon = vtkm::List<vtkm::UInt8,
vtkm::Int32,
vtkm::Int64,
vtkm::Float32,
vtkm::Float64,
vtkm::Vec3f_32,
vtkm::Vec3f_64>;
} // namespace vtkm
#endif //vtk_m_TypeList_h

@ -10,202 +10,63 @@
#ifndef vtk_m_TypeListTag_h
#define vtk_m_TypeListTag_h
// Everything in this header file is deprecated and movded to TypeList.h.
#ifndef VTKM_DEFAULT_TYPE_LIST_TAG
#define VTKM_DEFAULT_TYPE_LIST_TAG ::vtkm::TypeListTagCommon
#define VTKM_DEFAULT_TYPE_LIST_TAG ::vtkm::internal::TypeListTagDefault
#endif
#include <vtkm/ListTag.h>
#include <vtkm/Types.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> \
{ \
}
namespace vtkm
{
/// A list containing the type vtkm::Id.
///
struct VTKM_ALWAYS_EXPORT TypeListTagId : vtkm::ListTagBase<vtkm::Id>
{
};
/// A list containing the type vtkm::Id2.
///
struct VTKM_ALWAYS_EXPORT TypeListTagId2 : vtkm::ListTagBase<vtkm::Id2>
{
};
/// A list containing the type vtkm::Id3.
///
struct VTKM_ALWAYS_EXPORT TypeListTagId3 : vtkm::ListTagBase<vtkm::Id3>
{
};
/// A list containing the type vtkm::IdComponent
///
struct VTKM_ALWAYS_EXPORT TypeListTagIdComponent : vtkm::ListTagBase<vtkm::IdComponent>
{
};
/// A list containing types used to index arrays. Contains vtkm::Id, vtkm::Id2,
/// and vtkm::Id3.
///
struct VTKM_ALWAYS_EXPORT TypeListTagIndex : vtkm::ListTagBase<vtkm::Id, vtkm::Id2, vtkm::Id3>
{
};
/// A list containing types used for scalar fields. Specifically, contains
/// floating point numbers of different widths (i.e. vtkm::Float32 and
/// vtkm::Float64).
struct VTKM_ALWAYS_EXPORT TypeListTagFieldScalar : vtkm::ListTagBase<vtkm::Float32, vtkm::Float64>
{
};
/// A list containing types for values for fields with two dimensional
/// vectors.
///
struct VTKM_ALWAYS_EXPORT TypeListTagFieldVec2
: vtkm::ListTagBase<vtkm::Vec2f_32, vtkm::Vec2f_64>
{
};
/// A list containing types for values for fields with three dimensional
/// vectors.
///
struct VTKM_ALWAYS_EXPORT TypeListTagFieldVec3
: vtkm::ListTagBase<vtkm::Vec3f_32, vtkm::Vec3f_64>
{
};
/// A list containing types for values for fields with four dimensional
/// vectors.
///
struct VTKM_ALWAYS_EXPORT TypeListTagFieldVec4
: vtkm::ListTagBase<vtkm::Vec4f_32, vtkm::Vec4f_64>
{
};
/// A list containing common types for floating-point vectors. Specifically contains
/// floating point vectors of size 2, 3, and 4 with floating point components.
/// Scalars are not included.
///
struct VTKM_ALWAYS_EXPORT TypeListTagFloatVec
: vtkm::ListTagBase<vtkm::Vec2f_32,
vtkm::Vec2f_64,
vtkm::Vec3f_32,
vtkm::Vec3f_64,
vtkm::Vec4f_32,
vtkm::Vec4f_64>
{
};
/// A list containing common types for values in fields. Specifically contains
/// floating point scalars and vectors of size 2, 3, and 4 with floating point
/// components.
///
struct VTKM_ALWAYS_EXPORT TypeListTagField
: vtkm::ListTagBase<vtkm::Float32,
vtkm::Float64,
vtkm::Vec2f_32,
vtkm::Vec2f_64,
vtkm::Vec3f_32,
vtkm::Vec3f_64,
vtkm::Vec4f_32,
vtkm::Vec4f_64>
{
};
/// A list of all scalars defined in vtkm/Types.h. A scalar is a type that
/// holds a single number.
///
struct VTKM_ALWAYS_EXPORT TypeListTagScalarAll
: vtkm::ListTagBase<vtkm::Int8,
vtkm::UInt8,
vtkm::Int16,
vtkm::UInt16,
vtkm::Int32,
vtkm::UInt32,
vtkm::Int64,
vtkm::UInt64,
vtkm::Float32,
vtkm::Float64>
{
};
/// A list of the most commonly use Vec classes. Specifically, these are
/// vectors of size 2, 3, or 4 containing either unsigned bytes, signed
/// integers of 32 or 64 bits, or floating point values of 32 or 64 bits.
///
struct VTKM_ALWAYS_EXPORT TypeListTagVecCommon
: vtkm::ListTagBase<vtkm::Vec2ui_8,
vtkm::Vec2i_32,
vtkm::Vec2i_64,
vtkm::Vec2f_32,
vtkm::Vec2f_64,
vtkm::Vec3ui_8,
vtkm::Vec3i_32,
vtkm::Vec3i_64,
vtkm::Vec3f_32,
vtkm::Vec3f_64,
vtkm::Vec4ui_8,
vtkm::Vec4i_32,
vtkm::Vec4i_64,
vtkm::Vec4f_32,
vtkm::Vec4f_64>
{
};
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
{
/// A list of uncommon Vec classes with length up to 4. This is not much
/// use in general, but is used when joined with \c TypeListTagVecCommon
/// to get a list of all vectors up to size 4.
///
struct VTKM_ALWAYS_EXPORT TypeListTagVecUncommon
: vtkm::ListTagBase<vtkm::Vec2i_8,
vtkm::Vec2i_16,
vtkm::Vec2ui_16,
vtkm::Vec2ui_32,
vtkm::Vec2ui_64,
vtkm::Vec3i_8,
vtkm::Vec3i_16,
vtkm::Vec3ui_16,
vtkm::Vec3ui_32,
vtkm::Vec3ui_64,
vtkm::Vec4i_8,
vtkm::Vec4i_16,
vtkm::Vec4ui_16,
vtkm::Vec4ui_32,
vtkm::Vec4ui_64>
VTK_M_OLD_TYPE_LIST_DEFINITION(VecUncommon);
// Special definition of TypeListTagCommon to give descriptive warning when
// VTKM_DEFAULT_TYPE_LIST_TAG is used.
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>
{
};
} // namespace internal
/// A list of all vector classes with standard types as components and
/// lengths between 2 and 4.
///
using TypeListTagVecAll =
vtkm::ListAppend<vtkm::TypeListTagVecCommon, vtkm::internal::TypeListTagVecUncommon>;
/// A list of all basic types listed in vtkm/Types.h. Does not include all
/// possible VTK-m types like arbitrarily typed and sized Vecs (only up to
/// length 4) or math types like matrices.
///
using TypeListTagAll = vtkm::ListAppend<vtkm::TypeListTagScalarAll, vtkm::TypeListTagVecAll>;
/// A list of the most commonly used types across multiple domains. Includes
/// integers, floating points, and 3 dimensional vectors of floating points.
///
struct VTKM_ALWAYS_EXPORT TypeListTagCommon
: vtkm::ListTagBase<vtkm::UInt8,
vtkm::Int32,
vtkm::Int64,
vtkm::Float32,
vtkm::Float64,
vtkm::Vec3f_32,
vtkm::Vec3f_64>
{
};
VTKM_DEPRECATED_SUPPRESS_BEGIN
// Special implementation of ListContains for TypeListTagAll to always be
// true. Although TypeListTagAll is necessarily finite, the point is to
@ -218,21 +79,25 @@ struct ListContains<vtkm::TypeListTagAll, Type>
};
VTKM_DEPRECATED_SUPPRESS_END
// Special implementation of ListContains for TypeListTagAll to always be
// 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
{
VTKM_DEPRECATED_SUPPRESS_BEGIN
template<typename Type>
struct ListHasImpl<vtkm::TypeListTagAll, Type>
{
using type = std::true_type;
};
VTKM_DEPRECATED_SUPPRESS_END
} // namespace detail
} // namespace vtkm
#undef VTK_M_OLD_TYPE_LIST_DEFINITION
#endif //vtk_m_TypeListTag_h

@ -10,7 +10,6 @@
#ifndef vtk_m_cont_ArrayHandleMultiplexer_h
#define vtk_m_cont_ArrayHandleMultiplexer_h
#include <vtkm/TypeListTag.h>
#include <vtkm/TypeTraits.h>
#include <vtkm/internal/Variant.h>

@ -10,6 +10,7 @@
#ifndef vtk_m_cont_AtomicArray_h
#define vtk_m_cont_AtomicArray_h
#include <vtkm/List.h>
#include <vtkm/ListTag.h>
#include <vtkm/StaticAssert.h>
#include <vtkm/cont/ArrayHandle.h>
@ -24,8 +25,12 @@ namespace cont
/// \brief A type list containing types that can be used with an AtomicArray.
///
struct AtomicArrayTypeListTag
: vtkm::ListTagBase<vtkm::UInt32, vtkm::Int32, vtkm::UInt64, vtkm::Int64>
using AtomicArrayTypeList = vtkm::List<vtkm::UInt32, vtkm::Int32, vtkm::UInt64, vtkm::Int64>;
struct VTKM_DEPRECATED(1.6,
"AtomicArrayTypeListTag replaced by AtomicArrayTypeList. Note that the "
"new AtomicArrayTypeList cannot be subclassed.") AtomicArrayTypeListTag
: vtkm::internal::ListAsListTag<AtomicArrayTypeList>
{
};
@ -48,7 +53,7 @@ struct AtomicArrayTypeListTag
template <typename T>
class AtomicArray : public vtkm::cont::ExecutionObjectBase
{
static constexpr bool ValueTypeIsValid = vtkm::ListHas<AtomicArrayTypeListTag, T>::value;
static constexpr bool ValueTypeIsValid = vtkm::ListHas<AtomicArrayTypeList, T>::value;
VTKM_STATIC_ASSERT_MSG(ValueTypeIsValid, "AtomicArray used with unsupported ValueType.");

@ -41,7 +41,7 @@ VTKM_CONT vtkm::cont::ArrayHandleVirtualCoordinates MakeArrayHandleVirtualCoordi
const vtkm::cont::VariantArrayHandleBase<TypeList>& array)
{
vtkm::cont::ArrayHandleVirtualCoordinates output;
vtkm::cont::CastAndCall(array.ResetTypes(vtkm::TypeListTagFieldVec3{}),
vtkm::cont::CastAndCall(array.ResetTypes(vtkm::TypeListFieldVec3{}),
MakeArrayHandleVirtualCoordinatesFunctor{},
output);
return output;

@ -224,7 +224,7 @@ namespace vtkm
namespace cont
{
template <typename FieldTypeList = VTKM_DEFAULT_TYPE_LIST_TAG,
template <typename FieldTypeList = VTKM_DEFAULT_TYPE_LIST,
typename CellSetTypesList = VTKM_DEFAULT_CELL_SET_LIST_TAG>
struct SerializableDataSet
{

@ -107,13 +107,13 @@ public:
VTKM_CONT
const vtkm::cont::ArrayHandle<vtkm::Range>& GetRange() const
{
return this->GetRangeImpl(VTKM_DEFAULT_TYPE_LIST_TAG());
};
return this->GetRangeImpl(VTKM_DEFAULT_TYPE_LIST());
}
VTKM_CONT void GetRange(vtkm::Range* range) const
{
return this->GetRange(range, VTKM_DEFAULT_TYPE_LIST_TAG());
};
return this->GetRange(range, VTKM_DEFAULT_TYPE_LIST());
}
template <typename T, typename StorageTag>
VTKM_CONT void SetData(const vtkm::cont::ArrayHandle<T, StorageTag>& newdata)
@ -248,7 +248,7 @@ namespace vtkm
{
namespace cont
{
template <typename TypeList = VTKM_DEFAULT_TYPE_LIST_TAG>
template <typename TypeList = VTKM_DEFAULT_TYPE_LIST>
struct SerializableField
{
SerializableField() = default;

@ -23,8 +23,7 @@ vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeCompute(const vtkm::cont::DataSet
const std::string& name,
vtkm::cont::Field::Association assoc)
{
return vtkm::cont::detail::FieldRangeComputeImpl(
dataset, name, assoc, VTKM_DEFAULT_TYPE_LIST_TAG());
return vtkm::cont::detail::FieldRangeComputeImpl(dataset, name, assoc, VTKM_DEFAULT_TYPE_LIST());
}
//-----------------------------------------------------------------------------
@ -33,7 +32,7 @@ vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeCompute(const vtkm::cont::Partiti
const std::string& name,
vtkm::cont::Field::Association assoc)
{
return vtkm::cont::detail::FieldRangeComputeImpl(pds, name, assoc, VTKM_DEFAULT_TYPE_LIST_TAG());
return vtkm::cont::detail::FieldRangeComputeImpl(pds, name, assoc, VTKM_DEFAULT_TYPE_LIST());
}
}
} // namespace vtkm::cont

@ -27,7 +27,7 @@ vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeGlobalCompute(const vtkm::cont::D
const std::string& name,
vtkm::cont::Field::Association assoc)
{
return detail::FieldRangeGlobalComputeImpl(dataset, name, assoc, VTKM_DEFAULT_TYPE_LIST_TAG());
return detail::FieldRangeGlobalComputeImpl(dataset, name, assoc, VTKM_DEFAULT_TYPE_LIST());
}
//-----------------------------------------------------------------------------
@ -37,7 +37,7 @@ vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeGlobalCompute(
const std::string& name,
vtkm::cont::Field::Association assoc)
{
return detail::FieldRangeGlobalComputeImpl(pds, name, assoc, VTKM_DEFAULT_TYPE_LIST_TAG());
return detail::FieldRangeGlobalComputeImpl(pds, name, assoc, VTKM_DEFAULT_TYPE_LIST());
}
//-----------------------------------------------------------------------------

@ -12,7 +12,7 @@
#include <vtkm/cont/vtkm_cont_export.h>
#include <vtkm/TypeListTag.h>
#include <vtkm/TypeList.h>
#include <vtkm/VecTraits.h>
#include <vtkm/cont/ArrayHandleMultiplexer.h>
@ -46,7 +46,7 @@ namespace cont
/// mechanism to determine the type when running algorithms.
///
/// By default, \c VariantArrayHandle will assume that the value type in the
/// array matches one of the types specified by \c VTKM_DEFAULT_TYPE_LIST_TAG
/// array matches one of the types specified by \c VTKM_DEFAULT_TYPE_LIST
/// This list can be changed by using the \c 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
@ -201,7 +201,7 @@ public:
/// \c 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 \c VariantArrayHandle set this to \c VTKM_DEFAULT_TYPE_LIST_TAG.
/// By default \c VariantArrayHandle set this to \c VTKM_DEFAULT_TYPE_LIST.
///
/// In addition to the value type, an \c ArrayHandle also requires a storage tag.
/// By default, \c CastAndCall attempts to cast the array using the storage tags
@ -296,7 +296,7 @@ private:
VTKM_CONT void CastAndCallImpl(std::true_type, StorageTagList, Functor&& f, Args&&...) const;
};
using VariantArrayHandle = vtkm::cont::VariantArrayHandleBase<VTKM_DEFAULT_TYPE_LIST_TAG>;
using VariantArrayHandle = vtkm::cont::VariantArrayHandleBase<VTKM_DEFAULT_TYPE_LIST>;
//=============================================================================

@ -12,7 +12,7 @@
#include <vtkm/cont/arg/TypeCheck.h>
#include <vtkm/ListTag.h>
#include <vtkm/List.h>
#include <vtkm/cont/ArrayHandle.h>
#include <vtkm/cont/StorageBasic.h>
@ -42,13 +42,13 @@ struct TypeCheck<TypeCheckTagAtomicArray, ArrayType>
template <typename T>
struct TypeCheck<TypeCheckTagAtomicArray, vtkm::cont::ArrayHandle<T, vtkm::cont::StorageTagBasic>>
{
static constexpr bool value = vtkm::ListHas<vtkm::cont::AtomicArrayTypeListTag, T>::value;
static constexpr bool value = vtkm::ListHas<vtkm::cont::AtomicArrayTypeList, T>::value;
};
template <typename T>
struct TypeCheck<TypeCheckTagAtomicArray, vtkm::cont::ArrayHandle<T, vtkm::cont::StorageTagVirtual>>
{
static constexpr bool value = vtkm::ListHas<vtkm::cont::AtomicArrayTypeListTag, T>::value;
static constexpr bool value = vtkm::ListHas<vtkm::cont::AtomicArrayTypeList, T>::value;
};
}
}

@ -77,7 +77,7 @@ struct TryArrayInOutType
template <typename Device>
void TryArrayInOutTransport(Device)
{
vtkm::testing::Testing::TryTypes(TryArrayInOutType<Device>(), vtkm::TypeListTagCommon());
vtkm::testing::Testing::TryTypes(TryArrayInOutType<Device>(), vtkm::TypeListCommon());
}
void TestArrayInOutTransport()

@ -184,9 +184,8 @@ struct TryAtomicArrayType
template <typename Device>
void TryArrayOutTransport(Device)
{
vtkm::testing::Testing::TryTypes(TryWholeArrayType<Device>(), vtkm::TypeListTagCommon());
vtkm::testing::Testing::TryTypes(TryAtomicArrayType<Device>(),
vtkm::cont::AtomicArrayTypeListTag());
vtkm::testing::Testing::TryTypes(TryWholeArrayType<Device>(), vtkm::TypeListCommon());
vtkm::testing::Testing::TryTypes(TryAtomicArrayType<Device>(), vtkm::cont::AtomicArrayTypeList());
}
void TestWholeArrayTransport()

@ -319,7 +319,7 @@ inline VTKM_CONT TestEqualResult test_equal_CellSets(const CellSet1& cellset1,
return result;
}
template <typename FieldTypeList = VTKM_DEFAULT_TYPE_LIST_TAG>
template <typename FieldTypeList = VTKM_DEFAULT_TYPE_LIST>
inline VTKM_CONT TestEqualResult test_equal_Fields(const vtkm::cont::Field& f1,
const vtkm::cont::Field& f2,
FieldTypeList fTtypes = FieldTypeList())
@ -349,7 +349,7 @@ inline VTKM_CONT TestEqualResult test_equal_Fields(const vtkm::cont::Field& f1,
}
template <typename CellSetTypes = VTKM_DEFAULT_CELL_SET_LIST_TAG,
typename FieldTypeList = VTKM_DEFAULT_TYPE_LIST_TAG>
typename FieldTypeList = VTKM_DEFAULT_TYPE_LIST>
inline VTKM_CONT TestEqualResult test_equal_DataSets(const vtkm::cont::DataSet& ds1,
const vtkm::cont::DataSet& ds2,
CellSetTypes ctypes = CellSetTypes(),

@ -391,7 +391,7 @@ struct DecoratorTests
void TestArrayHandleDecorator()
{
vtkm::testing::Testing::TryTypes(DecoratorTests{}, vtkm::TypeListTagScalarAll{});
vtkm::testing::Testing::TryTypes(DecoratorTests{}, vtkm::TypeListScalarAll{});
}
} // anonymous namespace

@ -67,7 +67,7 @@ struct ImplicitTests
void TestArrayHandleImplicit()
{
vtkm::testing::Testing::TryTypes(ImplicitTests(), vtkm::TypeListTagCommon());
vtkm::testing::Testing::TryTypes(ImplicitTests(), vtkm::TypeListCommon());
}
} // anonymous namespace

@ -243,7 +243,7 @@ struct TryInputType
void TestArrayHandlePermutation()
{
vtkm::testing::Testing::TryTypes(TryInputType(), vtkm::TypeListTagCommon());
vtkm::testing::Testing::TryTypes(TryInputType(), vtkm::TypeListCommon());
}
} // anonymous namespace

@ -21,7 +21,7 @@
#include <vtkm/Pair.h>
#include <vtkm/Range.h>
#include <vtkm/TypeListTag.h>
#include <vtkm/TypeList.h>
#include <vtkm/cont/testing/Testing.h>
#include <type_traits>
@ -107,14 +107,14 @@ struct vtkmComplexCustomTypes : vtkm::ListTagBase<vtkm::Vec<vtkm::Vec<float, 3>,
void TestContDataTypesHaveMoveSemantics()
{
//verify the Vec types are triv and noexcept
vtkm::testing::Testing::TryTypes(IsTrivNoExcept{}, vtkm::TypeListTagVecCommon{});
vtkm::testing::Testing::TryTypes(IsTrivNoExcept{}, vtkm::TypeListVecCommon{});
//verify that vtkm::Pair, Bitset, Bounds, and Range are triv and noexcept
vtkm::testing::Testing::TryTypes(IsTrivNoExcept{}, vtkmComplexCustomTypes{});
//verify that ArrayHandles and related portals are noexcept movable
//allowing for efficient storage in containers such as std::vector
vtkm::testing::Testing::TryTypes(IsNoExceptHandle{}, vtkm::TypeListTagAll{});
vtkm::testing::Testing::TryTypes(IsNoExceptHandle{}, vtkm::TypeListAll{});
vtkm::testing::Testing::TryTypes(IsNoExceptHandle{}, ::vtkmComplexCustomTypes{});

@ -273,7 +273,7 @@ void CheckCastToVirtualArrayHandle(const ArrayType& array)
using Storage = typename ArrayType::StorageTag;
using StorageList = vtkm::ListAppend<VTKM_DEFAULT_STORAGE_LIST_TAG, vtkm::List<Storage>>;
using TypeList = vtkm::ListAppend<VTKM_DEFAULT_TYPE_LIST_TAG, vtkm::List<ValueType>>;
using TypeList = vtkm::ListAppend<VTKM_DEFAULT_TYPE_LIST, vtkm::List<ValueType>>;
using VariantArrayType = vtkm::cont::VariantArrayHandleBase<TypeList>;
VariantArrayType arrayVariant = array;
@ -442,9 +442,9 @@ struct TryBasicVTKmType
vtkm::cont::VariantArrayHandle array = CreateArrayVariant(T());
CheckArrayVariant(
array.ResetTypes(vtkm::TypeListTagAll()), vtkm::VecTraits<T>::NUM_COMPONENTS, true, false);
array.ResetTypes(vtkm::TypeListAll()), vtkm::VecTraits<T>::NUM_COMPONENTS, true, false);
TryNewInstance(T(), array.ResetTypes(vtkm::TypeListTagAll()));
TryNewInstance(T(), array.ResetTypes(vtkm::TypeListAll()));
}
};

@ -94,7 +94,7 @@ struct TryType
void TestExecObjectFetch()
{
vtkm::testing::Testing::TryTypes(TryType(), vtkm::TypeListTagCommon());
vtkm::testing::Testing::TryTypes(TryType(), vtkm::TypeListCommon());
}
} // anonymous namespace

@ -242,7 +242,7 @@ void TryStructuredPointCoordinates()
void TestArrayTopologyMapIn()
{
vtkm::testing::Testing::TryTypes(TryType(), vtkm::TypeListTagCommon());
vtkm::testing::Testing::TryTypes(TryType(), vtkm::TypeListCommon());
TryStructuredPointCoordinates();
}

@ -30,7 +30,7 @@ template <typename IntegrationType>
class CellMeasures : public vtkm::filter::FilterCell<CellMeasures<IntegrationType>>
{
public:
using SupportedTypes = vtkm::TypeListTagFieldVec3;
using SupportedTypes = vtkm::TypeListFieldVec3;
VTKM_CONT
CellMeasures();

@ -27,7 +27,7 @@ namespace filter
class CellSetConnectivity : public vtkm::filter::FilterDataSet<CellSetConnectivity>
{
public:
using SupportedTypes = vtkm::TypeListTagScalarAll;
using SupportedTypes = vtkm::TypeListScalarAll;
VTKM_CONT CellSetConnectivity();
void SetOutputFieldName(const std::string& name) { this->OutputFieldName = name; }

@ -29,7 +29,7 @@ namespace filter
class VTKM_ALWAYS_EXPORT ClipWithField : public vtkm::filter::FilterDataSetWithField<ClipWithField>
{
public:
using SupportedTypes = vtkm::TypeListTagScalarAll;
using SupportedTypes = vtkm::TypeListScalarAll;
VTKM_CONT
void SetClipValue(vtkm::Float64 value) { this->ClipValue = value; }

@ -73,7 +73,7 @@ namespace filter
class ContourTreeMesh2D : public vtkm::filter::FilterCell<ContourTreeMesh2D>
{
public:
using SupportedTypes = TypeListTagScalarAll;
using SupportedTypes = TypeListScalarAll;
VTKM_CONT
ContourTreeMesh2D();
@ -95,7 +95,7 @@ public:
class ContourTreeMesh3D : public vtkm::filter::FilterCell<ContourTreeMesh3D>
{
public:
using SupportedTypes = TypeListTagScalarAll;
using SupportedTypes = TypeListScalarAll;
VTKM_CONT
ContourTreeMesh3D();

@ -78,7 +78,7 @@ class MultiBlockContourTreeHelper;
class ContourTreePPP2 : public vtkm::filter::FilterCell<ContourTreePPP2>
{
public:
using SupportedTypes = vtkm::TypeListTagScalarAll;
using SupportedTypes = vtkm::TypeListScalarAll;
VTKM_CONT
ContourTreePPP2(bool useMarchingCubes = false, unsigned int computeRegularStructure = 1);

@ -25,7 +25,7 @@ class CylindricalCoordinateTransform
: public vtkm::filter::FilterField<CylindricalCoordinateTransform>
{
public:
using SupportedTypes = vtkm::TypeListTagFieldVec3;
using SupportedTypes = vtkm::TypeListFieldVec3;
VTKM_CONT
CylindricalCoordinateTransform();
@ -46,7 +46,7 @@ private:
class SphericalCoordinateTransform : public vtkm::filter::FilterField<SphericalCoordinateTransform>
{
public:
using SupportedTypes = vtkm::TypeListTagFieldVec3;
using SupportedTypes = vtkm::TypeListFieldVec3;
VTKM_CONT
SphericalCoordinateTransform();

@ -23,7 +23,7 @@ class CrossProduct : public vtkm::filter::FilterField<CrossProduct>
{
public:
//currently the DotProduct filter only works on vector data.
using SupportedTypes = TypeListTagVecCommon;
using SupportedTypes = TypeListVecCommon;
VTKM_CONT
CrossProduct();

@ -23,7 +23,7 @@ class DotProduct : public vtkm::filter::FilterField<DotProduct>
{
public:
//currently the DotProduct filter only works on vector data.
using SupportedTypes = TypeListTagVecCommon;
using SupportedTypes = TypeListVecCommon;
VTKM_CONT
DotProduct();

@ -26,7 +26,7 @@ class Entropy : public vtkm::filter::FilterField<Entropy>
{
public:
//currently the Entropy filter only works on scalar data.
using SupportedTypes = TypeListTagScalarAll;
using SupportedTypes = TypeListScalarAll;
//Construct a histogram which is used to compute the entropy with a default of 10 bins
VTKM_CONT

@ -39,7 +39,7 @@ class ExtractGeometry : public vtkm::filter::FilterDataSet<ExtractGeometry>
{
public:
//currently the ExtractGeometry filter only works on scalar data.
using SupportedTypes = TypeListTagScalarAll;
using SupportedTypes = TypeListScalarAll;
VTKM_CONT
ExtractGeometry();

@ -11,7 +11,7 @@
#ifndef vtk_m_filter_FilterTraits_h
#define vtk_m_filter_FilterTraits_h
#include <vtkm/TypeListTag.h>
#include <vtkm/List.h>
namespace vtkm
{

@ -25,7 +25,7 @@ namespace filter
class Histogram : public vtkm::filter::FilterField<Histogram>
{
public:
using SupportedTypes = vtkm::TypeListTagScalarAll;
using SupportedTypes = vtkm::TypeListScalarAll;
//Construct a histogram with a default of 10 bins
VTKM_CONT

@ -31,7 +31,7 @@ namespace filter
class ImageConnectivity : public vtkm::filter::FilterCell<ImageConnectivity>
{
public:
using SupportedTypes = vtkm::TypeListTagScalarAll;
using SupportedTypes = vtkm::TypeListScalarAll;
VTKM_CONT ImageConnectivity();

@ -32,7 +32,7 @@ class ImageMedian : public vtkm::filter::FilterField<ImageMedian>
int Neighborhood = 1;
public:
using SupportedTypes = vtkm::TypeListTagScalarAll;
using SupportedTypes = vtkm::TypeListScalarAll;
VTKM_CONT ImageMedian();

@ -21,7 +21,7 @@ namespace filter
class Lagrangian : public vtkm::filter::FilterDataSetWithField<Lagrangian>
{
public:
using SupportedTypes = vtkm::TypeListTagFieldVec3;
using SupportedTypes = vtkm::TypeListFieldVec3;
VTKM_CONT
Lagrangian();

@ -28,7 +28,7 @@ namespace filter
class LagrangianStructures : public vtkm::filter::FilterDataSetWithField<LagrangianStructures>
{
public:
using SupportedTypes = vtkm::TypeListTagFieldVec3;
using SupportedTypes = vtkm::TypeListFieldVec3;
LagrangianStructures();

@ -97,7 +97,7 @@ enum class CellMetric
class MeshQuality : public vtkm::filter::FilterField<MeshQuality>
{
public:
using SupportedTypes = vtkm::TypeListTagFieldVec3;
using SupportedTypes = vtkm::TypeListFieldVec3;
VTKM_CONT MeshQuality(CellMetric);

@ -27,7 +27,7 @@ namespace filter
class Pathline : public vtkm::filter::FilterDataSetWithField<Pathline>
{
public:
using SupportedTypes = vtkm::TypeListTagFieldVec3;
using SupportedTypes = vtkm::TypeListFieldVec3;
VTKM_CONT
Pathline();

@ -28,7 +28,7 @@ namespace filter
class PointElevation : public vtkm::filter::FilterField<PointElevation>
{
public:
using SupportedTypes = vtkm::TypeListTagFieldVec3;
using SupportedTypes = vtkm::TypeListFieldVec3;
VTKM_CONT
PointElevation();

@ -24,7 +24,7 @@ namespace filter
class PointTransform : public vtkm::filter::FilterField<PointTransform>
{
public:
using SupportedTypes = vtkm::TypeListTagFieldVec3;
using SupportedTypes = vtkm::TypeListFieldVec3;
VTKM_CONT
PointTransform();

@ -11,7 +11,7 @@
#ifndef vtk_m_filter_PolicyBase_h
#define vtk_m_filter_PolicyBase_h
#include <vtkm/TypeListTag.h>
#include <vtkm/List.h>
#include <vtkm/cont/CellSetListTag.h>
#include <vtkm/cont/CoordinateSystem.h>
@ -31,7 +31,7 @@ namespace filter
template <typename Derived>
struct PolicyBase
{
using FieldTypeList = VTKM_DEFAULT_TYPE_LIST_TAG;
using FieldTypeList = VTKM_DEFAULT_TYPE_LIST;
using StorageList = vtkm::ListAppend<
VTKM_DEFAULT_STORAGE_LIST_TAG,
vtkm::List<

@ -36,7 +36,7 @@ class SplitSharpEdges : public vtkm::filter::FilterDataSetWithField<SplitSharpEd
{
public:
// SplitSharpEdges filter needs cell normals to decide split.
using SupportedTypes = vtkm::TypeListTagFieldVec3;
using SupportedTypes = vtkm::TypeListFieldVec3;
VTKM_CONT
SplitSharpEdges();

@ -28,7 +28,7 @@ namespace filter
class StreamSurface : public vtkm::filter::FilterDataSetWithField<StreamSurface>
{
public:
using SupportedTypes = vtkm::TypeListTagFieldVec3;
using SupportedTypes = vtkm::TypeListFieldVec3;
VTKM_CONT
StreamSurface();

@ -27,7 +27,7 @@ namespace filter
class Streamline : public vtkm::filter::FilterDataSetWithField<Streamline>
{
public:
using SupportedTypes = vtkm::TypeListTagFieldVec3;
using SupportedTypes = vtkm::TypeListFieldVec3;
VTKM_CONT
Streamline();

@ -26,7 +26,7 @@ namespace filter
class SurfaceNormals : public vtkm::filter::FilterCell<SurfaceNormals>
{
public:
using SupportedTypes = vtkm::TypeListTagFieldVec3;
using SupportedTypes = vtkm::TypeListFieldVec3;
/// Create SurfaceNormals filter. This calls
/// this->SetUseCoordinateSystemAsField(true) since that is the most common

@ -33,7 +33,7 @@ namespace filter
class VTKM_ALWAYS_EXPORT Threshold : public vtkm::filter::FilterDataSetWithField<Threshold>
{
public:
using SupportedTypes = vtkm::TypeListTagScalarAll;
using SupportedTypes = vtkm::TypeListScalarAll;
VTKM_CONT
void SetLowerThreshold(vtkm::Float64 value) { this->LowerValue = value; }

@ -23,7 +23,7 @@ namespace filter
class ThresholdPoints : public vtkm::filter::FilterDataSetWithField<ThresholdPoints>
{
public:
using SupportedTypes = vtkm::TypeListTagScalarAll;
using SupportedTypes = vtkm::TypeListScalarAll;
VTKM_CONT
ThresholdPoints();

@ -25,7 +25,7 @@ class VTKM_ALWAYS_EXPORT VectorMagnitude : public vtkm::filter::FilterField<Vect
{
public:
//currently the VectorMagnitude filter only works on vector data.
using SupportedTypes = vtkm::TypeListTagVecCommon;
using SupportedTypes = vtkm::TypeListVecCommon;
VTKM_FILTER_EXPORT
VectorMagnitude();

@ -30,7 +30,7 @@ class WarpScalar : public vtkm::filter::FilterField<WarpScalar>
{
public:
// WarpScalar can only applies to Float and Double Vec3 arrays
using SupportedTypes = vtkm::TypeListTagFieldVec3;
using SupportedTypes = vtkm::TypeListFieldVec3;
// WarpScalar often operates on a constant normal value
using AdditionalFieldStorage =

@ -29,7 +29,7 @@ namespace filter
class WarpVector : public vtkm::filter::FilterField<WarpVector>
{
public:
using SupportedTypes = vtkm::TypeListTagFieldVec3;
using SupportedTypes = vtkm::TypeListFieldVec3;
using AdditionalFieldStorage =
vtkm::ListTagBase<vtkm::cont::ArrayHandleConstant<vtkm::Vec3f_32>::StorageTag,
vtkm::cont::ArrayHandleConstant<vtkm::Vec3f_64>::StorageTag>;

@ -134,11 +134,9 @@ public:
class PolicyRadiantDataSet : public vtkm::filter::PolicyBase<PolicyRadiantDataSet>
{
public:
struct TypeListTagRadiantCellSetTypes : vtkm::ListTagBase<MakeRadiantDataSet::CellSet>
{
};
using TypeListRadiantCellSetTypes = vtkm::List<MakeRadiantDataSet::CellSet>;
using AllCellSetList = TypeListTagRadiantCellSetTypes;
using AllCellSetList = TypeListRadiantCellSetTypes;
};
inline vtkm::cont::DataSet MakeRadiantDataSet::Make3DRadiantDataSet(vtkm::IdComponent dim)

@ -55,12 +55,9 @@ class PolicyWarpVector : public vtkm::filter::PolicyBase<PolicyWarpVector>
{
public:
using vecType = vtkm::Vec3f;
struct TypeListTagWarpVectorTags
: vtkm::ListTagBase<vtkm::cont::ArrayHandleConstant<vecType>::StorageTag,
vtkm::cont::ArrayHandle<vecType>::StorageTag>
{
};
using FieldStorageList = TypeListTagWarpVectorTags;
using TypeListWarpVectorTags = vtkm::List<vtkm::cont::ArrayHandleConstant<vecType>::StorageTag,
vtkm::cont::ArrayHandle<vecType>::StorageTag>;
using FieldStorageList = TypeListWarpVectorTags;
};
void CheckResult(const vtkm::filter::WarpVector& filter, const vtkm::cont::DataSet& result)

@ -293,8 +293,8 @@ void DoTest()
// simply doing a += (or similar) operation on them automatically creates a conversion warning
// on some compilers. Since we want to test these operators, just remove the short types from
// the list to avoid the warning.
vtkm::testing::Testing::TryTypes(
DoTestForType(), vtkm::ListTagBase<vtkm::Id, vtkm::FloatDefault, vtkm::Vec3f_64>());
vtkm::testing::Testing::TryTypes(DoTestForType(),
vtkm::List<vtkm::Id, vtkm::FloatDefault, vtkm::Vec3f_64>());
}
} // anonymous namespace

@ -86,7 +86,7 @@ struct StreamIOType<vtkm::UInt8>
// Since Fields and DataSets store data in the default VariantArrayHandle, convert
// the data to the closest type supported by default. The following will
// need to be updated if VariantArrayHandle or TypeListTagCommon changes.
// need to be updated if VariantArrayHandle or TypeListCommon changes.
template <typename T>
struct ClosestCommonType
{

@ -29,10 +29,7 @@ namespace rendering
namespace
{
struct TypeListTagId4 : vtkm::ListTagBase<vtkm::Vec<Id, 4>>
{
};
using Id4Type = TypeListTagId4;
using Id4Type = TypeListId4;
class MapColorAndVertices : public vtkm::worklet::WorkletMapField
{

@ -267,7 +267,7 @@ void MapperWireframer::RenderCells(const vtkm::cont::DynamicCellSet& inCellSet,
vtkm::worklet::DispatcherMapField<Convert1DCoordinates>(
Convert1DCoordinates(this->LogarithmY, this->LogarithmX))
.Invoke(coords.GetData(),
inScalarField.GetData().ResetTypes(vtkm::TypeListTagFieldScalar()),
inScalarField.GetData().ResetTypes(vtkm::TypeListFieldScalar()),
newCoords,
newScalars);

@ -542,7 +542,7 @@ private:
vtkm::worklet::DispatcherMapField<EdgePlotter<DeviceTag>> plotterDispatcher(plotter);
plotterDispatcher.SetDevice(DeviceTag());
plotterDispatcher.Invoke(
PointIndices, Coordinates, ScalarField.GetData().ResetTypes(vtkm::TypeListTagFieldScalar()));
PointIndices, Coordinates, ScalarField.GetData().ResetTypes(vtkm::TypeListFieldScalar()));
BufferConverter converter;
vtkm::worklet::DispatcherMapField<BufferConverter> converterDispatcher(converter);

@ -286,7 +286,7 @@ void CylinderExtractor::SetVaryingRadius(const vtkm::Float32 minRadius,
Radii.Allocate(this->CylIds.GetNumberOfValues());
vtkm::worklet::DispatcherMapField<detail::FieldRadius>(
detail::FieldRadius(minRadius, maxRadius, range))
.Invoke(this->CylIds, this->Radii, field.GetData().ResetTypes(vtkm::TypeListTagFieldScalar()));
.Invoke(this->CylIds, this->Radii, field.GetData().ResetTypes(vtkm::TypeListFieldScalar()));
}

@ -446,7 +446,7 @@ void QuadIntersector::IntersectionDataImp(Ray<Precision>& rays,
detail::GetScalar<Precision>(vtkm::Float32(scalarRange.Min), vtkm::Float32(scalarRange.Max)))
.Invoke(rays.HitIdx,
rays.Scalar,
scalarField.GetData().ResetTypes(vtkm::TypeListTagFieldScalar()),
scalarField.GetData().ResetTypes(vtkm::TypeListFieldScalar()),
QuadIds);
}

@ -266,8 +266,7 @@ void SphereExtractor::SetVaryingRadius(const vtkm::Float32 minRadius,
Radii.Allocate(this->PointIds.GetNumberOfValues());
vtkm::worklet::DispatcherMapField<detail::FieldRadius>(
detail::FieldRadius(minRadius, maxRadius, range))
.Invoke(
this->PointIds, this->Radii, field.GetData().ResetTypes(vtkm::TypeListTagFieldScalar()));
.Invoke(this->PointIds, this->Radii, field.GetData().ResetTypes(vtkm::TypeListFieldScalar()));
}
vtkm::cont::ArrayHandle<vtkm::Id> SphereExtractor::GetPointIds()

@ -360,7 +360,7 @@ void SphereIntersector::IntersectionDataImp(Ray<Precision>& rays,
detail::GetScalar<Precision>(vtkm::Float32(scalarRange.Min), vtkm::Float32(scalarRange.Max)))
.Invoke(rays.HitIdx,
rays.Scalar,
scalarField.GetData().ResetTypes(vtkm::TypeListTagFieldScalar()),
scalarField.GetData().ResetTypes(vtkm::TypeListFieldScalar()),
PointIds);
}

@ -831,7 +831,7 @@ void VolumeRendererStructured::RenderOnDevice(vtkm::rendering::raytracing::Ray<P
rays.MinDistance,
rays.MaxDistance,
rays.Buffers.at(0).Buffer,
ScalarField->GetData().ResetTypes(vtkm::TypeListTagFieldScalar()));
ScalarField->GetData().ResetTypes(vtkm::TypeListFieldScalar()));
}
else
{
@ -846,7 +846,7 @@ void VolumeRendererStructured::RenderOnDevice(vtkm::rendering::raytracing::Ray<P
rays.MinDistance,
rays.MaxDistance,
rays.Buffers.at(0).Buffer,
ScalarField->GetData().ResetTypes(vtkm::TypeListTagFieldScalar()));
ScalarField->GetData().ResetTypes(vtkm::TypeListFieldScalar()));
}
}
else
@ -869,7 +869,7 @@ void VolumeRendererStructured::RenderOnDevice(vtkm::rendering::raytracing::Ray<P
rays.MinDistance,
rays.MaxDistance,
rays.Buffers.at(0).Buffer,
ScalarField->GetData().ResetTypes(vtkm::TypeListTagFieldScalar()));
ScalarField->GetData().ResetTypes(vtkm::TypeListFieldScalar()));
}
else
{
@ -887,7 +887,7 @@ void VolumeRendererStructured::RenderOnDevice(vtkm::rendering::raytracing::Ray<P
rays.MinDistance,
rays.MaxDistance,
rays.Buffers.at(0).Buffer,
ScalarField->GetData().ResetTypes(vtkm::TypeListTagFieldScalar()));
ScalarField->GetData().ResetTypes(vtkm::TypeListFieldScalar()));
}
}

@ -35,6 +35,7 @@ set(unit_tests
UnitTestRange.cxx
UnitTestTesting.cxx
UnitTestTransform3D.cxx
UnitTestTypeList.cxx
UnitTestTypeListTag.cxx
UnitTestTypes.cxx
UnitTestTypeTraits.cxx

@ -18,7 +18,7 @@
#include <vtkm/Matrix.h>
#include <vtkm/Pair.h>
#include <vtkm/Range.h>
#include <vtkm/TypeListTag.h>
#include <vtkm/TypeList.h>
#include <vtkm/TypeTraits.h>
#include <vtkm/Types.h>
#include <vtkm/VecTraits.h>
@ -422,7 +422,7 @@ public:
// template<typename FunctionType>
// static void TryAllTypes(const FunctionType &function)
// {
// TryTypes(function, vtkm::TypeListTagAll());
// TryTypes(function, vtkm::TypeListAll());
// }
/// Runs templated \p function on all cell shapes defined in VTK-m. This is

@ -13,7 +13,7 @@
#include <vtkm/Geometry.h>
#include <vtkm/Math.h>
#include <vtkm/TypeListTag.h>
#include <vtkm/TypeList.h>
#include <vtkm/VecTraits.h>
#include <vtkm/exec/FunctorBase.h>
@ -472,13 +472,13 @@ template <typename Device>
void RunGeometryTests()
{
std::cout << "Tests for rays." << std::endl;
vtkm::testing::Testing::TryTypes(TryRayTests<Device>(), vtkm::TypeListTagFieldScalar());
vtkm::testing::Testing::TryTypes(TryRayTests<Device>(), vtkm::TypeListFieldScalar());
std::cout << "Tests for line segments." << std::endl;
vtkm::testing::Testing::TryTypes(TryLineSegmentTests<Device>(), vtkm::TypeListTagFieldScalar());
vtkm::testing::Testing::TryTypes(TryLineSegmentTests<Device>(), vtkm::TypeListFieldScalar());
std::cout << "Tests for planes." << std::endl;
vtkm::testing::Testing::TryTypes(TryPlaneTests<Device>(), vtkm::TypeListTagFieldScalar());
vtkm::testing::Testing::TryTypes(TryPlaneTests<Device>(), vtkm::TypeListFieldScalar());
std::cout << "Tests for spheres." << std::endl;
vtkm::testing::Testing::TryTypes(TrySphereTests<Device>(), vtkm::TypeListTagFieldScalar());
vtkm::testing::Testing::TryTypes(TrySphereTests<Device>(), vtkm::TypeListFieldScalar());
}
} // namespace UnitTestGeometryNamespace

@ -12,7 +12,7 @@
#include <vtkm/Math.h>
#include <vtkm/TypeListTag.h>
#include <vtkm/TypeList.h>
#include <vtkm/VecTraits.h>
#include <vtkm/exec/FunctorBase.h>
@ -742,9 +742,8 @@ struct TryAbsTests
}
};
using TypeListAbs = vtkm::ListAppend<vtkm::List<vtkm::Int32, vtkm::Int64>,
vtkm::TypeListTagIndex,
vtkm::TypeListTagField>;
using TypeListAbs =
vtkm::ListAppend<vtkm::List<vtkm::Int32, vtkm::Int64>, vtkm::TypeListIndex, vtkm::TypeListField>;
//-----------------------------------------------------------------------------
static constexpr vtkm::Id BitOpSamples = 1024 * 1024;
@ -821,9 +820,9 @@ template <typename Device>
void RunMathTests()
{
std::cout << "Tests for scalar types." << std::endl;
vtkm::testing::Testing::TryTypes(TryScalarFieldTests<Device>(), vtkm::TypeListTagFieldScalar());
vtkm::testing::Testing::TryTypes(TryScalarFieldTests<Device>(), vtkm::TypeListFieldScalar());
std::cout << "Test for scalar and vector types." << std::endl;
vtkm::testing::Testing::TryTypes(TryScalarVectorFieldTests<Device>(), vtkm::TypeListTagField());
vtkm::testing::Testing::TryTypes(TryScalarVectorFieldTests<Device>(), vtkm::TypeListField());
std::cout << "Test for exemplar types." << std::endl;
vtkm::testing::Testing::TryTypes(TryAllTypesTests<Device>());
std::cout << "Test all Abs types" << std::endl;

@ -593,14 +593,14 @@ void TestMatrices()
{
// std::cout << "****** Rectangle tests" << std::endl;
// vtkm::testing::Testing::TryTypes(MatrixTestFunctor(),
// vtkm::TypeListTagScalarAll());
// vtkm::TypeListScalarAll());
std::cout << "****** Square tests" << std::endl;
vtkm::testing::Testing::TryTypes(SquareMatrixTestFunctor(), vtkm::TypeListTagFieldScalar());
vtkm::testing::Testing::TryTypes(SquareMatrixTestFunctor(), vtkm::TypeListFieldScalar());
// std::cout << "***** Vector multiply tests" << std::endl;
// vtkm::testing::Testing::TryTypes(VectorMultFunctor(),
// vtkm::TypeListTagVecAll());
// vtkm::TypeListVecAll());
}
} // anonymous namespace

@ -147,13 +147,11 @@ void PairTest()
PairTestOrdering<T, U>();
}
struct PairTypesToTry : vtkm::ListTagBase<vtkm::Int8, // Integer types
vtkm::FloatDefault, // Float types
vtkm::Id3, // Vec types
vtkm::Pair<vtkm::Vec3f_32, vtkm::Int64> // Recursive Pairs
>
{
};
using PairTypesToTry = vtkm::List<vtkm::Int8, // Integer types
vtkm::FloatDefault, // Float types
vtkm::Id3, // Vec types
vtkm::Pair<vtkm::Vec3f_32, vtkm::Int64> // Recursive Pairs
>;
template <typename FirstType>
struct DecideSecondType

@ -197,7 +197,7 @@ void TestTransforms()
std::cout << "Seed: " << seed << std::endl;
g_RandomGenerator.seed(seed);
vtkm::testing::Testing::TryTypes(TryTransformsFunctor(), vtkm::TypeListTagFieldScalar());
vtkm::testing::Testing::TryTypes(TryTransformsFunctor(), vtkm::TypeListFieldScalar());
}
} // anonymous namespace

@ -0,0 +1,280 @@
//============================================================================
// 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/TypeList.h>
#include <vtkm/Types.h>
#include <vtkm/testing/Testing.h>
#include <set>
#include <string>
namespace
{
class TypeSet
{
using NameSetType = std::set<std::string>;
NameSetType NameSet;
public:
template <typename T>
void AddExpected(T)
{
this->NameSet.insert(vtkm::testing::TypeName<T>::Name());
}
template <typename T>
void Found(T)
{
std::string name = vtkm::testing::TypeName<T>::Name();
//std::cout << " found " << name << std::endl;
NameSetType::iterator typeLocation = this->NameSet.find(name);
if (typeLocation != this->NameSet.end())
{
// This type is expected. Remove it to mark it found.
this->NameSet.erase(typeLocation);
}
else
{
std::cout << "**** Did not expect to get type " << name << std::endl;
VTKM_TEST_FAIL("Got unexpected type.");
}
}
void CheckFound()
{
for (NameSetType::iterator typeP = this->NameSet.begin(); typeP != this->NameSet.end(); typeP++)
{
std::cout << "**** Failed to find " << *typeP << std::endl;
}
VTKM_TEST_ASSERT(this->NameSet.empty(), "List did not call functor on all expected types.");
}
};
struct TestFunctor
{
TypeSet ExpectedTypes;
TestFunctor(const TypeSet& expectedTypes)
: ExpectedTypes(expectedTypes)
{
}
template <typename T>
VTKM_CONT void operator()(T)
{
this->ExpectedTypes.Found(T());
}
};
template <typename ListTag>
void TryList(const TypeSet& expected, ListTag)
{
TestFunctor functor(expected);
vtkm::ListForEach(functor, ListTag());
functor.ExpectedTypes.CheckFound();
}
void TestLists()
{
std::cout << "TypeListId" << std::endl;
TypeSet id;
id.AddExpected(vtkm::Id());
TryList(id, vtkm::TypeListId());
std::cout << "TypeListId2" << std::endl;
TypeSet id2;
id2.AddExpected(vtkm::Id2());
TryList(id2, vtkm::TypeListId2());
std::cout << "TypeListId3" << std::endl;
TypeSet id3;
id3.AddExpected(vtkm::Id3());
TryList(id3, vtkm::TypeListId3());
std::cout << "TypeListId4" << std::endl;
TypeSet id4;
id4.AddExpected(vtkm::Id4());
TryList(id4, vtkm::TypeListId4());
std::cout << "TypeListIndex" << std::endl;
TypeSet index;
index.AddExpected(vtkm::Id());
index.AddExpected(vtkm::Id2());
index.AddExpected(vtkm::Id3());
TryList(index, vtkm::TypeListIndex());
std::cout << "TypeListFieldScalar" << std::endl;
TypeSet scalar;
scalar.AddExpected(vtkm::Float32());
scalar.AddExpected(vtkm::Float64());
TryList(scalar, vtkm::TypeListFieldScalar());
std::cout << "TypeListFieldVec2" << std::endl;
TypeSet vec2;
vec2.AddExpected(vtkm::Vec2f_32());
vec2.AddExpected(vtkm::Vec2f_64());
TryList(vec2, vtkm::TypeListFieldVec2());
std::cout << "TypeListFieldVec3" << std::endl;
TypeSet vec3;
vec3.AddExpected(vtkm::Vec3f_32());
vec3.AddExpected(vtkm::Vec3f_64());
TryList(vec3, vtkm::TypeListFieldVec3());
std::cout << "TypeListFieldVec4" << std::endl;
TypeSet vec4;
vec4.AddExpected(vtkm::Vec4f_32());
vec4.AddExpected(vtkm::Vec4f_64());
TryList(vec4, vtkm::TypeListFieldVec4());
std::cout << "TypeListField" << std::endl;
TypeSet field;
field.AddExpected(vtkm::Float32());
field.AddExpected(vtkm::Float64());
field.AddExpected(vtkm::Vec2f_32());
field.AddExpected(vtkm::Vec2f_64());
field.AddExpected(vtkm::Vec3f_32());
field.AddExpected(vtkm::Vec3f_64());
field.AddExpected(vtkm::Vec4f_32());
field.AddExpected(vtkm::Vec4f_64());
TryList(field, vtkm::TypeListField());
std::cout << "TypeListCommon" << std::endl;
TypeSet common;
common.AddExpected(vtkm::Float32());
common.AddExpected(vtkm::Float64());
common.AddExpected(vtkm::UInt8());
common.AddExpected(vtkm::Int32());
common.AddExpected(vtkm::Int64());
common.AddExpected(vtkm::Vec3f_32());
common.AddExpected(vtkm::Vec3f_64());
TryList(common, vtkm::TypeListCommon());
std::cout << "TypeListScalarAll" << std::endl;
TypeSet scalarsAll;
scalarsAll.AddExpected(vtkm::Float32());
scalarsAll.AddExpected(vtkm::Float64());
scalarsAll.AddExpected(vtkm::Int8());
scalarsAll.AddExpected(vtkm::UInt8());
scalarsAll.AddExpected(vtkm::Int16());
scalarsAll.AddExpected(vtkm::UInt16());
scalarsAll.AddExpected(vtkm::Int32());
scalarsAll.AddExpected(vtkm::UInt32());
scalarsAll.AddExpected(vtkm::Int64());
scalarsAll.AddExpected(vtkm::UInt64());
TryList(scalarsAll, vtkm::TypeListScalarAll());
std::cout << "TypeListVecCommon" << std::endl;
TypeSet vecCommon;
vecCommon.AddExpected(vtkm::Vec2f_32());
vecCommon.AddExpected(vtkm::Vec2f_64());
vecCommon.AddExpected(vtkm::Vec2ui_8());
vecCommon.AddExpected(vtkm::Vec2i_32());
vecCommon.AddExpected(vtkm::Vec2i_64());
vecCommon.AddExpected(vtkm::Vec3f_32());
vecCommon.AddExpected(vtkm::Vec3f_64());
vecCommon.AddExpected(vtkm::Vec3ui_8());
vecCommon.AddExpected(vtkm::Vec3i_32());
vecCommon.AddExpected(vtkm::Vec3i_64());
vecCommon.AddExpected(vtkm::Vec4f_32());
vecCommon.AddExpected(vtkm::Vec4f_64());
vecCommon.AddExpected(vtkm::Vec4ui_8());
vecCommon.AddExpected(vtkm::Vec4i_32());
vecCommon.AddExpected(vtkm::Vec4i_64());
TryList(vecCommon, vtkm::TypeListVecCommon());
std::cout << "TypeListVecAll" << std::endl;
TypeSet vecAll;
vecAll.AddExpected(vtkm::Vec2f_32());
vecAll.AddExpected(vtkm::Vec2f_64());
vecAll.AddExpected(vtkm::Vec2i_8());
vecAll.AddExpected(vtkm::Vec2i_16());
vecAll.AddExpected(vtkm::Vec2i_32());
vecAll.AddExpected(vtkm::Vec2i_64());
vecAll.AddExpected(vtkm::Vec2ui_8());
vecAll.AddExpected(vtkm::Vec2ui_16());
vecAll.AddExpected(vtkm::Vec2ui_32());
vecAll.AddExpected(vtkm::Vec2ui_64());
vecAll.AddExpected(vtkm::Vec3f_32());
vecAll.AddExpected(vtkm::Vec3f_64());
vecAll.AddExpected(vtkm::Vec3i_8());
vecAll.AddExpected(vtkm::Vec3i_16());
vecAll.AddExpected(vtkm::Vec3i_32());
vecAll.AddExpected(vtkm::Vec3i_64());
vecAll.AddExpected(vtkm::Vec3ui_8());
vecAll.AddExpected(vtkm::Vec3ui_16());
vecAll.AddExpected(vtkm::Vec3ui_32());
vecAll.AddExpected(vtkm::Vec3ui_64());
vecAll.AddExpected(vtkm::Vec4f_32());
vecAll.AddExpected(vtkm::Vec4f_64());
vecAll.AddExpected(vtkm::Vec4i_8());
vecAll.AddExpected(vtkm::Vec4i_16());
vecAll.AddExpected(vtkm::Vec4i_32());
vecAll.AddExpected(vtkm::Vec4i_64());
vecAll.AddExpected(vtkm::Vec4ui_8());
vecAll.AddExpected(vtkm::Vec4ui_16());
vecAll.AddExpected(vtkm::Vec4ui_32());
vecAll.AddExpected(vtkm::Vec4ui_64());
TryList(vecAll, vtkm::TypeListVecAll());
std::cout << "TypeListAll" << std::endl;
TypeSet all;
all.AddExpected(vtkm::Float32());
all.AddExpected(vtkm::Float64());
all.AddExpected(vtkm::Int8());
all.AddExpected(vtkm::UInt8());
all.AddExpected(vtkm::Int16());
all.AddExpected(vtkm::UInt16());
all.AddExpected(vtkm::Int32());
all.AddExpected(vtkm::UInt32());
all.AddExpected(vtkm::Int64());
all.AddExpected(vtkm::UInt64());
all.AddExpected(vtkm::Vec2f_32());
all.AddExpected(vtkm::Vec2f_64());
all.AddExpected(vtkm::Vec2i_8());
all.AddExpected(vtkm::Vec2i_16());
all.AddExpected(vtkm::Vec2i_32());
all.AddExpected(vtkm::Vec2i_64());
all.AddExpected(vtkm::Vec2ui_8());
all.AddExpected(vtkm::Vec2ui_16());
all.AddExpected(vtkm::Vec2ui_32());
all.AddExpected(vtkm::Vec2ui_64());
all.AddExpected(vtkm::Vec3f_32());
all.AddExpected(vtkm::Vec3f_64());
all.AddExpected(vtkm::Vec3i_8());
all.AddExpected(vtkm::Vec3i_16());
all.AddExpected(vtkm::Vec3i_32());
all.AddExpected(vtkm::Vec3i_64());
all.AddExpected(vtkm::Vec3ui_8());
all.AddExpected(vtkm::Vec3ui_16());
all.AddExpected(vtkm::Vec3ui_32());
all.AddExpected(vtkm::Vec3ui_64());
all.AddExpected(vtkm::Vec4f_32());
all.AddExpected(vtkm::Vec4f_64());
all.AddExpected(vtkm::Vec4i_8());
all.AddExpected(vtkm::Vec4i_16());
all.AddExpected(vtkm::Vec4i_32());
all.AddExpected(vtkm::Vec4i_64());
all.AddExpected(vtkm::Vec4ui_8());
all.AddExpected(vtkm::Vec4ui_16());
all.AddExpected(vtkm::Vec4ui_32());
all.AddExpected(vtkm::Vec4ui_64());
TryList(all, vtkm::TypeListAll());
}
} // anonymous namespace
int UnitTestTypeList(int argc, char* argv[])
{
return vtkm::testing::Testing::Run(TestLists, argc, argv);
}

@ -17,6 +17,8 @@
#include <set>
#include <string>
VTKM_DEPRECATED_SUPPRESS_BEGIN
namespace
{
@ -273,3 +275,5 @@ int UnitTestTypeListTag(int argc, char* argv[])
{
return vtkm::testing::Testing::Run(TestLists, argc, argv);
}
VTKM_DEPRECATED_SUPPRESS_END

@ -89,7 +89,7 @@ struct VecFromPortalTestFunctor
void VecFromPortalTest()
{
vtkm::testing::Testing::TryTypes(VecFromPortalTestFunctor(), vtkm::TypeListTagCommon());
vtkm::testing::Testing::TryTypes(VecFromPortalTestFunctor(), vtkm::TypeListCommon());
}
} // namespace UnitTestVecFromPortalNamespace

@ -98,7 +98,7 @@ struct VecFromPortalPermuteTestFunctor
void VecFromPortalPermuteTest()
{
vtkm::testing::Testing::TryTypes(VecFromPortalPermuteTestFunctor(), vtkm::TypeListTagCommon());
vtkm::testing::Testing::TryTypes(VecFromPortalPermuteTestFunctor(), vtkm::TypeListCommon());
}
} // namespace UnitTestVecFromPortalPermuteNamespace

@ -94,7 +94,7 @@ struct VecVariableTestFunctor
void TestVecVariable()
{
vtkm::testing::Testing::TryTypes(VecVariableTestFunctor(), vtkm::TypeListTagFieldScalar());
vtkm::testing::Testing::TryTypes(VecVariableTestFunctor(), vtkm::TypeListFieldScalar());
}
} // anonymous namespace

@ -245,9 +245,9 @@ struct TestVectorFunctor
void TestVectorAnalysis()
{
vtkm::testing::Testing::TryTypes(TestLinearFunctor(), vtkm::TypeListTagField());
vtkm::testing::Testing::TryTypes(TestCrossFunctor(), vtkm::TypeListTagFieldVec3());
vtkm::testing::Testing::TryTypes(TestVectorFunctor(), vtkm::TypeListTagFloatVec());
vtkm::testing::Testing::TryTypes(TestLinearFunctor(), vtkm::TypeListField());
vtkm::testing::Testing::TryTypes(TestCrossFunctor(), vtkm::TypeListFieldVec3());
vtkm::testing::Testing::TryTypes(TestVectorFunctor(), vtkm::TypeListFloatVec());
}
} // anonymous namespace

@ -61,7 +61,7 @@ public:
else
{
CastAndCall(
fieldArray.ResetTypes(vtkm::TypeListTagScalarAll()),
fieldArray.ResetTypes(vtkm::TypeListScalarAll()),
vtkm::worklet::histogram::ComputeBins(Bin1DIndex, numberOfBins, rangeOfValues, binDelta));
}
}

@ -133,7 +133,7 @@ public:
template <typename CellSetType, typename NormalCompType>
void Run(const CellSetType& cellset,
const vtkm::cont::VariantArrayHandleBase<vtkm::TypeListTagFieldVec3>& points,
const vtkm::cont::VariantArrayHandleBase<vtkm::TypeListFieldVec3>& points,
vtkm::cont::ArrayHandle<vtkm::Vec<NormalCompType, 3>>& normals)
{
if (this->Normalize)

@ -12,8 +12,6 @@
#include <vtkm/worklet/internal/WorkletBase.h>
#include <vtkm/TypeListTag.h>
#include <vtkm/cont/arg/ControlSignatureTagBase.h>
#include <vtkm/cont/arg/TransportTagArrayIn.h>
#include <vtkm/cont/arg/TransportTagArrayInOut.h>

@ -13,7 +13,6 @@
#include <vtkm/worklet/internal/WorkletBase.h>
#include <vtkm/TopologyElementTag.h>
#include <vtkm/TypeListTag.h>
#include <vtkm/cont/arg/ControlSignatureTagBase.h>
#include <vtkm/cont/arg/TransportTagArrayInOut.h>

@ -19,7 +19,6 @@
#include <vtkm/worklet/internal/WorkletBase.h>
#include <vtkm/TopologyElementTag.h>
#include <vtkm/TypeListTag.h>
#include <vtkm/cont/arg/ControlSignatureTagBase.h>
#include <vtkm/cont/arg/TransportTagArrayIn.h>

@ -165,7 +165,7 @@ public:
const vtkm::cont::VariantArrayHandleBase<T>& pixels,
OutputPortalType& componentsOut) const
{
using Types = vtkm::TypeListTagScalarAll;
using Types = vtkm::TypeListScalarAll;
vtkm::cont::CastAndCall(pixels.ResetTypes(Types{}), RunImpl(), input, componentsOut);
}

@ -51,7 +51,7 @@
#ifndef vtkm_worklet_cosmotools_graft_tagtypes_h
#define vtkm_worklet_cosmotools_graft_tagtypes_h
#include <vtkm/TypeListTag.h>
#include <vtkm/List.h>
namespace vtkm
{
@ -60,14 +60,10 @@ namespace worklet
namespace cosmotools
{
struct UInt32TagType : vtkm::ListTagBase<vtkm::UInt32>
{
};
using UInt32TagType = vtkm::List<vtkm::UInt32>;
template <typename T>
struct Vec3TagType : vtkm::ListTagBase<vtkm::Vec<T, 3>>
{
};
using Vec3TagType = vtkm::List<vtkm::Vec<T, 3>>;
}
}
}

@ -11,7 +11,6 @@
#define vtk_m_worklet_internal_WorkletBase_h
#include <vtkm/TopologyElementTag.h>
#include <vtkm/TypeListTag.h>
#include <vtkm/exec/FunctorBase.h>
#include <vtkm/exec/arg/BasicArg.h>

@ -119,7 +119,7 @@ void TestClippingExplicit()
bool invertClip = false;
vtkm::cont::CellSetExplicit<> outputCellSet =
clip.Run(ds.GetCellSet(),
ds.GetField("scalars").GetData().ResetTypes(vtkm::TypeListTagFieldScalar()),
ds.GetField("scalars").GetData().ResetTypes(vtkm::TypeListFieldScalar()),
clipValue,
invertClip);
@ -175,7 +175,7 @@ void TestClippingStructured()
vtkm::worklet::Clip clip;
vtkm::cont::CellSetExplicit<> outputCellSet =
clip.Run(ds.GetCellSet(),
ds.GetField("scalars").GetData().ResetTypes(vtkm::TypeListTagFieldScalar()),
ds.GetField("scalars").GetData().ResetTypes(vtkm::TypeListFieldScalar()),
clipValue,
invertClip);

@ -120,7 +120,7 @@ void TestClippingExplicit()
bool invertClip = false;
vtkm::cont::CellSetExplicit<> outputCellSet =
clip.Run(ds.GetCellSet(),
ds.GetField("scalars").GetData().ResetTypes(vtkm::TypeListTagFieldScalar()),
ds.GetField("scalars").GetData().ResetTypes(vtkm::TypeListFieldScalar()),
clipValue,
invertClip);
@ -176,7 +176,7 @@ void TestClippingStructured()
vtkm::worklet::Clip clip;
vtkm::cont::CellSetExplicit<> outputCellSet =
clip.Run(ds.GetCellSet(),
ds.GetField("scalars").GetData().ResetTypes(vtkm::TypeListTagFieldScalar()),
ds.GetField("scalars").GetData().ResetTypes(vtkm::TypeListFieldScalar()),
clipValue,
invertClip);

@ -339,51 +339,46 @@ struct TestToRGBA
#endif
struct TypeListTagScalarColorTypes : vtkm::ListTagBase<vtkm::Float32,
vtkm::Float64,
vtkm::Vec2f_32,
vtkm::Vec2f_64,
vtkm::Vec3f_32,
vtkm::Vec3f_64,
vtkm::Vec4f_32,
vtkm::Vec4f_64>
{
};
using TypeListScalarColorTypes = vtkm::List<vtkm::Float32,
vtkm::Float64,
vtkm::Vec2f_32,
vtkm::Vec2f_64,
vtkm::Vec3f_32,
vtkm::Vec3f_64,
vtkm::Vec4f_32,
vtkm::Vec4f_64>;
struct TypeListTagUIntColorTypes
: vtkm::ListTagBase<vtkm::UInt8, vtkm::Vec2ui_8, vtkm::Vec3ui_8, vtkm::Vec4ui_8>
{
};
using TypeListUIntColorTypes =
vtkm::List<vtkm::UInt8, vtkm::Vec2ui_8, vtkm::Vec3ui_8, vtkm::Vec4ui_8>;
void TestScalarsToColors()
{
std::cout << "Test ConvertToRGB with UInt8 types" << std::endl;
vtkm::testing::Testing::TryTypes(TestToRGB(), TypeListTagUIntColorTypes());
vtkm::testing::Testing::TryTypes(TestToRGB(), TypeListUIntColorTypes());
std::cout << "Test ConvertToRGB with Scalar types" << std::endl;
vtkm::testing::Testing::TryTypes(TestToRGB(0.0f, 1.0f), TypeListTagScalarColorTypes());
vtkm::testing::Testing::TryTypes(TestToRGB(0.0f, 1.0f), TypeListScalarColorTypes());
std::cout << "Test ShiftScaleToRGB with scalar types and varying range" << std::endl;
vtkm::testing::Testing::TryTypes(TestToRGB(1024.0f, 4096.0f), TypeListTagScalarColorTypes());
vtkm::testing::Testing::TryTypes(TestToRGB(-2048.0f, 1024.0f), TypeListTagScalarColorTypes());
vtkm::testing::Testing::TryTypes(TestToRGB(1024.0f, 4096.0f), TypeListScalarColorTypes());
vtkm::testing::Testing::TryTypes(TestToRGB(-2048.0f, 1024.0f), TypeListScalarColorTypes());
std::cout << "Test ConvertToRGBA with UInt8 types and alpha values=[1.0, 0.5, 0.0]" << std::endl;
vtkm::testing::Testing::TryTypes(TestToRGBA(), TypeListTagUIntColorTypes());
vtkm::testing::Testing::TryTypes(TestToRGBA(0.0f, 255.0f, 0.5f), TypeListTagUIntColorTypes());
vtkm::testing::Testing::TryTypes(TestToRGBA(0.0f, 255.0f, 0.0f), TypeListTagUIntColorTypes());
vtkm::testing::Testing::TryTypes(TestToRGBA(), TypeListUIntColorTypes());
vtkm::testing::Testing::TryTypes(TestToRGBA(0.0f, 255.0f, 0.5f), TypeListUIntColorTypes());
vtkm::testing::Testing::TryTypes(TestToRGBA(0.0f, 255.0f, 0.0f), TypeListUIntColorTypes());
std::cout << "Test ConvertToRGBA with Scalar types and alpha values=[0.3, 0.6, 1.0]" << std::endl;
vtkm::testing::Testing::TryTypes(TestToRGBA(0.0f, 1.0f, 0.3f), TypeListTagScalarColorTypes());
vtkm::testing::Testing::TryTypes(TestToRGBA(0.0f, 1.0f, 0.6f), TypeListTagScalarColorTypes());
vtkm::testing::Testing::TryTypes(TestToRGBA(0.0f, 1.0f, 1.0f), TypeListTagScalarColorTypes());
vtkm::testing::Testing::TryTypes(TestToRGBA(0.0f, 1.0f, 0.3f), TypeListScalarColorTypes());
vtkm::testing::Testing::TryTypes(TestToRGBA(0.0f, 1.0f, 0.6f), TypeListScalarColorTypes());
vtkm::testing::Testing::TryTypes(TestToRGBA(0.0f, 1.0f, 1.0f), TypeListScalarColorTypes());
std::cout
<< "Test ConvertToRGBA with Scalar types and varying range with alpha values=[0.25, 0.5, 0.75]"
<< std::endl;
vtkm::testing::Testing::TryTypes(TestToRGBA(-0.075f, -0.025f, 0.25f),
TypeListTagScalarColorTypes());
vtkm::testing::Testing::TryTypes(TestToRGBA(0.0f, 2048.0f, 0.5f), TypeListTagScalarColorTypes());
vtkm::testing::Testing::TryTypes(TestToRGBA(-0.075f, -0.025f, 0.25f), TypeListScalarColorTypes());
vtkm::testing::Testing::TryTypes(TestToRGBA(0.0f, 2048.0f, 0.5f), TypeListScalarColorTypes());
vtkm::testing::Testing::TryTypes(TestToRGBA(-2048.0f, 2048.0f, 0.75f),
TypeListTagScalarColorTypes());
TypeListScalarColorTypes());
}
}

@ -107,10 +107,10 @@ public:
// Output dataset gets new cell set of points that meet threshold predicate
vtkm::worklet::ThresholdPoints threshold;
OutCellSetType outCellSet;
outCellSet = threshold.Run(
dataset.GetCellSet(),
dataset.GetField("pointvar").GetData().ResetTypes(vtkm::TypeListTagFieldScalar()),
ValuesBetween(40.0f, 71.0f));
outCellSet =
threshold.Run(dataset.GetCellSet(),
dataset.GetField("pointvar").GetData().ResetTypes(vtkm::TypeListFieldScalar()),
ValuesBetween(40.0f, 71.0f));
outDataSet.SetCellSet(outCellSet);
VTKM_TEST_ASSERT(test_equal(outCellSet.GetNumberOfCells(), 11),
@ -139,10 +139,10 @@ public:
// Output dataset gets new cell set of points that meet threshold predicate
vtkm::worklet::ThresholdPoints threshold;
OutCellSetType outCellSet;
outCellSet = threshold.Run(
dataset.GetCellSet(),
dataset.GetField("pointvar").GetData().ResetTypes(vtkm::TypeListTagFieldScalar()),
ValuesAbove(1.0f));
outCellSet =
threshold.Run(dataset.GetCellSet(),
dataset.GetField("pointvar").GetData().ResetTypes(vtkm::TypeListFieldScalar()),
ValuesAbove(1.0f));
outDataSet.SetCellSet(outCellSet);
VTKM_TEST_ASSERT(test_equal(outCellSet.GetNumberOfCells(), 27),
@ -164,10 +164,10 @@ public:
// Output dataset gets new cell set of points that meet threshold predicate
vtkm::worklet::ThresholdPoints threshold;
OutCellSetType outCellSet;
outCellSet = threshold.Run(
dataset.GetCellSet(),
dataset.GetField("pointvar").GetData().ResetTypes(vtkm::TypeListTagFieldScalar()),
ValuesBelow(50.0f));
outCellSet =
threshold.Run(dataset.GetCellSet(),
dataset.GetField("pointvar").GetData().ResetTypes(vtkm::TypeListFieldScalar()),
ValuesBelow(50.0f));
outDataSet.SetCellSet(outCellSet);
VTKM_TEST_ASSERT(test_equal(outCellSet.GetNumberOfCells(), 6),

@ -67,8 +67,7 @@ void TestWarpScalar()
vtkm::cont::make_ArrayHandleConstant(normal, nov);
vtkm::cont::ArrayHandle<vtkm::FloatDefault> scaleFactorArray;
auto scaleFactor =
ds.GetField("scalefactor").GetData().ResetTypes(vtkm::TypeListTagFieldScalar());
auto scaleFactor = ds.GetField("scalefactor").GetData().ResetTypes(vtkm::TypeListFieldScalar());
scaleFactor.CopyTo(scaleFactorArray);
auto sFAPortal = scaleFactorArray.GetPortalControl();

@ -176,7 +176,7 @@ void TestWorkletMapField(vtkm::cont::DeviceAdapterId id)
std::cout << "Testing Map Field on device adapter: " << id.GetName() << std::endl;
vtkm::testing::Testing::TryTypes(mapfield::DoTestWorklet<TestMapFieldWorklet>(),
vtkm::TypeListTagCommon());
vtkm::TypeListCommon());
}
} // mapfield namespace

@ -109,7 +109,7 @@ void TestWorkletMapFieldExecArg(vtkm::cont::DeviceAdapterId id)
std::cout << "--- Worklet accepting all types." << std::endl;
vtkm::testing::Testing::TryTypes(map_exec_field::DoTestWorklet<TestExecObjectWorklet>(),
vtkm::TypeListTagCommon());
vtkm::TypeListCommon());
}
} // anonymous namespace

@ -92,7 +92,7 @@ void TestWorkletMapFieldExecArg(vtkm::cont::DeviceAdapterId id)
std::cout << "--- Worklet accepting all types." << std::endl;
vtkm::testing::Testing::TryTypes(map_whole_array::DoTestWholeArrayWorklet(),
vtkm::TypeListTagCommon());
vtkm::TypeListCommon());
}
} // anonymous namespace

@ -47,7 +47,7 @@ struct DoTestAtomicArrayWorklet
std::cout << "Create and run dispatcher." << std::endl;
vtkm::worklet::DispatcherMapField<WorkletType> dispatcher;
dispatcher.Invoke(vtkm::cont::ArrayHandleIndex(ARRAY_SIZE),
inOutArray.ResetTypes<vtkm::cont::AtomicArrayTypeListTag>());
inOutArray.ResetTypes<vtkm::cont::AtomicArrayTypeList>());
}
template <typename T>
@ -73,7 +73,7 @@ void TestWorkletMapFieldExecArgAtomic(vtkm::cont::DeviceAdapterId id)
std::cout << "Testing Worklet with AtomicWholeArray on device adapter: " << id.GetName()
<< std::endl;
vtkm::testing::Testing::TryTypes(map_whole_array::DoTestAtomicArrayWorklet(),
vtkm::cont::AtomicArrayTypeListTag());
vtkm::cont::AtomicArrayTypeList());
}
} // anonymous namespace

@ -210,7 +210,7 @@ static void TestMaxNeighborValue()
vtkm::cont::DataSet dataSet3D = testDataSet.Make3DUniformDataSet0();
dispatcher.Invoke(
dataSet3D.GetField("pointvar").GetData().ResetTypes(vtkm::TypeListTagFieldScalar()),
dataSet3D.GetField("pointvar").GetData().ResetTypes(vtkm::TypeListFieldScalar()),
dataSet3D.GetCellSet(),
output);
@ -225,7 +225,7 @@ static void TestMaxNeighborValue()
vtkm::cont::DataSet dataSet2D = testDataSet.Make2DUniformDataSet1();
dispatcher.Invoke(
dataSet2D.GetField("pointvar").GetData().ResetTypes(vtkm::TypeListTagFieldScalar()),
dataSet2D.GetField("pointvar").GetData().ResetTypes(vtkm::TypeListFieldScalar()),
dataSet2D.GetCellSet(),
output);

@ -87,11 +87,10 @@ static void TestMaxPointOrCell()
vtkm::cont::ArrayHandle<vtkm::Float32> result;
vtkm::worklet::DispatcherMapTopology<::test_explicit::MaxPointOrCellValue> dispatcher;
dispatcher.Invoke(
dataSet.GetField("cellvar").GetData().ResetTypes(vtkm::TypeListTagFieldScalar()),
dataSet.GetField("pointvar").GetData().ResetTypes(vtkm::TypeListTagFieldScalar()),
&cellset,
result);
dispatcher.Invoke(dataSet.GetField("cellvar").GetData().ResetTypes(vtkm::TypeListFieldScalar()),
dataSet.GetField("pointvar").GetData().ResetTypes(vtkm::TypeListFieldScalar()),
&cellset,
result);
std::cout << "Make sure we got the right answer." << std::endl;
VTKM_TEST_ASSERT(test_equal(result.GetPortalConstControl().Get(0), 100.1f),

@ -110,15 +110,14 @@ static void TestMaxPointOrCell()
vtkm::cont::ArrayHandle<vtkm::Float32> result;
vtkm::worklet::DispatcherMapTopology<::test_uniform::MaxPointOrCellValue> dispatcher;
dispatcher.Invoke(
dataSet.GetField("cellvar").GetData().ResetTypes(vtkm::TypeListTagFieldScalar()),
dataSet.GetField("pointvar").GetData().ResetTypes(vtkm::TypeListTagFieldScalar()),
// We know that the cell set is a structured 2D grid and
// The worklet does not work with general types because
// of the way we get cell indices. We need to make that
// part more flexible.
dataSet.GetCellSet().ResetCellSetList(vtkm::cont::CellSetListTagStructured2D()),
result);
dispatcher.Invoke(dataSet.GetField("cellvar").GetData().ResetTypes(vtkm::TypeListFieldScalar()),
dataSet.GetField("pointvar").GetData().ResetTypes(vtkm::TypeListFieldScalar()),
// We know that the cell set is a structured 2D grid and
// The worklet does not work with general types because
// of the way we get cell indices. We need to make that
// part more flexible.
dataSet.GetCellSet().ResetCellSetList(vtkm::cont::CellSetListTagStructured2D()),
result);
std::cout << "Make sure we got the right answer." << std::endl;
VTKM_TEST_ASSERT(test_equal(result.GetPortalConstControl().Get(0), 100.1f),