mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-10-08 11:29:02 +00:00
Switch over to c++11 type_traits.
This commit is contained in:
parent
696ca48bd1
commit
12810165bb
@ -23,10 +23,6 @@
|
||||
#include <vtkm/StaticAssert.h>
|
||||
#include <vtkm/Types.h>
|
||||
|
||||
VTKM_THIRDPARTY_PRE_INCLUDE
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
VTKM_THIRDPARTY_POST_INCLUDE
|
||||
|
||||
namespace vtkm {
|
||||
|
||||
/// CellShapeId identifies the type of each cell. Currently these are designed
|
||||
@ -63,10 +59,10 @@ enum CellShapeIdEnum
|
||||
namespace internal {
|
||||
|
||||
/// A class that can be used to determine if a class is a CellShapeTag or not.
|
||||
/// The class will be either boost::true_type or boost::false_type.
|
||||
/// The class will be either std::true_type or std::false_type.
|
||||
///
|
||||
template<typename T>
|
||||
struct CellShapeTagCheck : boost::false_type { };
|
||||
struct CellShapeTagCheck : std::false_type { };
|
||||
|
||||
} // namespace internal
|
||||
|
||||
@ -87,7 +83,7 @@ struct CellShapeIdToTag {
|
||||
// probably means you are using an ID that does not have a defined cell
|
||||
// shape.
|
||||
|
||||
typedef boost::false_type valid;
|
||||
typedef std::false_type valid;
|
||||
};
|
||||
|
||||
|
||||
@ -100,7 +96,7 @@ struct CellShapeIdToTag {
|
||||
}; \
|
||||
namespace internal { \
|
||||
template<> \
|
||||
struct CellShapeTagCheck<vtkm::CellShapeTag ## name> : boost::true_type { }; \
|
||||
struct CellShapeTagCheck<vtkm::CellShapeTag ## name> : std::true_type { }; \
|
||||
} \
|
||||
VTKM_EXEC_CONT_EXPORT \
|
||||
const char *GetCellShapeName(vtkm::CellShapeTag ## name) { \
|
||||
@ -108,7 +104,7 @@ struct CellShapeIdToTag {
|
||||
} \
|
||||
template<> \
|
||||
struct CellShapeIdToTag<vtkm::idname> { \
|
||||
typedef boost::true_type valid; \
|
||||
typedef std::true_type valid; \
|
||||
typedef vtkm::CellShapeTag ## name Tag; \
|
||||
}
|
||||
|
||||
|
@ -25,9 +25,7 @@
|
||||
#include <vtkm/StaticAssert.h>
|
||||
#include <vtkm/internal/ExportMacros.h>
|
||||
|
||||
VTKM_THIRDPARTY_PRE_INCLUDE
|
||||
#include <boost/type_traits/is_base_of.hpp>
|
||||
VTKM_THIRDPARTY_POST_INCLUDE
|
||||
#include <type_traits>
|
||||
|
||||
namespace vtkm {
|
||||
|
||||
@ -36,8 +34,8 @@ namespace internal {
|
||||
template<typename ListTag>
|
||||
struct ListTagCheck
|
||||
{
|
||||
static const bool Valid =
|
||||
boost::is_base_of<vtkm::detail::ListRoot,ListTag>::value;
|
||||
static VTKM_CONSTEXPR bool Valid = std::is_base_of<vtkm::detail::ListRoot,
|
||||
ListTag>::value;
|
||||
};
|
||||
|
||||
} // namespace internal
|
||||
|
@ -22,10 +22,6 @@
|
||||
|
||||
#include <vtkm/Types.h>
|
||||
|
||||
VTKM_THIRDPARTY_PRE_INCLUDE
|
||||
#include <boost/mpl/assert.hpp>
|
||||
VTKM_THIRDPARTY_POST_INCLUDE
|
||||
|
||||
namespace vtkm {
|
||||
|
||||
/// \brief A tag used to identify the cell elements in a topology.
|
||||
@ -63,44 +59,41 @@ struct TopologyElementTagFace { };
|
||||
|
||||
namespace internal {
|
||||
|
||||
/// Checks to see if the given object is a topology element tag. This check is
|
||||
/// compatible with the Boost meta-template programing library (MPL). It
|
||||
/// contains a typedef named \c type that is either boost::mpl::true_ or
|
||||
/// boost::mpl::false_. Both of these have a typedef named value with the
|
||||
/// Checks to see if the given object is a topology element tag.This check is
|
||||
/// compatible with C++11 type_traits.
|
||||
/// 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 TopologyElementTagCheck
|
||||
struct TopologyElementTagCheck : std::false_type
|
||||
{
|
||||
typedef boost::mpl::false_ type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct TopologyElementTagCheck<vtkm::TopologyElementTagCell>
|
||||
struct TopologyElementTagCheck<vtkm::TopologyElementTagCell> : std::true_type
|
||||
{
|
||||
typedef boost::mpl::true_ type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct TopologyElementTagCheck<vtkm::TopologyElementTagPoint>
|
||||
struct TopologyElementTagCheck<vtkm::TopologyElementTagPoint> : std::true_type
|
||||
{
|
||||
typedef boost::mpl::true_ type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct TopologyElementTagCheck<vtkm::TopologyElementTagEdge>
|
||||
struct TopologyElementTagCheck<vtkm::TopologyElementTagEdge> : std::true_type
|
||||
{
|
||||
typedef boost::mpl::true_ type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct TopologyElementTagCheck<vtkm::TopologyElementTagFace>
|
||||
struct TopologyElementTagCheck<vtkm::TopologyElementTagFace> : std::true_type
|
||||
{
|
||||
typedef boost::mpl::true_ type;
|
||||
};
|
||||
|
||||
|
||||
#define VTKM_IS_TOPOLOGY_ELEMENT_TAG(type) \
|
||||
BOOST_MPL_ASSERT(( ::vtkm::internal::TopologyElementTagCheck<type> ))
|
||||
static_assert( ::vtkm::internal::TopologyElementTagCheck<type>::value, \
|
||||
"Invalid Topology Element Tag being used");
|
||||
|
||||
} // namespace internal
|
||||
|
||||
|
20
vtkm/Types.h
20
vtkm/Types.h
@ -20,20 +20,13 @@
|
||||
#ifndef vtk_m_Types_h
|
||||
#define vtk_m_Types_h
|
||||
|
||||
|
||||
#include <vtkm/internal/Configure.h>
|
||||
#include <vtkm/internal/ExportMacros.h>
|
||||
|
||||
#include <vtkm/Assert.h>
|
||||
|
||||
VTKM_THIRDPARTY_PRE_INCLUDE
|
||||
#include <boost/mpl/or.hpp>
|
||||
#include <boost/type_traits/is_floating_point.hpp>
|
||||
#include <boost/type_traits/is_signed.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
VTKM_THIRDPARTY_POST_INCLUDE
|
||||
|
||||
#include <iostream>
|
||||
#include <type_traits>
|
||||
|
||||
/*!
|
||||
* \namespace vtkm
|
||||
@ -1270,16 +1263,15 @@ operator/(const vtkm::Vec<vtkm::Float64, Size> &vec, vtkm::Float64 scalar)
|
||||
}
|
||||
// The enable_if for this operator is effectively disabling the negate
|
||||
// operator for Vec of unsigned integers. Another approach would be
|
||||
// to use disable_if<is_unsigned>. That would be more inclusive but would
|
||||
// to use enable_if<!is_unsigned>. That would be more inclusive but would
|
||||
// also allow other types like Vec<Vec<unsigned> >. If necessary, we could
|
||||
// change this implementation to be more inclusive.
|
||||
template<typename T, vtkm::IdComponent Size>
|
||||
VTKM_EXEC_CONT_EXPORT
|
||||
typename boost::enable_if<
|
||||
typename boost::mpl::or_<
|
||||
typename boost::is_floating_point<T>::type,
|
||||
typename boost::is_signed<T>::type>::type,
|
||||
vtkm::Vec<T,Size> >::type
|
||||
typename std::enable_if<
|
||||
(std::is_floating_point<T>::value || std::is_signed<T>::value),
|
||||
vtkm::Vec<T,Size>
|
||||
>::type
|
||||
operator-(const vtkm::Vec<T,Size> &x)
|
||||
{
|
||||
return vtkm::internal::VecComponentWiseUnaryOperation<Size>()(
|
||||
|
@ -22,10 +22,6 @@
|
||||
|
||||
#include <vtkm/Types.h>
|
||||
|
||||
VTKM_THIRDPARTY_PRE_INCLUDE
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
VTKM_THIRDPARTY_POST_INCLUDE
|
||||
|
||||
namespace vtkm {
|
||||
|
||||
/// A tag for vectors that are "true" vectors (i.e. have more than one
|
||||
@ -103,10 +99,10 @@ struct VecTraits
|
||||
/// Returns the value in a given component of the vector.
|
||||
///
|
||||
VTKM_EXEC_CONT_EXPORT static const ComponentType &GetComponent(
|
||||
const typename boost::remove_const<VecType>::type &vector,
|
||||
const typename std::remove_const<VecType>::type &vector,
|
||||
vtkm::IdComponent component);
|
||||
VTKM_EXEC_CONT_EXPORT static ComponentType &GetComponent(
|
||||
typename boost::remove_const<VecType>::type &vector,
|
||||
typename std::remove_const<VecType>::type &vector,
|
||||
vtkm::IdComponent component);
|
||||
|
||||
/// Changes the value in a given component of the vector.
|
||||
|
@ -34,10 +34,8 @@
|
||||
|
||||
VTKM_THIRDPARTY_PRE_INCLUDE
|
||||
#include <boost/concept_check.hpp>
|
||||
#include <boost/mpl/not.hpp>
|
||||
#include <boost/smart_ptr/scoped_ptr.hpp>
|
||||
#include <boost/smart_ptr/shared_ptr.hpp>
|
||||
#include <boost/type_traits/is_base_of.hpp>
|
||||
VTKM_THIRDPARTY_POST_INCLUDE
|
||||
|
||||
#include <vector>
|
||||
@ -56,48 +54,48 @@ namespace internal {
|
||||
class ArrayHandleBase { };
|
||||
|
||||
/// Checks to see if the given type and storage can form a valid array handle
|
||||
/// (some storage objects cannot support all types). This check is compatable
|
||||
/// with the Boost meta-template programming library (MPL). It contains a
|
||||
/// typedef named type that is either boost::mpl::true_ or boost::mpl::false_.
|
||||
/// (some storage objects cannot support all types). This check is compatible
|
||||
/// with C++11 type_traits. It contains a
|
||||
/// typedef named 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, typename StorageTag>
|
||||
struct IsValidArrayHandle {
|
||||
typedef typename boost::mpl::not_<
|
||||
typename boost::is_base_of<
|
||||
//need to add the not
|
||||
using type = std::integral_constant<bool,
|
||||
!( std::is_base_of<
|
||||
vtkm::cont::internal::UndefinedStorage,
|
||||
vtkm::cont::internal::Storage<T,StorageTag>
|
||||
>::type
|
||||
>::type type;
|
||||
>::value)>;
|
||||
};
|
||||
|
||||
/// Checks to see if the ArrayHandle for the given DeviceAdatper allows
|
||||
/// writing, as some ArrayHandles (Implicit) don't support writing.
|
||||
/// This check is compatable with the Boost meta-template programming
|
||||
/// library (MPL). It contains a typedef named type that is either
|
||||
// boost::mpl::true_ or boost::mpl::false_.
|
||||
/// This check is compatible with the C++11 type_traits.
|
||||
/// It contains a typedef named 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 ArrayHandle, typename DeviceAdapterTag>
|
||||
struct IsWriteableArrayHandle {
|
||||
private:
|
||||
typedef typename ArrayHandle:: template ExecutionTypes<
|
||||
DeviceAdapterTag > ExecutionTypes;
|
||||
typedef typename ExecutionTypes::Portal::ValueType ValueType;
|
||||
template<typename T>
|
||||
using ExecutionTypes = typename ArrayHandle::template ExecutionTypes<T>;
|
||||
|
||||
using ValueType = typename ExecutionTypes<DeviceAdapterTag>::Portal::ValueType;
|
||||
|
||||
//All ArrayHandles that use ImplicitStorage as the final writable location
|
||||
//will have a value type of void*, which is what we are trying to detect
|
||||
typedef typename boost::remove_pointer<ValueType>::type RawValueType;
|
||||
typedef boost::is_void<RawValueType> IsVoidType;
|
||||
using RawValueType = typename std::remove_pointer<ValueType>::type;
|
||||
using IsVoidType = std::is_void<RawValueType>;
|
||||
public:
|
||||
typedef typename boost::mpl::not_<IsVoidType>::type type;
|
||||
using type = std::integral_constant<bool, !IsVoidType::value>;
|
||||
};
|
||||
|
||||
/// Checks to see if the given object is an array handle. This check is
|
||||
/// compatible with the Boost meta-template programming library (MPL). It
|
||||
/// contains a typedef named \c type that is either boost::mpl::true_ or
|
||||
/// boost::mpl::false_. Both of these have a typedef named value with the
|
||||
/// respective boolean value.
|
||||
/// compatible with C++11 type_traits. It 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.
|
||||
///
|
||||
/// Unlike \c IsValidArrayHandle, if an \c ArrayHandle is used with this
|
||||
/// class, then it must be created by the compiler and therefore must already
|
||||
@ -109,8 +107,8 @@ public:
|
||||
template<typename T>
|
||||
struct ArrayHandleCheck
|
||||
{
|
||||
typedef typename boost::is_base_of<
|
||||
::vtkm::cont::internal::ArrayHandleBase, T>::type type;
|
||||
using type = typename std::is_base_of<
|
||||
::vtkm::cont::internal::ArrayHandleBase, T>::type;
|
||||
};
|
||||
|
||||
#define VTKM_IS_ARRAY_HANDLE(T) \
|
||||
|
@ -24,10 +24,6 @@
|
||||
#include <vtkm/cont/ArrayPortal.h>
|
||||
#include <vtkm/cont/ErrorControlBadValue.h>
|
||||
|
||||
VTKM_THIRDPARTY_PRE_INCLUDE
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
VTKM_THIRDPARTY_POST_INCLUDE
|
||||
|
||||
namespace vtkm {
|
||||
namespace exec {
|
||||
|
||||
@ -41,7 +37,7 @@ public:
|
||||
typedef _SourcePortalType SourcePortalType;
|
||||
|
||||
typedef typename
|
||||
boost::remove_const<typename SourcePortalType::ValueType>::type
|
||||
std::remove_const<typename SourcePortalType::ValueType>::type
|
||||
ComponentType;
|
||||
typedef vtkm::Vec<ComponentType, NUM_COMPONENTS> ValueType;
|
||||
|
||||
|
@ -28,10 +28,6 @@
|
||||
#include <vtkm/cont/DynamicArrayHandle.h>
|
||||
#include <vtkm/cont/DeviceAdapterAlgorithm.h>
|
||||
|
||||
VTKM_THIRDPARTY_PRE_INCLUDE
|
||||
#include <boost/type_traits/is_base_of.hpp>
|
||||
VTKM_THIRDPARTY_POST_INCLUDE
|
||||
|
||||
namespace vtkm {
|
||||
namespace cont {
|
||||
|
||||
@ -90,16 +86,15 @@ protected:
|
||||
|
||||
namespace internal {
|
||||
|
||||
/// Checks to see if the given object is a cell set. This check is compatible
|
||||
/// with the Boost meta-template programming library (MPL). It contains a
|
||||
/// typedef named \c type that is either boost::mpl::true_ or
|
||||
/// boost::mpl::false_. Both of these have a typedef named value with the
|
||||
/// Checks to see if the given object is a 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 CellSetCheck
|
||||
{
|
||||
typedef typename boost::is_base_of<vtkm::cont::CellSet, T>::type type;
|
||||
using type = typename std::is_base_of<vtkm::cont::CellSet, T>;
|
||||
};
|
||||
|
||||
#define VTKM_IS_CELL_SET(T) \
|
||||
|
@ -442,7 +442,7 @@ struct DynamicArrayHandleTryStorage {
|
||||
|
||||
private:
|
||||
template<typename Storage>
|
||||
void DoCast(Storage, boost::mpl::bool_<true>)
|
||||
void DoCast(Storage, std::true_type)
|
||||
{
|
||||
if (!this->FoundCast &&
|
||||
this->Array->template IsTypeAndStorage<Type,Storage>())
|
||||
@ -453,7 +453,7 @@ private:
|
||||
}
|
||||
|
||||
template<typename Storage>
|
||||
void DoCast(Storage, boost::mpl::bool_<false>)
|
||||
void DoCast(Storage, std::false_type)
|
||||
{
|
||||
// This type of array handle cannot exist, so do nothing.
|
||||
}
|
||||
|
@ -23,9 +23,7 @@
|
||||
#include <vtkm/StaticAssert.h>
|
||||
#include <vtkm/internal/ExportMacros.h>
|
||||
|
||||
VTKM_THIRDPARTY_PRE_INCLUDE
|
||||
#include <boost/type_traits/is_base_of.hpp>
|
||||
VTKM_THIRDPARTY_POST_INCLUDE
|
||||
#include <type_traits>
|
||||
|
||||
namespace vtkm {
|
||||
namespace cont {
|
||||
@ -49,8 +47,8 @@ namespace internal {
|
||||
template<typename ControlSignatureTag>
|
||||
struct ControlSignatureTagCheck
|
||||
{
|
||||
static const bool Valid =
|
||||
boost::is_base_of<
|
||||
static VTKM_CONSTEXPR bool Valid =
|
||||
std::is_base_of<
|
||||
vtkm::cont::arg::ControlSignatureTagBase, ControlSignatureTag>::value;
|
||||
};
|
||||
|
||||
|
@ -26,11 +26,6 @@
|
||||
|
||||
#include <vtkm/exec/ExecutionObjectBase.h>
|
||||
|
||||
VTKM_THIRDPARTY_PRE_INCLUDE
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/type_traits/is_base_of.hpp>
|
||||
VTKM_THIRDPARTY_POST_INCLUDE
|
||||
|
||||
namespace vtkm {
|
||||
namespace cont {
|
||||
namespace arg {
|
||||
@ -49,7 +44,9 @@ struct Transport<vtkm::cont::arg::TransportTagExecObject,ContObjectType,Device>
|
||||
// is not an execution object as an argument that is expected to be one. All
|
||||
// execution objects are expected to inherit from
|
||||
// vtkm::exec::ExecutionObjectBase.
|
||||
BOOST_MPL_ASSERT(( boost::is_base_of<vtkm::exec::ExecutionObjectBase, ContObjectType> ));
|
||||
static_assert(
|
||||
std::is_base_of<vtkm::exec::ExecutionObjectBase, ContObjectType>::value,
|
||||
"All execution objects are expected to inherit from vtkm::exec::ExecutionObjectBase");
|
||||
|
||||
typedef ContObjectType ExecObjectType;
|
||||
|
||||
|
@ -26,9 +26,7 @@
|
||||
|
||||
#include <vtkm/exec/ExecutionObjectBase.h>
|
||||
|
||||
VTKM_THIRDPARTY_PRE_INCLUDE
|
||||
#include <boost/type_traits/is_base_of.hpp>
|
||||
VTKM_THIRDPARTY_POST_INCLUDE
|
||||
#include <type_traits>
|
||||
|
||||
namespace vtkm {
|
||||
namespace cont {
|
||||
@ -43,8 +41,8 @@ struct TypeCheckTagExecObject { };
|
||||
template<typename Type>
|
||||
struct TypeCheck<TypeCheckTagExecObject, Type>
|
||||
{
|
||||
static const bool value =
|
||||
boost::is_base_of<vtkm::exec::ExecutionObjectBase, Type>::value;
|
||||
static VTKM_CONSTEXPR bool value =
|
||||
std::is_base_of<vtkm::exec::ExecutionObjectBase, Type>::value;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include <iterator>
|
||||
#include <limits>
|
||||
|
||||
#include <boost/type_traits.hpp>
|
||||
#include <type_traits>
|
||||
|
||||
namespace vtkm {
|
||||
namespace cont {
|
||||
@ -43,8 +43,8 @@ class ArrayPortalFromIterators;
|
||||
///
|
||||
template<class IteratorT>
|
||||
class ArrayPortalFromIterators<IteratorT,
|
||||
typename boost::disable_if<
|
||||
boost::is_const< typename boost::remove_pointer<IteratorT>::type > >::type>
|
||||
typename std::enable_if<
|
||||
!std::is_const< typename std::remove_pointer<IteratorT>::type >::value >::type >
|
||||
{
|
||||
public:
|
||||
typedef typename std::iterator_traits<IteratorT>::value_type ValueType;
|
||||
@ -127,8 +127,8 @@ private:
|
||||
|
||||
template<class IteratorT>
|
||||
class ArrayPortalFromIterators<IteratorT,
|
||||
typename boost::enable_if<
|
||||
boost::is_const< typename boost::remove_pointer<IteratorT>::type > >::type>
|
||||
typename std::enable_if<
|
||||
std::is_const< typename std::remove_pointer<IteratorT>::type >::value >::type >
|
||||
{
|
||||
public:
|
||||
typedef typename std::iterator_traits<IteratorT>::value_type ValueType;
|
||||
|
@ -35,7 +35,7 @@ template<typename NumIndicesArrayType,
|
||||
void buildIndexOffsets(const NumIndicesArrayType& numIndices,
|
||||
IndexOffsetArrayType& offsets,
|
||||
DeviceAdapterTag,
|
||||
boost::mpl::bool_<true>)
|
||||
std::true_type)
|
||||
{
|
||||
//We first need to make sure that NumIndices and IndexOffsetArrayType
|
||||
//have the same type so we can call scane exclusive
|
||||
@ -55,7 +55,7 @@ template<typename NumIndicesArrayType,
|
||||
void buildIndexOffsets(const NumIndicesArrayType&,
|
||||
IndexOffsetArrayType&,
|
||||
DeviceAdapterTag,
|
||||
boost::mpl::bool_<false>)
|
||||
std::false_type)
|
||||
{
|
||||
//this is a no-op as the storage for the offsets is an implicit handle
|
||||
//and should already be built. This signature exists so that
|
||||
|
@ -32,11 +32,6 @@
|
||||
|
||||
#include <vtkm/exec/internal/ErrorMessageBuffer.h>
|
||||
|
||||
VTKM_THIRDPARTY_PRE_INCLUDE
|
||||
#include <boost/iterator/counting_iterator.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
VTKM_THIRDPARTY_POST_INCLUDE
|
||||
|
||||
#include <algorithm>
|
||||
#include <numeric>
|
||||
|
||||
|
@ -23,10 +23,6 @@
|
||||
#include <vtkm/StaticAssert.h>
|
||||
#include <vtkm/Types.h>
|
||||
|
||||
VTKM_THIRDPARTY_PRE_INCLUDE
|
||||
#include <boost/type_traits/is_base_of.hpp>
|
||||
VTKM_THIRDPARTY_POST_INCLUDE
|
||||
|
||||
/// Checks that the argument is a proper \c PointCoordinates class. This is a
|
||||
/// handy concept check for functions and classes to make sure that a template
|
||||
/// argument is actually point coordinates. (You can get weird errors elsewhere
|
||||
@ -61,15 +57,14 @@ public:
|
||||
virtual ~PointCoordinatesBase() { }
|
||||
};
|
||||
|
||||
/// Checks to see if the given type is a valid point coordinates class. This
|
||||
/// check is compatable with the Boost meta-template programming library (MPL).
|
||||
/// It contains a typedef named type that is either boost::mpl::true_ or
|
||||
/// boost::mpl::false_. Both of these have a typedef named value with the
|
||||
/// Checks to see if the given type is a valid point coordinates class.
|
||||
/// It contains a typedef named 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 Type>
|
||||
struct IsValidPointCoordinates {
|
||||
typedef typename boost::is_base_of<
|
||||
typedef typename std::is_base_of<
|
||||
vtkm::cont::internal::PointCoordinatesBase,Type>::type type;
|
||||
};
|
||||
|
||||
|
@ -29,8 +29,6 @@
|
||||
|
||||
|
||||
VTKM_THIRDPARTY_PRE_INCLUDE
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
|
||||
// gcc || clang
|
||||
#if defined(_WIN32)
|
||||
// TBB includes windows.h, which clobbers min and max functions so we
|
||||
@ -77,8 +75,8 @@ template<class InputPortalType, class OutputPortalType,
|
||||
class BinaryOperationType>
|
||||
struct ScanInclusiveBody
|
||||
{
|
||||
typedef typename boost::remove_reference<
|
||||
typename OutputPortalType::ValueType>::type ValueType;
|
||||
using ValueType = typename std::remove_reference<
|
||||
typename OutputPortalType::ValueType>::type;
|
||||
ValueType Sum;
|
||||
bool FirstCall;
|
||||
InputPortalType InputPortal;
|
||||
@ -175,8 +173,9 @@ template<class InputPortalType, class OutputPortalType,
|
||||
class BinaryOperationType>
|
||||
struct ScanExclusiveBody
|
||||
{
|
||||
typedef typename boost::remove_reference<
|
||||
typename OutputPortalType::ValueType>::type ValueType;
|
||||
using ValueType = typename std::remove_reference<
|
||||
typename OutputPortalType::ValueType>::type;
|
||||
|
||||
ValueType Sum;
|
||||
ValueType InitialValue;
|
||||
InputPortalType InputPortal;
|
||||
@ -272,14 +271,14 @@ template<class InputPortalType, class OutputPortalType,
|
||||
class BinaryOperationType>
|
||||
VTKM_SUPPRESS_EXEC_WARNINGS
|
||||
VTKM_CONT_EXPORT static
|
||||
typename boost::remove_reference<typename OutputPortalType::ValueType>::type
|
||||
typename std::remove_reference<typename OutputPortalType::ValueType>::type
|
||||
ScanInclusivePortals(InputPortalType inputPortal,
|
||||
OutputPortalType outputPortal,
|
||||
BinaryOperationType binaryOperation)
|
||||
{
|
||||
typedef typename
|
||||
boost::remove_reference<typename OutputPortalType::ValueType>::type
|
||||
ValueType;
|
||||
using ValueType = typename std::remove_reference<
|
||||
typename OutputPortalType::ValueType>::type;
|
||||
|
||||
typedef internal::WrappedBinaryOperator<ValueType, BinaryOperationType>
|
||||
WrappedBinaryOp;
|
||||
|
||||
@ -297,16 +296,16 @@ template<class InputPortalType, class OutputPortalType,
|
||||
class BinaryOperationType>
|
||||
VTKM_SUPPRESS_EXEC_WARNINGS
|
||||
VTKM_CONT_EXPORT static
|
||||
typename boost::remove_reference<typename OutputPortalType::ValueType>::type
|
||||
typename std::remove_reference<typename OutputPortalType::ValueType>::type
|
||||
ScanExclusivePortals(InputPortalType inputPortal,
|
||||
OutputPortalType outputPortal,
|
||||
BinaryOperationType binaryOperation,
|
||||
typename boost::remove_reference<
|
||||
typename std::remove_reference<
|
||||
typename OutputPortalType::ValueType>::type initialValue)
|
||||
{
|
||||
typedef typename
|
||||
boost::remove_reference<typename OutputPortalType::ValueType>::type
|
||||
ValueType;
|
||||
using ValueType = typename std::remove_reference<
|
||||
typename OutputPortalType::ValueType>::type;
|
||||
|
||||
typedef internal::WrappedBinaryOperator<ValueType, BinaryOperationType>
|
||||
WrappedBinaryOp;
|
||||
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include <vtkm/cont/DeviceAdapterSerial.h>
|
||||
#include <vtkm/cont/testing/Testing.h>
|
||||
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
@ -232,7 +231,7 @@ private:
|
||||
array_handle_testing::CheckValues(array, array+ARRAY_SIZE, T());
|
||||
}
|
||||
|
||||
if (!boost::is_same<DeviceAdapterTag, vtkm::cont::DeviceAdapterTagSerial>::value)
|
||||
if (!std::is_same<DeviceAdapterTag, vtkm::cont::DeviceAdapterTagSerial>::value)
|
||||
{
|
||||
std::cout << "Check using different device adapter" << std::endl;
|
||||
//Copy the data to the execution environment
|
||||
|
@ -30,7 +30,6 @@
|
||||
VTKM_THIRDPARTY_PRE_INCLUDE
|
||||
#include <boost/random/mersenne_twister.hpp>
|
||||
#include <boost/random/uniform_int_distribution.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
VTKM_THIRDPARTY_POST_INCLUDE
|
||||
|
||||
#include <time.h>
|
||||
|
@ -30,7 +30,6 @@
|
||||
VTKM_THIRDPARTY_PRE_INCLUDE
|
||||
#include <boost/random/mersenne_twister.hpp>
|
||||
#include <boost/random/uniform_int_distribution.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
VTKM_THIRDPARTY_POST_INCLUDE
|
||||
|
||||
#include <time.h>
|
||||
|
@ -23,9 +23,7 @@
|
||||
#include <vtkm/StaticAssert.h>
|
||||
#include <vtkm/internal/ExportMacros.h>
|
||||
|
||||
VTKM_THIRDPARTY_PRE_INCLUDE
|
||||
#include <boost/type_traits/is_base_of.hpp>
|
||||
VTKM_THIRDPARTY_POST_INCLUDE
|
||||
#include <type_traits>
|
||||
|
||||
namespace vtkm {
|
||||
namespace exec {
|
||||
@ -51,7 +49,7 @@ template<typename ExecutionSignatureTag>
|
||||
struct ExecutionSignatureTagCheck
|
||||
{
|
||||
static const bool Valid =
|
||||
boost::is_base_of<
|
||||
std::is_base_of<
|
||||
vtkm::exec::arg::ExecutionSignatureTagBase, ExecutionSignatureTag>::
|
||||
value;
|
||||
};
|
||||
|
@ -25,10 +25,7 @@
|
||||
|
||||
#include <vtkm/exec/ExecutionObjectBase.h>
|
||||
|
||||
VTKM_THIRDPARTY_PRE_INCLUDE
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/type_traits/is_base_of.hpp>
|
||||
VTKM_THIRDPARTY_POST_INCLUDE
|
||||
#include <type_traits>
|
||||
|
||||
namespace vtkm {
|
||||
namespace exec {
|
||||
@ -55,7 +52,8 @@ struct Fetch<
|
||||
// is not an execution object as an argument that is expected to be one. All
|
||||
// execution objects are expected to inherit from
|
||||
// vtkm::exec::ExecutionObjectBase.
|
||||
BOOST_MPL_ASSERT(( boost::is_base_of<vtkm::exec::ExecutionObjectBase, ExecObjectType> ));
|
||||
static_assert(std::is_base_of<vtkm::exec::ExecutionObjectBase, ExecObjectType>::value,
|
||||
"All execution objects are expected to inherit from vtkm::exec::ExecutionObjectBase");
|
||||
|
||||
typedef ExecObjectType ValueType;
|
||||
|
||||
|
@ -24,12 +24,9 @@
|
||||
#include <vtkm/cont/ArrayPortalToIterators.h>
|
||||
|
||||
#include <iterator>
|
||||
#include <type_traits>
|
||||
|
||||
VTKM_THIRDPARTY_PRE_INCLUDE
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
|
||||
#include <thrust/system/cuda/memory.h>
|
||||
VTKM_THIRDPARTY_POST_INCLUDE
|
||||
|
||||
@ -38,30 +35,30 @@ namespace exec {
|
||||
namespace cuda {
|
||||
namespace internal {
|
||||
|
||||
template<typename T> struct UseScalarTextureLoad {typedef boost::false_type type;};
|
||||
template<typename T> struct UseVecTextureLoads {typedef boost::false_type type;};
|
||||
template<typename T> struct UseMultipleScalarTextureLoads {typedef boost::false_type type;};
|
||||
template<typename T> struct UseScalarTextureLoad : public std::false_type {};
|
||||
template<typename T> struct UseVecTextureLoads : public std::false_type {};
|
||||
template<typename T> struct UseMultipleScalarTextureLoads : public std::false_type {};
|
||||
|
||||
//currently CUDA doesn't support texture loading of signed char's so that is why
|
||||
//you don't see vtkm::Int8 in any of the lists.
|
||||
template<> struct UseScalarTextureLoad< const vtkm::UInt8 > {typedef boost::true_type type; };
|
||||
template<> struct UseScalarTextureLoad< const vtkm::Int16 > {typedef boost::true_type type; };
|
||||
template<> struct UseScalarTextureLoad< const vtkm::UInt16 > {typedef boost::true_type type; };
|
||||
template<> struct UseScalarTextureLoad< const vtkm::Int32 > {typedef boost::true_type type; };
|
||||
template<> struct UseScalarTextureLoad< const vtkm::UInt32 > {typedef boost::true_type type; };
|
||||
template<> struct UseScalarTextureLoad< const vtkm::Float32 > {typedef boost::true_type type; };
|
||||
template<> struct UseScalarTextureLoad< const vtkm::Float64 > {typedef boost::true_type type; };
|
||||
template<> struct UseScalarTextureLoad< const vtkm::UInt8 > : std::true_type {};
|
||||
template<> struct UseScalarTextureLoad< const vtkm::Int16 > : std::true_type {};
|
||||
template<> struct UseScalarTextureLoad< const vtkm::UInt16 > : std::true_type {};
|
||||
template<> struct UseScalarTextureLoad< const vtkm::Int32 > : std::true_type {};
|
||||
template<> struct UseScalarTextureLoad< const vtkm::UInt32 > : std::true_type {};
|
||||
template<> struct UseScalarTextureLoad< const vtkm::Float32 > : std::true_type {};
|
||||
template<> struct UseScalarTextureLoad< const vtkm::Float64 > : std::true_type {};
|
||||
|
||||
//CUDA needs vec types converted to CUDA types ( float2, uint2), so we have a special
|
||||
//case for these vec texture loads.
|
||||
template<> struct UseVecTextureLoads< const vtkm::Vec<vtkm::Int32,2> > {typedef boost::true_type type; };
|
||||
template<> struct UseVecTextureLoads< const vtkm::Vec<vtkm::UInt32,2> > {typedef boost::true_type type; };
|
||||
template<> struct UseVecTextureLoads< const vtkm::Vec<vtkm::Float32,2> > {typedef boost::true_type type; };
|
||||
template<> struct UseVecTextureLoads< const vtkm::Vec<vtkm::Float64,2> > {typedef boost::true_type type; };
|
||||
template<> struct UseVecTextureLoads< const vtkm::Vec<vtkm::Int32,2> > : std::true_type {};
|
||||
template<> struct UseVecTextureLoads< const vtkm::Vec<vtkm::UInt32,2> > : std::true_type {};
|
||||
template<> struct UseVecTextureLoads< const vtkm::Vec<vtkm::Float32,2> > : std::true_type {};
|
||||
template<> struct UseVecTextureLoads< const vtkm::Vec<vtkm::Float64,2> > : std::true_type {};
|
||||
|
||||
template<> struct UseVecTextureLoads< const vtkm::Vec<vtkm::Int32,4> > {typedef boost::true_type type; };
|
||||
template<> struct UseVecTextureLoads< const vtkm::Vec<vtkm::UInt32,4> > {typedef boost::true_type type; };
|
||||
template<> struct UseVecTextureLoads< const vtkm::Vec<vtkm::Float32,4> > {typedef boost::true_type type; };
|
||||
template<> struct UseVecTextureLoads< const vtkm::Vec<vtkm::Int32,4> > : std::true_type {};
|
||||
template<> struct UseVecTextureLoads< const vtkm::Vec<vtkm::UInt32,4> > : std::true_type {};
|
||||
template<> struct UseVecTextureLoads< const vtkm::Vec<vtkm::Float32,4> > : std::true_type {};
|
||||
|
||||
|
||||
//CUDA doesn't support loading 3 wide values through a texture unit by default,
|
||||
@ -69,26 +66,26 @@ template<> struct UseVecTextureLoads< const vtkm::Vec<vtkm::Float32,4> > {typede
|
||||
//currently CUDA doesn't support texture loading of signed char's so that is why
|
||||
//you don't see vtkm::Int8 in any of the lists.
|
||||
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::UInt8,2> > {typedef boost::true_type type; };
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::Int16,2> > {typedef boost::true_type type; };
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::UInt16,2> > {typedef boost::true_type type; };
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::Int64,2> > {typedef boost::true_type type; };
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::UInt64,2> > {typedef boost::true_type type; };
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::UInt8,2> > : std::true_type {};
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::Int16,2> > : std::true_type {};
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::UInt16,2> > : std::true_type {};
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::Int64,2> > : std::true_type {};
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::UInt64,2> > : std::true_type {};
|
||||
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::UInt8,3> > {typedef boost::true_type type; };
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::Int16,3> > {typedef boost::true_type type; };
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::UInt16,3> > {typedef boost::true_type type; };
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::Int32,3> > {typedef boost::true_type type; };
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::UInt32,3> > {typedef boost::true_type type; };
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::Float32,3> > {typedef boost::true_type type; };
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::Float64,3> > {typedef boost::true_type type; };
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::UInt8,3> > : std::true_type {};
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::Int16,3> > : std::true_type {};
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::UInt16,3> > : std::true_type {};
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::Int32,3> > : std::true_type {};
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::UInt32,3> > : std::true_type {};
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::Float32,3> > : std::true_type {};
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::Float64,3> > : std::true_type {};
|
||||
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::UInt8,4> > {typedef boost::true_type type; };
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::Int16,4> > {typedef boost::true_type type; };
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::UInt16,4> > {typedef boost::true_type type; };
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::Int64,4> > {typedef boost::true_type type; };
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::UInt64,4> > {typedef boost::true_type type; };
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::Float64,4> > {typedef boost::true_type type; };
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::UInt8,4> > : std::true_type {};
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::Int16,4> > : std::true_type {};
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::UInt16,4> > : std::true_type {};
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::Int64,4> > : std::true_type {};
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::UInt64,4> > : std::true_type {};
|
||||
template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec<vtkm::Float64,4> > : std::true_type {};
|
||||
|
||||
|
||||
//this T type is not one that is valid to be loaded through texture memory
|
||||
@ -108,7 +105,7 @@ struct load_through_texture
|
||||
|
||||
// this T type is valid to be loaded through a single texture memory fetch
|
||||
template<typename T>
|
||||
struct load_through_texture<T, typename ::boost::enable_if< typename UseScalarTextureLoad<const T>::type >::type >
|
||||
struct load_through_texture<T, typename std::enable_if< UseScalarTextureLoad<const T>::value >::type >
|
||||
{
|
||||
|
||||
static const vtkm::IdComponent WillUseTexture = 1;
|
||||
@ -127,7 +124,7 @@ struct load_through_texture<T, typename ::boost::enable_if< typename UseScalarTe
|
||||
|
||||
// this T type is valid to be loaded through a single vec texture memory fetch
|
||||
template<typename T>
|
||||
struct load_through_texture<T, typename ::boost::enable_if< typename UseVecTextureLoads<const T>::type >::type >
|
||||
struct load_through_texture<T, typename std::enable_if< UseVecTextureLoads<const T>::value >::type >
|
||||
{
|
||||
static const vtkm::IdComponent WillUseTexture = 1;
|
||||
|
||||
@ -195,11 +192,11 @@ struct load_through_texture<T, typename ::boost::enable_if< typename UseVecTextu
|
||||
|
||||
//this T type is valid to be loaded through multiple texture memory fetches
|
||||
template<typename T>
|
||||
struct load_through_texture<T, typename ::boost::enable_if< typename UseMultipleScalarTextureLoads<const T>::type >::type >
|
||||
struct load_through_texture<T, typename std::enable_if< UseMultipleScalarTextureLoads<const T>::value >::type >
|
||||
{
|
||||
static const vtkm::IdComponent WillUseTexture = 1;
|
||||
|
||||
typedef typename boost::remove_const<T>::type NonConstT;
|
||||
typedef typename std::remove_const<T>::type NonConstT;
|
||||
|
||||
__device__
|
||||
static T get(const thrust::system::cuda::pointer<const T>& data)
|
||||
|
@ -29,7 +29,6 @@
|
||||
// Disable warnings we check vtkm for but Thrust does not.
|
||||
VTKM_THIRDPARTY_PRE_INCLUDE
|
||||
#include <thrust/system/cuda/memory.h>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
VTKM_THIRDPARTY_POST_INCLUDE
|
||||
|
||||
namespace vtkm {
|
||||
@ -45,7 +44,7 @@ namespace internal {
|
||||
template<typename T_, typename Function>
|
||||
struct WrappedUnaryPredicate
|
||||
{
|
||||
typedef typename boost::remove_const<T_>::type T;
|
||||
typedef typename std::remove_const<T_>::type T;
|
||||
|
||||
//make typedefs that thust expects unary operators to have
|
||||
typedef T first_argument_type;
|
||||
@ -88,7 +87,7 @@ struct WrappedUnaryPredicate
|
||||
template<typename T_, typename Function>
|
||||
struct WrappedBinaryOperator
|
||||
{
|
||||
typedef typename boost::remove_const<T_>::type T;
|
||||
typedef typename std::remove_const<T_>::type T;
|
||||
|
||||
//make typedefs that thust expects binary operators to have
|
||||
typedef T first_argument_type;
|
||||
@ -163,7 +162,7 @@ struct WrappedBinaryOperator
|
||||
template<typename T_, typename Function>
|
||||
struct WrappedBinaryPredicate
|
||||
{
|
||||
typedef typename boost::remove_const<T_>::type T;
|
||||
typedef typename std::remove_const<T_>::type T;
|
||||
|
||||
//make typedefs that thust expects binary operators to have
|
||||
typedef T first_argument_type;
|
||||
|
@ -30,10 +30,6 @@
|
||||
|
||||
#include <vtkm/testing/Testing.h>
|
||||
|
||||
VTKM_THIRDPARTY_PRE_INCLUDE
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
VTKM_THIRDPARTY_POST_INCLUDE
|
||||
|
||||
namespace {
|
||||
|
||||
struct TestExecObject
|
||||
@ -222,15 +218,15 @@ struct TestWorkletErrorProxy : vtkm::exec::FunctorBase
|
||||
|
||||
// Check behavior of InvocationToFetch helper class.
|
||||
|
||||
VTKM_STATIC_ASSERT(( boost::is_same<
|
||||
VTKM_STATIC_ASSERT(( std::is_same<
|
||||
vtkm::exec::internal::detail::InvocationToFetch<vtkm::exec::arg::ThreadIndicesBasic,InvocationType1,1>::type,
|
||||
vtkm::exec::arg::Fetch<TestFetchTagInput,vtkm::exec::arg::AspectTagDefault,vtkm::exec::arg::ThreadIndicesBasic,TestExecObject> >::type::value ));
|
||||
|
||||
VTKM_STATIC_ASSERT(( boost::is_same<
|
||||
VTKM_STATIC_ASSERT(( std::is_same<
|
||||
vtkm::exec::internal::detail::InvocationToFetch<vtkm::exec::arg::ThreadIndicesBasic,InvocationType1,2>::type,
|
||||
vtkm::exec::arg::Fetch<TestFetchTagOutput,vtkm::exec::arg::AspectTagDefault,vtkm::exec::arg::ThreadIndicesBasic,TestExecObject> >::type::value ));
|
||||
|
||||
VTKM_STATIC_ASSERT(( boost::is_same<
|
||||
VTKM_STATIC_ASSERT(( std::is_same<
|
||||
vtkm::exec::internal::detail::InvocationToFetch<vtkm::exec::arg::ThreadIndicesBasic,InvocationType2,0>::type,
|
||||
vtkm::exec::arg::Fetch<TestFetchTagOutput,vtkm::exec::arg::AspectTagDefault,vtkm::exec::arg::ThreadIndicesBasic,TestExecObject> >::type::value ));
|
||||
|
||||
|
@ -32,7 +32,6 @@
|
||||
VTKM_THIRDPARTY_PRE_INCLUDE
|
||||
#include <boost/random/mersenne_twister.hpp>
|
||||
#include <boost/random/uniform_real_distribution.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
VTKM_THIRDPARTY_POST_INCLUDE
|
||||
|
||||
#include <time.h>
|
||||
|
@ -134,8 +134,6 @@
|
||||
_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
|
||||
|
||||
// GCC has a unused by set variable warnings that needs to be silenced.
|
||||
// Because boost boost::shared_ptr inline assembly causes nvcc to incorrectly
|
||||
// generate warnings.
|
||||
#if defined(VTKM_GCC)
|
||||
#define VTK_M_THIRDPARTY_GCC_WARNING_PRAGMAS \
|
||||
_Pragma("GCC diagnostic ignored \"-Wunused-but-set-variable\"") \
|
||||
@ -261,11 +259,6 @@
|
||||
#cmakedefine VTKM_ENABLE_OPENGL_INTEROP
|
||||
#endif
|
||||
|
||||
// Determine whether we will use variadic templates (a new feature in C++11).
|
||||
VTKM_THIRDPARTY_PRE_INCLUDE
|
||||
# include <boost/config.hpp>
|
||||
VTKM_THIRDPARTY_POST_INCLUDE
|
||||
|
||||
#if __cplusplus >= 201103L || ( defined(VTKM_MSVC) && _MSC_VER >= 1700 )
|
||||
#define VTKM_HAVE_CXX_11
|
||||
#endif
|
||||
|
@ -44,6 +44,15 @@
|
||||
|
||||
#define VTKM_CONT_EXPORT inline
|
||||
|
||||
// constexpr support was added to VisualStudio 2015 and above. So this makes
|
||||
// sure when that we gracefully fall back to just const when using 2013
|
||||
#if defined(VTKM_MSVC) && _MSC_VER < 1900
|
||||
#define VTKM_CONSTEXPR const
|
||||
#else
|
||||
#define VTKM_CONSTEXPR constexpr
|
||||
#endif
|
||||
|
||||
|
||||
/// Simple macro to identify a parameter as unused. This allows you to name a
|
||||
/// parameter that is not used. There are several instances where you might
|
||||
/// want to do this. For example, when using a parameter to overload or
|
||||
|
@ -31,7 +31,6 @@ VTKM_THIRDPARTY_PRE_INCLUDE
|
||||
#include <boost/function_types/function_type.hpp>
|
||||
#include <boost/function_types/parameter_types.hpp>
|
||||
#include <boost/function_types/result_type.hpp>
|
||||
#include <boost/integer/static_min_max.hpp>
|
||||
#include <boost/mpl/advance.hpp>
|
||||
#include <boost/mpl/at.hpp>
|
||||
#include <boost/mpl/begin.hpp>
|
||||
@ -41,7 +40,6 @@ VTKM_THIRDPARTY_PRE_INCLUDE
|
||||
#include <boost/mpl/push_back.hpp>
|
||||
#include <boost/mpl/joint_view.hpp>
|
||||
#include <boost/mpl/single_view.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
VTKM_THIRDPARTY_POST_INCLUDE
|
||||
|
||||
|
||||
@ -399,10 +397,12 @@ public:
|
||||
void Copy(const FunctionInterface<SrcFunctionSignature> &src)
|
||||
{
|
||||
this->Result = src.GetReturnValueSafe();
|
||||
typedef boost::static_unsigned_min< ARITY,
|
||||
FunctionInterface<SrcFunctionSignature>::ARITY > MinArity;
|
||||
|
||||
(detail::CopyAllParameters<MinArity::value>()).Copy(this->Parameters, src.Parameters);
|
||||
VTKM_CONSTEXPR vtkm::UInt16 minArity =
|
||||
(ARITY < FunctionInterface<SrcFunctionSignature>::ARITY) ?
|
||||
ARITY : FunctionInterface<SrcFunctionSignature>::ARITY;
|
||||
|
||||
(detail::CopyAllParameters<minArity>()).Copy(this->Parameters, src.Parameters);
|
||||
}
|
||||
|
||||
void Copy(const FunctionInterface<FunctionSignature> &src)
|
||||
@ -812,12 +812,12 @@ public:
|
||||
typedef FunctionInterface< typename FuntionType::type > NextInterfaceType;
|
||||
|
||||
//Determine if we should do the next transform, and if so convert from
|
||||
//boost mpl to boost::true_type/false_type ( for readability of sigs)
|
||||
//boost mpl to std::true_type/false_type ( for readability of sigs )
|
||||
typedef typename boost::mpl::less<
|
||||
typename NextInterfaceType::SignatureArity,
|
||||
typename vtkm::internal::FunctionInterface<OriginalFunction>::SignatureArity
|
||||
>::type IsLessType;
|
||||
typedef boost::integral_constant<bool, IsLessType::value > ShouldDoNextTransformType;
|
||||
typedef std::integral_constant<bool, IsLessType::value > ShouldDoNextTransformType;
|
||||
|
||||
NextInterfaceType nextInterface = this->NewInterface.Append(newParameter);
|
||||
this->DoNextTransform(nextInterface, ShouldDoNextTransformType());
|
||||
@ -849,7 +849,7 @@ private:
|
||||
void
|
||||
DoNextTransform(
|
||||
vtkm::internal::FunctionInterface<NextFunction> &nextInterface,
|
||||
boost::true_type) const
|
||||
std::true_type) const
|
||||
{
|
||||
typedef FunctionInterfaceDynamicTransformContContinue<
|
||||
OriginalFunction,NextFunction,TransformFunctor,FinishFunctor> NextContinueType;
|
||||
@ -869,7 +869,7 @@ private:
|
||||
void
|
||||
DoNextTransform(
|
||||
vtkm::internal::FunctionInterface<NextFunction> &nextInterface,
|
||||
boost::false_type) const
|
||||
std::false_type) const
|
||||
{
|
||||
this->Finish(nextInterface);
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ struct GetReferenceFunctor
|
||||
{
|
||||
template<typename T>
|
||||
struct ReturnType {
|
||||
typedef const typename boost::remove_reference<T>::type *type;
|
||||
typedef const typename std::remove_reference<T>::type *type;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
|
@ -36,7 +36,6 @@
|
||||
VTKM_THIRDPARTY_PRE_INCLUDE
|
||||
#include <boost/smart_ptr/scoped_ptr.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
VTKM_THIRDPARTY_POST_INCLUDE
|
||||
|
||||
#include <algorithm>
|
||||
@ -115,7 +114,7 @@ vtkm::cont::DynamicArrayHandle CreateDynamicArrayHandle(const std::vector<T> &ve
|
||||
case 1:
|
||||
{
|
||||
typedef typename ClosestCommonType<T>::Type CommonType;
|
||||
if (!boost::is_same<T, CommonType>::value)
|
||||
if (!std::is_same<T, CommonType>::value)
|
||||
{
|
||||
std::cerr << "Type " << vtkm::io::internal::DataTypeName<T>::Name()
|
||||
<< " is currently unsupported. Converting to "
|
||||
@ -139,7 +138,7 @@ vtkm::cont::DynamicArrayHandle CreateDynamicArrayHandle(const std::vector<T> &ve
|
||||
typedef typename vtkm::VecTraits<T>::ComponentType InComponentType;
|
||||
typedef typename ClosestFloat<InComponentType>::Type OutComponentType;
|
||||
typedef vtkm::Vec<OutComponentType, 3> CommonType;
|
||||
if (!boost::is_same<T, CommonType>::value)
|
||||
if (!std::is_same<T, CommonType>::value)
|
||||
{
|
||||
std::cerr << "Type " << vtkm::io::internal::DataTypeName<InComponentType>::Name()
|
||||
<< "[" << vtkm::VecTraits<T>::NUM_COMPONENTS << "] "
|
||||
|
@ -135,7 +135,7 @@ struct InternalTryCellShape
|
||||
|
||||
private:
|
||||
template<typename FunctionType>
|
||||
void PrintAndInvoke(const FunctionType &function, boost::true_type) const {
|
||||
void PrintAndInvoke(const FunctionType &function, std::true_type) const {
|
||||
typedef typename vtkm::CellShapeIdToTag<cellShapeId>::Tag CellShapeTag;
|
||||
std::cout << "*** "
|
||||
<< vtkm::GetCellShapeName(CellShapeTag())
|
||||
@ -144,7 +144,7 @@ private:
|
||||
}
|
||||
|
||||
template<typename FunctionType>
|
||||
void PrintAndInvoke(const FunctionType &, boost::false_type) const {
|
||||
void PrintAndInvoke(const FunctionType &, std::false_type) const {
|
||||
// Not a valid cell shape. Do nothing.
|
||||
}
|
||||
};
|
||||
|
@ -26,10 +26,6 @@
|
||||
|
||||
#include <vtkm/testing/Testing.h>
|
||||
|
||||
VTKM_THIRDPARTY_PRE_INCLUDE
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
VTKM_THIRDPARTY_POST_INCLUDE
|
||||
|
||||
namespace vtkm {
|
||||
namespace testing {
|
||||
|
||||
@ -63,11 +59,11 @@ inline void CheckIsStatic(const T &, vtkm::VecTraitsTagSizeVariable)
|
||||
/// the Tuple class.
|
||||
template <vtkm::IdComponent NUM_COMPONENTS, typename T>
|
||||
static void TestVecTypeImpl(
|
||||
const typename boost::remove_const<T>::type &vector)
|
||||
const typename std::remove_const<T>::type &vector)
|
||||
{
|
||||
typedef typename vtkm::VecTraits<T> Traits;
|
||||
typedef typename Traits::ComponentType ComponentType;
|
||||
typedef typename boost::remove_const<T>::type NonConstT;
|
||||
typedef typename std::remove_const<T>::type NonConstT;
|
||||
|
||||
CheckIsStatic<NUM_COMPONENTS>(vector, typename Traits::IsSizeStatic());
|
||||
|
||||
|
@ -40,13 +40,10 @@
|
||||
|
||||
VTKM_THIRDPARTY_PRE_INCLUDE
|
||||
#include <boost/mpl/at.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/fold.hpp>
|
||||
#include <boost/mpl/find.hpp>
|
||||
#include <boost/mpl/zip_view.hpp>
|
||||
#include <boost/mpl/vector.hpp>
|
||||
#include <boost/type_traits/is_base_of.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
VTKM_THIRDPARTY_POST_INCLUDE
|
||||
|
||||
#include <sstream>
|
||||
@ -65,8 +62,8 @@ namespace detail {
|
||||
// these unsupported combinations we just silently halt the compiler from
|
||||
// attempting to create code for these errant conditions and throw a run-time
|
||||
// error if one every tries to create one.
|
||||
inline void PrintFailureMessage(int, boost::true_type) {}
|
||||
inline void PrintFailureMessage(int index, boost::false_type)
|
||||
inline void PrintFailureMessage(int, std::true_type) {}
|
||||
inline void PrintFailureMessage(int index, std::false_type)
|
||||
{
|
||||
std::stringstream message;
|
||||
message << "Encountered bad type for parameter "
|
||||
@ -82,11 +79,12 @@ struct DetermineIfHasDynamicParameter
|
||||
struct apply
|
||||
{
|
||||
typedef typename vtkm::cont::internal::DynamicTransformTraits<U>::DynamicTag DynamicTag;
|
||||
typedef typename boost::is_same<
|
||||
typedef typename std::is_same<
|
||||
DynamicTag,
|
||||
vtkm::cont::internal::DynamicTransformTagCastAndCall>::type UType;
|
||||
|
||||
typedef typename boost::mpl::or_<T,UType>::type type;
|
||||
typedef std::integral_constant<bool,
|
||||
(T::value || UType::value) > type;
|
||||
};
|
||||
};
|
||||
|
||||
@ -99,10 +97,10 @@ void NiceInCorrectParameterErrorMessage()
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void ShowInCorrectParameter(boost::mpl::true_, T) {}
|
||||
void ShowInCorrectParameter(std::true_type, T) {}
|
||||
|
||||
template<typename T>
|
||||
void ShowInCorrectParameter(boost::mpl::false_, T)
|
||||
void ShowInCorrectParameter(std::false_type, T)
|
||||
{
|
||||
typedef typename boost::mpl::deref<T>::type ZipType;
|
||||
typedef typename boost::mpl::at_c<ZipType,0>::type ValueType;
|
||||
@ -118,19 +116,15 @@ struct DetermineHasInCorrectParameters
|
||||
template<typename T>
|
||||
struct apply
|
||||
{
|
||||
typedef typename boost::mpl::at_c<T,0>::type ValueType;
|
||||
typedef typename boost::mpl::at_c<T,1>::type ControlSignatureTag;
|
||||
|
||||
typedef typename ControlSignatureTag::TypeCheckTag TypeCheckTag;
|
||||
|
||||
typedef boost::mpl::bool_<
|
||||
vtkm::cont::arg::TypeCheck<TypeCheckTag,ValueType>::value> CanContinueTagType;
|
||||
using ValueType = typename boost::mpl::at_c<T,0>::type;
|
||||
using ControlSignatureTag = typename boost::mpl::at_c<T,1>::type;
|
||||
using TypeCheckTag = typename ControlSignatureTag::TypeCheckTag;
|
||||
|
||||
//We need to not the result of CanContinueTagType, because we want to return
|
||||
//true when we have the first parameter that DOES NOT match the control
|
||||
//signature requirements
|
||||
typedef typename boost::mpl::not_< typename CanContinueTagType::type
|
||||
>::type type;
|
||||
using type = std::integral_constant< bool,
|
||||
!vtkm::cont::arg::TypeCheck<TypeCheckTag,ValueType>::value>;
|
||||
};
|
||||
};
|
||||
|
||||
@ -177,7 +171,7 @@ struct DispatcherBaseTypeCheckFunctor
|
||||
VTKM_CONT_EXPORT
|
||||
void operator()(const T &x) const
|
||||
{
|
||||
typedef boost::integral_constant<bool,
|
||||
typedef std::integral_constant<bool,
|
||||
vtkm::cont::arg::TypeCheck<TypeCheckTag,T>::value> CanContinueTagType;
|
||||
|
||||
vtkm::worklet::internal::detail::PrintFailureMessage(Index,CanContinueTagType());
|
||||
@ -187,14 +181,14 @@ struct DispatcherBaseTypeCheckFunctor
|
||||
private:
|
||||
template<typename T>
|
||||
VTKM_CONT_EXPORT
|
||||
void WillContinue(const T &x, boost::true_type) const
|
||||
void WillContinue(const T &x, std::true_type) const
|
||||
{
|
||||
this->Continue(x);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
VTKM_CONT_EXPORT
|
||||
void WillContinue(const T&, boost::false_type) const
|
||||
void WillContinue(const T&, std::false_type) const
|
||||
{ }
|
||||
};
|
||||
|
||||
@ -239,7 +233,7 @@ struct DispatcherBaseDynamicTransformHelper
|
||||
template<typename FunctionInterface>
|
||||
VTKM_CONT_EXPORT
|
||||
void operator()(const FunctionInterface ¶meters) const {
|
||||
this->Dispatcher->DynamicTransformInvoke(parameters, boost::mpl::true_() );
|
||||
this->Dispatcher->DynamicTransformInvoke(parameters, std::true_type() );
|
||||
}
|
||||
};
|
||||
|
||||
@ -334,10 +328,12 @@ private:
|
||||
const vtkm::internal::FunctionInterface<Signature> ¶meters) const
|
||||
{
|
||||
typedef vtkm::internal::FunctionInterface<Signature> ParameterInterface;
|
||||
|
||||
VTKM_STATIC_ASSERT_MSG(ParameterInterface::ARITY == NUM_INVOKE_PARAMS,
|
||||
"Dispatcher Invoke called with wrong number of arguments.");
|
||||
|
||||
BOOST_MPL_ASSERT(( boost::is_base_of<BaseWorkletType,WorkletType> ));
|
||||
static_assert( std::is_base_of<BaseWorkletType,WorkletType>::value,
|
||||
"The worklet being scheduled by this dispatcher doesn't match the type of the dispatcher");
|
||||
|
||||
//We need to determine if we have the need to do any dynamic
|
||||
//transforms. This is fairly simple of a query. We just need to check
|
||||
@ -348,7 +344,7 @@ private:
|
||||
typedef boost::function_types::parameter_types<Signature> MPLSignatureForm;
|
||||
typedef typename boost::mpl::fold<
|
||||
MPLSignatureForm,
|
||||
boost::mpl::false_,
|
||||
std::false_type,
|
||||
detail::DetermineIfHasDynamicParameter>::type HasDynamicTypes;
|
||||
|
||||
this->StartInvokeDynamic(parameters, HasDynamicTypes() );
|
||||
@ -359,7 +355,7 @@ private:
|
||||
VTKM_CONT_EXPORT
|
||||
void StartInvokeDynamic(
|
||||
const vtkm::internal::FunctionInterface<Signature> ¶meters,
|
||||
boost::mpl::true_) const
|
||||
std::true_type) const
|
||||
{
|
||||
// As we do the dynamic transform, we are also going to check the static
|
||||
// type against the TypeCheckTag in the ControlSignature tags. To do this,
|
||||
@ -379,7 +375,7 @@ private:
|
||||
VTKM_CONT_EXPORT
|
||||
void StartInvokeDynamic(
|
||||
const vtkm::internal::FunctionInterface<Signature> ¶meters,
|
||||
boost::mpl::false_) const
|
||||
std::false_type) const
|
||||
{
|
||||
//Nothing requires a conversion from dynamic to static types, so
|
||||
//next we need to verify that each argument's type is correct. If not
|
||||
@ -395,7 +391,7 @@ private:
|
||||
ZippedView,
|
||||
detail::DetermineHasInCorrectParameters>::type LocationOfIncorrectParameter;
|
||||
|
||||
typedef typename boost::is_same< LocationOfIncorrectParameter,
|
||||
typedef typename std::is_same< LocationOfIncorrectParameter,
|
||||
typename boost::mpl::end< ZippedView>::type >::type HasOnlyCorrectTypes;
|
||||
|
||||
//When HasOnlyCorrectTypes is false we produce an error
|
||||
@ -411,7 +407,7 @@ private:
|
||||
VTKM_CONT_EXPORT
|
||||
void DynamicTransformInvoke(
|
||||
const vtkm::internal::FunctionInterface<Signature> ¶meters,
|
||||
boost::mpl::true_ ) const
|
||||
std::true_type ) const
|
||||
{
|
||||
// TODO: Check parameters
|
||||
static const vtkm::IdComponent INPUT_DOMAIN_INDEX =
|
||||
@ -425,7 +421,7 @@ private:
|
||||
VTKM_CONT_EXPORT
|
||||
void DynamicTransformInvoke(
|
||||
const vtkm::internal::FunctionInterface<Signature> &,
|
||||
boost::mpl::false_ ) const
|
||||
std::false_type ) const
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ struct Gaussian : public KernelBase< Gaussian<Dimensions> >
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
// return the multiplier between smoothing length and max cutoff distance
|
||||
/*constexpr */ double getDilationFactor() const { return 5.0; }
|
||||
VTKM_CONSTEXPR double getDilationFactor() const { return 5.0; }
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
// compute w(h) for the given distance
|
||||
|
Loading…
Reference in New Issue
Block a user