Merge topic 'remove_usage_of_reserved_names'

8114e9e62 VTK-m now doesn't use reserved C++ identifiers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Allison Vacanti <allison.vacanti@kitware.com>
Merge-request: !1564
This commit is contained in:
Robert Maynard 2019-03-04 20:25:14 +00:00 committed by Kitware Robot
commit 48dc6509f8
10 changed files with 95 additions and 91 deletions

@ -26,24 +26,24 @@ namespace vtkm
namespace cont
{
#define _VTKM_ARRAYHANDLE_INSTANTIATE(Type) \
#define VTKM_ARRAYHANDLE_INSTANTIATE(Type) \
template class VTKM_CONT_EXPORT ArrayHandle<Type, StorageTagBasic>; \
template class VTKM_CONT_EXPORT ArrayHandle<vtkm::Vec<Type, 2>, StorageTagBasic>; \
template class VTKM_CONT_EXPORT ArrayHandle<vtkm::Vec<Type, 3>, StorageTagBasic>; \
template class VTKM_CONT_EXPORT ArrayHandle<vtkm::Vec<Type, 4>, StorageTagBasic>;
_VTKM_ARRAYHANDLE_INSTANTIATE(char)
_VTKM_ARRAYHANDLE_INSTANTIATE(vtkm::Int8)
_VTKM_ARRAYHANDLE_INSTANTIATE(vtkm::UInt8)
_VTKM_ARRAYHANDLE_INSTANTIATE(vtkm::Int16)
_VTKM_ARRAYHANDLE_INSTANTIATE(vtkm::UInt16)
_VTKM_ARRAYHANDLE_INSTANTIATE(vtkm::Int32)
_VTKM_ARRAYHANDLE_INSTANTIATE(vtkm::UInt32)
_VTKM_ARRAYHANDLE_INSTANTIATE(vtkm::Int64)
_VTKM_ARRAYHANDLE_INSTANTIATE(vtkm::UInt64)
_VTKM_ARRAYHANDLE_INSTANTIATE(vtkm::Float32)
_VTKM_ARRAYHANDLE_INSTANTIATE(vtkm::Float64)
VTKM_ARRAYHANDLE_INSTANTIATE(char)
VTKM_ARRAYHANDLE_INSTANTIATE(vtkm::Int8)
VTKM_ARRAYHANDLE_INSTANTIATE(vtkm::UInt8)
VTKM_ARRAYHANDLE_INSTANTIATE(vtkm::Int16)
VTKM_ARRAYHANDLE_INSTANTIATE(vtkm::UInt16)
VTKM_ARRAYHANDLE_INSTANTIATE(vtkm::Int32)
VTKM_ARRAYHANDLE_INSTANTIATE(vtkm::UInt32)
VTKM_ARRAYHANDLE_INSTANTIATE(vtkm::Int64)
VTKM_ARRAYHANDLE_INSTANTIATE(vtkm::UInt64)
VTKM_ARRAYHANDLE_INSTANTIATE(vtkm::Float32)
VTKM_ARRAYHANDLE_INSTANTIATE(vtkm::Float64)
#undef _VTKM_ARRAYHANDLE_INSTANTIATE
#undef VTKM_ARRAYHANDLE_INSTANTIATE
}
} // end vtkm::cont

@ -748,7 +748,7 @@ namespace vtkm
namespace cont
{
#define _VTKM_ARRAYHANDLE_EXPORT(Type) \
#define VTKM_ARRAYHANDLE_EXPORT(Type) \
extern template class VTKM_CONT_TEMPLATE_EXPORT ArrayHandle<Type, StorageTagBasic>; \
extern template class VTKM_CONT_TEMPLATE_EXPORT \
ArrayHandle<vtkm::Vec<Type, 2>, StorageTagBasic>; \
@ -756,19 +756,19 @@ namespace cont
ArrayHandle<vtkm::Vec<Type, 3>, StorageTagBasic>; \
extern template class VTKM_CONT_TEMPLATE_EXPORT ArrayHandle<vtkm::Vec<Type, 4>, StorageTagBasic>;
_VTKM_ARRAYHANDLE_EXPORT(char)
_VTKM_ARRAYHANDLE_EXPORT(vtkm::Int8)
_VTKM_ARRAYHANDLE_EXPORT(vtkm::UInt8)
_VTKM_ARRAYHANDLE_EXPORT(vtkm::Int16)
_VTKM_ARRAYHANDLE_EXPORT(vtkm::UInt16)
_VTKM_ARRAYHANDLE_EXPORT(vtkm::Int32)
_VTKM_ARRAYHANDLE_EXPORT(vtkm::UInt32)
_VTKM_ARRAYHANDLE_EXPORT(vtkm::Int64)
_VTKM_ARRAYHANDLE_EXPORT(vtkm::UInt64)
_VTKM_ARRAYHANDLE_EXPORT(vtkm::Float32)
_VTKM_ARRAYHANDLE_EXPORT(vtkm::Float64)
VTKM_ARRAYHANDLE_EXPORT(char)
VTKM_ARRAYHANDLE_EXPORT(vtkm::Int8)
VTKM_ARRAYHANDLE_EXPORT(vtkm::UInt8)
VTKM_ARRAYHANDLE_EXPORT(vtkm::Int16)
VTKM_ARRAYHANDLE_EXPORT(vtkm::UInt16)
VTKM_ARRAYHANDLE_EXPORT(vtkm::Int32)
VTKM_ARRAYHANDLE_EXPORT(vtkm::UInt32)
VTKM_ARRAYHANDLE_EXPORT(vtkm::Int64)
VTKM_ARRAYHANDLE_EXPORT(vtkm::UInt64)
VTKM_ARRAYHANDLE_EXPORT(vtkm::Float32)
VTKM_ARRAYHANDLE_EXPORT(vtkm::Float64)
#undef _VTKM_ARRAYHANDLE_EXPORT
#undef VTKM_ARRAYHANDLE_EXPORT
}
} // end vtkm::cont

@ -32,12 +32,12 @@ namespace exec
namespace internal
{
template <typename _SourcePortalType, vtkm::IdComponent _NUM_COMPONENTS>
template <typename PortalType, vtkm::IdComponent N_COMPONENTS>
class VTKM_ALWAYS_EXPORT ArrayPortalGroupVec
{
public:
static constexpr vtkm::IdComponent NUM_COMPONENTS = _NUM_COMPONENTS;
using SourcePortalType = _SourcePortalType;
static constexpr vtkm::IdComponent NUM_COMPONENTS = N_COMPONENTS;
using SourcePortalType = PortalType;
using ComponentType = typename std::remove_const<typename SourcePortalType::ValueType>::type;
using ValueType = vtkm::Vec<ComponentType, NUM_COMPONENTS>;

@ -309,23 +309,25 @@ void* StorageBasicBase::GetCapacityPointer() const
return static_cast<void*>(v);
}
#define _VTKM_STORAGE_INSTANTIATE(Type) \
#define VTKM_STORAGE_INSTANTIATE(Type) \
template class VTKM_CONT_EXPORT Storage<Type, StorageTagBasic>; \
template class VTKM_CONT_EXPORT Storage<vtkm::Vec<Type, 2>, StorageTagBasic>; \
template class VTKM_CONT_EXPORT Storage<vtkm::Vec<Type, 3>, StorageTagBasic>; \
template class VTKM_CONT_EXPORT Storage<vtkm::Vec<Type, 4>, StorageTagBasic>;
_VTKM_STORAGE_INSTANTIATE(char)
_VTKM_STORAGE_INSTANTIATE(vtkm::Int8)
_VTKM_STORAGE_INSTANTIATE(vtkm::UInt8)
_VTKM_STORAGE_INSTANTIATE(vtkm::Int16)
_VTKM_STORAGE_INSTANTIATE(vtkm::UInt16)
_VTKM_STORAGE_INSTANTIATE(vtkm::Int32)
_VTKM_STORAGE_INSTANTIATE(vtkm::UInt32)
_VTKM_STORAGE_INSTANTIATE(vtkm::Int64)
_VTKM_STORAGE_INSTANTIATE(vtkm::UInt64)
_VTKM_STORAGE_INSTANTIATE(vtkm::Float32)
_VTKM_STORAGE_INSTANTIATE(vtkm::Float64)
VTKM_STORAGE_INSTANTIATE(char)
VTKM_STORAGE_INSTANTIATE(vtkm::Int8)
VTKM_STORAGE_INSTANTIATE(vtkm::UInt8)
VTKM_STORAGE_INSTANTIATE(vtkm::Int16)
VTKM_STORAGE_INSTANTIATE(vtkm::UInt16)
VTKM_STORAGE_INSTANTIATE(vtkm::Int32)
VTKM_STORAGE_INSTANTIATE(vtkm::UInt32)
VTKM_STORAGE_INSTANTIATE(vtkm::Int64)
VTKM_STORAGE_INSTANTIATE(vtkm::UInt64)
VTKM_STORAGE_INSTANTIATE(vtkm::Float32)
VTKM_STORAGE_INSTANTIATE(vtkm::Float64)
#undef VTKM_STORAGE_INSTANTIATE
}
}
} // namespace vtkm::cont::internal

@ -234,23 +234,25 @@ namespace internal
/// \cond
/// Make doxygen ignore this section
#define _VTKM_STORAGE_EXPORT(Type) \
#define VTKM_STORAGE_EXPORT(Type) \
extern template class VTKM_CONT_TEMPLATE_EXPORT Storage<Type, StorageTagBasic>; \
extern template class VTKM_CONT_TEMPLATE_EXPORT Storage<vtkm::Vec<Type, 2>, StorageTagBasic>; \
extern template class VTKM_CONT_TEMPLATE_EXPORT Storage<vtkm::Vec<Type, 3>, StorageTagBasic>; \
extern template class VTKM_CONT_TEMPLATE_EXPORT Storage<vtkm::Vec<Type, 4>, StorageTagBasic>;
_VTKM_STORAGE_EXPORT(char)
_VTKM_STORAGE_EXPORT(vtkm::Int8)
_VTKM_STORAGE_EXPORT(vtkm::UInt8)
_VTKM_STORAGE_EXPORT(vtkm::Int16)
_VTKM_STORAGE_EXPORT(vtkm::UInt16)
_VTKM_STORAGE_EXPORT(vtkm::Int32)
_VTKM_STORAGE_EXPORT(vtkm::UInt32)
_VTKM_STORAGE_EXPORT(vtkm::Int64)
_VTKM_STORAGE_EXPORT(vtkm::UInt64)
_VTKM_STORAGE_EXPORT(vtkm::Float32)
_VTKM_STORAGE_EXPORT(vtkm::Float64)
VTKM_STORAGE_EXPORT(char)
VTKM_STORAGE_EXPORT(vtkm::Int8)
VTKM_STORAGE_EXPORT(vtkm::UInt8)
VTKM_STORAGE_EXPORT(vtkm::Int16)
VTKM_STORAGE_EXPORT(vtkm::UInt16)
VTKM_STORAGE_EXPORT(vtkm::Int32)
VTKM_STORAGE_EXPORT(vtkm::UInt32)
VTKM_STORAGE_EXPORT(vtkm::Int64)
VTKM_STORAGE_EXPORT(vtkm::UInt64)
VTKM_STORAGE_EXPORT(vtkm::Float32)
VTKM_STORAGE_EXPORT(vtkm::Float64)
#undef VTKM_STORAGE_EXPORT
/// \endcond
}
}

@ -212,14 +212,14 @@ namespace cont
/// ArrayPortalFromIterators. Returns the original array rather than
/// the portal wrapped in an \c IteratorFromArrayPortal.
///
template <typename _IteratorType>
class ArrayPortalToIterators<vtkm::cont::internal::ArrayPortalFromIterators<_IteratorType>>
template <typename IterType>
class ArrayPortalToIterators<vtkm::cont::internal::ArrayPortalFromIterators<IterType>>
{
using PortalType = vtkm::cont::internal::ArrayPortalFromIterators<_IteratorType>;
using PortalType = vtkm::cont::internal::ArrayPortalFromIterators<IterType>;
public:
#if !defined(VTKM_MSVC) || (defined(_ITERATOR_DEBUG_LEVEL) && _ITERATOR_DEBUG_LEVEL == 0)
using IteratorType = _IteratorType;
using IteratorType = IterType;
VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_CONT
@ -233,7 +233,7 @@ public:
// The MSVC compiler issues warnings when using raw pointer math when in
// debug mode. To keep the compiler happy (and add some safety checks),
// wrap the iterator in checked_array_iterator.
using IteratorType = stdext::checked_array_iterator<_IteratorType>;
using IteratorType = stdext::checked_array_iterator<IterType>;
VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_CONT

@ -40,8 +40,8 @@
// Wrap all '#pragma omp ...' calls in this macro so we can disable them in
// non-omp builds and avoid a multitude of 'ignoring pragma..." warnings.
#ifdef _OPENMP
#define _VTKM_OPENMP_DIRECTIVE_IMPL(fullDir) _Pragma(#fullDir)
#define VTKM_OPENMP_DIRECTIVE(dir) _VTKM_OPENMP_DIRECTIVE_IMPL(omp dir)
#define VTKM_OPENMP_DIRECTIVE_IMPL(fullDir) _Pragma(#fullDir)
#define VTKM_OPENMP_DIRECTIVE(dir) VTKM_OPENMP_DIRECTIVE_IMPL(omp dir)
#else // _OPENMP
#define VTKM_OPENMP_DIRECTIVE(directive)
#endif // _OPENMP

@ -495,7 +495,7 @@ VTKM_CONT static T ReducePortals(InputPortalType inputPortal,
// Define this to print out timing information from the reduction and join
// operations in the tbb ReduceByKey algorithm:
//#define _VTKM_DEBUG_TBB_RBK
//#define VTKM_DEBUG_TBB_RBK
template <typename KeysInPortalType,
typename ValuesInPortalType,
@ -554,7 +554,7 @@ struct ReduceByKeyBody
ValuesOutPortalType ValuesOutPortal;
BinaryOperationType BinaryOperation;
Range Ranges;
#ifdef _VTKM_DEBUG_TBB_RBK
#ifdef VTKM_DEBUG_TBB_RBK
double ReduceTime;
double JoinTime;
#endif
@ -570,7 +570,7 @@ struct ReduceByKeyBody
, KeysOutPortal(keysOutPortal)
, ValuesOutPortal(valuesOutPortal)
, BinaryOperation(binaryOperation)
#ifdef _VTKM_DEBUG_TBB_RBK
#ifdef VTKM_DEBUG_TBB_RBK
, ReduceTime(0)
, JoinTime(0)
#endif
@ -584,7 +584,7 @@ struct ReduceByKeyBody
, KeysOutPortal(body.KeysOutPortal)
, ValuesOutPortal(body.ValuesOutPortal)
, BinaryOperation(body.BinaryOperation)
#ifdef _VTKM_DEBUG_TBB_RBK
#ifdef VTKM_DEBUG_TBB_RBK
, ReduceTime(0)
, JoinTime(0)
#endif
@ -595,9 +595,9 @@ struct ReduceByKeyBody
void operator()(const ::tbb::blocked_range<vtkm::Id>& range)
{
#ifdef _VTKM_DEBUG_TBB_RBK
#ifdef VTKM_DEBUG_TBB_RBK
::tbb::tick_count startTime = ::tbb::tick_count::now();
#endif // _VTKM_DEBUG_TBB_RBK
#endif // VTKM_DEBUG_TBB_RBK
if (range.empty())
{
return;
@ -714,7 +714,7 @@ struct ReduceByKeyBody
this->Ranges.OutputEnd = writePos;
#ifdef _VTKM_DEBUG_TBB_RBK
#ifdef VTKM_DEBUG_TBB_RBK
::tbb::tick_count endTime = ::tbb::tick_count::now();
double time = (endTime - startTime).seconds();
this->ReduceTime += time;
@ -735,7 +735,7 @@ struct ReduceByKeyBody
using KeysIteratorType = typename KeysIteratorsType::IteratorType;
using ValuesIteratorType = typename ValuesIteratorsType::IteratorType;
#ifdef _VTKM_DEBUG_TBB_RBK
#ifdef VTKM_DEBUG_TBB_RBK
::tbb::tick_count startTime = ::tbb::tick_count::now();
#endif
@ -775,7 +775,7 @@ struct ReduceByKeyBody
this->Ranges.OutputEnd += srcEnd - srcBegin;
this->Ranges.AssertSane();
#ifdef _VTKM_DEBUG_TBB_RBK
#ifdef VTKM_DEBUG_TBB_RBK
::tbb::tick_count endTime = ::tbb::tick_count::now();
double time = (endTime - startTime).seconds();
this->JoinTime += rhs.JoinTime + time;
@ -820,13 +820,13 @@ VTKM_CONT vtkm::Id ReduceByKeyPortals(KeysInPortalType keysInPortal,
body(keysInPortal, valuesInPortal, keysOutPortal, valuesOutPortal, wrappedBinaryOp);
::tbb::blocked_range<vtkm::Id> range(0, inputLength, TBB_GRAIN_SIZE);
#ifdef _VTKM_DEBUG_TBB_RBK
#ifdef VTKM_DEBUG_TBB_RBK
std::cerr << "\n\nTBB ReduceByKey:\n";
#endif
::tbb::parallel_reduce(range, body);
#ifdef _VTKM_DEBUG_TBB_RBK
#ifdef VTKM_DEBUG_TBB_RBK
std::cerr << "Total reduce time: " << body.ReduceTime << "s\n";
std::cerr << "Total join time: " << body.JoinTime << "s\n";
std::cerr << "\nend\n";
@ -839,8 +839,8 @@ VTKM_CONT vtkm::Id ReduceByKeyPortals(KeysInPortalType keysInPortal,
return body.Ranges.OutputEnd;
}
#ifdef _VTKM_DEBUG_TBB_RBK
#undef _VTKM_DEBUG_TBB_RBK
#ifdef VTKM_DEBUG_TBB_RBK
#undef VTKM_DEBUG_TBB_RBK
#endif
template <class InputPortalType, class OutputPortalType, class BinaryOperationType>

@ -33,13 +33,13 @@ namespace internal
/// track of the types of all parameters and the associated features of the
/// worklet. \c Invocation is a class that manages all these types.
///
template <typename _ParameterInterface,
typename _ControlInterface,
typename _ExecutionInterface,
vtkm::IdComponent _InputDomainIndex,
typename _OutputToInputMapType = vtkm::internal::NullType,
typename _VisitArrayType = vtkm::internal::NullType,
typename _ThreadToOutputMapType = vtkm::internal::NullType>
template <typename ParameterInterface_,
typename ControlInterface_,
typename ExecutionInterface_,
vtkm::IdComponent InputDomainIndex_,
typename OutputToInputMapType_ = vtkm::internal::NullType,
typename VisitArrayType_ = vtkm::internal::NullType,
typename ThreadToOutputMapType_ = vtkm::internal::NullType>
struct Invocation
{
/// \brief The types of the parameters
@ -47,7 +47,7 @@ struct Invocation
/// \c ParameterInterface is (expected to be) a \c FunctionInterface class
/// that lists the types of the parameters for the invocation.
///
using ParameterInterface = _ParameterInterface;
using ParameterInterface = ParameterInterface_;
/// \brief The tags of the \c ControlSignature.
///
@ -55,7 +55,7 @@ struct Invocation
/// represents the \c ControlSignature of a worklet (although dispatchers
/// might modify the control signature to provide auxiliary information).
///
using ControlInterface = _ControlInterface;
using ControlInterface = ControlInterface_;
/// \brief The tags of the \c ExecutionSignature.
///
@ -63,7 +63,7 @@ struct Invocation
/// represents the \c ExecutionSignature of a worklet (although dispatchers
/// might modify the execution signature to provide auxiliary information).
///
using ExecutionInterface = _ExecutionInterface;
using ExecutionInterface = ExecutionInterface_;
/// \brief The index of the input domain.
///
@ -71,7 +71,7 @@ struct Invocation
/// constituent element of the input (such as the points or cells). This
/// index points to the parameter that defines this input domain.
///
static constexpr vtkm::IdComponent InputDomainIndex = _InputDomainIndex;
static constexpr vtkm::IdComponent InputDomainIndex = InputDomainIndex_;
/// \brief An array representing the output to input map.
///
@ -80,7 +80,7 @@ struct Invocation
/// represented with a map where each output points to an input that creates
/// it.
///
using OutputToInputMapType = _OutputToInputMapType;
using OutputToInputMapType = OutputToInputMapType_;
/// \brief An array containing visit indices.
///
@ -89,7 +89,7 @@ struct Invocation
/// multiple outputs may point to the same input. The visit index uniquely
/// identifies which instance each is.
///
using VisitArrayType = _VisitArrayType;
using VisitArrayType = VisitArrayType_;
/// \brief An array representing the thread to output map.
///
@ -97,7 +97,7 @@ struct Invocation
/// prevent the worklet to be run on masked-out elements of the output. This
/// is represented with a map where each thread points to an output it creates.
///
using ThreadToOutputMapType = _ThreadToOutputMapType;
using ThreadToOutputMapType = ThreadToOutputMapType_;
/// \brief Default Invocation constructors that holds the given parameters
/// by reference.

@ -76,11 +76,11 @@ enum class KeysSortType
/// Keys structure is reused for all the \c Invoke. This is more efficient than
/// creating a different \c Keys structure for each \c Invoke.
///
template <typename _KeyType>
template <typename T>
class VTKM_ALWAYS_EXPORT Keys
{
public:
using KeyType = _KeyType;
using KeyType = T;
using KeyArrayHandleType = vtkm::cont::ArrayHandle<KeyType>;
VTKM_CONT
@ -272,8 +272,8 @@ private:
}
};
template <typename _KeyType>
VTKM_CONT Keys<_KeyType>::Keys() = default;
template <typename T>
VTKM_CONT Keys<T>::Keys() = default;
}
} // namespace vtkm::worklet