clang-format: reformat the repository with clang-format-9

This commit is contained in:
Kitware Robot 2020-08-17 10:18:24 -04:00 committed by Ben Boeckel
parent 1ea2e77ec2
commit cf0cdcf7d1
244 changed files with 1314 additions and 1575 deletions

@ -165,8 +165,8 @@ void BenchGradient(::benchmark::State& state, int options)
}
}
#define VTKM_PRIVATE_GRADIENT_BENCHMARK(Name, Opts) \
void BenchGradient##Name(::benchmark::State& state) { BenchGradient(state, Opts); } \
#define VTKM_PRIVATE_GRADIENT_BENCHMARK(Name, Opts) \
void BenchGradient##Name(::benchmark::State& state) { BenchGradient(state, Opts); } \
VTKM_BENCHMARK(BenchGradient##Name)
VTKM_PRIVATE_GRADIENT_BENCHMARK(Scalar, Gradient | ScalarInput);

@ -170,7 +170,7 @@
/// and modified using the passed arguments; see the Google Benchmark documentation
/// for more details. The `preamble` string may be used to supply additional
/// information that will be appended to the output's preamble.
#define VTKM_EXECUTE_BENCHMARKS_PREAMBLE(argc, argv, preamble) \
#define VTKM_EXECUTE_BENCHMARKS_PREAMBLE(argc, argv, preamble) \
vtkm::bench::detail::ExecuteBenchmarks(argc, argv, preamble)
/// \def VTKM_BENCHMARK(BenchFunc)
@ -181,7 +181,7 @@
/// ```
/// void BenchFunc(::benchmark::State& state)
/// ```
#define VTKM_BENCHMARK(BenchFunc) \
#define VTKM_BENCHMARK(BenchFunc) \
BENCHMARK(BenchFunc)->UseManualTime()->Unit(benchmark::kMillisecond)
/// \def VTKM_BENCHMARK_OPTS(BenchFunc, Args)
@ -196,7 +196,7 @@
/// Note the similarity to the raw Google Benchmark usage of
/// `BENCHMARK(MyBenchmark)->ArgName("MyParam")->Range(32, 1024*1024);`. See
/// the Google Benchmark documentation for more details on the available options.
#define VTKM_BENCHMARK_OPTS(BenchFunc, options) \
#define VTKM_BENCHMARK_OPTS(BenchFunc, options) \
BENCHMARK(BenchFunc)->UseManualTime()->Unit(benchmark::kMillisecond) options
/// \def VTKM_BENCHMARK_APPLY(BenchFunc, ConfigFunc)
@ -211,7 +211,7 @@
/// ```
///
/// See the Google Benchmark documentation for more details on the available options.
#define VTKM_BENCHMARK_APPLY(BenchFunc, applyFunctor) \
#define VTKM_BENCHMARK_APPLY(BenchFunc, applyFunctor) \
BENCHMARK(BenchFunc)->Apply(applyFunctor)->UseManualTime()->Unit(benchmark::kMillisecond)
/// \def VTKM_BENCHMARK_TEMPLATES(BenchFunc, TypeList)
@ -224,7 +224,7 @@
/// template <typename T>
/// void BenchFunc(::benchmark::State& state)
/// ```
#define VTKM_BENCHMARK_TEMPLATES(BenchFunc, TypeList) \
#define VTKM_BENCHMARK_TEMPLATES(BenchFunc, TypeList) \
VTKM_BENCHMARK_TEMPLATES_APPLY(BenchFunc, vtkm::bench::detail::NullApply, TypeList)
/// \def VTKM_BENCHMARK_TEMPLATES_OPTS(BenchFunc, Args, TypeList)
@ -237,10 +237,10 @@
/// ->ArgName("MyParam")->Range(32, 1024*1024),
/// vtkm::List<vtkm::Float32, vtkm::Vec3f_32>);
/// ```
#define VTKM_BENCHMARK_TEMPLATES_OPTS(BenchFunc, options, TypeList) \
VTKM_BENCHMARK_TEMPLATES_APPLY( \
BenchFunc, \
[](::benchmark::internal::Benchmark* bm) { bm options->Unit(benchmark::kMillisecond); }, \
#define VTKM_BENCHMARK_TEMPLATES_OPTS(BenchFunc, options, TypeList) \
VTKM_BENCHMARK_TEMPLATES_APPLY( \
BenchFunc, \
[](::benchmark::internal::Benchmark* bm) { bm options->Unit(benchmark::kMillisecond); }, \
TypeList)
/// \def VTKM_BENCHMARK_TEMPLATES_APPLY(BenchFunc, ConfigFunc, TypeList)
@ -255,22 +255,22 @@
/// ```
///
/// See the Google Benchmark documentation for more details on the available options.
#define VTKM_BENCHMARK_TEMPLATES_APPLY(BenchFunc, ApplyFunctor, TypeList) \
namespace \
#define VTKM_BENCHMARK_TEMPLATES_APPLY(BenchFunc, ApplyFunctor, TypeList) \
namespace \
{ /* A template function cannot be used as a template parameter, so wrap the function with \
* a template struct to get it into the GenerateTemplateBenchmarks class. */ \
template <typename... Ts> \
struct VTKM_BENCHMARK_WRAPPER_NAME(BenchFunc) \
{ \
static ::benchmark::internal::Function* GetFunction() { return BenchFunc<Ts...>; } \
}; \
} /* end anon namespace */ \
int BENCHMARK_PRIVATE_NAME(BenchFunc) = vtkm::bench::detail::GenerateTemplateBenchmarks< \
brigand::bind<VTKM_BENCHMARK_WRAPPER_NAME(BenchFunc)>, \
template <typename... Ts> \
struct VTKM_BENCHMARK_WRAPPER_NAME(BenchFunc) \
{ \
static ::benchmark::internal::Function* GetFunction() { return BenchFunc<Ts...>; } \
}; \
} /* end anon namespace */ \
int BENCHMARK_PRIVATE_NAME(BenchFunc) = vtkm::bench::detail::GenerateTemplateBenchmarks< \
brigand::bind<VTKM_BENCHMARK_WRAPPER_NAME(BenchFunc)>, \
TypeList>::Register(#BenchFunc, ApplyFunctor)
// Internal use only:
#define VTKM_BENCHMARK_WRAPPER_NAME(BenchFunc) \
#define VTKM_BENCHMARK_WRAPPER_NAME(BenchFunc) \
BENCHMARK_PRIVATE_CONCAT(_wrapper_, BenchFunc, __LINE__)
namespace vtkm
@ -280,9 +280,7 @@ namespace bench
namespace detail
{
static inline void NullApply(::benchmark::internal::Benchmark*)
{
}
static inline void NullApply(::benchmark::internal::Benchmark*) {}
/// Do not use directly. The VTKM_BENCHMARK_TEMPLATES macros should be used
/// instead.

@ -370,28 +370,14 @@ int main(int argc, char* argv[])
VTKM_LOG_IF_S(vtkm::cont::LogLevel::Info,
numLevels > 0,
std::endl
<< " ------------ Settings Isolevel Selection -----------"
<< std::endl
<< " levels="
<< numLevels
<< std::endl
<< " eps="
<< eps
<< std::endl
<< " comp"
<< numComp
<< std::endl
<< " type="
<< contourType
<< std::endl
<< " method="
<< contourSelectMethod
<< std::endl
<< " mc="
<< useMarchingCubes
<< std::endl
<< " use"
<< (usePersistenceSorter ? "PersistenceSorter" : "VolumeSorter"));
<< " ------------ Settings Isolevel Selection -----------" << std::endl
<< " levels=" << numLevels << std::endl
<< " eps=" << eps << std::endl
<< " comp" << numComp << std::endl
<< " type=" << contourType << std::endl
<< " method=" << contourSelectMethod << std::endl
<< " mc=" << useMarchingCubes << std::endl
<< " use" << (usePersistenceSorter ? "PersistenceSorter" : "VolumeSorter"));
}
currTime = totalTime.GetElapsedTime();
vtkm::Float64 startUpTime = currTime - prevTime;
@ -558,19 +544,17 @@ int main(int argc, char* argv[])
{
VTKM_LOG_S(vtkm::cont::LogLevel::Info,
std::endl
<< " ---------------- Input Mesh Properties --------------"
<< std::endl
<< " Number of dimensions: "
<< nDims);
<< " ---------------- Input Mesh Properties --------------" << std::endl
<< " Number of dimensions: " << nDims);
}
// Check if marching cubes is enabled for non 3D data
bool invalidMCOption = (useMarchingCubes && nDims != 3);
VTKM_LOG_IF_S(
vtkm::cont::LogLevel::Error,
invalidMCOption && (rank == 0),
"The input mesh is " << nDims << "D. "
<< "Contour tree using marching cubes is only supported for 3D data.");
VTKM_LOG_IF_S(vtkm::cont::LogLevel::Error,
invalidMCOption && (rank == 0),
"The input mesh is "
<< nDims << "D. "
<< "Contour tree using marching cubes is only supported for 3D data.");
// If we found any errors in the setttings than finalize MPI and exit the execution
if (invalidMCOption)
@ -583,7 +567,7 @@ int main(int argc, char* argv[])
#ifndef WITH_MPI // construct regular, single-block VTK-M input dataset
vtkm::cont::DataSet useDataSet = inDataSet; // Single block dataset
#else // Create a multi-block dataset for multi-block DIY-paralle processing
#else // Create a multi-block dataset for multi-block DIY-paralle processing
vtkm::cont::PartitionedDataSet useDataSet; // Partitioned variant of the input dataset
vtkm::Id3 blocksPerDim =
nDims == 3 ? vtkm::Id3(1, 1, numBlocks) : vtkm::Id3(1, numBlocks, 1); // Decompose the data into
@ -683,7 +667,7 @@ int main(int argc, char* argv[])
useDataSet.AppendPartition(ds);
}
}
#endif // WITH_MPI construct input dataset
#endif // WITH_MPI construct input dataset
currTime = totalTime.GetElapsedTime();
buildDatasetTime = currTime - prevTime;
@ -866,116 +850,47 @@ int main(int argc, char* argv[])
currTime = totalTime.GetElapsedTime();
VTKM_LOG_S(vtkm::cont::LogLevel::Info,
std::endl
<< " -------------------------- Totals "
<< rank
<< " -----------------------------"
<< std::endl
<< std::setw(42)
<< std::left
<< " Start-up"
<< ": "
<< startUpTime
<< " seconds"
<< std::endl
<< std::setw(42)
<< std::left
<< " Data Read"
<< ": "
<< dataReadTime
<< " seconds"
<< std::endl
<< std::setw(42)
<< std::left
<< " Build VTKM Dataset"
<< ": "
<< buildDatasetTime
<< " seconds"
<< std::endl
<< std::setw(42)
<< std::left
<< " Compute Contour Tree"
<< ": "
<< computeContourTreeTime
<< " seconds"
<< std::endl
<< std::setw(42)
<< std::left
<< " Compute Branch Decomposition"
<< ": "
<< computeBranchDecompTime
<< " seconds"
<< std::endl
<< std::setw(42)
<< std::left
<< " Total Time"
<< ": "
<< currTime
<< " seconds");
<< " -------------------------- Totals " << rank
<< " -----------------------------" << std::endl
<< std::setw(42) << std::left << " Start-up"
<< ": " << startUpTime << " seconds" << std::endl
<< std::setw(42) << std::left << " Data Read"
<< ": " << dataReadTime << " seconds" << std::endl
<< std::setw(42) << std::left << " Build VTKM Dataset"
<< ": " << buildDatasetTime << " seconds" << std::endl
<< std::setw(42) << std::left << " Compute Contour Tree"
<< ": " << computeContourTreeTime << " seconds" << std::endl
<< std::setw(42) << std::left << " Compute Branch Decomposition"
<< ": " << computeBranchDecompTime << " seconds" << std::endl
<< std::setw(42) << std::left << " Total Time"
<< ": " << currTime << " seconds");
const ctaug_ns::ContourTree& ct = filter.GetContourTree();
VTKM_LOG_S(vtkm::cont::LogLevel::Info,
std::endl
<< " ---------------- Contour Tree Array Sizes ---------------------"
<< std::endl
<< std::setw(42)
<< std::left
<< " #Nodes"
<< ": "
<< ct.Nodes.GetNumberOfValues()
<< std::endl
<< std::setw(42)
<< std::left
<< " #Arcs"
<< ": "
<< ct.Arcs.GetNumberOfValues()
<< std::endl
<< std::setw(42)
<< std::left
<< " #Superparents"
<< ": "
<< ct.Superparents.GetNumberOfValues()
<< std::endl
<< std::setw(42)
<< std::left
<< " #Superarcs"
<< ": "
<< ct.Superarcs.GetNumberOfValues()
<< std::endl
<< std::setw(42)
<< std::left
<< " #Supernodes"
<< ": "
<< ct.Supernodes.GetNumberOfValues()
<< std::endl
<< std::setw(42)
<< std::left
<< " #Hyperparents"
<< ": "
<< ct.Hyperparents.GetNumberOfValues()
<< std::endl
<< std::setw(42)
<< std::left
<< " #WhenTransferred"
<< ": "
<< ct.WhenTransferred.GetNumberOfValues()
<< std::endl
<< std::setw(42)
<< std::left
<< " #Hypernodes"
<< ": "
<< ct.Hypernodes.GetNumberOfValues()
<< std::endl
<< std::setw(42)
<< std::left
<< " #Hyperarcs"
<< ": "
<< ct.Hyperarcs.GetNumberOfValues()
<< std::endl);
<< " ---------------- Contour Tree Array Sizes ---------------------" << std::endl
<< std::setw(42) << std::left << " #Nodes"
<< ": " << ct.Nodes.GetNumberOfValues() << std::endl
<< std::setw(42) << std::left << " #Arcs"
<< ": " << ct.Arcs.GetNumberOfValues() << std::endl
<< std::setw(42) << std::left << " #Superparents"
<< ": " << ct.Superparents.GetNumberOfValues() << std::endl
<< std::setw(42) << std::left << " #Superarcs"
<< ": " << ct.Superarcs.GetNumberOfValues() << std::endl
<< std::setw(42) << std::left << " #Supernodes"
<< ": " << ct.Supernodes.GetNumberOfValues() << std::endl
<< std::setw(42) << std::left << " #Hyperparents"
<< ": " << ct.Hyperparents.GetNumberOfValues() << std::endl
<< std::setw(42) << std::left << " #WhenTransferred"
<< ": " << ct.WhenTransferred.GetNumberOfValues() << std::endl
<< std::setw(42) << std::left << " #Hypernodes"
<< ": " << ct.Hypernodes.GetNumberOfValues() << std::endl
<< std::setw(42) << std::left << " #Hyperarcs"
<< ": " << ct.Hyperarcs.GetNumberOfValues() << std::endl);
// Print hyperstructure statistics
VTKM_LOG_S(vtkm::cont::LogLevel::Info,
std::endl
<< ct.PrintHyperStructureStatistics(false)
<< std::endl);
<< ct.PrintHyperStructureStatistics(false) << std::endl);
// Flush ouput streams just to make sure everything has been logged (in particular when using MPI)
std::cout << std::flush;

@ -252,25 +252,14 @@ int main(int argc, char* argv[])
{
VTKM_LOG_S(vtkm::cont::LogLevel::Info,
std::endl
<< " ------------ Settings -----------"
<< std::endl
<< " filename="
<< filename
<< std::endl
<< " device="
<< device.GetName()
<< std::endl
<< " mc="
<< useMarchingCubes
<< std::endl
<< " ------------ Settings -----------" << std::endl
<< " filename=" << filename << std::endl
<< " device=" << device.GetName() << std::endl
<< " mc=" << useMarchingCubes << std::endl
#ifdef ENABLE_SET_NUM_THREADS
<< " numThreads="
<< numThreads
<< std::endl
<< " numThreads=" << numThreads << std::endl
#endif
<< " nblocks="
<< numBlocks
<< std::endl);
<< " nblocks=" << numBlocks << std::endl);
}
currTime = totalTime.GetElapsedTime();
vtkm::Float64 startUpTime = currTime - prevTime;
@ -341,14 +330,9 @@ int main(int argc, char* argv[])
{
VTKM_LOG_S(vtkm::cont::LogLevel::Info,
std::endl
<< " ---------------- Input Mesh Properties --------------"
<< std::endl
<< " Number of dimensions: "
<< nDims
<< std::endl
<< " Number of mesh vertices: "
<< numVertices
<< std::endl);
<< " ---------------- Input Mesh Properties --------------" << std::endl
<< " Number of dimensions: " << nDims << std::endl
<< " Number of mesh vertices: " << numVertices << std::endl);
}
// Check for fatal input errors
@ -359,13 +343,14 @@ int main(int argc, char* argv[])
// Log any errors if found on rank 0
VTKM_LOG_IF_S(vtkm::cont::LogLevel::Error,
invalidNumDimensions && (rank == 0),
"The input mesh is " << nDims << "D. "
"The input data must be either 2D or 3D.");
VTKM_LOG_IF_S(
vtkm::cont::LogLevel::Error,
invalidMCOption && (rank == 0),
"The input mesh is " << nDims << "D. "
<< "Contour tree using marching cubes is only supported for 3D data.");
"The input mesh is " << nDims
<< "D. "
"The input data must be either 2D or 3D.");
VTKM_LOG_IF_S(vtkm::cont::LogLevel::Error,
invalidMCOption && (rank == 0),
"The input mesh is "
<< nDims << "D. "
<< "Contour tree using marching cubes is only supported for 3D data.");
// If we found any errors in the setttings than finalize MPI and exit the execution
if (invalidNumDimensions || invalidMCOption)
{
@ -519,44 +504,18 @@ int main(int argc, char* argv[])
currTime = totalTime.GetElapsedTime();
VTKM_LOG_S(vtkm::cont::LogLevel::Info,
std::endl
<< " -------------------------- Totals "
<< rank
<< " -----------------------------"
<< std::endl
<< std::setw(42)
<< std::left
<< " Start-up"
<< ": "
<< startUpTime
<< " seconds"
<< std::endl
<< std::setw(42)
<< std::left
<< " Data Read"
<< ": "
<< dataReadTime
<< " seconds"
<< std::endl
<< std::setw(42)
<< std::left
<< " Build VTKM Dataset"
<< ": "
<< buildDatasetTime
<< " seconds"
<< std::endl
<< std::setw(42)
<< std::left
<< " Compute Contour Tree"
<< ": "
<< computeContourTreeTime
<< " seconds"
<< std::endl
<< std::setw(42)
<< std::left
<< " Total Time"
<< ": "
<< currTime
<< " seconds");
<< " -------------------------- Totals " << rank
<< " -----------------------------" << std::endl
<< std::setw(42) << std::left << " Start-up"
<< ": " << startUpTime << " seconds" << std::endl
<< std::setw(42) << std::left << " Data Read"
<< ": " << dataReadTime << " seconds" << std::endl
<< std::setw(42) << std::left << " Build VTKM Dataset"
<< ": " << buildDatasetTime << " seconds" << std::endl
<< std::setw(42) << std::left << " Compute Contour Tree"
<< ": " << computeContourTreeTime << " seconds" << std::endl
<< std::setw(42) << std::left << " Total Time"
<< ": " << currTime << " seconds");
// Flush ouput streams just to make sure everything has been logged (in particular when using MPI)
std::cout << std::flush;

@ -25,10 +25,10 @@
// write that image to a file. It then computes an isosurface on the input data set and renders
// this output data set in a separate image file
using vtkm::rendering::MapperVolume;
using vtkm::rendering::MapperRayTracer;
using vtkm::rendering::MapperWireframer;
using vtkm::rendering::CanvasRayTracer;
using vtkm::rendering::MapperRayTracer;
using vtkm::rendering::MapperVolume;
using vtkm::rendering::MapperWireframer;
int main(int argc, char* argv[])
{

@ -66,10 +66,10 @@ struct UpdateSpins : public vtkm::worklet::WorkletCellNeighborhood
const auto mySpin = prevspin.Get(0, 0, 0);
// 1. Calculate the energy of flipping, E_flip
vtkm::Float32 E_flip =
J * mySpin * (prevspin.Get(-1, -1, 0) + prevspin.Get(-1, 0, 0) + prevspin.Get(-1, 1, 0) +
prevspin.Get(0, -1, 0) + prevspin.Get(0, 1, 0) + prevspin.Get(1, -1, 0) +
prevspin.Get(1, 0, 0) + prevspin.Get(1, 1, 0));
vtkm::Float32 E_flip = J * mySpin *
(prevspin.Get(-1, -1, 0) + prevspin.Get(-1, 0, 0) + prevspin.Get(-1, 1, 0) +
prevspin.Get(0, -1, 0) + prevspin.Get(0, 1, 0) + prevspin.Get(1, -1, 0) +
prevspin.Get(1, 0, 0) + prevspin.Get(1, 1, 0));
if (E_flip <= 0)
{

@ -223,11 +223,12 @@ inline VTKM_CONT vtkm::cont::PartitionedDataSet RedistributePoints::PrepareForEx
vtkmdiy::RegularDecomposer<vtkmdiy::ContinuousBounds> decomposer(
/*dim*/ 3, internal::convert(gbounds), assigner.nblocks());
vtkmdiy::Master master(comm,
/*threads*/ 1,
/*limit*/ -1,
[]() -> void* { return new vtkm::cont::DataSet(); },
[](void* ptr) { delete static_cast<vtkm::cont::DataSet*>(ptr); });
vtkmdiy::Master master(
comm,
/*threads*/ 1,
/*limit*/ -1,
[]() -> void* { return new vtkm::cont::DataSet(); },
[](void* ptr) { delete static_cast<vtkm::cont::DataSet*>(ptr); });
decomposer.decompose(comm.rank(), assigner, master);
assert(static_cast<vtkm::Id>(master.size()) == input.GetNumberOfPartitions());

@ -471,29 +471,29 @@ VTKM_EXEC_CONT inline void AtomicStoreImpl(vtkm::UInt64* addr,
*addr = val;
}
#define VTKM_ATOMIC_OP(vtkmName, winName, vtkmType, winType, suffix) \
VTKM_EXEC_CONT inline vtkmType vtkmName(vtkmType* addr, vtkmType arg, vtkm::MemoryOrder order) \
{ \
return BitCast<vtkmType>( \
winName##suffix(reinterpret_cast<volatile winType*>(addr), BitCast<winType>(arg))); \
#define VTKM_ATOMIC_OP(vtkmName, winName, vtkmType, winType, suffix) \
VTKM_EXEC_CONT inline vtkmType vtkmName(vtkmType* addr, vtkmType arg, vtkm::MemoryOrder order) \
{ \
return BitCast<vtkmType>( \
winName##suffix(reinterpret_cast<volatile winType*>(addr), BitCast<winType>(arg))); \
}
#define VTKM_ATOMIC_OPS_FOR_TYPE(vtkmType, winType, suffix) \
VTKM_ATOMIC_OP(AtomicAddImpl, _InterlockedExchangeAdd, vtkmType, winType, suffix) \
VTKM_ATOMIC_OP(AtomicAndImpl, _InterlockedAnd, vtkmType, winType, suffix) \
VTKM_ATOMIC_OP(AtomicOrImpl, _InterlockedOr, vtkmType, winType, suffix) \
VTKM_ATOMIC_OP(AtomicXorImpl, _InterlockedXor, vtkmType, winType, suffix) \
VTKM_EXEC_CONT inline vtkmType AtomicNotImpl(vtkmType* addr, vtkm::MemoryOrder order) \
{ \
return AtomicXorImpl(addr, static_cast<vtkmType>(~vtkmType{ 0u }), order); \
} \
VTKM_EXEC_CONT inline vtkmType AtomicCompareAndSwapImpl( \
vtkmType* addr, vtkmType desired, vtkmType expected, vtkm::MemoryOrder order) \
{ \
return BitCast<vtkmType>( \
_InterlockedCompareExchange##suffix(reinterpret_cast<volatile winType*>(addr), \
BitCast<winType>(desired), \
BitCast<winType>(expected))); \
#define VTKM_ATOMIC_OPS_FOR_TYPE(vtkmType, winType, suffix) \
VTKM_ATOMIC_OP(AtomicAddImpl, _InterlockedExchangeAdd, vtkmType, winType, suffix) \
VTKM_ATOMIC_OP(AtomicAndImpl, _InterlockedAnd, vtkmType, winType, suffix) \
VTKM_ATOMIC_OP(AtomicOrImpl, _InterlockedOr, vtkmType, winType, suffix) \
VTKM_ATOMIC_OP(AtomicXorImpl, _InterlockedXor, vtkmType, winType, suffix) \
VTKM_EXEC_CONT inline vtkmType AtomicNotImpl(vtkmType* addr, vtkm::MemoryOrder order) \
{ \
return AtomicXorImpl(addr, static_cast<vtkmType>(~vtkmType{ 0u }), order); \
} \
VTKM_EXEC_CONT inline vtkmType AtomicCompareAndSwapImpl( \
vtkmType* addr, vtkmType desired, vtkmType expected, vtkm::MemoryOrder order) \
{ \
return BitCast<vtkmType>( \
_InterlockedCompareExchange##suffix(reinterpret_cast<volatile winType*>(addr), \
BitCast<winType>(desired), \
BitCast<winType>(expected))); \
}
VTKM_ATOMIC_OPS_FOR_TYPE(vtkm::UInt8, CHAR, 8)

@ -79,8 +79,8 @@ struct CellShapeTagVtkmToVtkc;
/// concept check to make sure that a template argument is a proper cell shape
/// tag.
///
#define VTKM_IS_CELL_SHAPE_TAG(tag) \
VTKM_STATIC_ASSERT_MSG(::vtkm::internal::CellShapeTagCheck<tag>::value, \
#define VTKM_IS_CELL_SHAPE_TAG(tag) \
VTKM_STATIC_ASSERT_MSG(::vtkm::internal::CellShapeTagCheck<tag>::value, \
"Provided type is not a valid VTK-m cell shape tag.")
/// A traits-like class to get an CellShapeId known at compile time to a tag.
@ -98,32 +98,32 @@ struct CellShapeIdToTag
// Define a tag for each cell shape as well as the support structs to go
// between tags and ids. The following macro is only valid here.
#define VTKM_DEFINE_CELL_TAG(name, idname) \
struct CellShapeTag##name \
{ \
static constexpr vtkm::UInt8 Id = vtkm::idname; \
}; \
namespace internal \
{ \
template <> \
struct CellShapeTagCheck<vtkm::CellShapeTag##name> : std::true_type \
{ \
}; \
template <> \
struct CellShapeTagVtkmToVtkc<vtkm::CellShapeTag##name> \
{ \
using Type = lcl::name; \
}; \
} \
static inline VTKM_EXEC_CONT const char* GetCellShapeName(vtkm::CellShapeTag##name) \
{ \
return #name; \
} \
template <> \
struct CellShapeIdToTag<vtkm::idname> \
{ \
using valid = std::true_type; \
using Tag = vtkm::CellShapeTag##name; \
#define VTKM_DEFINE_CELL_TAG(name, idname) \
struct CellShapeTag##name \
{ \
static constexpr vtkm::UInt8 Id = vtkm::idname; \
}; \
namespace internal \
{ \
template <> \
struct CellShapeTagCheck<vtkm::CellShapeTag##name> : std::true_type \
{ \
}; \
template <> \
struct CellShapeTagVtkmToVtkc<vtkm::CellShapeTag##name> \
{ \
using Type = lcl::name; \
}; \
} \
static inline VTKM_EXEC_CONT const char* GetCellShapeName(vtkm::CellShapeTag##name) \
{ \
return #name; \
} \
template <> \
struct CellShapeIdToTag<vtkm::idname> \
{ \
using valid = std::true_type; \
using Tag = vtkm::CellShapeTag##name; \
}
VTKM_DEFINE_CELL_TAG(Empty, CELL_SHAPE_EMPTY);
@ -189,12 +189,12 @@ inline lcl::Cell make_LclCellShapeTag(const vtkm::CellShapeTagGeneric& tag,
} // namespace internal
#define vtkmGenericCellShapeMacroCase(cellShapeId, call) \
case vtkm::cellShapeId: \
{ \
using CellShapeTag = vtkm::CellShapeIdToTag<vtkm::cellShapeId>::Tag; \
call; \
} \
#define vtkmGenericCellShapeMacroCase(cellShapeId, call) \
case vtkm::cellShapeId: \
{ \
using CellShapeTag = vtkm::CellShapeIdToTag<vtkm::cellShapeId>::Tag; \
call; \
} \
break
/// \brief A macro used in a \c switch statement to determine cell shape.
@ -227,17 +227,17 @@ inline lcl::Cell make_LclCellShapeTag(const vtkm::CellShapeTagGeneric& tag,
/// Note that \c vtkmGenericCellShapeMacro does not have a default case. You
/// should consider adding one that gives a
///
#define vtkmGenericCellShapeMacro(call) \
vtkmGenericCellShapeMacroCase(CELL_SHAPE_EMPTY, call); \
vtkmGenericCellShapeMacroCase(CELL_SHAPE_VERTEX, call); \
vtkmGenericCellShapeMacroCase(CELL_SHAPE_LINE, call); \
vtkmGenericCellShapeMacroCase(CELL_SHAPE_POLY_LINE, call); \
vtkmGenericCellShapeMacroCase(CELL_SHAPE_TRIANGLE, call); \
vtkmGenericCellShapeMacroCase(CELL_SHAPE_POLYGON, call); \
vtkmGenericCellShapeMacroCase(CELL_SHAPE_QUAD, call); \
vtkmGenericCellShapeMacroCase(CELL_SHAPE_TETRA, call); \
vtkmGenericCellShapeMacroCase(CELL_SHAPE_HEXAHEDRON, call); \
vtkmGenericCellShapeMacroCase(CELL_SHAPE_WEDGE, call); \
#define vtkmGenericCellShapeMacro(call) \
vtkmGenericCellShapeMacroCase(CELL_SHAPE_EMPTY, call); \
vtkmGenericCellShapeMacroCase(CELL_SHAPE_VERTEX, call); \
vtkmGenericCellShapeMacroCase(CELL_SHAPE_LINE, call); \
vtkmGenericCellShapeMacroCase(CELL_SHAPE_POLY_LINE, call); \
vtkmGenericCellShapeMacroCase(CELL_SHAPE_TRIANGLE, call); \
vtkmGenericCellShapeMacroCase(CELL_SHAPE_POLYGON, call); \
vtkmGenericCellShapeMacroCase(CELL_SHAPE_QUAD, call); \
vtkmGenericCellShapeMacroCase(CELL_SHAPE_TETRA, call); \
vtkmGenericCellShapeMacroCase(CELL_SHAPE_HEXAHEDRON, call); \
vtkmGenericCellShapeMacroCase(CELL_SHAPE_WEDGE, call); \
vtkmGenericCellShapeMacroCase(CELL_SHAPE_PYRAMID, call)
} // namespace vtkm

@ -81,23 +81,23 @@ struct CellTraits
// Define traits for every cell type.
#define VTKM_DEFINE_CELL_TRAITS(name, dimensions, numPoints) \
template <> \
struct CellTraits<vtkm::CellShapeTag##name> \
{ \
static constexpr vtkm::IdComponent TOPOLOGICAL_DIMENSIONS = dimensions; \
using TopologicalDimensionsTag = vtkm::CellTopologicalDimensionsTag<TOPOLOGICAL_DIMENSIONS>; \
using IsSizeFixed = vtkm::CellTraitsTagSizeFixed; \
static constexpr vtkm::IdComponent NUM_POINTS = numPoints; \
#define VTKM_DEFINE_CELL_TRAITS(name, dimensions, numPoints) \
template <> \
struct CellTraits<vtkm::CellShapeTag##name> \
{ \
static constexpr vtkm::IdComponent TOPOLOGICAL_DIMENSIONS = dimensions; \
using TopologicalDimensionsTag = vtkm::CellTopologicalDimensionsTag<TOPOLOGICAL_DIMENSIONS>; \
using IsSizeFixed = vtkm::CellTraitsTagSizeFixed; \
static constexpr vtkm::IdComponent NUM_POINTS = numPoints; \
}
#define VTKM_DEFINE_CELL_TRAITS_VARIABLE(name, dimensions) \
template <> \
struct CellTraits<vtkm::CellShapeTag##name> \
{ \
static constexpr vtkm::IdComponent TOPOLOGICAL_DIMENSIONS = dimensions; \
using TopologicalDimensionsTag = vtkm::CellTopologicalDimensionsTag<TOPOLOGICAL_DIMENSIONS>; \
using IsSizeFixed = vtkm::CellTraitsTagSizeVariable; \
#define VTKM_DEFINE_CELL_TRAITS_VARIABLE(name, dimensions) \
template <> \
struct CellTraits<vtkm::CellShapeTag##name> \
{ \
static constexpr vtkm::IdComponent TOPOLOGICAL_DIMENSIONS = dimensions; \
using TopologicalDimensionsTag = vtkm::CellTopologicalDimensionsTag<TOPOLOGICAL_DIMENSIONS>; \
using IsSizeFixed = vtkm::CellTraitsTagSizeVariable; \
}
VTKM_DEFINE_CELL_TRAITS(Empty, 0, 0);

@ -13,9 +13,9 @@
#include <vtkm/StaticAssert.h>
#include <vtkm/Types.h>
#define VTK_M_DEPRECATED_MAKE_MESSAGE(...) \
#define VTK_M_DEPRECATED_MAKE_MESSAGE(...) \
VTKM_EXPAND(VTK_M_DEPRECATED_MAKE_MESSAGE_IMPL(__VA_ARGS__, "", vtkm::internal::NullType{}))
#define VTK_M_DEPRECATED_MAKE_MESSAGE_IMPL(version, message, ...) \
#define VTK_M_DEPRECATED_MAKE_MESSAGE_IMPL(version, message, ...) \
message " Deprecated in version " #version "."
/// \def VTKM_DEPRECATED(version, message)
@ -104,7 +104,7 @@
#if defined(VTKM_GCC) || defined(VTKM_CLANG)
#define VTKM_DEPRECATED_SUPPRESS_SUPPORTED
#define VTKM_DEPRECATED_SUPPRESS_BEGIN \
#define VTKM_DEPRECATED_SUPPRESS_BEGIN \
_Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
#define VTKM_DEPRECATED_SUPPRESS_END _Pragma("GCC diagnostic pop")

@ -108,14 +108,14 @@ VTKM_EXEC_CONT inline vtkm::ErrorCode LclErrorToVtkmError(lcl::ErrorCode code) n
} // namespace vtkm
#define VTKM_RETURN_ON_ERROR(call) \
do \
{ \
auto status = (call); \
if (status != ::vtkm::ErrorCode::Success) \
{ \
return status; \
} \
#define VTKM_RETURN_ON_ERROR(call) \
do \
{ \
auto status = (call); \
if (status != ::vtkm::ErrorCode::Success) \
{ \
return status; \
} \
} while (false)
#endif //vtk_m_exec_ErrorCode_h

@ -57,8 +57,8 @@ using IsList = typename vtkm::internal::IsListImpl<T>::type;
/// actually a device adapter tag. (You can get weird errors elsewhere in the
/// code when a mistake is made.)
///
#define VTKM_IS_LIST(type) \
VTKM_STATIC_ASSERT_MSG((::vtkm::internal::IsList<type>::value), \
#define VTKM_IS_LIST(type) \
VTKM_STATIC_ASSERT_MSG((::vtkm::internal::IsList<type>::value), \
"Provided type is not a valid VTK-m list type.")
namespace detail
@ -226,8 +226,7 @@ template <vtkm::IdComponent NumSearched,
typename... Ts>
struct FindFirstOfType<NumSearched, Target, T0, T1, T2, T3, T4, T5, Ts...>
: FindFirstOfSplit4<(std::is_same<Target, T0>::value || std::is_same<Target, T1>::value ||
std::is_same<Target, T2>::value ||
std::is_same<Target, T3>::value),
std::is_same<Target, T2>::value || std::is_same<Target, T3>::value),
NumSearched,
Target,
T0,
@ -257,8 +256,7 @@ template <vtkm::IdComponent NumSearched,
typename... Ts>
struct FindFirstOfSplit8<true, NumSearched, Target, T0, T1, T2, T3, T4, T5, T6, T7, Ts...>
: FindFirstOfSplit4<(std::is_same<Target, T0>::value || std::is_same<Target, T1>::value ||
std::is_same<Target, T2>::value ||
std::is_same<Target, T3>::value),
std::is_same<Target, T2>::value || std::is_same<Target, T3>::value),
NumSearched,
Target,
T0,
@ -305,12 +303,9 @@ template <vtkm::IdComponent NumSearched,
typename... Ts>
struct FindFirstOfType<NumSearched, Target, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, Ts...>
: FindFirstOfSplit8<(std::is_same<Target, T0>::value || std::is_same<Target, T1>::value ||
std::is_same<Target, T2>::value ||
std::is_same<Target, T3>::value ||
std::is_same<Target, T4>::value ||
std::is_same<Target, T5>::value ||
std::is_same<Target, T6>::value ||
std::is_same<Target, T7>::value),
std::is_same<Target, T2>::value || std::is_same<Target, T3>::value ||
std::is_same<Target, T4>::value || std::is_same<Target, T5>::value ||
std::is_same<Target, T6>::value || std::is_same<Target, T7>::value),
NumSearched,
Target,
T0,

@ -103,8 +103,8 @@ struct VTKM_DEPRECATED(1.6, "VTKM_IS_LIST_TAG replaced with VTKM_IS_LIST.") List
/// actually a device adapter tag. (You can get weird errors elsewhere in the
/// code when a mistake is made.)
///
#define VTKM_IS_LIST_TAG(tag) \
VTKM_STATIC_ASSERT_MSG((::vtkm::detail::ListTagAssert<tag>::value), \
#define VTKM_IS_LIST_TAG(tag) \
VTKM_STATIC_ASSERT_MSG((::vtkm::detail::ListTagAssert<tag>::value), \
"Provided type is not a valid VTK-m list tag.")
namespace internal

@ -13,7 +13,7 @@
#include <type_traits>
#define VTKM_STATIC_ASSERT(condition) \
#define VTKM_STATIC_ASSERT(condition) \
static_assert((condition), "Failed static assert: " #condition)
#define VTKM_STATIC_ASSERT_MSG(condition, message) static_assert((condition), message)
@ -30,7 +30,7 @@ struct ReadTheSourceCodeHereForHelpOnThisError<true> : std::true_type
} // namespace vtkm
#define VTKM_READ_THE_SOURCE_CODE_FOR_HELP(noError) \
#define VTKM_READ_THE_SOURCE_CODE_FOR_HELP(noError) \
VTKM_STATIC_ASSERT(vtkm::ReadTheSourceCodeHereForHelpOnThisError<noError>::value)
#endif //vtk_m_StaticAssert_h

@ -89,8 +89,8 @@ struct TopologyElementTagCheck<vtkm::TopologyElementTagFace> : std::true_type
{
};
#define VTKM_IS_TOPOLOGY_ELEMENT_TAG(type) \
static_assert(::vtkm::internal::TopologyElementTagCheck<type>::value, \
#define VTKM_IS_TOPOLOGY_ELEMENT_TAG(type) \
static_assert(::vtkm::internal::TopologyElementTagCheck<type>::value, \
"Invalid Topology Element Tag being used")
} // namespace internal

@ -82,26 +82,26 @@ struct TypeTraits<const T> : TypeTraits<T>
{
};
#define VTKM_BASIC_REAL_TYPE(T) \
template <> \
struct TypeTraits<T> \
{ \
using NumericTag = TypeTraitsRealTag; \
using DimensionalityTag = TypeTraitsScalarTag; \
VTKM_EXEC_CONT static T ZeroInitialization() { return T(); } \
#define VTKM_BASIC_REAL_TYPE(T) \
template <> \
struct TypeTraits<T> \
{ \
using NumericTag = TypeTraitsRealTag; \
using DimensionalityTag = TypeTraitsScalarTag; \
VTKM_EXEC_CONT static T ZeroInitialization() { return T(); } \
};
#define VTKM_BASIC_INTEGER_TYPE(T) \
template <> \
struct TypeTraits<T> \
{ \
using NumericTag = TypeTraitsIntegerTag; \
using DimensionalityTag = TypeTraitsScalarTag; \
VTKM_EXEC_CONT static T ZeroInitialization() \
{ \
using ReturnType = T; \
return ReturnType(); \
} \
#define VTKM_BASIC_INTEGER_TYPE(T) \
template <> \
struct TypeTraits<T> \
{ \
using NumericTag = TypeTraitsIntegerTag; \
using DimensionalityTag = TypeTraitsScalarTag; \
VTKM_EXEC_CONT static T ZeroInitialization() \
{ \
using ReturnType = T; \
return ReturnType(); \
} \
};
/// Traits for basic C++ types.

@ -1558,11 +1558,11 @@ static inline VTKM_EXEC_CONT typename detail::DotType<T>::type Dot(const vtkm::V
}
// Integer types of a width less than an integer get implicitly casted to
// an integer when doing a multiplication.
#define VTK_M_SCALAR_DOT(stype) \
static inline VTKM_EXEC_CONT detail::DotType<stype>::type dot(stype a, stype b) \
{ \
return a * b; \
} /* LEGACY */ \
#define VTK_M_SCALAR_DOT(stype) \
static inline VTKM_EXEC_CONT detail::DotType<stype>::type dot(stype a, stype b) \
{ \
return a * b; \
} /* LEGACY */ \
static inline VTKM_EXEC_CONT detail::DotType<stype>::type Dot(stype a, stype b) { return a * b; }
VTK_M_SCALAR_DOT(vtkm::Int8)
VTK_M_SCALAR_DOT(vtkm::UInt8)

@ -556,13 +556,13 @@ struct VTKM_NEVER_EXPORT VecTraits<vtkm::Pair<T, U>>
} // anonymous namespace
#define VTKM_BASIC_TYPE_VECTOR(type) \
namespace vtkm \
{ \
template <> \
struct VTKM_NEVER_EXPORT VecTraits<type> : public vtkm::internal::VecTraitsBasic<type> \
{ \
}; \
#define VTKM_BASIC_TYPE_VECTOR(type) \
namespace vtkm \
{ \
template <> \
struct VTKM_NEVER_EXPORT VecTraits<type> : public vtkm::internal::VecTraitsBasic<type> \
{ \
}; \
}
/// Allows you to treat basic types as if they were vectors.

@ -101,8 +101,7 @@ VTKM_CONT void ArrayGetValues(const vtkm::cont::ArrayHandle<vtkm::Id, SIds>& ids
{ // Retry on any device if the first attempt failed.
VTKM_LOG_S(vtkm::cont::LogLevel::Error,
"Failed to run ArrayGetValues on device '"
<< devId.GetName()
<< "'. Falling back to control-side copy.");
<< devId.GetName() << "'. Falling back to control-side copy.");
copyComplete = vtkm::cont::Algorithm::Copy(vtkm::cont::DeviceAdapterTagAny{}, input, output);
}
}

@ -135,7 +135,7 @@ struct ArrayHandleCheck
using type = typename std::is_base_of<::vtkm::cont::internal::ArrayHandleBase, U>::type;
};
#define VTKM_IS_ARRAY_HANDLE(T) \
#define VTKM_IS_ARRAY_HANDLE(T) \
VTKM_STATIC_ASSERT(::vtkm::cont::internal::ArrayHandleCheck<T>::type::value)
} // namespace internal
@ -173,7 +173,10 @@ struct GetTypeInParentheses<void(T)>
} \
\
VTKM_CONT \
classname(Thisclass&& src) noexcept : Superclass(std::move(src)) {} \
classname(Thisclass&& src) noexcept \
: Superclass(std::move(src)) \
{ \
} \
\
VTKM_CONT \
classname(const vtkm::cont::ArrayHandle<typename__ Superclass::ValueType, \
@ -227,7 +230,7 @@ struct GetTypeInParentheses<void(T)>
/// templated. For ArrayHandle sublcasses that are not templates, use
/// VTKM_ARRAY_HANDLE_SUBCLASS_NT.
///
#define VTKM_ARRAY_HANDLE_SUBCLASS(classname, fullclasstype, superclass) \
#define VTKM_ARRAY_HANDLE_SUBCLASS(classname, fullclasstype, superclass) \
VTK_M_ARRAY_HANDLE_SUBCLASS_IMPL(classname, fullclasstype, superclass, typename)
/// \brief Macro to make default methods in ArrayHandle subclasses.
@ -250,7 +253,7 @@ struct GetTypeInParentheses<void(T)>
/// templated. For ArrayHandle sublcasses that are templates, use
/// VTKM_ARRAY_HANDLE_SUBCLASS.
///
#define VTKM_ARRAY_HANDLE_SUBCLASS_NT(classname, superclass) \
#define VTKM_ARRAY_HANDLE_SUBCLASS_NT(classname, superclass) \
VTK_M_ARRAY_HANDLE_SUBCLASS_IMPL(classname, (classname), superclass, )
/// \brief Manages an array-worth of data.

@ -37,10 +37,10 @@ vtkm::BufferSizeType NumberOfBytes(vtkm::Id numValues, std::size_t typeSize)
} // namespace detail
#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>; \
#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)
@ -59,10 +59,10 @@ VTKM_STORAGE_INSTANTIATE(vtkm::Float64)
} // namespace internal
#define VTKM_ARRAYHANDLE_INSTANTIATE(Type) \
template class VTKM_CONT_EXPORT ArrayHandleNewStyle<Type, StorageTagBasic>; \
template class VTKM_CONT_EXPORT ArrayHandleNewStyle<vtkm::Vec<Type, 2>, StorageTagBasic>; \
template class VTKM_CONT_EXPORT ArrayHandleNewStyle<vtkm::Vec<Type, 3>, StorageTagBasic>; \
#define VTKM_ARRAYHANDLE_INSTANTIATE(Type) \
template class VTKM_CONT_EXPORT ArrayHandleNewStyle<Type, StorageTagBasic>; \
template class VTKM_CONT_EXPORT ArrayHandleNewStyle<vtkm::Vec<Type, 2>, StorageTagBasic>; \
template class VTKM_CONT_EXPORT ArrayHandleNewStyle<vtkm::Vec<Type, 3>, StorageTagBasic>; \
template class VTKM_CONT_EXPORT ArrayHandleNewStyle<vtkm::Vec<Type, 4>, StorageTagBasic>;
VTKM_ARRAYHANDLE_INSTANTIATE(char)

@ -434,10 +434,10 @@ namespace internal
/// \cond
/// Make doxygen ignore this section
#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>; \
#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)
@ -457,13 +457,13 @@ VTKM_STORAGE_EXPORT(vtkm::Float64)
} // namespace internal
#define VTKM_ARRAYHANDLE_EXPORT(Type) \
extern template class VTKM_CONT_TEMPLATE_EXPORT ArrayHandleNewStyle<Type, StorageTagBasic>; \
extern template class VTKM_CONT_TEMPLATE_EXPORT \
ArrayHandleNewStyle<vtkm::Vec<Type, 2>, StorageTagBasic>; \
extern template class VTKM_CONT_TEMPLATE_EXPORT \
ArrayHandleNewStyle<vtkm::Vec<Type, 3>, StorageTagBasic>; \
extern template class VTKM_CONT_TEMPLATE_EXPORT \
#define VTKM_ARRAYHANDLE_EXPORT(Type) \
extern template class VTKM_CONT_TEMPLATE_EXPORT ArrayHandleNewStyle<Type, StorageTagBasic>; \
extern template class VTKM_CONT_TEMPLATE_EXPORT \
ArrayHandleNewStyle<vtkm::Vec<Type, 2>, StorageTagBasic>; \
extern template class VTKM_CONT_TEMPLATE_EXPORT \
ArrayHandleNewStyle<vtkm::Vec<Type, 3>, StorageTagBasic>; \
extern template class VTKM_CONT_TEMPLATE_EXPORT \
ArrayHandleNewStyle<vtkm::Vec<Type, 4>, StorageTagBasic>;
VTKM_ARRAYHANDLE_EXPORT(char)

@ -29,10 +29,16 @@ public:
using ValueType = bool;
VTKM_EXEC_CONT
explicit ArrayPortalBitField(const BitPortalType& portal) noexcept : BitPortal{ portal } {}
explicit ArrayPortalBitField(const BitPortalType& portal) noexcept
: BitPortal{ portal }
{
}
VTKM_EXEC_CONT
explicit ArrayPortalBitField(BitPortalType&& portal) noexcept : BitPortal{ std::move(portal) } {}
explicit ArrayPortalBitField(BitPortalType&& portal) noexcept
: BitPortal{ std::move(portal) }
{
}
ArrayPortalBitField() noexcept = default;
ArrayPortalBitField(const ArrayPortalBitField&) noexcept = default;
@ -78,7 +84,10 @@ public:
{
}
explicit VTKM_CONT Storage(vtkm::cont::BitField&& data) noexcept : Data{ std::move(data) } {}
explicit VTKM_CONT Storage(vtkm::cont::BitField&& data) noexcept
: Data{ std::move(data) }
{
}
VTKM_CONT Storage() = default;
VTKM_CONT Storage(const Storage&) = default;

@ -135,14 +135,11 @@ struct Storage<TargetT, vtkm::cont::StorageTagCast<SourceT, SourceStorage>>
template <typename TargetT, typename SourceT, typename SourceStorage, typename Device>
struct ArrayTransfer<TargetT, vtkm::cont::StorageTagCast<SourceT, SourceStorage>, Device>
: detail::ArrayHandleCastTraits<TargetT,
SourceT,
SourceStorage>::template ArrayTransferSuperclass<Device>
: detail::ArrayHandleCastTraits<TargetT, SourceT, SourceStorage>::
template ArrayTransferSuperclass<Device>
{
using Superclass =
typename detail::ArrayHandleCastTraits<TargetT,
SourceT,
SourceStorage>::template ArrayTransferSuperclass<Device>;
using Superclass = typename detail::ArrayHandleCastTraits<TargetT, SourceT, SourceStorage>::
template ArrayTransferSuperclass<Device>;
using Superclass::Superclass;
};

@ -500,9 +500,9 @@ public:
using PortalControl = typename StorageType::PortalType;
using PortalConstControl = typename StorageType::PortalConstType;
using PortalExecution = ArrayPortalCompositeVector<
typename vtkm::cont::ArrayHandle<T,
StorageTags>::template ExecutionTypes<DeviceTag>::Portal...>;
using PortalExecution =
ArrayPortalCompositeVector<typename vtkm::cont::ArrayHandle<T, StorageTags>::
template ExecutionTypes<DeviceTag>::Portal...>;
using PortalConstExecution =
ArrayPortalCompositeVector<typename vtkm::cont::ArrayHandle<T, StorageTags>::
template ExecutionTypes<DeviceTag>::PortalConst...>;

@ -483,10 +483,10 @@ struct DecoratorStorageTraits
}
// Static dispatch for calling AllocateSourceArrays on supported implementations:
VTKM_CONT[[noreturn]] static void CallAllocate(std::false_type,
const DecoratorImplT&,
vtkm::Id,
ArrayTs&...)
VTKM_CONT [[noreturn]] static void CallAllocate(std::false_type,
const DecoratorImplT&,
vtkm::Id,
ArrayTs&...)
{
throw vtkm::cont::ErrorBadType("Allocate not supported by this ArrayHandleDecorator.");
}
@ -500,10 +500,10 @@ struct DecoratorStorageTraits
}
// Static dispatch for calling ShrinkSourceArrays on supported implementations.
VTKM_CONT[[noreturn]] static void CallShrink(std::false_type,
const DecoratorImplT&,
vtkm::Id,
ArrayTs&...)
VTKM_CONT [[noreturn]] static void CallShrink(std::false_type,
const DecoratorImplT&,
vtkm::Id,
ArrayTs&...)
{
throw vtkm::cont::ErrorBadType("Shrink not supported by this ArrayHandleDecorator.");
}

@ -101,7 +101,8 @@ struct ArrayPortalMultiplexer
ArrayPortalMultiplexer& operator=(const ArrayPortalMultiplexer&) = default;
template <typename Portal>
VTKM_EXEC_CONT ArrayPortalMultiplexer(const Portal& src) noexcept : PortalVariant(src)
VTKM_EXEC_CONT ArrayPortalMultiplexer(const Portal& src) noexcept
: PortalVariant(src)
{
}

@ -16,10 +16,10 @@ namespace vtkm
namespace cont
{
#define VTKM_ARRAYHANDLE_SOA_INSTANTIATE(Type) \
template class VTKM_CONT_EXPORT ArrayHandle<Type, StorageTagSOA>; \
template class VTKM_CONT_EXPORT ArrayHandle<vtkm::Vec<Type, 2>, StorageTagSOA>; \
template class VTKM_CONT_EXPORT ArrayHandle<vtkm::Vec<Type, 3>, StorageTagSOA>; \
#define VTKM_ARRAYHANDLE_SOA_INSTANTIATE(Type) \
template class VTKM_CONT_EXPORT ArrayHandle<Type, StorageTagSOA>; \
template class VTKM_CONT_EXPORT ArrayHandle<vtkm::Vec<Type, 2>, StorageTagSOA>; \
template class VTKM_CONT_EXPORT ArrayHandle<vtkm::Vec<Type, 3>, StorageTagSOA>; \
template class VTKM_CONT_EXPORT ArrayHandle<vtkm::Vec<Type, 4>, StorageTagSOA>;
VTKM_ARRAYHANDLE_SOA_INSTANTIATE(char)

@ -183,13 +183,10 @@ struct ArrayHandleSOATraits
using IsTrueVec = std::integral_constant<bool, (NUM_COMPONENTS > 1)>;
using PortalControl = typename detail::SOAPortalChooser<ValueType,
typename BaseArrayType::WritePortalType,
IsTrueVec>::Type;
using PortalConstControl =
typename detail::SOAPortalChooser<ValueType,
typename BaseArrayType::ReadPortalType,
IsTrueVec>::Type;
using PortalControl = typename detail::
SOAPortalChooser<ValueType, typename BaseArrayType::WritePortalType, IsTrueVec>::Type;
using PortalConstControl = typename detail::
SOAPortalChooser<ValueType, typename BaseArrayType::ReadPortalType, IsTrueVec>::Type;
template <typename Device>
using PortalExecution = typename detail::SOAPortalChooser<
@ -778,10 +775,10 @@ namespace vtkm
namespace cont
{
#define VTKM_ARRAYHANDLE_SOA_EXPORT(Type) \
extern template class VTKM_CONT_TEMPLATE_EXPORT ArrayHandle<Type, StorageTagSOA>; \
extern template class VTKM_CONT_TEMPLATE_EXPORT ArrayHandle<vtkm::Vec<Type, 2>, StorageTagSOA>; \
extern template class VTKM_CONT_TEMPLATE_EXPORT ArrayHandle<vtkm::Vec<Type, 3>, StorageTagSOA>; \
#define VTKM_ARRAYHANDLE_SOA_EXPORT(Type) \
extern template class VTKM_CONT_TEMPLATE_EXPORT ArrayHandle<Type, StorageTagSOA>; \
extern template class VTKM_CONT_TEMPLATE_EXPORT ArrayHandle<vtkm::Vec<Type, 2>, StorageTagSOA>; \
extern template class VTKM_CONT_TEMPLATE_EXPORT ArrayHandle<vtkm::Vec<Type, 3>, StorageTagSOA>; \
extern template class VTKM_CONT_TEMPLATE_EXPORT ArrayHandle<vtkm::Vec<Type, 4>, StorageTagSOA>;
VTKM_ARRAYHANDLE_SOA_EXPORT(char)

@ -15,14 +15,14 @@ namespace vtkm
namespace cont
{
#define VTK_M_ARRAY_HANDLE_VIRTUAL_INSTANTIATE(T) \
template class VTKM_CONT_EXPORT ArrayHandle<T, StorageTagVirtual>; \
template class VTKM_CONT_EXPORT ArrayHandleVirtual<T>; \
template class VTKM_CONT_EXPORT ArrayHandle<vtkm::Vec<T, 2>, StorageTagVirtual>; \
template class VTKM_CONT_EXPORT ArrayHandleVirtual<vtkm::Vec<T, 2>>; \
template class VTKM_CONT_EXPORT ArrayHandle<vtkm::Vec<T, 3>, StorageTagVirtual>; \
template class VTKM_CONT_EXPORT ArrayHandleVirtual<vtkm::Vec<T, 3>>; \
template class VTKM_CONT_EXPORT ArrayHandle<vtkm::Vec<T, 4>, StorageTagVirtual>; \
#define VTK_M_ARRAY_HANDLE_VIRTUAL_INSTANTIATE(T) \
template class VTKM_CONT_EXPORT ArrayHandle<T, StorageTagVirtual>; \
template class VTKM_CONT_EXPORT ArrayHandleVirtual<T>; \
template class VTKM_CONT_EXPORT ArrayHandle<vtkm::Vec<T, 2>, StorageTagVirtual>; \
template class VTKM_CONT_EXPORT ArrayHandleVirtual<vtkm::Vec<T, 2>>; \
template class VTKM_CONT_EXPORT ArrayHandle<vtkm::Vec<T, 3>, StorageTagVirtual>; \
template class VTKM_CONT_EXPORT ArrayHandleVirtual<vtkm::Vec<T, 3>>; \
template class VTKM_CONT_EXPORT ArrayHandle<vtkm::Vec<T, 4>, StorageTagVirtual>; \
template class VTKM_CONT_EXPORT ArrayHandleVirtual<vtkm::Vec<T, 4>>
VTK_M_ARRAY_HANDLE_VIRTUAL_INSTANTIATE(char);

@ -20,22 +20,22 @@ void ThrowArrayRangeComputeFailed()
throw vtkm::cont::ErrorExecution("Failed to run ArrayRangeComputation on any device.");
}
#define VTKM_ARRAY_RANGE_COMPUTE_IMPL_T(T, Storage) \
VTKM_CONT \
vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute( \
const vtkm::cont::ArrayHandle<T, Storage>& input, vtkm::cont::DeviceAdapterId device) \
{ \
return detail::ArrayRangeComputeImpl(input, device); \
} \
#define VTKM_ARRAY_RANGE_COMPUTE_IMPL_T(T, Storage) \
VTKM_CONT \
vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute( \
const vtkm::cont::ArrayHandle<T, Storage>& input, vtkm::cont::DeviceAdapterId device) \
{ \
return detail::ArrayRangeComputeImpl(input, device); \
} \
struct SwallowSemicolon
#define VTKM_ARRAY_RANGE_COMPUTE_IMPL_VEC(T, N, Storage) \
VTKM_CONT \
vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute( \
const vtkm::cont::ArrayHandle<vtkm::Vec<T, N>, Storage>& input, \
vtkm::cont::DeviceAdapterId device) \
{ \
return detail::ArrayRangeComputeImpl(input, device); \
} \
#define VTKM_ARRAY_RANGE_COMPUTE_IMPL_VEC(T, N, Storage) \
VTKM_CONT \
vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute( \
const vtkm::cont::ArrayHandle<vtkm::Vec<T, N>, Storage>& input, \
vtkm::cont::DeviceAdapterId device) \
{ \
return detail::ArrayRangeComputeImpl(input, device); \
} \
struct SwallowSemicolon
VTKM_ARRAY_RANGE_COMPUTE_IMPL_T(char, vtkm::cont::StorageTagBasic);

@ -43,17 +43,17 @@ VTKM_CONT vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute(
vtkm::cont::DeviceAdapterId device = vtkm::cont::DeviceAdapterTagAny());
// Precompiled versions of ArrayRangeCompute
#define VTK_M_ARRAY_RANGE_COMPUTE_EXPORT_T(T, Storage) \
VTKM_CONT_EXPORT \
VTKM_CONT \
vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute( \
const vtkm::cont::ArrayHandle<T, Storage>& input, \
#define VTK_M_ARRAY_RANGE_COMPUTE_EXPORT_T(T, Storage) \
VTKM_CONT_EXPORT \
VTKM_CONT \
vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute( \
const vtkm::cont::ArrayHandle<T, Storage>& input, \
vtkm::cont::DeviceAdapterId device = vtkm::cont::DeviceAdapterTagAny())
#define VTK_M_ARRAY_RANGE_COMPUTE_EXPORT_VEC(T, N, Storage) \
VTKM_CONT_EXPORT \
VTKM_CONT \
vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute( \
const vtkm::cont::ArrayHandle<vtkm::Vec<T, N>, Storage>& input, \
#define VTK_M_ARRAY_RANGE_COMPUTE_EXPORT_VEC(T, N, Storage) \
VTKM_CONT_EXPORT \
VTKM_CONT \
vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute( \
const vtkm::cont::ArrayHandle<vtkm::Vec<T, N>, Storage>& input, \
vtkm::cont::DeviceAdapterId device = vtkm::cont::DeviceAdapterTagAny())
VTK_M_ARRAY_RANGE_COMPUTE_EXPORT_T(char, vtkm::cont::StorageTagBasic);

@ -50,9 +50,7 @@ AssignerPartitionedDataSet::AssignerPartitionedDataSet(vtkm::Id num_partitions)
}
VTKM_CONT
AssignerPartitionedDataSet::~AssignerPartitionedDataSet()
{
}
AssignerPartitionedDataSet::~AssignerPartitionedDataSet() {}
VTKM_CONT
void AssignerPartitionedDataSet::local_gids(int my_rank, std::vector<int>& gids) const

@ -70,9 +70,10 @@ VTKM_EXEC static BinsBBox ComputeIntersectingBins(const Bounds cellBounds, const
VTKM_EXEC static vtkm::Id GetNumberOfBins(const BinsBBox& binsBBox)
{
return binsBBox.Empty() ? 0 : ((binsBBox.Max[0] - binsBBox.Min[0] + 1) *
(binsBBox.Max[1] - binsBBox.Min[1] + 1) *
(binsBBox.Max[2] - binsBBox.Min[2] + 1));
return binsBBox.Empty()
? 0
: ((binsBBox.Max[0] - binsBBox.Min[0] + 1) * (binsBBox.Max[1] - binsBBox.Min[1] + 1) *
(binsBBox.Max[2] - binsBBox.Min[2] + 1));
}
class BBoxIterator

@ -15,8 +15,6 @@ namespace vtkm
namespace cont
{
CellSet::~CellSet()
{
}
CellSet::~CellSet() {}
}
} // namespace vtkm::cont

@ -131,9 +131,8 @@ class VTKM_ALWAYS_EXPORT CellSetExplicit : public CellSet
struct ConnectivityChooser
{
private:
using Chooser = typename detail::CellSetExplicitConnectivityChooser<Thisclass,
VisitTopology,
IncidentTopology>;
using Chooser = typename detail::
CellSetExplicitConnectivityChooser<Thisclass, VisitTopology, IncidentTopology>;
public:
using ConnectivityType = typename Chooser::ConnectivityType;

@ -64,18 +64,18 @@ CellSetExtrude::CellSetExtrude(const CellSetExtrude& src)
}
CellSetExtrude::CellSetExtrude(CellSetExtrude&& src) noexcept
: CellSet(std::forward<CellSet>(src)),
IsPeriodic(src.IsPeriodic),
NumberOfPointsPerPlane(src.NumberOfPointsPerPlane),
NumberOfCellsPerPlane(src.NumberOfCellsPerPlane),
NumberOfPlanes(src.NumberOfPlanes),
Connectivity(std::move(src.Connectivity)),
NextNode(std::move(src.NextNode)),
ReverseConnectivityBuilt(src.ReverseConnectivityBuilt),
RConnectivity(std::move(src.RConnectivity)),
ROffsets(std::move(src.ROffsets)),
RCounts(std::move(src.RCounts)),
PrevNode(std::move(src.PrevNode))
: CellSet(std::forward<CellSet>(src))
, IsPeriodic(src.IsPeriodic)
, NumberOfPointsPerPlane(src.NumberOfPointsPerPlane)
, NumberOfCellsPerPlane(src.NumberOfCellsPerPlane)
, NumberOfPlanes(src.NumberOfPlanes)
, Connectivity(std::move(src.Connectivity))
, NextNode(std::move(src.NextNode))
, ReverseConnectivityBuilt(src.ReverseConnectivityBuilt)
, RConnectivity(std::move(src.RConnectivity))
, ROffsets(std::move(src.ROffsets))
, RCounts(std::move(src.RCounts))
, PrevNode(std::move(src.PrevNode))
{
}
@ -117,9 +117,7 @@ CellSetExtrude& CellSetExtrude::operator=(CellSetExtrude&& src) noexcept
return *this;
}
CellSetExtrude::~CellSetExtrude()
{
}
CellSetExtrude::~CellSetExtrude() {}
vtkm::Int32 CellSetExtrude::GetNumberOfPlanes() const
{

@ -20,13 +20,13 @@
#include <vtkm/cont/CellSetList.h>
#define VTK_M_OLD_CELL_LIST_DEFINITION(name) \
struct VTKM_ALWAYS_EXPORT VTKM_DEPRECATED( \
1.6, \
"CellSetListTag" #name " replaced by CellSetList" #name ". " \
"Note that the new CellSetList" #name " cannot be subclassed.") CellSetListTag##name \
: vtkm::internal::ListAsListTag<CellSetList##name> \
{ \
#define VTK_M_OLD_CELL_LIST_DEFINITION(name) \
struct VTKM_ALWAYS_EXPORT VTKM_DEPRECATED( \
1.6, \
"CellSetListTag" #name " replaced by CellSetList" #name ". " \
"Note that the new CellSetList" #name " cannot be subclassed.") CellSetListTag##name \
: vtkm::internal::ListAsListTag<CellSetList##name> \
{ \
}
namespace vtkm

@ -172,9 +172,8 @@ private:
public:
using ConnectivityArrays = vtkm::cont::internal::RConnBuilderInputData<ConnectivityStorageTag,
OffsetsStorageTag,
NumIndicesStorageTag>;
using ConnectivityArrays = vtkm::cont::internal::
RConnBuilderInputData<ConnectivityStorageTag, OffsetsStorageTag, NumIndicesStorageTag>;
template <typename Device>
static ConnectivityArrays Get(const CellSetPermutationType& cellset, Device)

@ -61,10 +61,11 @@ public:
}
VTKM_CONT
CellSetSingleType(Thisclass&& src) noexcept : Superclass(std::forward<Superclass>(src)),
ExpectedNumberOfCellsAdded(-1),
CellShapeAsId(src.CellShapeAsId),
NumberOfPointsPerCell(src.NumberOfPointsPerCell)
CellSetSingleType(Thisclass&& src) noexcept
: Superclass(std::forward<Superclass>(src))
, ExpectedNumberOfCellsAdded(-1)
, CellShapeAsId(src.CellShapeAsId)
, NumberOfPointsPerCell(src.NumberOfPointsPerCell)
{
}

@ -150,8 +150,9 @@ public:
return *this;
}
CellSetStructured(CellSetStructured&& src) noexcept : CellSet(),
Structure(std::move(src.Structure))
CellSetStructured(CellSetStructured&& src) noexcept
: CellSet()
, Structure(std::move(src.Structure))
{
}

@ -26,13 +26,12 @@ typename CellSetStructured<DIMENSION>::SchedulingRangeType
template <vtkm::IdComponent DIMENSION>
template <typename DeviceAdapter, typename VisitTopology, typename IncidentTopology>
typename CellSetStructured<DIMENSION>::template ExecutionTypes<DeviceAdapter,
VisitTopology,
IncidentTopology>::ExecObjectType
CellSetStructured<DIMENSION>::PrepareForInput(DeviceAdapter,
VisitTopology,
IncidentTopology,
vtkm::cont::Token&) const
typename CellSetStructured<DIMENSION>::
template ExecutionTypes<DeviceAdapter, VisitTopology, IncidentTopology>::ExecObjectType
CellSetStructured<DIMENSION>::PrepareForInput(DeviceAdapter,
VisitTopology,
IncidentTopology,
vtkm::cont::Token&) const
{
using ConnectivityType =
typename ExecutionTypes<DeviceAdapter, VisitTopology, IncidentTopology>::ExecObjectType;

@ -110,9 +110,7 @@ ColorTable::ColorTable(const std::string& name,
}
//----------------------------------------------------------------------------
ColorTable::~ColorTable()
{
}
ColorTable::~ColorTable() {}
//----------------------------------------------------------------------------
const std::string& ColorTable::GetName() const

@ -16,9 +16,7 @@ namespace cont
{
VTKM_CONT
DataSetBuilderExplicitIterative::DataSetBuilderExplicitIterative()
{
}
DataSetBuilderExplicitIterative::DataSetBuilderExplicitIterative() {}
VTKM_CONT

@ -16,8 +16,6 @@ namespace cont
{
VTKM_CONT
DataSetBuilderRectilinear::DataSetBuilderRectilinear()
{
}
DataSetBuilderRectilinear::DataSetBuilderRectilinear() {}
}
} // end namespace vtkm::cont

@ -16,9 +16,7 @@ namespace cont
{
VTKM_CONT
DataSetBuilderUniform::DataSetBuilderUniform()
{
}
DataSetBuilderUniform::DataSetBuilderUniform() {}
VTKM_CONT
vtkm::cont::DataSet DataSetBuilderUniform::Create(const vtkm::Id& dimension,

@ -104,49 +104,49 @@ struct DeviceAdapterTraits;
/// Creates a tag named vtkm::cont::DeviceAdapterTagName and associated MPL
/// structures to use this tag. Always use this macro (in the base namespace)
/// when creating a device adapter.
#define VTKM_VALID_DEVICE_ADAPTER(Name, Id) \
namespace vtkm \
{ \
namespace cont \
{ \
struct VTKM_ALWAYS_EXPORT DeviceAdapterTag##Name : DeviceAdapterId \
{ \
constexpr DeviceAdapterTag##Name() \
: DeviceAdapterId(Id) \
{ \
} \
static constexpr bool IsEnabled = true; \
}; \
template <> \
struct DeviceAdapterTraits<vtkm::cont::DeviceAdapterTag##Name> \
{ \
static DeviceAdapterNameType GetName() { return DeviceAdapterNameType(#Name); } \
}; \
} \
#define VTKM_VALID_DEVICE_ADAPTER(Name, Id) \
namespace vtkm \
{ \
namespace cont \
{ \
struct VTKM_ALWAYS_EXPORT DeviceAdapterTag##Name : DeviceAdapterId \
{ \
constexpr DeviceAdapterTag##Name() \
: DeviceAdapterId(Id) \
{ \
} \
static constexpr bool IsEnabled = true; \
}; \
template <> \
struct DeviceAdapterTraits<vtkm::cont::DeviceAdapterTag##Name> \
{ \
static DeviceAdapterNameType GetName() { return DeviceAdapterNameType(#Name); } \
}; \
} \
}
/// Marks the tag named vtkm::cont::DeviceAdapterTagName and associated
/// structures as invalid to use. Always use this macro (in the base namespace)
/// when creating a device adapter.
#define VTKM_INVALID_DEVICE_ADAPTER(Name, Id) \
namespace vtkm \
{ \
namespace cont \
{ \
struct VTKM_ALWAYS_EXPORT DeviceAdapterTag##Name : DeviceAdapterId \
{ \
constexpr DeviceAdapterTag##Name() \
: DeviceAdapterId(Id) \
{ \
} \
static constexpr bool IsEnabled = false; \
}; \
template <> \
struct DeviceAdapterTraits<vtkm::cont::DeviceAdapterTag##Name> \
{ \
static DeviceAdapterNameType GetName() { return DeviceAdapterNameType(#Name); } \
}; \
} \
#define VTKM_INVALID_DEVICE_ADAPTER(Name, Id) \
namespace vtkm \
{ \
namespace cont \
{ \
struct VTKM_ALWAYS_EXPORT DeviceAdapterTag##Name : DeviceAdapterId \
{ \
constexpr DeviceAdapterTag##Name() \
: DeviceAdapterId(Id) \
{ \
} \
static constexpr bool IsEnabled = false; \
}; \
template <> \
struct DeviceAdapterTraits<vtkm::cont::DeviceAdapterTag##Name> \
{ \
static DeviceAdapterNameType GetName() { return DeviceAdapterNameType(#Name); } \
}; \
} \
}
// Represents when using TryExecute that the functor
@ -161,9 +161,9 @@ VTKM_INVALID_DEVICE_ADAPTER(Undefined, VTKM_DEVICE_ADAPTER_UNDEFINED)
/// argument is actually a device adapter tag. (You can get weird errors
/// elsewhere in the code when a mistake is made.)
///
#define VTKM_IS_DEVICE_ADAPTER_TAG(tag) \
static_assert(std::is_base_of<vtkm::cont::DeviceAdapterId, tag>::value && \
!std::is_same<vtkm::cont::DeviceAdapterId, tag>::value, \
#define VTKM_IS_DEVICE_ADAPTER_TAG(tag) \
static_assert(std::is_base_of<vtkm::cont::DeviceAdapterId, tag>::value && \
!std::is_same<vtkm::cont::DeviceAdapterId, tag>::value, \
"Provided type is not a valid VTK-m device adapter tag.")
#endif //vtk_m_cont_DeviceAdapterTag_h

@ -326,11 +326,11 @@ struct DynamicCellSetCheck<vtkm::cont::DynamicCellSetBase<CellSetList>>
using type = std::true_type;
};
#define VTKM_IS_DYNAMIC_CELL_SET(T) \
#define VTKM_IS_DYNAMIC_CELL_SET(T) \
VTKM_STATIC_ASSERT(::vtkm::cont::internal::DynamicCellSetCheck<T>::type::value)
#define VTKM_IS_DYNAMIC_OR_STATIC_CELL_SET(T) \
VTKM_STATIC_ASSERT(::vtkm::cont::internal::CellSetCheck<T>::type::value || \
#define VTKM_IS_DYNAMIC_OR_STATIC_CELL_SET(T) \
VTKM_STATIC_ASSERT(::vtkm::cont::internal::CellSetCheck<T>::type::value || \
::vtkm::cont::internal::DynamicCellSetCheck<T>::type::value)
} // namespace internal

@ -21,8 +21,8 @@ namespace cont
void throwFailedRuntimeDeviceTransfer(const std::string& className,
vtkm::cont::DeviceAdapterId deviceId)
{ //Should we support typeid() instead of className?
const std::string msg = "VTK-m was unable to transfer " + className + " to DeviceAdapter[id=" +
std::to_string(deviceId.GetValue()) + ", name=" + deviceId.GetName() +
const std::string msg = "VTK-m was unable to transfer " + className +
" to DeviceAdapter[id=" + std::to_string(deviceId.GetValue()) + ", name=" + deviceId.GetName() +
"]. This is generally caused by asking for execution on a DeviceAdapter that "
"isn't compiled into VTK-m. In the case of CUDA it can also be caused by accidentally "
"compiling source files as C++ files instead of CUDA.";

@ -57,13 +57,13 @@ struct HasPrepareForControl
/// Checks that the argument is a proper execution object.
///
#define VTKM_IS_EXECUTION_AND_CONTROL_OBJECT(execObject) \
static_assert(::vtkm::cont::internal::IsExecutionAndControlObjectBase<execObject>::value, \
"Provided type is not a subclass of vtkm::cont::ExecutionAndControlObjectBase."); \
static_assert(::vtkm::cont::internal::HasPrepareForExecution<execObject>::value || \
::vtkm::cont::internal::HasPrepareForExecutionDeprecated<execObject>::value, \
"Provided type does not have requisite PrepareForExecution method."); \
static_assert(::vtkm::cont::internal::HasPrepareForControl<execObject>::value, \
#define VTKM_IS_EXECUTION_AND_CONTROL_OBJECT(execObject) \
static_assert(::vtkm::cont::internal::IsExecutionAndControlObjectBase<execObject>::value, \
"Provided type is not a subclass of vtkm::cont::ExecutionAndControlObjectBase."); \
static_assert(::vtkm::cont::internal::HasPrepareForExecution<execObject>::value || \
::vtkm::cont::internal::HasPrepareForExecutionDeprecated<execObject>::value, \
"Provided type does not have requisite PrepareForExecution method."); \
static_assert(::vtkm::cont::internal::HasPrepareForControl<execObject>::value, \
"Provided type does not have requisite PrepareForControl method.")
/// \brief Gets the object to use in the control environment from an ExecutionAndControlObject.

@ -83,11 +83,11 @@ struct HasPrepareForExecutionDeprecated
/// Checks that the argument is a proper execution object.
///
#define VTKM_IS_EXECUTION_OBJECT(execObject) \
static_assert(::vtkm::cont::internal::IsExecutionObjectBase<execObject>::value, \
"Provided type is not a subclass of vtkm::cont::ExecutionObjectBase."); \
static_assert(::vtkm::cont::internal::HasPrepareForExecution<execObject>::value || \
::vtkm::cont::internal::HasPrepareForExecutionDeprecated<execObject>::value, \
#define VTKM_IS_EXECUTION_OBJECT(execObject) \
static_assert(::vtkm::cont::internal::IsExecutionObjectBase<execObject>::value, \
"Provided type is not a subclass of vtkm::cont::ExecutionObjectBase."); \
static_assert(::vtkm::cont::internal::HasPrepareForExecution<execObject>::value || \
::vtkm::cont::internal::HasPrepareForExecutionDeprecated<execObject>::value, \
"Provided type does not have requisite PrepareForExecution method.")
/// \brief Gets the object to use in the execution environment from an ExecutionObject.

@ -37,11 +37,12 @@ Field::Field(const vtkm::cont::Field& src)
}
VTKM_CONT
Field::Field(vtkm::cont::Field&& src) noexcept : Name(std::move(src.Name)),
FieldAssociation(std::move(src.FieldAssociation)),
Data(std::move(src.Data)),
Range(std::move(src.Range)),
ModifiedFlag(std::move(src.ModifiedFlag))
Field::Field(vtkm::cont::Field&& src) noexcept
: Name(std::move(src.Name))
, FieldAssociation(std::move(src.FieldAssociation))
, Data(std::move(src.Data))
, Range(std::move(src.Range))
, ModifiedFlag(std::move(src.ModifiedFlag))
{
}
@ -92,9 +93,7 @@ void Field::PrintSummary(std::ostream& out) const
}
VTKM_CONT
Field::~Field()
{
}
Field::~Field() {}
VTKM_CONT

@ -60,11 +60,12 @@ vtkm::cont::ArrayHandle<vtkm::Range> MergeRangesGlobal(
using VectorOfRangesT = std::vector<vtkm::Range>;
vtkmdiy::Master master(comm,
1,
-1,
[]() -> void* { return new VectorOfRangesT(); },
[](void* ptr) { delete static_cast<VectorOfRangesT*>(ptr); });
vtkmdiy::Master master(
comm,
1,
-1,
[]() -> void* { return new VectorOfRangesT(); },
[](void* ptr) { delete static_cast<VectorOfRangesT*>(ptr); });
vtkmdiy::ContiguousAssigner assigner(/*num ranks*/ comm.size(),
/*global-num-blocks*/ comm.size());
@ -76,8 +77,9 @@ vtkm::cont::ArrayHandle<vtkm::Range> MergeRangesGlobal(
vtkmdiy::RegularAllReducePartners all_reduce_partners(decomposer, /*k*/ 2);
auto callback = [](
VectorOfRangesT* data, const vtkmdiy::ReduceProxy& srp, const vtkmdiy::RegularMergePartners&) {
auto callback = [](VectorOfRangesT* data,
const vtkmdiy::ReduceProxy& srp,
const vtkmdiy::RegularMergePartners&) {
const auto selfid = srp.gid();
// 1. dequeue.
std::vector<int> incoming;

@ -46,9 +46,7 @@ struct VtkmArg : public opt::Arg
VTKM_LOG_ALWAYS_S(vtkm::cont::LogLevel::Error,
"Missing device after option '"
<< std::string(option.name, static_cast<size_t>(option.namelen))
<< "'.\nValid devices are: "
<< VtkmArg::GetValidDeviceNames()
<< "\n");
<< "'.\nValid devices are: " << VtkmArg::GetValidDeviceNames() << "\n");
}
return opt::ARG_ILLEGAL;
}
@ -59,12 +57,9 @@ struct VtkmArg : public opt::Arg
{
VTKM_LOG_ALWAYS_S(vtkm::cont::LogLevel::Error,
"Unavailable device specificed after option '"
<< std::string(option.name, static_cast<size_t>(option.namelen))
<< "': '"
<< std::string(option.name, static_cast<size_t>(option.namelen)) << "': '"
<< option.arg
<< "'.\nValid devices are: "
<< VtkmArg::GetValidDeviceNames()
<< "\n");
<< "'.\nValid devices are: " << VtkmArg::GetValidDeviceNames() << "\n");
return opt::ARG_ILLEGAL;
}

@ -209,12 +209,12 @@
#define VTKM_LOG_S(level, ...) VLOG_S(static_cast<loguru::Verbosity>(level)) << __VA_ARGS__
#define VTKM_LOG_F(level, ...) VLOG_F(static_cast<loguru::Verbosity>(level), __VA_ARGS__)
#define VTKM_LOG_IF_S(level, cond, ...) \
#define VTKM_LOG_IF_S(level, cond, ...) \
VLOG_IF_S(static_cast<loguru::Verbosity>(level), cond) << __VA_ARGS__
#define VTKM_LOG_IF_F(level, cond, ...) \
#define VTKM_LOG_IF_F(level, cond, ...) \
VLOG_IF_F(static_cast<loguru::Verbosity>(level), cond, __VA_ARGS__)
#define VTKM_LOG_SCOPE(level, ...) VLOG_SCOPE_F(static_cast<loguru::Verbosity>(level), __VA_ARGS__)
#define VTKM_LOG_SCOPE_FUNCTION(level) \
#define VTKM_LOG_SCOPE_FUNCTION(level) \
VTKM_LOG_SCOPE(static_cast<loguru::Verbosity>(level), __func__)
#define VTKM_LOG_ERROR_CONTEXT(desc, data) ERROR_CONTEXT(desc, data)
#define VTKM_LOG_ALWAYS_S(level, ...) VTKM_LOG_S(level, __VA_ARGS__)
@ -222,42 +222,43 @@
// Convenience macros:
// Cast success:
#define VTKM_LOG_CAST_SUCC(inObj, outObj) \
VTKM_LOG_F(vtkm::cont::LogLevel::Cast, \
"Cast succeeded: %s (%p) --> %s (%p)", \
vtkm::cont::TypeToString(inObj).c_str(), \
&inObj, \
vtkm::cont::TypeToString(outObj).c_str(), \
#define VTKM_LOG_CAST_SUCC(inObj, outObj) \
VTKM_LOG_F(vtkm::cont::LogLevel::Cast, \
"Cast succeeded: %s (%p) --> %s (%p)", \
vtkm::cont::TypeToString(inObj).c_str(), \
&inObj, \
vtkm::cont::TypeToString(outObj).c_str(), \
&outObj)
// Cast failure:
#define VTKM_LOG_CAST_FAIL(inObj, outType) \
VTKM_LOG_F(vtkm::cont::LogLevel::Cast, \
"Cast failed: %s (%p) --> %s", \
vtkm::cont::TypeToString(inObj).c_str(), \
&inObj, \
#define VTKM_LOG_CAST_FAIL(inObj, outType) \
VTKM_LOG_F(vtkm::cont::LogLevel::Cast, \
"Cast failed: %s (%p) --> %s", \
vtkm::cont::TypeToString(inObj).c_str(), \
&inObj, \
vtkm::cont::TypeToString<outType>().c_str())
// TryExecute failure
#define VTKM_LOG_TRYEXECUTE_FAIL(errorMessage, functorName, deviceId) \
VTKM_LOG_S(vtkm::cont::LogLevel::Error, "TryExecute encountered an error: " << errorMessage); \
VTKM_LOG_S(vtkm::cont::LogLevel::Error, "Failing functor: " << functorName); \
#define VTKM_LOG_TRYEXECUTE_FAIL(errorMessage, functorName, deviceId) \
VTKM_LOG_S(vtkm::cont::LogLevel::Error, "TryExecute encountered an error: " << errorMessage); \
VTKM_LOG_S(vtkm::cont::LogLevel::Error, "Failing functor: " << functorName); \
VTKM_LOG_S(vtkm::cont::LogLevel::Error, "Failing device: " << deviceId.GetName())
// Same, but disabling device:
#define VTKM_LOG_TRYEXECUTE_DISABLE(errorMessage, functorName, deviceId) \
VTKM_LOG_S(vtkm::cont::LogLevel::Error, "TryExecute encountered an error: " << errorMessage); \
VTKM_LOG_S(vtkm::cont::LogLevel::Error, "Failing functor: " << functorName); \
VTKM_LOG_S(vtkm::cont::LogLevel::Error, "Failing device: " << deviceId.GetName()); \
#define VTKM_LOG_TRYEXECUTE_DISABLE(errorMessage, functorName, deviceId) \
VTKM_LOG_S(vtkm::cont::LogLevel::Error, "TryExecute encountered an error: " << errorMessage); \
VTKM_LOG_S(vtkm::cont::LogLevel::Error, "Failing functor: " << functorName); \
VTKM_LOG_S(vtkm::cont::LogLevel::Error, "Failing device: " << deviceId.GetName()); \
VTKM_LOG_S(vtkm::cont::LogLevel::Error, "The failing device has been disabled.")
// Custom log level
#define VTKM_DEFINE_USER_LOG_LEVEL(name, offset) \
static constexpr vtkm::cont::LogLevel name = static_cast<vtkm::cont::LogLevel>( \
static_cast<typename std::underlying_type<vtkm::cont::LogLevel>::type>( \
vtkm::cont::LogLevel::UserFirst) + \
offset % static_cast<typename std::underlying_type<vtkm::cont::LogLevel>::type>( \
vtkm::cont::LogLevel::UserLast))
#define VTKM_DEFINE_USER_LOG_LEVEL(name, offset) \
static constexpr vtkm::cont::LogLevel name = static_cast<vtkm::cont::LogLevel>( \
static_cast<typename std::underlying_type<vtkm::cont::LogLevel>::type>( \
vtkm::cont::LogLevel::UserFirst) + \
offset % \
static_cast<typename std::underlying_type<vtkm::cont::LogLevel>::type>( \
vtkm::cont::LogLevel::UserLast))
#else // VTKM_ENABLE_LOGGING
@ -274,20 +275,20 @@
// Always emitted. When logging is disabled, std::cerr is used.
#define VTKM_LOG_ALWAYS_S(level, ...) \
(static_cast<int>(level) < 0 ? std::cerr : std::cout) << vtkm::cont::GetLogLevelName(level) \
<< ": " << __VA_ARGS__ << "\n"
#define VTKM_LOG_ALWAYS_S(level, ...) \
(static_cast<int>(level) < 0 ? std::cerr : std::cout) \
<< vtkm::cont::GetLogLevelName(level) << ": " << __VA_ARGS__ << "\n"
// TryExecute failures are still important enough to log, but we just write to
// std::cerr when logging is disabled.
#define VTKM_LOG_TRYEXECUTE_FAIL(errorMessage, functorName, deviceId) \
std::cerr << "Error: TryExecute encountered an error: " << errorMessage << "\n" \
<< "\t- Failing functor: " << functorName << "\n" \
#define VTKM_LOG_TRYEXECUTE_FAIL(errorMessage, functorName, deviceId) \
std::cerr << "Error: TryExecute encountered an error: " << errorMessage << "\n" \
<< "\t- Failing functor: " << functorName << "\n" \
<< "\t- Failing device: " << deviceId.GetName() << "\n\n"
#define VTKM_LOG_TRYEXECUTE_DISABLE(errorMessage, functorName, deviceId) \
std::cerr << "Error: TryExecute encountered an error: " << errorMessage << "\n" \
<< "\t- Failing functor: " << functorName << "\n" \
<< "\t- Failing device: " << deviceId.GetName() << "\n" \
#define VTKM_LOG_TRYEXECUTE_DISABLE(errorMessage, functorName, deviceId) \
std::cerr << "Error: TryExecute encountered an error: " << errorMessage << "\n" \
<< "\t- Failing functor: " << functorName << "\n" \
<< "\t- Failing device: " << deviceId.GetName() << "\n" \
<< "The failing device has been disabled.\n\n"
#endif // VTKM_ENABLE_LOGGING

@ -48,14 +48,10 @@ PartitionedDataSet::PartitionedDataSet(vtkm::Id size)
}
VTKM_CONT
PartitionedDataSet::PartitionedDataSet()
{
}
PartitionedDataSet::PartitionedDataSet() {}
VTKM_CONT
PartitionedDataSet::~PartitionedDataSet()
{
}
PartitionedDataSet::~PartitionedDataSet() {}
VTKM_CONT
PartitionedDataSet& PartitionedDataSet::operator=(const vtkm::cont::PartitionedDataSet& src)

@ -44,9 +44,7 @@ RuntimeDeviceTracker::RuntimeDeviceTracker(detail::RuntimeDeviceTrackerInternals
}
VTKM_CONT
RuntimeDeviceTracker::~RuntimeDeviceTracker()
{
}
RuntimeDeviceTracker::~RuntimeDeviceTracker() {}
VTKM_CONT
void RuntimeDeviceTracker::CheckDevice(vtkm::cont::DeviceAdapterId deviceId) const

@ -31,8 +31,8 @@ StorageVirtual::StorageVirtual(const StorageVirtual& src)
//--------------------------------------------------------------------
StorageVirtual::StorageVirtual(StorageVirtual&& src) noexcept
: DeviceUpToDate(src.DeviceUpToDate),
DeviceTransferState(std::move(src.DeviceTransferState))
: DeviceUpToDate(src.DeviceUpToDate)
, DeviceTransferState(std::move(src.DeviceTransferState))
{
}
@ -53,9 +53,7 @@ StorageVirtual& StorageVirtual::operator=(StorageVirtual&& src) noexcept
}
//--------------------------------------------------------------------
StorageVirtual::~StorageVirtual()
{
}
StorageVirtual::~StorageVirtual() {}
//--------------------------------------------------------------------
void StorageVirtual::DropExecutionPortal()
@ -182,10 +180,10 @@ void StorageVirtual::TransferPortalForOutput(vtkm::cont::internal::TransferInfoA
throw vtkm::cont::ErrorBadValue("StorageTagVirtual by default doesn't support exec side writes.");
}
#define VTK_M_ARRAY_TRANSFER_VIRTUAL_INSTANTIATE(T) \
template class VTKM_CONT_EXPORT ArrayTransferVirtual<T>; \
template class VTKM_CONT_EXPORT ArrayTransferVirtual<vtkm::Vec<T, 2>>; \
template class VTKM_CONT_EXPORT ArrayTransferVirtual<vtkm::Vec<T, 3>>; \
#define VTK_M_ARRAY_TRANSFER_VIRTUAL_INSTANTIATE(T) \
template class VTKM_CONT_EXPORT ArrayTransferVirtual<T>; \
template class VTKM_CONT_EXPORT ArrayTransferVirtual<vtkm::Vec<T, 2>>; \
template class VTKM_CONT_EXPORT ArrayTransferVirtual<vtkm::Vec<T, 3>>; \
template class VTKM_CONT_EXPORT ArrayTransferVirtual<vtkm::Vec<T, 4>>
VTK_M_ARRAY_TRANSFER_VIRTUAL_INSTANTIATE(char);
@ -202,10 +200,10 @@ VTK_M_ARRAY_TRANSFER_VIRTUAL_INSTANTIATE(vtkm::Float64);
#undef VTK_M_ARRAY_TRANSFER_VIRTUAL_INSTANTIATE
#define VTK_M_STORAGE_VIRTUAL_INSTANTIATE(T) \
template class VTKM_CONT_EXPORT StorageVirtualImpl<T, VTKM_DEFAULT_STORAGE_TAG>; \
template class VTKM_CONT_EXPORT StorageVirtualImpl<vtkm::Vec<T, 2>, VTKM_DEFAULT_STORAGE_TAG>; \
template class VTKM_CONT_EXPORT StorageVirtualImpl<vtkm::Vec<T, 3>, VTKM_DEFAULT_STORAGE_TAG>; \
#define VTK_M_STORAGE_VIRTUAL_INSTANTIATE(T) \
template class VTKM_CONT_EXPORT StorageVirtualImpl<T, VTKM_DEFAULT_STORAGE_TAG>; \
template class VTKM_CONT_EXPORT StorageVirtualImpl<vtkm::Vec<T, 2>, VTKM_DEFAULT_STORAGE_TAG>; \
template class VTKM_CONT_EXPORT StorageVirtualImpl<vtkm::Vec<T, 3>, VTKM_DEFAULT_STORAGE_TAG>; \
template class VTKM_CONT_EXPORT StorageVirtualImpl<vtkm::Vec<T, 4>, VTKM_DEFAULT_STORAGE_TAG>
VTK_M_STORAGE_VIRTUAL_INSTANTIATE(char);

@ -35,8 +35,8 @@ public:
ArrayPortalRef() = default;
ArrayPortalRef(std::shared_ptr<vtkm::ArrayPortalVirtual<T>> portal, vtkm::Id numValues) noexcept
: vtkm::ArrayPortalRef<T>(portal.get(), numValues),
ManagedPortal(portal)
: vtkm::ArrayPortalRef<T>(portal.get(), numValues)
, ManagedPortal(portal)
{
}
};

@ -101,8 +101,8 @@ StorageVirtualImpl<T, S>::StorageVirtualImpl(const vtkm::cont::ArrayHandle<T, S>
VTKM_CONT
template <typename T, typename S>
StorageVirtualImpl<T, S>::StorageVirtualImpl(vtkm::cont::ArrayHandle<T, S>&& ah) noexcept
: vtkm::cont::internal::detail::StorageVirtual(),
Handle(std::move(ah))
: vtkm::cont::internal::detail::StorageVirtual()
, Handle(std::move(ah))
{
}
@ -359,10 +359,10 @@ public:
#ifndef vtk_m_cont_StorageVirtual_cxx
#define VTK_M_ARRAY_TRANSFER_VIRTUAL_EXPORT(T) \
extern template class VTKM_CONT_TEMPLATE_EXPORT ArrayTransferVirtual<T>; \
extern template class VTKM_CONT_TEMPLATE_EXPORT ArrayTransferVirtual<vtkm::Vec<T, 2>>; \
extern template class VTKM_CONT_TEMPLATE_EXPORT ArrayTransferVirtual<vtkm::Vec<T, 3>>; \
#define VTK_M_ARRAY_TRANSFER_VIRTUAL_EXPORT(T) \
extern template class VTKM_CONT_TEMPLATE_EXPORT ArrayTransferVirtual<T>; \
extern template class VTKM_CONT_TEMPLATE_EXPORT ArrayTransferVirtual<vtkm::Vec<T, 2>>; \
extern template class VTKM_CONT_TEMPLATE_EXPORT ArrayTransferVirtual<vtkm::Vec<T, 3>>; \
extern template class VTKM_CONT_TEMPLATE_EXPORT ArrayTransferVirtual<vtkm::Vec<T, 4>>
VTK_M_ARRAY_TRANSFER_VIRTUAL_EXPORT(char);

@ -242,8 +242,9 @@ Timer::Timer(vtkm::cont::DeviceAdapterId device)
if (!tracker.CanRunOn(device))
{
VTKM_LOG_S(vtkm::cont::LogLevel::Error,
"Device '" << device.GetName() << "' can not run on current Device."
"Thus timer is not usable");
"Device '" << device.GetName()
<< "' can not run on current Device."
"Thus timer is not usable");
}
}
@ -262,8 +263,9 @@ void Timer::Reset(vtkm::cont::DeviceAdapterId device)
if (!tracker.CanRunOn(device))
{
VTKM_LOG_S(vtkm::cont::LogLevel::Error,
"Device '" << device.GetName() << "' can not run on current Device."
"Thus timer is not usable");
"Device '" << device.GetName()
<< "' can not run on current Device."
"Thus timer is not usable");
}
this->Device = device;

@ -52,9 +52,7 @@ struct vtkm::cont::Token::HeldReference
}
};
vtkm::cont::Token::Token()
{
}
vtkm::cont::Token::Token() {}
vtkm::cont::Token::Token(Token&& rhs)
: Internals(std::move(rhs.Internals))

@ -54,8 +54,8 @@ struct ControlSignatureTagCheck
/// that a template argument is actually an \c ControlSignature tag. (You can
/// get weird errors elsewhere in the code when a mistake is made.)
///
#define VTKM_IS_CONTROL_SIGNATURE_TAG(tag) \
VTKM_STATIC_ASSERT_MSG(::vtkm::cont::arg::internal::ControlSignatureTagCheck<tag>::Valid, \
#define VTKM_IS_CONTROL_SIGNATURE_TAG(tag) \
VTKM_STATIC_ASSERT_MSG(::vtkm::cont::arg::internal::ControlSignatureTagCheck<tag>::Valid, \
"Provided a type that is not a valid ControlSignature tag.")
}
}

@ -108,16 +108,12 @@ struct TryWholeArrayType
{
using ArrayHandleType = vtkm::cont::ArrayHandle<T>;
using InTransportType = vtkm::cont::arg::Transport<vtkm::cont::arg::TransportTagWholeArrayIn,
ArrayHandleType,
Device>;
using InOutTransportType =
vtkm::cont::arg::Transport<vtkm::cont::arg::TransportTagWholeArrayInOut,
ArrayHandleType,
Device>;
using OutTransportType = vtkm::cont::arg::Transport<vtkm::cont::arg::TransportTagWholeArrayOut,
ArrayHandleType,
Device>;
using InTransportType = vtkm::cont::arg::
Transport<vtkm::cont::arg::TransportTagWholeArrayIn, ArrayHandleType, Device>;
using InOutTransportType = vtkm::cont::arg::
Transport<vtkm::cont::arg::TransportTagWholeArrayInOut, ArrayHandleType, Device>;
using OutTransportType = vtkm::cont::arg::
Transport<vtkm::cont::arg::TransportTagWholeArrayOut, ArrayHandleType, Device>;
ArrayHandleType array;
array.Allocate(ARRAY_SIZE);

@ -20,31 +20,31 @@
/// A macro that can be used to check to see if there are any unchecked
/// CUDA errors. Will throw an ErrorCuda if there are.
///
#define VTKM_CUDA_CHECK_ASYNCHRONOUS_ERROR() \
VTKM_SWALLOW_SEMICOLON_PRE_BLOCK \
{ \
const cudaError_t vtkm_cuda_check_async_error = cudaGetLastError(); \
if (vtkm_cuda_check_async_error != cudaSuccess) \
{ \
throw ::vtkm::cont::cuda::ErrorCuda( \
vtkm_cuda_check_async_error, __FILE__, __LINE__, "Unchecked asynchronous error"); \
} \
} \
#define VTKM_CUDA_CHECK_ASYNCHRONOUS_ERROR() \
VTKM_SWALLOW_SEMICOLON_PRE_BLOCK \
{ \
const cudaError_t vtkm_cuda_check_async_error = cudaGetLastError(); \
if (vtkm_cuda_check_async_error != cudaSuccess) \
{ \
throw ::vtkm::cont::cuda::ErrorCuda( \
vtkm_cuda_check_async_error, __FILE__, __LINE__, "Unchecked asynchronous error"); \
} \
} \
VTKM_SWALLOW_SEMICOLON_POST_BLOCK
/// A macro that can be wrapped around a CUDA command and will throw an
/// ErrorCuda exception if the CUDA command fails.
///
#define VTKM_CUDA_CALL(command) \
VTKM_CUDA_CHECK_ASYNCHRONOUS_ERROR(); \
VTKM_SWALLOW_SEMICOLON_PRE_BLOCK \
{ \
const cudaError_t vtkm_cuda_call_error = command; \
if (vtkm_cuda_call_error != cudaSuccess) \
{ \
throw ::vtkm::cont::cuda::ErrorCuda(vtkm_cuda_call_error, __FILE__, __LINE__, #command); \
} \
} \
#define VTKM_CUDA_CALL(command) \
VTKM_CUDA_CHECK_ASYNCHRONOUS_ERROR(); \
VTKM_SWALLOW_SEMICOLON_PRE_BLOCK \
{ \
const cudaError_t vtkm_cuda_call_error = command; \
if (vtkm_cuda_call_error != cudaSuccess) \
{ \
throw ::vtkm::cont::cuda::ErrorCuda(vtkm_cuda_call_error, __FILE__, __LINE__, #command); \
} \
} \
VTKM_SWALLOW_SEMICOLON_POST_BLOCK
namespace vtkm

@ -1183,10 +1183,11 @@ public:
const vtkm::Id inSize = input.GetNumberOfValues();
// Check if the ranges overlap and fail if they do.
if (input == output && ((outputIndex >= inputStartIndex &&
outputIndex < inputStartIndex + numberOfElementsToCopy) ||
(inputStartIndex >= outputIndex &&
inputStartIndex < outputIndex + numberOfElementsToCopy)))
if (input == output &&
((outputIndex >= inputStartIndex &&
outputIndex < inputStartIndex + numberOfElementsToCopy) ||
(inputStartIndex >= outputIndex &&
inputStartIndex < outputIndex + numberOfElementsToCopy)))
{
return false;
}

@ -536,9 +536,7 @@ Buffer::Buffer(Buffer&& src)
}
// Defined to prevent issues with CUDA
Buffer::~Buffer()
{
}
Buffer::~Buffer() {}
// Defined to prevent issues with CUDA
Buffer& Buffer::operator=(const Buffer& src)

@ -241,10 +241,11 @@ public:
const vtkm::Id inSize = input.GetNumberOfValues();
// Check if the ranges overlap and fail if they do.
if (input == output && ((outputIndex >= inputStartIndex &&
outputIndex < inputStartIndex + numberOfElementsToCopy) ||
(inputStartIndex >= outputIndex &&
inputStartIndex < outputIndex + numberOfElementsToCopy)))
if (input == output &&
((outputIndex >= inputStartIndex &&
outputIndex < inputStartIndex + numberOfElementsToCopy) ||
(inputStartIndex >= outputIndex &&
inputStartIndex < outputIndex + numberOfElementsToCopy)))
{
return false;
}

@ -321,9 +321,7 @@ vtkm::cont::internal::BufferInfo AllocateOnHost(vtkm::BufferSizeType size)
}
//----------------------------------------------------------------------------------------
DeviceAdapterMemoryManagerBase::~DeviceAdapterMemoryManagerBase()
{
}
DeviceAdapterMemoryManagerBase::~DeviceAdapterMemoryManagerBase() {}
void DeviceAdapterMemoryManagerBase::Reallocate(vtkm::cont::internal::BufferInfo& buffer,
vtkm::BufferSizeType newSize) const

@ -1179,8 +1179,8 @@ struct InclusiveToExtendedKernel : vtkm::exec::FunctorBase
{
// The output array has one more value than the input, which holds the
// total sum.
const ValueType result =
(index == 0) ? this->InitialValue : (index == this->InPortal.GetNumberOfValues())
const ValueType result = (index == 0) ? this->InitialValue
: (index == this->InPortal.GetNumberOfValues())
? this->FinalValue
: this->BinaryOperator(this->InitialValue, this->InPortal.Get(index - 1));

@ -752,6 +752,7 @@ public:
void Next() { std::swap(src_, dst_); }
ValueType* GetResult() { return src_; }
private:
size_t max_elems_;
int max_threads_;
@ -894,25 +895,25 @@ public:
private:
};
#define KEY_SORT_CASE(plain_type, compare_type, unsigned_type, encoder_type) \
template <typename ThreaderType> \
class KeySort<ThreaderType, plain_type, compare_type> \
: public KeySort<ThreaderType, \
plain_type, \
compare_type, \
unsigned_type, \
encoder::Encoder##encoder_type> \
{ \
}; \
template <typename V, typename ThreaderType> \
class PairSort<ThreaderType, plain_type, V, compare_type> \
: public PairSort<ThreaderType, \
plain_type, \
V, \
compare_type, \
unsigned_type, \
encoder::Encoder##encoder_type> \
{ \
#define KEY_SORT_CASE(plain_type, compare_type, unsigned_type, encoder_type) \
template <typename ThreaderType> \
class KeySort<ThreaderType, plain_type, compare_type> \
: public KeySort<ThreaderType, \
plain_type, \
compare_type, \
unsigned_type, \
encoder::Encoder##encoder_type> \
{ \
}; \
template <typename V, typename ThreaderType> \
class PairSort<ThreaderType, plain_type, V, compare_type> \
: public PairSort<ThreaderType, \
plain_type, \
V, \
compare_type, \
unsigned_type, \
encoder::Encoder##encoder_type> \
{ \
};
// Unsigned integers
@ -974,15 +975,15 @@ struct run_kx_radix_sort_keys
}
};
#define KX_SORT_KEYS(key_type) \
template <> \
struct run_kx_radix_sort_keys<key_type, std::less<key_type>> \
{ \
static void run(key_type* data, size_t num_elems, const std::less<key_type>& comp) \
{ \
(void)comp; \
kx::radix_sort(data, data + num_elems); \
} \
#define KX_SORT_KEYS(key_type) \
template <> \
struct run_kx_radix_sort_keys<key_type, std::less<key_type>> \
{ \
static void run(key_type* data, size_t num_elems, const std::less<key_type>& comp) \
{ \
(void)comp; \
kx::radix_sort(data, data + num_elems); \
} \
};
KX_SORT_KEYS(unsigned short int);
@ -1009,58 +1010,58 @@ bool use_serial_sort_keys(T* data, size_t num_elems, const CompareType& comp)
}
// Generate radix sort interfaces for key and key value sorts.
#define VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(threader_type, key_type) \
VTKM_CONT_EXPORT void parallel_radix_sort_key_values( \
key_type* keys, vtkm::Id* vals, size_t num_elems, const std::greater<key_type>& comp) \
{ \
using namespace vtkm::cont::internal::radix; \
PairSort<threader_type, key_type, vtkm::Id, std::greater<key_type>> ps; \
ps.InitAndSort(keys, vals, num_elems, threader_type(), comp); \
} \
VTKM_CONT_EXPORT void parallel_radix_sort_key_values( \
key_type* keys, vtkm::Id* vals, size_t num_elems, const std::less<key_type>& comp) \
{ \
using namespace vtkm::cont::internal::radix; \
PairSort<threader_type, key_type, vtkm::Id, std::less<key_type>> ps; \
ps.InitAndSort(keys, vals, num_elems, threader_type(), comp); \
} \
VTKM_CONT_EXPORT void parallel_radix_sort( \
key_type* data, size_t num_elems, const std::greater<key_type>& comp) \
{ \
using namespace vtkm::cont::internal::radix; \
if (!use_serial_sort_keys(data, num_elems, comp)) \
{ \
KeySort<threader_type, key_type, std::greater<key_type>> ks; \
ks.InitAndSort(data, num_elems, threader_type(), comp); \
} \
} \
VTKM_CONT_EXPORT void parallel_radix_sort( \
key_type* data, size_t num_elems, const std::less<key_type>& comp) \
{ \
using namespace vtkm::cont::internal::radix; \
if (!use_serial_sort_keys(data, num_elems, comp)) \
{ \
KeySort<threader_type, key_type, std::less<key_type>> ks; \
ks.InitAndSort(data, num_elems, threader_type(), comp); \
} \
#define VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(threader_type, key_type) \
VTKM_CONT_EXPORT void parallel_radix_sort_key_values( \
key_type* keys, vtkm::Id* vals, size_t num_elems, const std::greater<key_type>& comp) \
{ \
using namespace vtkm::cont::internal::radix; \
PairSort<threader_type, key_type, vtkm::Id, std::greater<key_type>> ps; \
ps.InitAndSort(keys, vals, num_elems, threader_type(), comp); \
} \
VTKM_CONT_EXPORT void parallel_radix_sort_key_values( \
key_type* keys, vtkm::Id* vals, size_t num_elems, const std::less<key_type>& comp) \
{ \
using namespace vtkm::cont::internal::radix; \
PairSort<threader_type, key_type, vtkm::Id, std::less<key_type>> ps; \
ps.InitAndSort(keys, vals, num_elems, threader_type(), comp); \
} \
VTKM_CONT_EXPORT void parallel_radix_sort( \
key_type* data, size_t num_elems, const std::greater<key_type>& comp) \
{ \
using namespace vtkm::cont::internal::radix; \
if (!use_serial_sort_keys(data, num_elems, comp)) \
{ \
KeySort<threader_type, key_type, std::greater<key_type>> ks; \
ks.InitAndSort(data, num_elems, threader_type(), comp); \
} \
} \
VTKM_CONT_EXPORT void parallel_radix_sort( \
key_type* data, size_t num_elems, const std::less<key_type>& comp) \
{ \
using namespace vtkm::cont::internal::radix; \
if (!use_serial_sort_keys(data, num_elems, comp)) \
{ \
KeySort<threader_type, key_type, std::less<key_type>> ks; \
ks.InitAndSort(data, num_elems, threader_type(), comp); \
} \
}
#define VTKM_INSTANTIATE_RADIX_SORT_FOR_THREADER(ThreaderType) \
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, short int) \
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, unsigned short int) \
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, int) \
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, unsigned int) \
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, long int) \
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, unsigned long int) \
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, long long int) \
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, unsigned long long int) \
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, unsigned char) \
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, signed char) \
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, char) \
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, char16_t) \
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, char32_t) \
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, wchar_t) \
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, float) \
#define VTKM_INSTANTIATE_RADIX_SORT_FOR_THREADER(ThreaderType) \
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, short int) \
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, unsigned short int) \
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, int) \
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, unsigned int) \
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, long int) \
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, unsigned long int) \
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, long long int) \
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, unsigned long long int) \
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, unsigned char) \
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, signed char) \
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, char) \
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, char16_t) \
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, char32_t) \
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, wchar_t) \
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, float) \
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, double)
VTKM_THIRDPARTY_POST_INCLUDE

@ -89,9 +89,8 @@ struct sort_tag_type<T, vtkm::cont::StorageTagBasic, BinaryCompare>
using PrimT = std::is_arithmetic<T>;
using LongDT = std::is_same<T, long double>;
using BComp = is_valid_compare_type<BinaryCompare>;
using type = typename std::conditional<PrimT::value && BComp::value && !LongDT::value,
RadixSortTag,
PSortTag>::type;
using type = typename std::
conditional<PrimT::value && BComp::value && !LongDT::value, RadixSortTag, PSortTag>::type;
};
template <typename KeyType,
@ -120,33 +119,33 @@ struct sortbykey_tag_type<KeyType,
PSortTag>::type;
};
#define VTKM_INTERNAL_RADIX_SORT_DECLARE(key_type) \
VTKM_CONT_EXPORT void parallel_radix_sort( \
key_type* data, size_t num_elems, const std::greater<key_type>& comp); \
VTKM_CONT_EXPORT void parallel_radix_sort( \
key_type* data, size_t num_elems, const std::less<key_type>& comp); \
VTKM_CONT_EXPORT void parallel_radix_sort_key_values( \
key_type* keys, vtkm::Id* vals, size_t num_elems, const std::greater<key_type>& comp); \
VTKM_CONT_EXPORT void parallel_radix_sort_key_values( \
#define VTKM_INTERNAL_RADIX_SORT_DECLARE(key_type) \
VTKM_CONT_EXPORT void parallel_radix_sort( \
key_type* data, size_t num_elems, const std::greater<key_type>& comp); \
VTKM_CONT_EXPORT void parallel_radix_sort( \
key_type* data, size_t num_elems, const std::less<key_type>& comp); \
VTKM_CONT_EXPORT void parallel_radix_sort_key_values( \
key_type* keys, vtkm::Id* vals, size_t num_elems, const std::greater<key_type>& comp); \
VTKM_CONT_EXPORT void parallel_radix_sort_key_values( \
key_type* keys, vtkm::Id* vals, size_t num_elems, const std::less<key_type>& comp);
// Generate radix sort interfaces for key and key value sorts.
#define VTKM_DECLARE_RADIX_SORT() \
VTKM_INTERNAL_RADIX_SORT_DECLARE(short int) \
VTKM_INTERNAL_RADIX_SORT_DECLARE(unsigned short int) \
VTKM_INTERNAL_RADIX_SORT_DECLARE(int) \
VTKM_INTERNAL_RADIX_SORT_DECLARE(unsigned int) \
VTKM_INTERNAL_RADIX_SORT_DECLARE(long int) \
VTKM_INTERNAL_RADIX_SORT_DECLARE(unsigned long int) \
VTKM_INTERNAL_RADIX_SORT_DECLARE(long long int) \
VTKM_INTERNAL_RADIX_SORT_DECLARE(unsigned long long int) \
VTKM_INTERNAL_RADIX_SORT_DECLARE(unsigned char) \
VTKM_INTERNAL_RADIX_SORT_DECLARE(signed char) \
VTKM_INTERNAL_RADIX_SORT_DECLARE(char) \
VTKM_INTERNAL_RADIX_SORT_DECLARE(char16_t) \
VTKM_INTERNAL_RADIX_SORT_DECLARE(char32_t) \
VTKM_INTERNAL_RADIX_SORT_DECLARE(wchar_t) \
VTKM_INTERNAL_RADIX_SORT_DECLARE(float) \
#define VTKM_DECLARE_RADIX_SORT() \
VTKM_INTERNAL_RADIX_SORT_DECLARE(short int) \
VTKM_INTERNAL_RADIX_SORT_DECLARE(unsigned short int) \
VTKM_INTERNAL_RADIX_SORT_DECLARE(int) \
VTKM_INTERNAL_RADIX_SORT_DECLARE(unsigned int) \
VTKM_INTERNAL_RADIX_SORT_DECLARE(long int) \
VTKM_INTERNAL_RADIX_SORT_DECLARE(unsigned long int) \
VTKM_INTERNAL_RADIX_SORT_DECLARE(long long int) \
VTKM_INTERNAL_RADIX_SORT_DECLARE(unsigned long long int) \
VTKM_INTERNAL_RADIX_SORT_DECLARE(unsigned char) \
VTKM_INTERNAL_RADIX_SORT_DECLARE(signed char) \
VTKM_INTERNAL_RADIX_SORT_DECLARE(char) \
VTKM_INTERNAL_RADIX_SORT_DECLARE(char16_t) \
VTKM_INTERNAL_RADIX_SORT_DECLARE(char32_t) \
VTKM_INTERNAL_RADIX_SORT_DECLARE(wchar_t) \
VTKM_INTERNAL_RADIX_SORT_DECLARE(float) \
VTKM_INTERNAL_RADIX_SORT_DECLARE(double)
}
}

@ -31,9 +31,7 @@ VariantArrayHandleContainerBase::VariantArrayHandleContainerBase(const std::type
{
}
VariantArrayHandleContainerBase::~VariantArrayHandleContainerBase()
{
}
VariantArrayHandleContainerBase::~VariantArrayHandleContainerBase() {}
}
namespace detail

@ -274,8 +274,9 @@ private:
{ // number of components do not match
std::ostringstream str;
str << "VariantArrayHandle::AsVirtual: Cannot cast from " << vtkm::cont::TypeToString<S>()
<< " to " << vtkm::cont::TypeToString<D>() << "; "
"number of components must match exactly.";
<< " to " << vtkm::cont::TypeToString<D>()
<< "; "
"number of components must match exactly.";
throw vtkm::cont::ErrorBadType(str.str());
}
};

@ -10,12 +10,12 @@
#ifndef vtk_m_cont_internal_VirtualObjectTransferInstantiate_h
#define vtk_m_cont_internal_VirtualObjectTransferInstantiate_h
#define VTKM_EXPLICITLY_INSTANTIATE_TRANSFER_FOR_DEVICE(DerivedType, DeviceDapterTagType) \
#define VTKM_EXPLICITLY_INSTANTIATE_TRANSFER_FOR_DEVICE(DerivedType, DeviceDapterTagType) \
template class vtkm::cont::internal::VirtualObjectTransfer<DerivedType, DeviceDapterTagType>
#if defined(VTKM_ENABLE_CUDA)
#include <vtkm/cont/cuda/internal/VirtualObjectTransferCuda.h>
#define VTKM_EXPLICITLY_INSTANTIATE_TRANSFER_CUDA(DerivedType) \
#define VTKM_EXPLICITLY_INSTANTIATE_TRANSFER_CUDA(DerivedType) \
VTKM_EXPLICITLY_INSTANTIATE_TRANSFER_FOR_DEVICE(DerivedType, vtkm::cont::DeviceAdapterTagCuda)
#else // defined(VTKM_ENABLE_CUDA)
#define VTKM_EXPLICITLY_INSTANTIATE_TRANSFER_CUDA(DerivedType)
@ -23,14 +23,14 @@
#if defined(VTKM_ENABLE_KOKKOS)
#include <vtkm/cont/kokkos/internal/VirtualObjectTransferKokkos.h>
#define VTKM_EXPLICITLY_INSTANTIATE_TRANSFER_KOKKOS(DerivedType) \
#define VTKM_EXPLICITLY_INSTANTIATE_TRANSFER_KOKKOS(DerivedType) \
VTKM_EXPLICITLY_INSTANTIATE_TRANSFER_FOR_DEVICE(DerivedType, vtkm::cont::DeviceAdapterTagKokkos)
#else // defined(VTKM_ENABLE_KOKKOS)
#define VTKM_EXPLICITLY_INSTANTIATE_TRANSFER_KOKKOS(DerivedType)
#endif // defined(VTKM_ENABLE_KOKKOS)
#define VTKM_EXPLICITLY_INSTANTIATE_TRANSFER(DerivedType) \
VTKM_EXPLICITLY_INSTANTIATE_TRANSFER_CUDA(DerivedType) \
#define VTKM_EXPLICITLY_INSTANTIATE_TRANSFER(DerivedType) \
VTKM_EXPLICITLY_INSTANTIATE_TRANSFER_CUDA(DerivedType) \
VTKM_EXPLICITLY_INSTANTIATE_TRANSFER_KOKKOS(DerivedType)
#endif // vtk_m_cont_internal_VirtualObjectTransferInstantiate_h

@ -175,10 +175,11 @@ public:
Kokkos::MDRangePolicy<Kokkos::Rank<3>, Kokkos::IndexType<vtkm::Id>> policy(
{ 0, 0, 0 }, { rangeMax[0], rangeMax[1], rangeMax[2] });
Kokkos::parallel_for(policy, KOKKOS_LAMBDA(vtkm::Id i, vtkm::Id j, vtkm::Id k) {
auto flatIdx = i + (j * rangeMax[0]) + (k * rangeMax[0] * rangeMax[1]);
functor(vtkm::Id3(i, j, k), flatIdx);
});
Kokkos::parallel_for(
policy, KOKKOS_LAMBDA(vtkm::Id i, vtkm::Id j, vtkm::Id k) {
auto flatIdx = i + (j * rangeMax[0]) + (k * rangeMax[0] * rangeMax[1]);
functor(vtkm::Id3(i, j, k), flatIdx);
});
CheckForErrors(errorMessageStorage);
}

@ -15,8 +15,9 @@
//We always create the kokkos tag when included, but we only mark it as
//a valid tag when VTKM_ENABLE_KOKKOS is true. This is for easier development
//of multi-backend systems
#if defined(VTKM_ENABLE_KOKKOS) && ((!defined(VTKM_KOKKOS_CUDA) || defined(VTKM_CUDA)) || \
!defined(VTKM_NO_ERROR_ON_MIXED_CUDA_CXX_TAG))
#if defined(VTKM_ENABLE_KOKKOS) && \
((!defined(VTKM_KOKKOS_CUDA) || defined(VTKM_CUDA)) || \
!defined(VTKM_NO_ERROR_ON_MIXED_CUDA_CXX_TAG))
VTKM_VALID_DEVICE_ADAPTER(Kokkos, VTKM_DEVICE_ADAPTER_KOKKOS);
#else
VTKM_INVALID_DEVICE_ADAPTER(Kokkos, VTKM_DEVICE_ADAPTER_KOKKOS);

@ -54,17 +54,19 @@ struct VirtualObjectTransfer<VirtualDerivedType, vtkm::cont::DeviceAdapterTagKok
auto executionObjectPtr = this->ExecutionObject =
static_cast<VirtualDerivedType*>(Kokkos::kokkos_malloc(sizeof(VirtualDerivedType)));
// Initialize the device object
Kokkos::parallel_for("ConstructVirtualObject", 1, KOKKOS_LAMBDA(const int&) {
new (executionObjectPtr) VirtualDerivedType(*deviceTarget);
});
Kokkos::parallel_for(
"ConstructVirtualObject", 1, KOKKOS_LAMBDA(const int&) {
new (executionObjectPtr) VirtualDerivedType(*deviceTarget);
});
}
else if (updateData)
{
auto executionObjectPtr = this->ExecutionObject;
// Initialize the device object
Kokkos::parallel_for("UpdateVirtualObject", 1, KOKKOS_LAMBDA(const int&) {
*executionObjectPtr = *deviceTarget;
});
Kokkos::parallel_for(
"UpdateVirtualObject", 1, KOKKOS_LAMBDA(const int&) {
*executionObjectPtr = *deviceTarget;
});
}
}

@ -440,23 +440,23 @@ struct ReduceHelper
#ifdef VTKM_OPENMP_USE_NATIVE_REDUCTION
// Specialize for vtkm functors with OpenMP special cases:
#define VTKM_OPENMP_SPECIALIZE_REDUCE1(FunctorType, PragmaString) \
template <typename PortalT, typename ReturnType> \
static ReturnType Execute( \
PortalT portal, ReturnType value, FunctorType functorIn, std::true_type) \
{ \
const vtkm::Id numValues = portal.GetNumberOfValues(); \
internal::WrappedBinaryOperator<ReturnType, FunctorType> f(functorIn); \
_Pragma(#PragmaString) for (vtkm::Id i = 0; i < numValues; ++i) \
{ \
value = f(value, portal.Get(i)); \
} \
return value; \
#define VTKM_OPENMP_SPECIALIZE_REDUCE1(FunctorType, PragmaString) \
template <typename PortalT, typename ReturnType> \
static ReturnType Execute( \
PortalT portal, ReturnType value, FunctorType functorIn, std::true_type) \
{ \
const vtkm::Id numValues = portal.GetNumberOfValues(); \
internal::WrappedBinaryOperator<ReturnType, FunctorType> f(functorIn); \
_Pragma(#PragmaString) for (vtkm::Id i = 0; i < numValues; ++i) \
{ \
value = f(value, portal.Get(i)); \
} \
return value; \
}
// Constructing the pragma string inside the _Pragma call doesn't work so
// we jump through a hoop:
#define VTKM_OPENMP_SPECIALIZE_REDUCE(FunctorType, Operator) \
#define VTKM_OPENMP_SPECIALIZE_REDUCE(FunctorType, Operator) \
VTKM_OPENMP_SPECIALIZE_REDUCE1(FunctorType, "omp parallel for reduction(" #Operator ":value)")
// + (Add, Sum)

@ -154,10 +154,11 @@ public:
const vtkm::Id inSize = input.GetNumberOfValues();
// Check if the ranges overlap and fail if they do.
if (input == output && ((outputIndex >= inputStartIndex &&
outputIndex < inputStartIndex + numberOfElementsToCopy) ||
(inputStartIndex >= outputIndex &&
inputStartIndex < outputIndex + numberOfElementsToCopy)))
if (input == output &&
((outputIndex >= inputStartIndex &&
outputIndex < inputStartIndex + numberOfElementsToCopy) ||
(inputStartIndex >= outputIndex &&
inputStartIndex < outputIndex + numberOfElementsToCopy)))
{
return false;
}

@ -96,10 +96,11 @@ public:
const vtkm::Id inSize = input.GetNumberOfValues();
// Check if the ranges overlap and fail if they do.
if (input == output && ((outputIndex >= inputStartIndex &&
outputIndex < inputStartIndex + numberOfElementsToCopy) ||
(inputStartIndex >= outputIndex &&
inputStartIndex < outputIndex + numberOfElementsToCopy)))
if (input == output &&
((outputIndex >= inputStartIndex &&
outputIndex < inputStartIndex + numberOfElementsToCopy) ||
(inputStartIndex >= outputIndex &&
inputStartIndex < outputIndex + numberOfElementsToCopy)))
{
return false;
}

@ -208,9 +208,9 @@ void parallel_quick_sort(RandomAccessIterator begin, RandomAccessIterator end, c
if (my_context.is_group_execution_cancelled())
do_parallel_quick_sort:
#endif /* __TBB_TASK_GROUP_CONTEXT */
parallel_for(quick_sort_range<RandomAccessIterator, Compare>(begin, end - begin, comp),
quick_sort_body<RandomAccessIterator, Compare>(),
auto_partitioner());
parallel_for(quick_sort_range<RandomAccessIterator, Compare>(begin, end - begin, comp),
quick_sort_body<RandomAccessIterator, Compare>(),
auto_partitioner());
}
} // namespace internal

@ -208,9 +208,9 @@ void parallel_quick_sort(RandomAccessIterator begin, RandomAccessIterator end, c
if (my_context.is_group_execution_cancelled())
do_parallel_quick_sort:
#endif /* __TBB_TASK_GROUP_CONTEXT */
parallel_for(quick_sort_range<RandomAccessIterator, Compare>(begin, end - begin, comp),
quick_sort_body<RandomAccessIterator, Compare>(),
auto_partitioner());
parallel_for(quick_sort_range<RandomAccessIterator, Compare>(begin, end - begin, comp),
quick_sort_body<RandomAccessIterator, Compare>(),
auto_partitioner());
}
} // namespace internal

@ -23,32 +23,32 @@
#include <cstdio>
#define DEVICE_ASSERT_MSG(cond, message) \
do \
{ \
if (!(cond)) \
{ \
printf("Testing assert failed at %s:%d\n\t- Condition: %s\n\t- Subtest: %s\n", \
__FILE__, \
__LINE__, \
#cond, \
message); \
return false; \
} \
#define DEVICE_ASSERT_MSG(cond, message) \
do \
{ \
if (!(cond)) \
{ \
printf("Testing assert failed at %s:%d\n\t- Condition: %s\n\t- Subtest: %s\n", \
__FILE__, \
__LINE__, \
#cond, \
message); \
return false; \
} \
} while (false)
#define DEVICE_ASSERT(cond) \
do \
{ \
if (!(cond)) \
{ \
printf("Testing assert failed at %s:%d\n\t- Condition: %s\n", __FILE__, __LINE__, #cond); \
return false; \
} \
#define DEVICE_ASSERT(cond) \
do \
{ \
if (!(cond)) \
{ \
printf("Testing assert failed at %s:%d\n\t- Condition: %s\n", __FILE__, __LINE__, #cond); \
return false; \
} \
} while (false)
// Test with some trailing bits in partial last word:
#define NUM_BITS \
#define NUM_BITS \
vtkm::Id { 7681 }
using vtkm::cont::BitField;

@ -224,10 +224,10 @@ vtkm::cont::DataSet CreateDataSetVec(bool useSeparatedCoords,
vtkm::cont::testing::ExplicitData##num::numConn, vtkm::cont::testing::ExplicitData##num::conn, \
vtkm::cont::testing::ExplicitData##num::numIndices, \
vtkm::cont::testing::ExplicitData##num::shapes
#define TEST_NUMS(num) \
vtkm::cont::testing::ExplicitData##num::numPoints, \
#define TEST_NUMS(num) \
vtkm::cont::testing::ExplicitData##num::numPoints, \
vtkm::cont::testing::ExplicitData##num::numCells
#define TEST_BOUNDS(num) \
#define TEST_BOUNDS(num) \
vtkm::cont::testing::ExplicitData##num::numPoints, vtkm::cont::testing::ExplicitData##num::coords
void TestDataSetBuilderExplicit()

@ -82,9 +82,8 @@ class DeviceAdapterMemoryManager<vtkm::cont::DeviceAdapterTagTestAlgorithmGenera
template <typename T, class StorageTag>
class ArrayManagerExecution<T, StorageTag, vtkm::cont::DeviceAdapterTagTestAlgorithmGeneral>
: public vtkm::cont::internal::ArrayManagerExecution<T,
StorageTag,
vtkm::cont::DeviceAdapterTagSerial>
: public vtkm::cont::internal::
ArrayManagerExecution<T, StorageTag, vtkm::cont::DeviceAdapterTagSerial>
{
public:
using Superclass =

@ -25,10 +25,10 @@ static unsigned int uid = 1;
#define PRINT_INFO(msg) std::cout << "[" << comm.rank() << ":" << __LINE__ << "] " msg << std::endl;
#define PRINT_INFO_0(msg) \
if (comm.rank() == 0) \
{ \
std::cout << "[" << comm.rank() << ":" << __LINE__ << "] " msg << std::endl; \
#define PRINT_INFO_0(msg) \
if (comm.rank() == 0) \
{ \
std::cout << "[" << comm.rank() << ":" << __LINE__ << "] " msg << std::endl; \
}
template <typename T>
@ -90,8 +90,7 @@ void Validate(const vtkm::cont::ArrayHandle<vtkm::Range>& ranges,
auto portal = ranges.ReadPortal();
auto range = portal.Get(0);
PRINT_INFO(<< " expecting [" << min << ", " << max << "], got [" << range.Min << ", "
<< range.Max
<< "]");
<< range.Max << "]");
VTKM_TEST_ASSERT(range.IsNonEmpty() && range.Min >= static_cast<ValueType>(min) &&
range.Max <= static_cast<ValueType>(max),
"Got wrong range.");
@ -110,10 +109,7 @@ void Validate(const vtkm::cont::ArrayHandle<vtkm::Range>& ranges,
{
auto range = portal.Get(cc);
PRINT_INFO(<< " [" << cc << "] expecting [" << min[cc] << ", " << max[cc] << "], got ["
<< range.Min
<< ", "
<< range.Max
<< "]");
<< range.Min << ", " << range.Max << "]");
VTKM_TEST_ASSERT(range.IsNonEmpty() && range.Min >= static_cast<T>(min[cc]) &&
range.Max <= static_cast<T>(max[cc]),
"Got wrong range.");

@ -94,7 +94,7 @@ void RunTests()
} // end anon namespace
int UnitTestLogging(int, char* [])
int UnitTestLogging(int, char*[])
{
// Test that parameterless init works:
VTKM_LOG_S(vtkm::cont::LogLevel::Info, "Log before intialize");

@ -64,16 +64,16 @@ struct TestObject
}
};
#define CHECK_OBJECT(object, expectedTokens, expectedRefs) \
VTKM_TEST_ASSERT(*(object).TokenCount == (expectedTokens), \
"Expected object to have token count of ", \
(expectedTokens), \
". It actually was ", \
*(object).TokenCount); \
VTKM_TEST_ASSERT(*(object).ReferenceCount == (expectedRefs), \
"Expected object to have reference count of ", \
(expectedRefs), \
". It actually was ", \
#define CHECK_OBJECT(object, expectedTokens, expectedRefs) \
VTKM_TEST_ASSERT(*(object).TokenCount == (expectedTokens), \
"Expected object to have token count of ", \
(expectedTokens), \
". It actually was ", \
*(object).TokenCount); \
VTKM_TEST_ASSERT(*(object).ReferenceCount == (expectedRefs), \
"Expected object to have reference count of ", \
(expectedRefs), \
". It actually was ", \
*(object).ReferenceCount)
void TestBasicAttachDetatch()

@ -131,8 +131,8 @@ public:
// 14: CELL_SHAPE_PYRAMID
{ { 0, 3, 2, 1 }, { 0, 1, 4, -1 }, { 1, 2, 4, -1 },
{ 2, 3, 4, -1 }, { 3, 0, 4, -1 },{ -1, -1, -1, -1 } }
// clang-format on
};
// clang-format on
};
return pointsInFace[cellShapeId][faceIndex][localPointIndex];
}
};

@ -275,9 +275,8 @@ private:
using NodePortal = typename NodeArrayHandle::template ExecutionTypes<DeviceAdapter>::PortalConst;
using CellIdPortal =
typename CellIdArrayHandle::template ExecutionTypes<DeviceAdapter>::PortalConst;
using CellSetPortal = typename CellSetType::template ExecutionTypes<DeviceAdapter,
VisitType,
IncidentType>::ExecObjectType;
using CellSetPortal = typename CellSetType::
template ExecutionTypes<DeviceAdapter, VisitType, IncidentType>::ExecObjectType;
using CoordsPortal =
typename vtkm::cont::CoordinateSystem::MultiplexerArrayType::template ExecutionTypes<
DeviceAdapter>::PortalConst;

@ -95,7 +95,10 @@ VTKM_EXEC OutType CellMeasure(const vtkm::IdComponent& numPts,
}
typename PointCoordVecType::ComponentType edges[4] = {
pts[1] - pts[0], pts[2] - pts[1], pts[3] - pts[2], pts[0] - pts[3],
pts[1] - pts[0],
pts[2] - pts[1],
pts[3] - pts[2],
pts[0] - pts[3],
};
typename PointCoordVecType::ComponentType cornerNormals[4] = {
@ -107,7 +110,8 @@ VTKM_EXEC OutType CellMeasure(const vtkm::IdComponent& numPts,
// principal axes
typename PointCoordVecType::ComponentType principalAxes[2] = {
edges[0] - edges[2], edges[1] - edges[3],
edges[0] - edges[2],
edges[1] - edges[3],
};
// Unit normal at the quadrilateral center

@ -55,8 +55,8 @@ struct ExecutionSignatureTagCheck
/// that a template argument is actually an \c ExecutionSignature tag. (You can
/// get weird errors elsewhere in the code when a mistake is made.)
///
#define VTKM_IS_EXECUTION_SIGNATURE_TAG(tag) \
VTKM_STATIC_ASSERT_MSG(::vtkm::exec::arg::internal::ExecutionSignatureTagCheck<tag>::Valid, \
#define VTKM_IS_EXECUTION_SIGNATURE_TAG(tag) \
VTKM_STATIC_ASSERT_MSG(::vtkm::exec::arg::internal::ExecutionSignatureTagCheck<tag>::Valid, \
"Provided a type that is not a valid ExecutionSignature tag.")
}
}

@ -478,9 +478,8 @@ class ThreadIndicesTopologyMap<vtkm::exec::ConnectivityPermutedVisitCellsWithPoi
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint,
Dimension>>;
using ConnectivityType = vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint,
Dimension>;
using ConnectivityType = vtkm::exec::
ConnectivityStructured<vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint, Dimension>;
public:
using IndicesIncidentType = typename ConnectivityType::IndicesType;

@ -104,10 +104,9 @@ struct FetchArrayNeighborhoodInTests
vtkm::internal::ConnectivityStructuredInternals<3> connectivityInternals;
connectivityInternals.SetPointDimensions(POINT_DIMS);
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell,
3>
connectivity(connectivityInternals);
vtkm::exec::
ConnectivityStructured<vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell, 3>
connectivity(connectivityInternals);
// Verify that 3D scheduling works with neighborhoods
{

@ -126,10 +126,9 @@ struct FetchArrayTopologyMapInTests
vtkm::internal::ConnectivityStructuredInternals<3> connectivityInternals;
connectivityInternals.SetPointDimensions(vtkm::Id3(2, 2, 2));
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint,
3>
connectivity(connectivityInternals);
vtkm::exec::
ConnectivityStructured<vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint, 3>
connectivity(connectivityInternals);
using NullType = vtkm::internal::NullType;
auto baseFunctionInterface = vtkm::internal::make_FunctionInterface<void>(

@ -173,7 +173,7 @@ __host__ __device__::thrust::pair<OutputIterator1, OutputIterator2> reduce_by_ke
BinaryFunction binary_op)
{
#if defined(VTKM_CUDA_VERSION_MAJOR) && (VTKM_CUDA_VERSION_MAJOR == 7) && \
#if defined(VTKM_CUDA_VERSION_MAJOR) && (VTKM_CUDA_VERSION_MAJOR == 7) && \
(VTKM_CUDA_VERSION_MINOR >= 5)
::thrust::pair<OutputIterator1, OutputIterator2> result =
thrust::reduce_by_key(ThrustCudaPolicyPerThread,

@ -29,97 +29,97 @@ namespace detail
template <typename T, typename U>
T aligned_reinterpret_cast(U u);
#define ALIGN_RE_T(RT) \
template <> \
inline __host__ __device__ RT* aligned_reinterpret_cast(void* u) \
{ \
return reinterpret_cast<RT*>(reinterpret_cast<void*>(u)); \
} \
template <> \
inline __host__ __device__ RT* aligned_reinterpret_cast(vtkm::UInt8* u) \
{ \
return reinterpret_cast<RT*>(reinterpret_cast<void*>(u)); \
} \
#define ALIGN_RE_T(RT) \
template <> \
inline __host__ __device__ RT* aligned_reinterpret_cast(void* u) \
{ \
return reinterpret_cast<RT*>(reinterpret_cast<void*>(u)); \
} \
template <> \
inline __host__ __device__ RT* aligned_reinterpret_cast(vtkm::UInt8* u) \
{ \
return reinterpret_cast<RT*>(reinterpret_cast<void*>(u)); \
} \
struct SwallowSemicolon
#define ALIGN_RE_VEC(RT) \
template <> \
inline __host__ __device__ vtkm::Vec<RT, 2>* aligned_reinterpret_cast(void* u) \
{ \
return reinterpret_cast<vtkm::Vec<RT, 2>*>(reinterpret_cast<void*>(u)); \
} \
template <> \
inline __host__ __device__ vtkm::Vec<RT, 3>* aligned_reinterpret_cast(void* u) \
{ \
return reinterpret_cast<vtkm::Vec<RT, 3>*>(reinterpret_cast<void*>(u)); \
} \
template <> \
inline __host__ __device__ vtkm::Vec<RT, 4>* aligned_reinterpret_cast(void* u) \
{ \
return reinterpret_cast<vtkm::Vec<RT, 4>*>(reinterpret_cast<void*>(u)); \
} \
template <> \
inline __host__ __device__ vtkm::Vec<vtkm::Vec<RT, 3>, 2>* aligned_reinterpret_cast(void* u) \
{ \
return reinterpret_cast<vtkm::Vec<vtkm::Vec<RT, 3>, 2>*>(reinterpret_cast<void*>(u)); \
} \
template <> \
inline __host__ __device__ vtkm::Vec<vtkm::Vec<RT, 9>, 2>* aligned_reinterpret_cast(void* u) \
{ \
return reinterpret_cast<vtkm::Vec<vtkm::Vec<RT, 9>, 2>*>(reinterpret_cast<void*>(u)); \
} \
template <> \
inline __host__ __device__ vtkm::Vec<RT, 2>* aligned_reinterpret_cast(vtkm::UInt8* u) \
{ \
return reinterpret_cast<vtkm::Vec<RT, 2>*>(reinterpret_cast<void*>(u)); \
} \
template <> \
inline __host__ __device__ vtkm::Vec<RT, 3>* aligned_reinterpret_cast(vtkm::UInt8* u) \
{ \
return reinterpret_cast<vtkm::Vec<RT, 3>*>(reinterpret_cast<void*>(u)); \
} \
template <> \
inline __host__ __device__ vtkm::Vec<RT, 4>* aligned_reinterpret_cast(vtkm::UInt8* u) \
{ \
return reinterpret_cast<vtkm::Vec<RT, 4>*>(reinterpret_cast<void*>(u)); \
} \
template <> \
inline __host__ __device__ vtkm::Vec<vtkm::Vec<RT, 2>, 2>* aligned_reinterpret_cast( \
vtkm::UInt8* u) \
{ \
return reinterpret_cast<vtkm::Vec<vtkm::Vec<RT, 2>, 2>*>(reinterpret_cast<void*>(u)); \
} \
template <> \
inline __host__ __device__ vtkm::Vec<vtkm::Vec<RT, 3>, 2>* aligned_reinterpret_cast( \
vtkm::UInt8* u) \
{ \
return reinterpret_cast<vtkm::Vec<vtkm::Vec<RT, 3>, 2>*>(reinterpret_cast<void*>(u)); \
} \
template <> \
inline __host__ __device__ vtkm::Vec<vtkm::Vec<RT, 4>, 2>* aligned_reinterpret_cast( \
vtkm::UInt8* u) \
{ \
return reinterpret_cast<vtkm::Vec<vtkm::Vec<RT, 4>, 2>*>(reinterpret_cast<void*>(u)); \
} \
template <> \
inline __host__ __device__ vtkm::Vec<vtkm::Vec<RT, 9>, 2>* aligned_reinterpret_cast( \
vtkm::UInt8* u) \
{ \
return reinterpret_cast<vtkm::Vec<vtkm::Vec<RT, 9>, 2>*>(reinterpret_cast<void*>(u)); \
} \
#define ALIGN_RE_VEC(RT) \
template <> \
inline __host__ __device__ vtkm::Vec<RT, 2>* aligned_reinterpret_cast(void* u) \
{ \
return reinterpret_cast<vtkm::Vec<RT, 2>*>(reinterpret_cast<void*>(u)); \
} \
template <> \
inline __host__ __device__ vtkm::Vec<RT, 3>* aligned_reinterpret_cast(void* u) \
{ \
return reinterpret_cast<vtkm::Vec<RT, 3>*>(reinterpret_cast<void*>(u)); \
} \
template <> \
inline __host__ __device__ vtkm::Vec<RT, 4>* aligned_reinterpret_cast(void* u) \
{ \
return reinterpret_cast<vtkm::Vec<RT, 4>*>(reinterpret_cast<void*>(u)); \
} \
template <> \
inline __host__ __device__ vtkm::Vec<vtkm::Vec<RT, 3>, 2>* aligned_reinterpret_cast(void* u) \
{ \
return reinterpret_cast<vtkm::Vec<vtkm::Vec<RT, 3>, 2>*>(reinterpret_cast<void*>(u)); \
} \
template <> \
inline __host__ __device__ vtkm::Vec<vtkm::Vec<RT, 9>, 2>* aligned_reinterpret_cast(void* u) \
{ \
return reinterpret_cast<vtkm::Vec<vtkm::Vec<RT, 9>, 2>*>(reinterpret_cast<void*>(u)); \
} \
template <> \
inline __host__ __device__ vtkm::Vec<RT, 2>* aligned_reinterpret_cast(vtkm::UInt8* u) \
{ \
return reinterpret_cast<vtkm::Vec<RT, 2>*>(reinterpret_cast<void*>(u)); \
} \
template <> \
inline __host__ __device__ vtkm::Vec<RT, 3>* aligned_reinterpret_cast(vtkm::UInt8* u) \
{ \
return reinterpret_cast<vtkm::Vec<RT, 3>*>(reinterpret_cast<void*>(u)); \
} \
template <> \
inline __host__ __device__ vtkm::Vec<RT, 4>* aligned_reinterpret_cast(vtkm::UInt8* u) \
{ \
return reinterpret_cast<vtkm::Vec<RT, 4>*>(reinterpret_cast<void*>(u)); \
} \
template <> \
inline __host__ __device__ vtkm::Vec<vtkm::Vec<RT, 2>, 2>* aligned_reinterpret_cast( \
vtkm::UInt8* u) \
{ \
return reinterpret_cast<vtkm::Vec<vtkm::Vec<RT, 2>, 2>*>(reinterpret_cast<void*>(u)); \
} \
template <> \
inline __host__ __device__ vtkm::Vec<vtkm::Vec<RT, 3>, 2>* aligned_reinterpret_cast( \
vtkm::UInt8* u) \
{ \
return reinterpret_cast<vtkm::Vec<vtkm::Vec<RT, 3>, 2>*>(reinterpret_cast<void*>(u)); \
} \
template <> \
inline __host__ __device__ vtkm::Vec<vtkm::Vec<RT, 4>, 2>* aligned_reinterpret_cast( \
vtkm::UInt8* u) \
{ \
return reinterpret_cast<vtkm::Vec<vtkm::Vec<RT, 4>, 2>*>(reinterpret_cast<void*>(u)); \
} \
template <> \
inline __host__ __device__ vtkm::Vec<vtkm::Vec<RT, 9>, 2>* aligned_reinterpret_cast( \
vtkm::UInt8* u) \
{ \
return reinterpret_cast<vtkm::Vec<vtkm::Vec<RT, 9>, 2>*>(reinterpret_cast<void*>(u)); \
} \
struct SwallowSemicolon
#define ALIGN_RE_PAIR(T, U) \
template <> \
inline __host__ __device__ vtkm::Pair<T, U>* aligned_reinterpret_cast(void* u) \
{ \
return reinterpret_cast<vtkm::Pair<T, U>*>(reinterpret_cast<void*>(u)); \
} \
template <> \
inline __host__ __device__ vtkm::Pair<T, U>* aligned_reinterpret_cast(vtkm::UInt8* u) \
{ \
return reinterpret_cast<vtkm::Pair<T, U>*>(reinterpret_cast<void*>(u)); \
} \
#define ALIGN_RE_PAIR(T, U) \
template <> \
inline __host__ __device__ vtkm::Pair<T, U>* aligned_reinterpret_cast(void* u) \
{ \
return reinterpret_cast<vtkm::Pair<T, U>*>(reinterpret_cast<void*>(u)); \
} \
template <> \
inline __host__ __device__ vtkm::Pair<T, U>* aligned_reinterpret_cast(vtkm::UInt8* u) \
{ \
return reinterpret_cast<vtkm::Pair<T, U>*>(reinterpret_cast<void*>(u)); \
} \
struct SwallowSemicolon
#ifndef VTKM_DONT_FIX_THRUST

@ -241,25 +241,25 @@ struct TestWorkletErrorProxy : vtkm::exec::FunctorBase
// Check behavior of InvocationToFetch helper class.
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,
TestExecObject>>::type::value));
(std::is_same<
vtkm::exec::internal::detail::
InvocationToFetch<vtkm::exec::arg::ThreadIndicesBasic, InvocationType1, 1>::type,
vtkm::exec::arg::Fetch<TestFetchTagInput, vtkm::exec::arg::AspectTagDefault, TestExecObject>>::
type::value));
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,
TestExecObject>>::type::value));
(std::is_same<
vtkm::exec::internal::detail::
InvocationToFetch<vtkm::exec::arg::ThreadIndicesBasic, InvocationType1, 2>::type,
vtkm::exec::arg::Fetch<TestFetchTagOutput, vtkm::exec::arg::AspectTagDefault, TestExecObject>>::
type::value));
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,
TestExecObject>>::type::value));
(std::is_same<
vtkm::exec::internal::detail::
InvocationToFetch<vtkm::exec::arg::ThreadIndicesBasic, InvocationType2, 0>::type,
vtkm::exec::arg::Fetch<TestFetchTagOutput, vtkm::exec::arg::AspectTagDefault, TestExecObject>>::
type::value));
template <typename DeviceAdapter>
void TestNormalFunctorInvoke()

Some files were not shown because too many files have changed in this diff Show More