mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-10-05 01:49:02 +00:00
clang-format: reformat the repository with clang-format-9
This commit is contained in:
parent
1ea2e77ec2
commit
cf0cdcf7d1
@ -165,8 +165,8 @@ void BenchGradient(::benchmark::State& state, int options)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#define VTKM_PRIVATE_GRADIENT_BENCHMARK(Name, Opts) \
|
#define VTKM_PRIVATE_GRADIENT_BENCHMARK(Name, Opts) \
|
||||||
void BenchGradient##Name(::benchmark::State& state) { BenchGradient(state, Opts); } \
|
void BenchGradient##Name(::benchmark::State& state) { BenchGradient(state, Opts); } \
|
||||||
VTKM_BENCHMARK(BenchGradient##Name)
|
VTKM_BENCHMARK(BenchGradient##Name)
|
||||||
|
|
||||||
VTKM_PRIVATE_GRADIENT_BENCHMARK(Scalar, Gradient | ScalarInput);
|
VTKM_PRIVATE_GRADIENT_BENCHMARK(Scalar, Gradient | ScalarInput);
|
||||||
|
@ -170,7 +170,7 @@
|
|||||||
/// and modified using the passed arguments; see the Google Benchmark documentation
|
/// and modified using the passed arguments; see the Google Benchmark documentation
|
||||||
/// for more details. The `preamble` string may be used to supply additional
|
/// for more details. The `preamble` string may be used to supply additional
|
||||||
/// information that will be appended to the output's preamble.
|
/// 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)
|
vtkm::bench::detail::ExecuteBenchmarks(argc, argv, preamble)
|
||||||
|
|
||||||
/// \def VTKM_BENCHMARK(BenchFunc)
|
/// \def VTKM_BENCHMARK(BenchFunc)
|
||||||
@ -181,7 +181,7 @@
|
|||||||
/// ```
|
/// ```
|
||||||
/// void BenchFunc(::benchmark::State& state)
|
/// void BenchFunc(::benchmark::State& state)
|
||||||
/// ```
|
/// ```
|
||||||
#define VTKM_BENCHMARK(BenchFunc) \
|
#define VTKM_BENCHMARK(BenchFunc) \
|
||||||
BENCHMARK(BenchFunc)->UseManualTime()->Unit(benchmark::kMillisecond)
|
BENCHMARK(BenchFunc)->UseManualTime()->Unit(benchmark::kMillisecond)
|
||||||
|
|
||||||
/// \def VTKM_BENCHMARK_OPTS(BenchFunc, Args)
|
/// \def VTKM_BENCHMARK_OPTS(BenchFunc, Args)
|
||||||
@ -196,7 +196,7 @@
|
|||||||
/// Note the similarity to the raw Google Benchmark usage of
|
/// Note the similarity to the raw Google Benchmark usage of
|
||||||
/// `BENCHMARK(MyBenchmark)->ArgName("MyParam")->Range(32, 1024*1024);`. See
|
/// `BENCHMARK(MyBenchmark)->ArgName("MyParam")->Range(32, 1024*1024);`. See
|
||||||
/// the Google Benchmark documentation for more details on the available options.
|
/// 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
|
BENCHMARK(BenchFunc)->UseManualTime()->Unit(benchmark::kMillisecond) options
|
||||||
|
|
||||||
/// \def VTKM_BENCHMARK_APPLY(BenchFunc, ConfigFunc)
|
/// \def VTKM_BENCHMARK_APPLY(BenchFunc, ConfigFunc)
|
||||||
@ -211,7 +211,7 @@
|
|||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// See the Google Benchmark documentation for more details on the available options.
|
/// 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)
|
BENCHMARK(BenchFunc)->Apply(applyFunctor)->UseManualTime()->Unit(benchmark::kMillisecond)
|
||||||
|
|
||||||
/// \def VTKM_BENCHMARK_TEMPLATES(BenchFunc, TypeList)
|
/// \def VTKM_BENCHMARK_TEMPLATES(BenchFunc, TypeList)
|
||||||
@ -224,7 +224,7 @@
|
|||||||
/// template <typename T>
|
/// template <typename T>
|
||||||
/// void BenchFunc(::benchmark::State& state)
|
/// 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)
|
VTKM_BENCHMARK_TEMPLATES_APPLY(BenchFunc, vtkm::bench::detail::NullApply, TypeList)
|
||||||
|
|
||||||
/// \def VTKM_BENCHMARK_TEMPLATES_OPTS(BenchFunc, Args, TypeList)
|
/// \def VTKM_BENCHMARK_TEMPLATES_OPTS(BenchFunc, Args, TypeList)
|
||||||
@ -237,10 +237,10 @@
|
|||||||
/// ->ArgName("MyParam")->Range(32, 1024*1024),
|
/// ->ArgName("MyParam")->Range(32, 1024*1024),
|
||||||
/// vtkm::List<vtkm::Float32, vtkm::Vec3f_32>);
|
/// vtkm::List<vtkm::Float32, vtkm::Vec3f_32>);
|
||||||
/// ```
|
/// ```
|
||||||
#define VTKM_BENCHMARK_TEMPLATES_OPTS(BenchFunc, options, TypeList) \
|
#define VTKM_BENCHMARK_TEMPLATES_OPTS(BenchFunc, options, TypeList) \
|
||||||
VTKM_BENCHMARK_TEMPLATES_APPLY( \
|
VTKM_BENCHMARK_TEMPLATES_APPLY( \
|
||||||
BenchFunc, \
|
BenchFunc, \
|
||||||
[](::benchmark::internal::Benchmark* bm) { bm options->Unit(benchmark::kMillisecond); }, \
|
[](::benchmark::internal::Benchmark* bm) { bm options->Unit(benchmark::kMillisecond); }, \
|
||||||
TypeList)
|
TypeList)
|
||||||
|
|
||||||
/// \def VTKM_BENCHMARK_TEMPLATES_APPLY(BenchFunc, ConfigFunc, 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.
|
/// See the Google Benchmark documentation for more details on the available options.
|
||||||
#define VTKM_BENCHMARK_TEMPLATES_APPLY(BenchFunc, ApplyFunctor, TypeList) \
|
#define VTKM_BENCHMARK_TEMPLATES_APPLY(BenchFunc, ApplyFunctor, TypeList) \
|
||||||
namespace \
|
namespace \
|
||||||
{ /* A template function cannot be used as a template parameter, so wrap the function with \
|
{ /* 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. */ \
|
* a template struct to get it into the GenerateTemplateBenchmarks class. */ \
|
||||||
template <typename... Ts> \
|
template <typename... Ts> \
|
||||||
struct VTKM_BENCHMARK_WRAPPER_NAME(BenchFunc) \
|
struct VTKM_BENCHMARK_WRAPPER_NAME(BenchFunc) \
|
||||||
{ \
|
{ \
|
||||||
static ::benchmark::internal::Function* GetFunction() { return BenchFunc<Ts...>; } \
|
static ::benchmark::internal::Function* GetFunction() { return BenchFunc<Ts...>; } \
|
||||||
}; \
|
}; \
|
||||||
} /* end anon namespace */ \
|
} /* end anon namespace */ \
|
||||||
int BENCHMARK_PRIVATE_NAME(BenchFunc) = vtkm::bench::detail::GenerateTemplateBenchmarks< \
|
int BENCHMARK_PRIVATE_NAME(BenchFunc) = vtkm::bench::detail::GenerateTemplateBenchmarks< \
|
||||||
brigand::bind<VTKM_BENCHMARK_WRAPPER_NAME(BenchFunc)>, \
|
brigand::bind<VTKM_BENCHMARK_WRAPPER_NAME(BenchFunc)>, \
|
||||||
TypeList>::Register(#BenchFunc, ApplyFunctor)
|
TypeList>::Register(#BenchFunc, ApplyFunctor)
|
||||||
|
|
||||||
// Internal use only:
|
// Internal use only:
|
||||||
#define VTKM_BENCHMARK_WRAPPER_NAME(BenchFunc) \
|
#define VTKM_BENCHMARK_WRAPPER_NAME(BenchFunc) \
|
||||||
BENCHMARK_PRIVATE_CONCAT(_wrapper_, BenchFunc, __LINE__)
|
BENCHMARK_PRIVATE_CONCAT(_wrapper_, BenchFunc, __LINE__)
|
||||||
|
|
||||||
namespace vtkm
|
namespace vtkm
|
||||||
@ -280,9 +280,7 @@ namespace bench
|
|||||||
namespace detail
|
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
|
/// Do not use directly. The VTKM_BENCHMARK_TEMPLATES macros should be used
|
||||||
/// instead.
|
/// instead.
|
||||||
|
@ -370,28 +370,14 @@ int main(int argc, char* argv[])
|
|||||||
VTKM_LOG_IF_S(vtkm::cont::LogLevel::Info,
|
VTKM_LOG_IF_S(vtkm::cont::LogLevel::Info,
|
||||||
numLevels > 0,
|
numLevels > 0,
|
||||||
std::endl
|
std::endl
|
||||||
<< " ------------ Settings Isolevel Selection -----------"
|
<< " ------------ Settings Isolevel Selection -----------" << std::endl
|
||||||
<< std::endl
|
<< " levels=" << numLevels << std::endl
|
||||||
<< " levels="
|
<< " eps=" << eps << std::endl
|
||||||
<< numLevels
|
<< " comp" << numComp << std::endl
|
||||||
<< std::endl
|
<< " type=" << contourType << std::endl
|
||||||
<< " eps="
|
<< " method=" << contourSelectMethod << std::endl
|
||||||
<< eps
|
<< " mc=" << useMarchingCubes << std::endl
|
||||||
<< std::endl
|
<< " use" << (usePersistenceSorter ? "PersistenceSorter" : "VolumeSorter"));
|
||||||
<< " comp"
|
|
||||||
<< numComp
|
|
||||||
<< std::endl
|
|
||||||
<< " type="
|
|
||||||
<< contourType
|
|
||||||
<< std::endl
|
|
||||||
<< " method="
|
|
||||||
<< contourSelectMethod
|
|
||||||
<< std::endl
|
|
||||||
<< " mc="
|
|
||||||
<< useMarchingCubes
|
|
||||||
<< std::endl
|
|
||||||
<< " use"
|
|
||||||
<< (usePersistenceSorter ? "PersistenceSorter" : "VolumeSorter"));
|
|
||||||
}
|
}
|
||||||
currTime = totalTime.GetElapsedTime();
|
currTime = totalTime.GetElapsedTime();
|
||||||
vtkm::Float64 startUpTime = currTime - prevTime;
|
vtkm::Float64 startUpTime = currTime - prevTime;
|
||||||
@ -558,19 +544,17 @@ int main(int argc, char* argv[])
|
|||||||
{
|
{
|
||||||
VTKM_LOG_S(vtkm::cont::LogLevel::Info,
|
VTKM_LOG_S(vtkm::cont::LogLevel::Info,
|
||||||
std::endl
|
std::endl
|
||||||
<< " ---------------- Input Mesh Properties --------------"
|
<< " ---------------- Input Mesh Properties --------------" << std::endl
|
||||||
<< std::endl
|
<< " Number of dimensions: " << nDims);
|
||||||
<< " Number of dimensions: "
|
|
||||||
<< nDims);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if marching cubes is enabled for non 3D data
|
// Check if marching cubes is enabled for non 3D data
|
||||||
bool invalidMCOption = (useMarchingCubes && nDims != 3);
|
bool invalidMCOption = (useMarchingCubes && nDims != 3);
|
||||||
VTKM_LOG_IF_S(
|
VTKM_LOG_IF_S(vtkm::cont::LogLevel::Error,
|
||||||
vtkm::cont::LogLevel::Error,
|
invalidMCOption && (rank == 0),
|
||||||
invalidMCOption && (rank == 0),
|
"The input mesh is "
|
||||||
"The input mesh is " << nDims << "D. "
|
<< nDims << "D. "
|
||||||
<< "Contour tree using marching cubes is only supported for 3D data.");
|
<< "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 we found any errors in the setttings than finalize MPI and exit the execution
|
||||||
if (invalidMCOption)
|
if (invalidMCOption)
|
||||||
@ -583,7 +567,7 @@ int main(int argc, char* argv[])
|
|||||||
|
|
||||||
#ifndef WITH_MPI // construct regular, single-block VTK-M input dataset
|
#ifndef WITH_MPI // construct regular, single-block VTK-M input dataset
|
||||||
vtkm::cont::DataSet useDataSet = inDataSet; // Single block 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::cont::PartitionedDataSet useDataSet; // Partitioned variant of the input dataset
|
||||||
vtkm::Id3 blocksPerDim =
|
vtkm::Id3 blocksPerDim =
|
||||||
nDims == 3 ? vtkm::Id3(1, 1, numBlocks) : vtkm::Id3(1, numBlocks, 1); // Decompose the data into
|
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);
|
useDataSet.AppendPartition(ds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // WITH_MPI construct input dataset
|
#endif // WITH_MPI construct input dataset
|
||||||
|
|
||||||
currTime = totalTime.GetElapsedTime();
|
currTime = totalTime.GetElapsedTime();
|
||||||
buildDatasetTime = currTime - prevTime;
|
buildDatasetTime = currTime - prevTime;
|
||||||
@ -866,116 +850,47 @@ int main(int argc, char* argv[])
|
|||||||
currTime = totalTime.GetElapsedTime();
|
currTime = totalTime.GetElapsedTime();
|
||||||
VTKM_LOG_S(vtkm::cont::LogLevel::Info,
|
VTKM_LOG_S(vtkm::cont::LogLevel::Info,
|
||||||
std::endl
|
std::endl
|
||||||
<< " -------------------------- Totals "
|
<< " -------------------------- Totals " << rank
|
||||||
<< rank
|
<< " -----------------------------" << std::endl
|
||||||
<< " -----------------------------"
|
<< std::setw(42) << std::left << " Start-up"
|
||||||
<< std::endl
|
<< ": " << startUpTime << " seconds" << std::endl
|
||||||
<< std::setw(42)
|
<< std::setw(42) << std::left << " Data Read"
|
||||||
<< std::left
|
<< ": " << dataReadTime << " seconds" << std::endl
|
||||||
<< " Start-up"
|
<< std::setw(42) << std::left << " Build VTKM Dataset"
|
||||||
<< ": "
|
<< ": " << buildDatasetTime << " seconds" << std::endl
|
||||||
<< startUpTime
|
<< std::setw(42) << std::left << " Compute Contour Tree"
|
||||||
<< " seconds"
|
<< ": " << computeContourTreeTime << " seconds" << std::endl
|
||||||
<< std::endl
|
<< std::setw(42) << std::left << " Compute Branch Decomposition"
|
||||||
<< std::setw(42)
|
<< ": " << computeBranchDecompTime << " seconds" << std::endl
|
||||||
<< std::left
|
<< std::setw(42) << std::left << " Total Time"
|
||||||
<< " Data Read"
|
<< ": " << currTime << " seconds");
|
||||||
<< ": "
|
|
||||||
<< 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();
|
const ctaug_ns::ContourTree& ct = filter.GetContourTree();
|
||||||
VTKM_LOG_S(vtkm::cont::LogLevel::Info,
|
VTKM_LOG_S(vtkm::cont::LogLevel::Info,
|
||||||
std::endl
|
std::endl
|
||||||
<< " ---------------- Contour Tree Array Sizes ---------------------"
|
<< " ---------------- Contour Tree Array Sizes ---------------------" << std::endl
|
||||||
<< std::endl
|
<< std::setw(42) << std::left << " #Nodes"
|
||||||
<< std::setw(42)
|
<< ": " << ct.Nodes.GetNumberOfValues() << std::endl
|
||||||
<< std::left
|
<< std::setw(42) << std::left << " #Arcs"
|
||||||
<< " #Nodes"
|
<< ": " << ct.Arcs.GetNumberOfValues() << std::endl
|
||||||
<< ": "
|
<< std::setw(42) << std::left << " #Superparents"
|
||||||
<< ct.Nodes.GetNumberOfValues()
|
<< ": " << ct.Superparents.GetNumberOfValues() << std::endl
|
||||||
<< std::endl
|
<< std::setw(42) << std::left << " #Superarcs"
|
||||||
<< std::setw(42)
|
<< ": " << ct.Superarcs.GetNumberOfValues() << std::endl
|
||||||
<< std::left
|
<< std::setw(42) << std::left << " #Supernodes"
|
||||||
<< " #Arcs"
|
<< ": " << ct.Supernodes.GetNumberOfValues() << std::endl
|
||||||
<< ": "
|
<< std::setw(42) << std::left << " #Hyperparents"
|
||||||
<< ct.Arcs.GetNumberOfValues()
|
<< ": " << ct.Hyperparents.GetNumberOfValues() << std::endl
|
||||||
<< std::endl
|
<< std::setw(42) << std::left << " #WhenTransferred"
|
||||||
<< std::setw(42)
|
<< ": " << ct.WhenTransferred.GetNumberOfValues() << std::endl
|
||||||
<< std::left
|
<< std::setw(42) << std::left << " #Hypernodes"
|
||||||
<< " #Superparents"
|
<< ": " << ct.Hypernodes.GetNumberOfValues() << std::endl
|
||||||
<< ": "
|
<< std::setw(42) << std::left << " #Hyperarcs"
|
||||||
<< ct.Superparents.GetNumberOfValues()
|
<< ": " << ct.Hyperarcs.GetNumberOfValues() << std::endl);
|
||||||
<< 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
|
// Print hyperstructure statistics
|
||||||
VTKM_LOG_S(vtkm::cont::LogLevel::Info,
|
VTKM_LOG_S(vtkm::cont::LogLevel::Info,
|
||||||
std::endl
|
std::endl
|
||||||
<< ct.PrintHyperStructureStatistics(false)
|
<< ct.PrintHyperStructureStatistics(false) << std::endl);
|
||||||
<< std::endl);
|
|
||||||
|
|
||||||
// Flush ouput streams just to make sure everything has been logged (in particular when using MPI)
|
// Flush ouput streams just to make sure everything has been logged (in particular when using MPI)
|
||||||
std::cout << std::flush;
|
std::cout << std::flush;
|
||||||
|
@ -252,25 +252,14 @@ int main(int argc, char* argv[])
|
|||||||
{
|
{
|
||||||
VTKM_LOG_S(vtkm::cont::LogLevel::Info,
|
VTKM_LOG_S(vtkm::cont::LogLevel::Info,
|
||||||
std::endl
|
std::endl
|
||||||
<< " ------------ Settings -----------"
|
<< " ------------ Settings -----------" << std::endl
|
||||||
<< std::endl
|
<< " filename=" << filename << std::endl
|
||||||
<< " filename="
|
<< " device=" << device.GetName() << std::endl
|
||||||
<< filename
|
<< " mc=" << useMarchingCubes << std::endl
|
||||||
<< std::endl
|
|
||||||
<< " device="
|
|
||||||
<< device.GetName()
|
|
||||||
<< std::endl
|
|
||||||
<< " mc="
|
|
||||||
<< useMarchingCubes
|
|
||||||
<< std::endl
|
|
||||||
#ifdef ENABLE_SET_NUM_THREADS
|
#ifdef ENABLE_SET_NUM_THREADS
|
||||||
<< " numThreads="
|
<< " numThreads=" << numThreads << std::endl
|
||||||
<< numThreads
|
|
||||||
<< std::endl
|
|
||||||
#endif
|
#endif
|
||||||
<< " nblocks="
|
<< " nblocks=" << numBlocks << std::endl);
|
||||||
<< numBlocks
|
|
||||||
<< std::endl);
|
|
||||||
}
|
}
|
||||||
currTime = totalTime.GetElapsedTime();
|
currTime = totalTime.GetElapsedTime();
|
||||||
vtkm::Float64 startUpTime = currTime - prevTime;
|
vtkm::Float64 startUpTime = currTime - prevTime;
|
||||||
@ -341,14 +330,9 @@ int main(int argc, char* argv[])
|
|||||||
{
|
{
|
||||||
VTKM_LOG_S(vtkm::cont::LogLevel::Info,
|
VTKM_LOG_S(vtkm::cont::LogLevel::Info,
|
||||||
std::endl
|
std::endl
|
||||||
<< " ---------------- Input Mesh Properties --------------"
|
<< " ---------------- Input Mesh Properties --------------" << std::endl
|
||||||
<< std::endl
|
<< " Number of dimensions: " << nDims << std::endl
|
||||||
<< " Number of dimensions: "
|
<< " Number of mesh vertices: " << numVertices << std::endl);
|
||||||
<< nDims
|
|
||||||
<< std::endl
|
|
||||||
<< " Number of mesh vertices: "
|
|
||||||
<< numVertices
|
|
||||||
<< std::endl);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for fatal input errors
|
// Check for fatal input errors
|
||||||
@ -359,13 +343,14 @@ int main(int argc, char* argv[])
|
|||||||
// Log any errors if found on rank 0
|
// Log any errors if found on rank 0
|
||||||
VTKM_LOG_IF_S(vtkm::cont::LogLevel::Error,
|
VTKM_LOG_IF_S(vtkm::cont::LogLevel::Error,
|
||||||
invalidNumDimensions && (rank == 0),
|
invalidNumDimensions && (rank == 0),
|
||||||
"The input mesh is " << nDims << "D. "
|
"The input mesh is " << nDims
|
||||||
"The input data must be either 2D or 3D.");
|
<< "D. "
|
||||||
VTKM_LOG_IF_S(
|
"The input data must be either 2D or 3D.");
|
||||||
vtkm::cont::LogLevel::Error,
|
VTKM_LOG_IF_S(vtkm::cont::LogLevel::Error,
|
||||||
invalidMCOption && (rank == 0),
|
invalidMCOption && (rank == 0),
|
||||||
"The input mesh is " << nDims << "D. "
|
"The input mesh is "
|
||||||
<< "Contour tree using marching cubes is only supported for 3D data.");
|
<< 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 we found any errors in the setttings than finalize MPI and exit the execution
|
||||||
if (invalidNumDimensions || invalidMCOption)
|
if (invalidNumDimensions || invalidMCOption)
|
||||||
{
|
{
|
||||||
@ -519,44 +504,18 @@ int main(int argc, char* argv[])
|
|||||||
currTime = totalTime.GetElapsedTime();
|
currTime = totalTime.GetElapsedTime();
|
||||||
VTKM_LOG_S(vtkm::cont::LogLevel::Info,
|
VTKM_LOG_S(vtkm::cont::LogLevel::Info,
|
||||||
std::endl
|
std::endl
|
||||||
<< " -------------------------- Totals "
|
<< " -------------------------- Totals " << rank
|
||||||
<< rank
|
<< " -----------------------------" << std::endl
|
||||||
<< " -----------------------------"
|
<< std::setw(42) << std::left << " Start-up"
|
||||||
<< std::endl
|
<< ": " << startUpTime << " seconds" << std::endl
|
||||||
<< std::setw(42)
|
<< std::setw(42) << std::left << " Data Read"
|
||||||
<< std::left
|
<< ": " << dataReadTime << " seconds" << std::endl
|
||||||
<< " Start-up"
|
<< std::setw(42) << std::left << " Build VTKM Dataset"
|
||||||
<< ": "
|
<< ": " << buildDatasetTime << " seconds" << std::endl
|
||||||
<< startUpTime
|
<< std::setw(42) << std::left << " Compute Contour Tree"
|
||||||
<< " seconds"
|
<< ": " << computeContourTreeTime << " seconds" << std::endl
|
||||||
<< std::endl
|
<< std::setw(42) << std::left << " Total Time"
|
||||||
<< std::setw(42)
|
<< ": " << currTime << " seconds");
|
||||||
<< 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)
|
// Flush ouput streams just to make sure everything has been logged (in particular when using MPI)
|
||||||
std::cout << std::flush;
|
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
|
// 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
|
// 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::CanvasRayTracer;
|
||||||
|
using vtkm::rendering::MapperRayTracer;
|
||||||
|
using vtkm::rendering::MapperVolume;
|
||||||
|
using vtkm::rendering::MapperWireframer;
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
|
@ -66,10 +66,10 @@ struct UpdateSpins : public vtkm::worklet::WorkletCellNeighborhood
|
|||||||
const auto mySpin = prevspin.Get(0, 0, 0);
|
const auto mySpin = prevspin.Get(0, 0, 0);
|
||||||
|
|
||||||
// 1. Calculate the energy of flipping, E_flip
|
// 1. Calculate the energy of flipping, E_flip
|
||||||
vtkm::Float32 E_flip =
|
vtkm::Float32 E_flip = J * mySpin *
|
||||||
J * mySpin * (prevspin.Get(-1, -1, 0) + prevspin.Get(-1, 0, 0) + prevspin.Get(-1, 1, 0) +
|
(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(0, -1, 0) + prevspin.Get(0, 1, 0) + prevspin.Get(1, -1, 0) +
|
||||||
prevspin.Get(1, 0, 0) + prevspin.Get(1, 1, 0));
|
prevspin.Get(1, 0, 0) + prevspin.Get(1, 1, 0));
|
||||||
|
|
||||||
if (E_flip <= 0)
|
if (E_flip <= 0)
|
||||||
{
|
{
|
||||||
|
@ -223,11 +223,12 @@ inline VTKM_CONT vtkm::cont::PartitionedDataSet RedistributePoints::PrepareForEx
|
|||||||
vtkmdiy::RegularDecomposer<vtkmdiy::ContinuousBounds> decomposer(
|
vtkmdiy::RegularDecomposer<vtkmdiy::ContinuousBounds> decomposer(
|
||||||
/*dim*/ 3, internal::convert(gbounds), assigner.nblocks());
|
/*dim*/ 3, internal::convert(gbounds), assigner.nblocks());
|
||||||
|
|
||||||
vtkmdiy::Master master(comm,
|
vtkmdiy::Master master(
|
||||||
/*threads*/ 1,
|
comm,
|
||||||
/*limit*/ -1,
|
/*threads*/ 1,
|
||||||
[]() -> void* { return new vtkm::cont::DataSet(); },
|
/*limit*/ -1,
|
||||||
[](void* ptr) { delete static_cast<vtkm::cont::DataSet*>(ptr); });
|
[]() -> void* { return new vtkm::cont::DataSet(); },
|
||||||
|
[](void* ptr) { delete static_cast<vtkm::cont::DataSet*>(ptr); });
|
||||||
decomposer.decompose(comm.rank(), assigner, master);
|
decomposer.decompose(comm.rank(), assigner, master);
|
||||||
|
|
||||||
assert(static_cast<vtkm::Id>(master.size()) == input.GetNumberOfPartitions());
|
assert(static_cast<vtkm::Id>(master.size()) == input.GetNumberOfPartitions());
|
||||||
|
@ -471,29 +471,29 @@ VTKM_EXEC_CONT inline void AtomicStoreImpl(vtkm::UInt64* addr,
|
|||||||
*addr = val;
|
*addr = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define VTKM_ATOMIC_OP(vtkmName, winName, vtkmType, winType, suffix) \
|
#define VTKM_ATOMIC_OP(vtkmName, winName, vtkmType, winType, suffix) \
|
||||||
VTKM_EXEC_CONT inline vtkmType vtkmName(vtkmType* addr, vtkmType arg, vtkm::MemoryOrder order) \
|
VTKM_EXEC_CONT inline vtkmType vtkmName(vtkmType* addr, vtkmType arg, vtkm::MemoryOrder order) \
|
||||||
{ \
|
{ \
|
||||||
return BitCast<vtkmType>( \
|
return BitCast<vtkmType>( \
|
||||||
winName##suffix(reinterpret_cast<volatile winType*>(addr), BitCast<winType>(arg))); \
|
winName##suffix(reinterpret_cast<volatile winType*>(addr), BitCast<winType>(arg))); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define VTKM_ATOMIC_OPS_FOR_TYPE(vtkmType, winType, suffix) \
|
#define VTKM_ATOMIC_OPS_FOR_TYPE(vtkmType, winType, suffix) \
|
||||||
VTKM_ATOMIC_OP(AtomicAddImpl, _InterlockedExchangeAdd, vtkmType, winType, suffix) \
|
VTKM_ATOMIC_OP(AtomicAddImpl, _InterlockedExchangeAdd, vtkmType, winType, suffix) \
|
||||||
VTKM_ATOMIC_OP(AtomicAndImpl, _InterlockedAnd, vtkmType, winType, suffix) \
|
VTKM_ATOMIC_OP(AtomicAndImpl, _InterlockedAnd, vtkmType, winType, suffix) \
|
||||||
VTKM_ATOMIC_OP(AtomicOrImpl, _InterlockedOr, vtkmType, winType, suffix) \
|
VTKM_ATOMIC_OP(AtomicOrImpl, _InterlockedOr, vtkmType, winType, suffix) \
|
||||||
VTKM_ATOMIC_OP(AtomicXorImpl, _InterlockedXor, vtkmType, winType, suffix) \
|
VTKM_ATOMIC_OP(AtomicXorImpl, _InterlockedXor, vtkmType, winType, suffix) \
|
||||||
VTKM_EXEC_CONT inline vtkmType AtomicNotImpl(vtkmType* addr, vtkm::MemoryOrder order) \
|
VTKM_EXEC_CONT inline vtkmType AtomicNotImpl(vtkmType* addr, vtkm::MemoryOrder order) \
|
||||||
{ \
|
{ \
|
||||||
return AtomicXorImpl(addr, static_cast<vtkmType>(~vtkmType{ 0u }), order); \
|
return AtomicXorImpl(addr, static_cast<vtkmType>(~vtkmType{ 0u }), order); \
|
||||||
} \
|
} \
|
||||||
VTKM_EXEC_CONT inline vtkmType AtomicCompareAndSwapImpl( \
|
VTKM_EXEC_CONT inline vtkmType AtomicCompareAndSwapImpl( \
|
||||||
vtkmType* addr, vtkmType desired, vtkmType expected, vtkm::MemoryOrder order) \
|
vtkmType* addr, vtkmType desired, vtkmType expected, vtkm::MemoryOrder order) \
|
||||||
{ \
|
{ \
|
||||||
return BitCast<vtkmType>( \
|
return BitCast<vtkmType>( \
|
||||||
_InterlockedCompareExchange##suffix(reinterpret_cast<volatile winType*>(addr), \
|
_InterlockedCompareExchange##suffix(reinterpret_cast<volatile winType*>(addr), \
|
||||||
BitCast<winType>(desired), \
|
BitCast<winType>(desired), \
|
||||||
BitCast<winType>(expected))); \
|
BitCast<winType>(expected))); \
|
||||||
}
|
}
|
||||||
|
|
||||||
VTKM_ATOMIC_OPS_FOR_TYPE(vtkm::UInt8, CHAR, 8)
|
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
|
/// concept check to make sure that a template argument is a proper cell shape
|
||||||
/// tag.
|
/// tag.
|
||||||
///
|
///
|
||||||
#define VTKM_IS_CELL_SHAPE_TAG(tag) \
|
#define VTKM_IS_CELL_SHAPE_TAG(tag) \
|
||||||
VTKM_STATIC_ASSERT_MSG(::vtkm::internal::CellShapeTagCheck<tag>::value, \
|
VTKM_STATIC_ASSERT_MSG(::vtkm::internal::CellShapeTagCheck<tag>::value, \
|
||||||
"Provided type is not a valid VTK-m cell shape tag.")
|
"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.
|
/// 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
|
// 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.
|
// between tags and ids. The following macro is only valid here.
|
||||||
|
|
||||||
#define VTKM_DEFINE_CELL_TAG(name, idname) \
|
#define VTKM_DEFINE_CELL_TAG(name, idname) \
|
||||||
struct CellShapeTag##name \
|
struct CellShapeTag##name \
|
||||||
{ \
|
{ \
|
||||||
static constexpr vtkm::UInt8 Id = vtkm::idname; \
|
static constexpr vtkm::UInt8 Id = vtkm::idname; \
|
||||||
}; \
|
}; \
|
||||||
namespace internal \
|
namespace internal \
|
||||||
{ \
|
{ \
|
||||||
template <> \
|
template <> \
|
||||||
struct CellShapeTagCheck<vtkm::CellShapeTag##name> : std::true_type \
|
struct CellShapeTagCheck<vtkm::CellShapeTag##name> : std::true_type \
|
||||||
{ \
|
{ \
|
||||||
}; \
|
}; \
|
||||||
template <> \
|
template <> \
|
||||||
struct CellShapeTagVtkmToVtkc<vtkm::CellShapeTag##name> \
|
struct CellShapeTagVtkmToVtkc<vtkm::CellShapeTag##name> \
|
||||||
{ \
|
{ \
|
||||||
using Type = lcl::name; \
|
using Type = lcl::name; \
|
||||||
}; \
|
}; \
|
||||||
} \
|
} \
|
||||||
static inline VTKM_EXEC_CONT const char* GetCellShapeName(vtkm::CellShapeTag##name) \
|
static inline VTKM_EXEC_CONT const char* GetCellShapeName(vtkm::CellShapeTag##name) \
|
||||||
{ \
|
{ \
|
||||||
return #name; \
|
return #name; \
|
||||||
} \
|
} \
|
||||||
template <> \
|
template <> \
|
||||||
struct CellShapeIdToTag<vtkm::idname> \
|
struct CellShapeIdToTag<vtkm::idname> \
|
||||||
{ \
|
{ \
|
||||||
using valid = std::true_type; \
|
using valid = std::true_type; \
|
||||||
using Tag = vtkm::CellShapeTag##name; \
|
using Tag = vtkm::CellShapeTag##name; \
|
||||||
}
|
}
|
||||||
|
|
||||||
VTKM_DEFINE_CELL_TAG(Empty, CELL_SHAPE_EMPTY);
|
VTKM_DEFINE_CELL_TAG(Empty, CELL_SHAPE_EMPTY);
|
||||||
@ -189,12 +189,12 @@ inline lcl::Cell make_LclCellShapeTag(const vtkm::CellShapeTagGeneric& tag,
|
|||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
|
||||||
#define vtkmGenericCellShapeMacroCase(cellShapeId, call) \
|
#define vtkmGenericCellShapeMacroCase(cellShapeId, call) \
|
||||||
case vtkm::cellShapeId: \
|
case vtkm::cellShapeId: \
|
||||||
{ \
|
{ \
|
||||||
using CellShapeTag = vtkm::CellShapeIdToTag<vtkm::cellShapeId>::Tag; \
|
using CellShapeTag = vtkm::CellShapeIdToTag<vtkm::cellShapeId>::Tag; \
|
||||||
call; \
|
call; \
|
||||||
} \
|
} \
|
||||||
break
|
break
|
||||||
|
|
||||||
/// \brief A macro used in a \c switch statement to determine cell shape.
|
/// \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
|
/// Note that \c vtkmGenericCellShapeMacro does not have a default case. You
|
||||||
/// should consider adding one that gives a
|
/// should consider adding one that gives a
|
||||||
///
|
///
|
||||||
#define vtkmGenericCellShapeMacro(call) \
|
#define vtkmGenericCellShapeMacro(call) \
|
||||||
vtkmGenericCellShapeMacroCase(CELL_SHAPE_EMPTY, call); \
|
vtkmGenericCellShapeMacroCase(CELL_SHAPE_EMPTY, call); \
|
||||||
vtkmGenericCellShapeMacroCase(CELL_SHAPE_VERTEX, call); \
|
vtkmGenericCellShapeMacroCase(CELL_SHAPE_VERTEX, call); \
|
||||||
vtkmGenericCellShapeMacroCase(CELL_SHAPE_LINE, call); \
|
vtkmGenericCellShapeMacroCase(CELL_SHAPE_LINE, call); \
|
||||||
vtkmGenericCellShapeMacroCase(CELL_SHAPE_POLY_LINE, call); \
|
vtkmGenericCellShapeMacroCase(CELL_SHAPE_POLY_LINE, call); \
|
||||||
vtkmGenericCellShapeMacroCase(CELL_SHAPE_TRIANGLE, call); \
|
vtkmGenericCellShapeMacroCase(CELL_SHAPE_TRIANGLE, call); \
|
||||||
vtkmGenericCellShapeMacroCase(CELL_SHAPE_POLYGON, call); \
|
vtkmGenericCellShapeMacroCase(CELL_SHAPE_POLYGON, call); \
|
||||||
vtkmGenericCellShapeMacroCase(CELL_SHAPE_QUAD, call); \
|
vtkmGenericCellShapeMacroCase(CELL_SHAPE_QUAD, call); \
|
||||||
vtkmGenericCellShapeMacroCase(CELL_SHAPE_TETRA, call); \
|
vtkmGenericCellShapeMacroCase(CELL_SHAPE_TETRA, call); \
|
||||||
vtkmGenericCellShapeMacroCase(CELL_SHAPE_HEXAHEDRON, call); \
|
vtkmGenericCellShapeMacroCase(CELL_SHAPE_HEXAHEDRON, call); \
|
||||||
vtkmGenericCellShapeMacroCase(CELL_SHAPE_WEDGE, call); \
|
vtkmGenericCellShapeMacroCase(CELL_SHAPE_WEDGE, call); \
|
||||||
vtkmGenericCellShapeMacroCase(CELL_SHAPE_PYRAMID, call)
|
vtkmGenericCellShapeMacroCase(CELL_SHAPE_PYRAMID, call)
|
||||||
|
|
||||||
} // namespace vtkm
|
} // namespace vtkm
|
||||||
|
@ -81,23 +81,23 @@ struct CellTraits
|
|||||||
|
|
||||||
// Define traits for every cell type.
|
// Define traits for every cell type.
|
||||||
|
|
||||||
#define VTKM_DEFINE_CELL_TRAITS(name, dimensions, numPoints) \
|
#define VTKM_DEFINE_CELL_TRAITS(name, dimensions, numPoints) \
|
||||||
template <> \
|
template <> \
|
||||||
struct CellTraits<vtkm::CellShapeTag##name> \
|
struct CellTraits<vtkm::CellShapeTag##name> \
|
||||||
{ \
|
{ \
|
||||||
static constexpr vtkm::IdComponent TOPOLOGICAL_DIMENSIONS = dimensions; \
|
static constexpr vtkm::IdComponent TOPOLOGICAL_DIMENSIONS = dimensions; \
|
||||||
using TopologicalDimensionsTag = vtkm::CellTopologicalDimensionsTag<TOPOLOGICAL_DIMENSIONS>; \
|
using TopologicalDimensionsTag = vtkm::CellTopologicalDimensionsTag<TOPOLOGICAL_DIMENSIONS>; \
|
||||||
using IsSizeFixed = vtkm::CellTraitsTagSizeFixed; \
|
using IsSizeFixed = vtkm::CellTraitsTagSizeFixed; \
|
||||||
static constexpr vtkm::IdComponent NUM_POINTS = numPoints; \
|
static constexpr vtkm::IdComponent NUM_POINTS = numPoints; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define VTKM_DEFINE_CELL_TRAITS_VARIABLE(name, dimensions) \
|
#define VTKM_DEFINE_CELL_TRAITS_VARIABLE(name, dimensions) \
|
||||||
template <> \
|
template <> \
|
||||||
struct CellTraits<vtkm::CellShapeTag##name> \
|
struct CellTraits<vtkm::CellShapeTag##name> \
|
||||||
{ \
|
{ \
|
||||||
static constexpr vtkm::IdComponent TOPOLOGICAL_DIMENSIONS = dimensions; \
|
static constexpr vtkm::IdComponent TOPOLOGICAL_DIMENSIONS = dimensions; \
|
||||||
using TopologicalDimensionsTag = vtkm::CellTopologicalDimensionsTag<TOPOLOGICAL_DIMENSIONS>; \
|
using TopologicalDimensionsTag = vtkm::CellTopologicalDimensionsTag<TOPOLOGICAL_DIMENSIONS>; \
|
||||||
using IsSizeFixed = vtkm::CellTraitsTagSizeVariable; \
|
using IsSizeFixed = vtkm::CellTraitsTagSizeVariable; \
|
||||||
}
|
}
|
||||||
|
|
||||||
VTKM_DEFINE_CELL_TRAITS(Empty, 0, 0);
|
VTKM_DEFINE_CELL_TRAITS(Empty, 0, 0);
|
||||||
|
@ -13,9 +13,9 @@
|
|||||||
#include <vtkm/StaticAssert.h>
|
#include <vtkm/StaticAssert.h>
|
||||||
#include <vtkm/Types.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{}))
|
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 "."
|
message " Deprecated in version " #version "."
|
||||||
|
|
||||||
/// \def VTKM_DEPRECATED(version, message)
|
/// \def VTKM_DEPRECATED(version, message)
|
||||||
@ -104,7 +104,7 @@
|
|||||||
#if defined(VTKM_GCC) || defined(VTKM_CLANG)
|
#if defined(VTKM_GCC) || defined(VTKM_CLANG)
|
||||||
|
|
||||||
#define VTKM_DEPRECATED_SUPPRESS_SUPPORTED
|
#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\"")
|
_Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
|
||||||
#define VTKM_DEPRECATED_SUPPRESS_END _Pragma("GCC diagnostic pop")
|
#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
|
} // namespace vtkm
|
||||||
|
|
||||||
#define VTKM_RETURN_ON_ERROR(call) \
|
#define VTKM_RETURN_ON_ERROR(call) \
|
||||||
do \
|
do \
|
||||||
{ \
|
{ \
|
||||||
auto status = (call); \
|
auto status = (call); \
|
||||||
if (status != ::vtkm::ErrorCode::Success) \
|
if (status != ::vtkm::ErrorCode::Success) \
|
||||||
{ \
|
{ \
|
||||||
return status; \
|
return status; \
|
||||||
} \
|
} \
|
||||||
} while (false)
|
} while (false)
|
||||||
|
|
||||||
#endif //vtk_m_exec_ErrorCode_h
|
#endif //vtk_m_exec_ErrorCode_h
|
||||||
|
19
vtkm/List.h
19
vtkm/List.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
|
/// actually a device adapter tag. (You can get weird errors elsewhere in the
|
||||||
/// code when a mistake is made.)
|
/// code when a mistake is made.)
|
||||||
///
|
///
|
||||||
#define VTKM_IS_LIST(type) \
|
#define VTKM_IS_LIST(type) \
|
||||||
VTKM_STATIC_ASSERT_MSG((::vtkm::internal::IsList<type>::value), \
|
VTKM_STATIC_ASSERT_MSG((::vtkm::internal::IsList<type>::value), \
|
||||||
"Provided type is not a valid VTK-m list type.")
|
"Provided type is not a valid VTK-m list type.")
|
||||||
|
|
||||||
namespace detail
|
namespace detail
|
||||||
@ -226,8 +226,7 @@ template <vtkm::IdComponent NumSearched,
|
|||||||
typename... Ts>
|
typename... Ts>
|
||||||
struct FindFirstOfType<NumSearched, Target, T0, T1, T2, T3, T4, T5, 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 ||
|
: FindFirstOfSplit4<(std::is_same<Target, T0>::value || std::is_same<Target, T1>::value ||
|
||||||
std::is_same<Target, T2>::value ||
|
std::is_same<Target, T2>::value || std::is_same<Target, T3>::value),
|
||||||
std::is_same<Target, T3>::value),
|
|
||||||
NumSearched,
|
NumSearched,
|
||||||
Target,
|
Target,
|
||||||
T0,
|
T0,
|
||||||
@ -257,8 +256,7 @@ template <vtkm::IdComponent NumSearched,
|
|||||||
typename... Ts>
|
typename... Ts>
|
||||||
struct FindFirstOfSplit8<true, NumSearched, Target, T0, T1, T2, T3, T4, T5, T6, T7, 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 ||
|
: FindFirstOfSplit4<(std::is_same<Target, T0>::value || std::is_same<Target, T1>::value ||
|
||||||
std::is_same<Target, T2>::value ||
|
std::is_same<Target, T2>::value || std::is_same<Target, T3>::value),
|
||||||
std::is_same<Target, T3>::value),
|
|
||||||
NumSearched,
|
NumSearched,
|
||||||
Target,
|
Target,
|
||||||
T0,
|
T0,
|
||||||
@ -305,12 +303,9 @@ template <vtkm::IdComponent NumSearched,
|
|||||||
typename... Ts>
|
typename... Ts>
|
||||||
struct FindFirstOfType<NumSearched, Target, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 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 ||
|
: FindFirstOfSplit8<(std::is_same<Target, T0>::value || std::is_same<Target, T1>::value ||
|
||||||
std::is_same<Target, T2>::value ||
|
std::is_same<Target, T2>::value || std::is_same<Target, T3>::value ||
|
||||||
std::is_same<Target, T3>::value ||
|
std::is_same<Target, T4>::value || std::is_same<Target, T5>::value ||
|
||||||
std::is_same<Target, T4>::value ||
|
std::is_same<Target, T6>::value || std::is_same<Target, T7>::value),
|
||||||
std::is_same<Target, T5>::value ||
|
|
||||||
std::is_same<Target, T6>::value ||
|
|
||||||
std::is_same<Target, T7>::value),
|
|
||||||
NumSearched,
|
NumSearched,
|
||||||
Target,
|
Target,
|
||||||
T0,
|
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
|
/// actually a device adapter tag. (You can get weird errors elsewhere in the
|
||||||
/// code when a mistake is made.)
|
/// code when a mistake is made.)
|
||||||
///
|
///
|
||||||
#define VTKM_IS_LIST_TAG(tag) \
|
#define VTKM_IS_LIST_TAG(tag) \
|
||||||
VTKM_STATIC_ASSERT_MSG((::vtkm::detail::ListTagAssert<tag>::value), \
|
VTKM_STATIC_ASSERT_MSG((::vtkm::detail::ListTagAssert<tag>::value), \
|
||||||
"Provided type is not a valid VTK-m list tag.")
|
"Provided type is not a valid VTK-m list tag.")
|
||||||
|
|
||||||
namespace internal
|
namespace internal
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
#define VTKM_STATIC_ASSERT(condition) \
|
#define VTKM_STATIC_ASSERT(condition) \
|
||||||
static_assert((condition), "Failed static assert: " #condition)
|
static_assert((condition), "Failed static assert: " #condition)
|
||||||
#define VTKM_STATIC_ASSERT_MSG(condition, message) static_assert((condition), message)
|
#define VTKM_STATIC_ASSERT_MSG(condition, message) static_assert((condition), message)
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ struct ReadTheSourceCodeHereForHelpOnThisError<true> : std::true_type
|
|||||||
|
|
||||||
} // namespace vtkm
|
} // 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)
|
VTKM_STATIC_ASSERT(vtkm::ReadTheSourceCodeHereForHelpOnThisError<noError>::value)
|
||||||
|
|
||||||
#endif //vtk_m_StaticAssert_h
|
#endif //vtk_m_StaticAssert_h
|
||||||
|
@ -89,8 +89,8 @@ struct TopologyElementTagCheck<vtkm::TopologyElementTagFace> : std::true_type
|
|||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
#define VTKM_IS_TOPOLOGY_ELEMENT_TAG(type) \
|
#define VTKM_IS_TOPOLOGY_ELEMENT_TAG(type) \
|
||||||
static_assert(::vtkm::internal::TopologyElementTagCheck<type>::value, \
|
static_assert(::vtkm::internal::TopologyElementTagCheck<type>::value, \
|
||||||
"Invalid Topology Element Tag being used")
|
"Invalid Topology Element Tag being used")
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
@ -82,26 +82,26 @@ struct TypeTraits<const T> : TypeTraits<T>
|
|||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
#define VTKM_BASIC_REAL_TYPE(T) \
|
#define VTKM_BASIC_REAL_TYPE(T) \
|
||||||
template <> \
|
template <> \
|
||||||
struct TypeTraits<T> \
|
struct TypeTraits<T> \
|
||||||
{ \
|
{ \
|
||||||
using NumericTag = TypeTraitsRealTag; \
|
using NumericTag = TypeTraitsRealTag; \
|
||||||
using DimensionalityTag = TypeTraitsScalarTag; \
|
using DimensionalityTag = TypeTraitsScalarTag; \
|
||||||
VTKM_EXEC_CONT static T ZeroInitialization() { return T(); } \
|
VTKM_EXEC_CONT static T ZeroInitialization() { return T(); } \
|
||||||
};
|
};
|
||||||
|
|
||||||
#define VTKM_BASIC_INTEGER_TYPE(T) \
|
#define VTKM_BASIC_INTEGER_TYPE(T) \
|
||||||
template <> \
|
template <> \
|
||||||
struct TypeTraits<T> \
|
struct TypeTraits<T> \
|
||||||
{ \
|
{ \
|
||||||
using NumericTag = TypeTraitsIntegerTag; \
|
using NumericTag = TypeTraitsIntegerTag; \
|
||||||
using DimensionalityTag = TypeTraitsScalarTag; \
|
using DimensionalityTag = TypeTraitsScalarTag; \
|
||||||
VTKM_EXEC_CONT static T ZeroInitialization() \
|
VTKM_EXEC_CONT static T ZeroInitialization() \
|
||||||
{ \
|
{ \
|
||||||
using ReturnType = T; \
|
using ReturnType = T; \
|
||||||
return ReturnType(); \
|
return ReturnType(); \
|
||||||
} \
|
} \
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Traits for basic C++ types.
|
/// Traits for basic C++ types.
|
||||||
|
10
vtkm/Types.h
10
vtkm/Types.h
@ -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
|
// Integer types of a width less than an integer get implicitly casted to
|
||||||
// an integer when doing a multiplication.
|
// an integer when doing a multiplication.
|
||||||
#define VTK_M_SCALAR_DOT(stype) \
|
#define VTK_M_SCALAR_DOT(stype) \
|
||||||
static inline VTKM_EXEC_CONT detail::DotType<stype>::type dot(stype a, stype b) \
|
static inline VTKM_EXEC_CONT detail::DotType<stype>::type dot(stype a, stype b) \
|
||||||
{ \
|
{ \
|
||||||
return a * b; \
|
return a * b; \
|
||||||
} /* LEGACY */ \
|
} /* LEGACY */ \
|
||||||
static inline VTKM_EXEC_CONT detail::DotType<stype>::type Dot(stype a, stype b) { return a * b; }
|
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::Int8)
|
||||||
VTK_M_SCALAR_DOT(vtkm::UInt8)
|
VTK_M_SCALAR_DOT(vtkm::UInt8)
|
||||||
|
@ -556,13 +556,13 @@ struct VTKM_NEVER_EXPORT VecTraits<vtkm::Pair<T, U>>
|
|||||||
|
|
||||||
} // anonymous namespace
|
} // anonymous namespace
|
||||||
|
|
||||||
#define VTKM_BASIC_TYPE_VECTOR(type) \
|
#define VTKM_BASIC_TYPE_VECTOR(type) \
|
||||||
namespace vtkm \
|
namespace vtkm \
|
||||||
{ \
|
{ \
|
||||||
template <> \
|
template <> \
|
||||||
struct VTKM_NEVER_EXPORT VecTraits<type> : public vtkm::internal::VecTraitsBasic<type> \
|
struct VTKM_NEVER_EXPORT VecTraits<type> : public vtkm::internal::VecTraitsBasic<type> \
|
||||||
{ \
|
{ \
|
||||||
}; \
|
}; \
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Allows you to treat basic types as if they were vectors.
|
/// 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.
|
{ // Retry on any device if the first attempt failed.
|
||||||
VTKM_LOG_S(vtkm::cont::LogLevel::Error,
|
VTKM_LOG_S(vtkm::cont::LogLevel::Error,
|
||||||
"Failed to run ArrayGetValues on device '"
|
"Failed to run ArrayGetValues on device '"
|
||||||
<< devId.GetName()
|
<< devId.GetName() << "'. Falling back to control-side copy.");
|
||||||
<< "'. Falling back to control-side copy.");
|
|
||||||
copyComplete = vtkm::cont::Algorithm::Copy(vtkm::cont::DeviceAdapterTagAny{}, input, output);
|
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;
|
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)
|
VTKM_STATIC_ASSERT(::vtkm::cont::internal::ArrayHandleCheck<T>::type::value)
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
@ -173,7 +173,10 @@ struct GetTypeInParentheses<void(T)>
|
|||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
VTKM_CONT \
|
VTKM_CONT \
|
||||||
classname(Thisclass&& src) noexcept : Superclass(std::move(src)) {} \
|
classname(Thisclass&& src) noexcept \
|
||||||
|
: Superclass(std::move(src)) \
|
||||||
|
{ \
|
||||||
|
} \
|
||||||
\
|
\
|
||||||
VTKM_CONT \
|
VTKM_CONT \
|
||||||
classname(const vtkm::cont::ArrayHandle<typename__ Superclass::ValueType, \
|
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
|
/// templated. For ArrayHandle sublcasses that are not templates, use
|
||||||
/// VTKM_ARRAY_HANDLE_SUBCLASS_NT.
|
/// 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)
|
VTK_M_ARRAY_HANDLE_SUBCLASS_IMPL(classname, fullclasstype, superclass, typename)
|
||||||
|
|
||||||
/// \brief Macro to make default methods in ArrayHandle subclasses.
|
/// \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
|
/// templated. For ArrayHandle sublcasses that are templates, use
|
||||||
/// VTKM_ARRAY_HANDLE_SUBCLASS.
|
/// 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, )
|
VTK_M_ARRAY_HANDLE_SUBCLASS_IMPL(classname, (classname), superclass, )
|
||||||
|
|
||||||
/// \brief Manages an array-worth of data.
|
/// \brief Manages an array-worth of data.
|
||||||
|
@ -37,10 +37,10 @@ vtkm::BufferSizeType NumberOfBytes(vtkm::Id numValues, std::size_t typeSize)
|
|||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
#define VTKM_STORAGE_INSTANTIATE(Type) \
|
#define VTKM_STORAGE_INSTANTIATE(Type) \
|
||||||
template class VTKM_CONT_EXPORT Storage<Type, StorageTagBasic>; \
|
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, 2>, StorageTagBasic>; \
|
||||||
template class VTKM_CONT_EXPORT Storage<vtkm::Vec<Type, 3>, StorageTagBasic>; \
|
template class VTKM_CONT_EXPORT Storage<vtkm::Vec<Type, 3>, StorageTagBasic>; \
|
||||||
template class VTKM_CONT_EXPORT Storage<vtkm::Vec<Type, 4>, StorageTagBasic>;
|
template class VTKM_CONT_EXPORT Storage<vtkm::Vec<Type, 4>, StorageTagBasic>;
|
||||||
|
|
||||||
VTKM_STORAGE_INSTANTIATE(char)
|
VTKM_STORAGE_INSTANTIATE(char)
|
||||||
@ -59,10 +59,10 @@ VTKM_STORAGE_INSTANTIATE(vtkm::Float64)
|
|||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
|
||||||
#define VTKM_ARRAYHANDLE_INSTANTIATE(Type) \
|
#define VTKM_ARRAYHANDLE_INSTANTIATE(Type) \
|
||||||
template class VTKM_CONT_EXPORT ArrayHandleNewStyle<Type, StorageTagBasic>; \
|
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, 2>, StorageTagBasic>; \
|
||||||
template class VTKM_CONT_EXPORT ArrayHandleNewStyle<vtkm::Vec<Type, 3>, StorageTagBasic>; \
|
template class VTKM_CONT_EXPORT ArrayHandleNewStyle<vtkm::Vec<Type, 3>, StorageTagBasic>; \
|
||||||
template class VTKM_CONT_EXPORT ArrayHandleNewStyle<vtkm::Vec<Type, 4>, StorageTagBasic>;
|
template class VTKM_CONT_EXPORT ArrayHandleNewStyle<vtkm::Vec<Type, 4>, StorageTagBasic>;
|
||||||
|
|
||||||
VTKM_ARRAYHANDLE_INSTANTIATE(char)
|
VTKM_ARRAYHANDLE_INSTANTIATE(char)
|
||||||
|
@ -434,10 +434,10 @@ namespace internal
|
|||||||
|
|
||||||
/// \cond
|
/// \cond
|
||||||
/// Make doxygen ignore this section
|
/// Make doxygen ignore this section
|
||||||
#define VTKM_STORAGE_EXPORT(Type) \
|
#define VTKM_STORAGE_EXPORT(Type) \
|
||||||
extern template class VTKM_CONT_TEMPLATE_EXPORT Storage<Type, StorageTagBasic>; \
|
extern template class VTKM_CONT_TEMPLATE_EXPORT Storage<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, 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, 3>, StorageTagBasic>; \
|
||||||
extern template class VTKM_CONT_TEMPLATE_EXPORT Storage<vtkm::Vec<Type, 4>, StorageTagBasic>;
|
extern template class VTKM_CONT_TEMPLATE_EXPORT Storage<vtkm::Vec<Type, 4>, StorageTagBasic>;
|
||||||
|
|
||||||
VTKM_STORAGE_EXPORT(char)
|
VTKM_STORAGE_EXPORT(char)
|
||||||
@ -457,13 +457,13 @@ VTKM_STORAGE_EXPORT(vtkm::Float64)
|
|||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
|
||||||
#define VTKM_ARRAYHANDLE_EXPORT(Type) \
|
#define VTKM_ARRAYHANDLE_EXPORT(Type) \
|
||||||
extern template class VTKM_CONT_TEMPLATE_EXPORT ArrayHandleNewStyle<Type, StorageTagBasic>; \
|
extern template class VTKM_CONT_TEMPLATE_EXPORT ArrayHandleNewStyle<Type, StorageTagBasic>; \
|
||||||
extern template class VTKM_CONT_TEMPLATE_EXPORT \
|
extern template class VTKM_CONT_TEMPLATE_EXPORT \
|
||||||
ArrayHandleNewStyle<vtkm::Vec<Type, 2>, StorageTagBasic>; \
|
ArrayHandleNewStyle<vtkm::Vec<Type, 2>, StorageTagBasic>; \
|
||||||
extern template class VTKM_CONT_TEMPLATE_EXPORT \
|
extern template class VTKM_CONT_TEMPLATE_EXPORT \
|
||||||
ArrayHandleNewStyle<vtkm::Vec<Type, 3>, StorageTagBasic>; \
|
ArrayHandleNewStyle<vtkm::Vec<Type, 3>, StorageTagBasic>; \
|
||||||
extern template class VTKM_CONT_TEMPLATE_EXPORT \
|
extern template class VTKM_CONT_TEMPLATE_EXPORT \
|
||||||
ArrayHandleNewStyle<vtkm::Vec<Type, 4>, StorageTagBasic>;
|
ArrayHandleNewStyle<vtkm::Vec<Type, 4>, StorageTagBasic>;
|
||||||
|
|
||||||
VTKM_ARRAYHANDLE_EXPORT(char)
|
VTKM_ARRAYHANDLE_EXPORT(char)
|
||||||
|
@ -29,10 +29,16 @@ public:
|
|||||||
using ValueType = bool;
|
using ValueType = bool;
|
||||||
|
|
||||||
VTKM_EXEC_CONT
|
VTKM_EXEC_CONT
|
||||||
explicit ArrayPortalBitField(const BitPortalType& portal) noexcept : BitPortal{ portal } {}
|
explicit ArrayPortalBitField(const BitPortalType& portal) noexcept
|
||||||
|
: BitPortal{ portal }
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
VTKM_EXEC_CONT
|
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() noexcept = default;
|
||||||
ArrayPortalBitField(const 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() = default;
|
||||||
VTKM_CONT Storage(const 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>
|
template <typename TargetT, typename SourceT, typename SourceStorage, typename Device>
|
||||||
struct ArrayTransfer<TargetT, vtkm::cont::StorageTagCast<SourceT, SourceStorage>, Device>
|
struct ArrayTransfer<TargetT, vtkm::cont::StorageTagCast<SourceT, SourceStorage>, Device>
|
||||||
: detail::ArrayHandleCastTraits<TargetT,
|
: detail::ArrayHandleCastTraits<TargetT, SourceT, SourceStorage>::
|
||||||
SourceT,
|
template ArrayTransferSuperclass<Device>
|
||||||
SourceStorage>::template ArrayTransferSuperclass<Device>
|
|
||||||
{
|
{
|
||||||
using Superclass =
|
using Superclass = typename detail::ArrayHandleCastTraits<TargetT, SourceT, SourceStorage>::
|
||||||
typename detail::ArrayHandleCastTraits<TargetT,
|
template ArrayTransferSuperclass<Device>;
|
||||||
SourceT,
|
|
||||||
SourceStorage>::template ArrayTransferSuperclass<Device>;
|
|
||||||
|
|
||||||
using Superclass::Superclass;
|
using Superclass::Superclass;
|
||||||
};
|
};
|
||||||
|
@ -500,9 +500,9 @@ public:
|
|||||||
using PortalControl = typename StorageType::PortalType;
|
using PortalControl = typename StorageType::PortalType;
|
||||||
using PortalConstControl = typename StorageType::PortalConstType;
|
using PortalConstControl = typename StorageType::PortalConstType;
|
||||||
|
|
||||||
using PortalExecution = ArrayPortalCompositeVector<
|
using PortalExecution =
|
||||||
typename vtkm::cont::ArrayHandle<T,
|
ArrayPortalCompositeVector<typename vtkm::cont::ArrayHandle<T, StorageTags>::
|
||||||
StorageTags>::template ExecutionTypes<DeviceTag>::Portal...>;
|
template ExecutionTypes<DeviceTag>::Portal...>;
|
||||||
using PortalConstExecution =
|
using PortalConstExecution =
|
||||||
ArrayPortalCompositeVector<typename vtkm::cont::ArrayHandle<T, StorageTags>::
|
ArrayPortalCompositeVector<typename vtkm::cont::ArrayHandle<T, StorageTags>::
|
||||||
template ExecutionTypes<DeviceTag>::PortalConst...>;
|
template ExecutionTypes<DeviceTag>::PortalConst...>;
|
||||||
|
@ -483,10 +483,10 @@ struct DecoratorStorageTraits
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Static dispatch for calling AllocateSourceArrays on supported implementations:
|
// Static dispatch for calling AllocateSourceArrays on supported implementations:
|
||||||
VTKM_CONT[[noreturn]] static void CallAllocate(std::false_type,
|
VTKM_CONT [[noreturn]] static void CallAllocate(std::false_type,
|
||||||
const DecoratorImplT&,
|
const DecoratorImplT&,
|
||||||
vtkm::Id,
|
vtkm::Id,
|
||||||
ArrayTs&...)
|
ArrayTs&...)
|
||||||
{
|
{
|
||||||
throw vtkm::cont::ErrorBadType("Allocate not supported by this ArrayHandleDecorator.");
|
throw vtkm::cont::ErrorBadType("Allocate not supported by this ArrayHandleDecorator.");
|
||||||
}
|
}
|
||||||
@ -500,10 +500,10 @@ struct DecoratorStorageTraits
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Static dispatch for calling ShrinkSourceArrays on supported implementations.
|
// Static dispatch for calling ShrinkSourceArrays on supported implementations.
|
||||||
VTKM_CONT[[noreturn]] static void CallShrink(std::false_type,
|
VTKM_CONT [[noreturn]] static void CallShrink(std::false_type,
|
||||||
const DecoratorImplT&,
|
const DecoratorImplT&,
|
||||||
vtkm::Id,
|
vtkm::Id,
|
||||||
ArrayTs&...)
|
ArrayTs&...)
|
||||||
{
|
{
|
||||||
throw vtkm::cont::ErrorBadType("Shrink not supported by this ArrayHandleDecorator.");
|
throw vtkm::cont::ErrorBadType("Shrink not supported by this ArrayHandleDecorator.");
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,8 @@ struct ArrayPortalMultiplexer
|
|||||||
ArrayPortalMultiplexer& operator=(const ArrayPortalMultiplexer&) = default;
|
ArrayPortalMultiplexer& operator=(const ArrayPortalMultiplexer&) = default;
|
||||||
|
|
||||||
template <typename Portal>
|
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
|
namespace cont
|
||||||
{
|
{
|
||||||
|
|
||||||
#define VTKM_ARRAYHANDLE_SOA_INSTANTIATE(Type) \
|
#define VTKM_ARRAYHANDLE_SOA_INSTANTIATE(Type) \
|
||||||
template class VTKM_CONT_EXPORT ArrayHandle<Type, StorageTagSOA>; \
|
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, 2>, StorageTagSOA>; \
|
||||||
template class VTKM_CONT_EXPORT ArrayHandle<vtkm::Vec<Type, 3>, StorageTagSOA>; \
|
template class VTKM_CONT_EXPORT ArrayHandle<vtkm::Vec<Type, 3>, StorageTagSOA>; \
|
||||||
template class VTKM_CONT_EXPORT ArrayHandle<vtkm::Vec<Type, 4>, StorageTagSOA>;
|
template class VTKM_CONT_EXPORT ArrayHandle<vtkm::Vec<Type, 4>, StorageTagSOA>;
|
||||||
|
|
||||||
VTKM_ARRAYHANDLE_SOA_INSTANTIATE(char)
|
VTKM_ARRAYHANDLE_SOA_INSTANTIATE(char)
|
||||||
|
@ -183,13 +183,10 @@ struct ArrayHandleSOATraits
|
|||||||
|
|
||||||
using IsTrueVec = std::integral_constant<bool, (NUM_COMPONENTS > 1)>;
|
using IsTrueVec = std::integral_constant<bool, (NUM_COMPONENTS > 1)>;
|
||||||
|
|
||||||
using PortalControl = typename detail::SOAPortalChooser<ValueType,
|
using PortalControl = typename detail::
|
||||||
typename BaseArrayType::WritePortalType,
|
SOAPortalChooser<ValueType, typename BaseArrayType::WritePortalType, IsTrueVec>::Type;
|
||||||
IsTrueVec>::Type;
|
using PortalConstControl = typename detail::
|
||||||
using PortalConstControl =
|
SOAPortalChooser<ValueType, typename BaseArrayType::ReadPortalType, IsTrueVec>::Type;
|
||||||
typename detail::SOAPortalChooser<ValueType,
|
|
||||||
typename BaseArrayType::ReadPortalType,
|
|
||||||
IsTrueVec>::Type;
|
|
||||||
|
|
||||||
template <typename Device>
|
template <typename Device>
|
||||||
using PortalExecution = typename detail::SOAPortalChooser<
|
using PortalExecution = typename detail::SOAPortalChooser<
|
||||||
@ -778,10 +775,10 @@ namespace vtkm
|
|||||||
namespace cont
|
namespace cont
|
||||||
{
|
{
|
||||||
|
|
||||||
#define VTKM_ARRAYHANDLE_SOA_EXPORT(Type) \
|
#define VTKM_ARRAYHANDLE_SOA_EXPORT(Type) \
|
||||||
extern template class VTKM_CONT_TEMPLATE_EXPORT ArrayHandle<Type, StorageTagSOA>; \
|
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, 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, 3>, StorageTagSOA>; \
|
||||||
extern template class VTKM_CONT_TEMPLATE_EXPORT ArrayHandle<vtkm::Vec<Type, 4>, StorageTagSOA>;
|
extern template class VTKM_CONT_TEMPLATE_EXPORT ArrayHandle<vtkm::Vec<Type, 4>, StorageTagSOA>;
|
||||||
|
|
||||||
VTKM_ARRAYHANDLE_SOA_EXPORT(char)
|
VTKM_ARRAYHANDLE_SOA_EXPORT(char)
|
||||||
|
@ -15,14 +15,14 @@ namespace vtkm
|
|||||||
namespace cont
|
namespace cont
|
||||||
{
|
{
|
||||||
|
|
||||||
#define VTK_M_ARRAY_HANDLE_VIRTUAL_INSTANTIATE(T) \
|
#define VTK_M_ARRAY_HANDLE_VIRTUAL_INSTANTIATE(T) \
|
||||||
template class VTKM_CONT_EXPORT ArrayHandle<T, StorageTagVirtual>; \
|
template class VTKM_CONT_EXPORT ArrayHandle<T, StorageTagVirtual>; \
|
||||||
template class VTKM_CONT_EXPORT ArrayHandleVirtual<T>; \
|
template class VTKM_CONT_EXPORT ArrayHandleVirtual<T>; \
|
||||||
template class VTKM_CONT_EXPORT ArrayHandle<vtkm::Vec<T, 2>, StorageTagVirtual>; \
|
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 ArrayHandleVirtual<vtkm::Vec<T, 2>>; \
|
||||||
template class VTKM_CONT_EXPORT ArrayHandle<vtkm::Vec<T, 3>, StorageTagVirtual>; \
|
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 ArrayHandleVirtual<vtkm::Vec<T, 3>>; \
|
||||||
template class VTKM_CONT_EXPORT ArrayHandle<vtkm::Vec<T, 4>, StorageTagVirtual>; \
|
template class VTKM_CONT_EXPORT ArrayHandle<vtkm::Vec<T, 4>, StorageTagVirtual>; \
|
||||||
template class VTKM_CONT_EXPORT ArrayHandleVirtual<vtkm::Vec<T, 4>>
|
template class VTKM_CONT_EXPORT ArrayHandleVirtual<vtkm::Vec<T, 4>>
|
||||||
|
|
||||||
VTK_M_ARRAY_HANDLE_VIRTUAL_INSTANTIATE(char);
|
VTK_M_ARRAY_HANDLE_VIRTUAL_INSTANTIATE(char);
|
||||||
|
@ -20,22 +20,22 @@ void ThrowArrayRangeComputeFailed()
|
|||||||
throw vtkm::cont::ErrorExecution("Failed to run ArrayRangeComputation on any device.");
|
throw vtkm::cont::ErrorExecution("Failed to run ArrayRangeComputation on any device.");
|
||||||
}
|
}
|
||||||
|
|
||||||
#define VTKM_ARRAY_RANGE_COMPUTE_IMPL_T(T, Storage) \
|
#define VTKM_ARRAY_RANGE_COMPUTE_IMPL_T(T, Storage) \
|
||||||
VTKM_CONT \
|
VTKM_CONT \
|
||||||
vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute( \
|
vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute( \
|
||||||
const vtkm::cont::ArrayHandle<T, Storage>& input, vtkm::cont::DeviceAdapterId device) \
|
const vtkm::cont::ArrayHandle<T, Storage>& input, vtkm::cont::DeviceAdapterId device) \
|
||||||
{ \
|
{ \
|
||||||
return detail::ArrayRangeComputeImpl(input, device); \
|
return detail::ArrayRangeComputeImpl(input, device); \
|
||||||
} \
|
} \
|
||||||
struct SwallowSemicolon
|
struct SwallowSemicolon
|
||||||
#define VTKM_ARRAY_RANGE_COMPUTE_IMPL_VEC(T, N, Storage) \
|
#define VTKM_ARRAY_RANGE_COMPUTE_IMPL_VEC(T, N, Storage) \
|
||||||
VTKM_CONT \
|
VTKM_CONT \
|
||||||
vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute( \
|
vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute( \
|
||||||
const vtkm::cont::ArrayHandle<vtkm::Vec<T, N>, Storage>& input, \
|
const vtkm::cont::ArrayHandle<vtkm::Vec<T, N>, Storage>& input, \
|
||||||
vtkm::cont::DeviceAdapterId device) \
|
vtkm::cont::DeviceAdapterId device) \
|
||||||
{ \
|
{ \
|
||||||
return detail::ArrayRangeComputeImpl(input, device); \
|
return detail::ArrayRangeComputeImpl(input, device); \
|
||||||
} \
|
} \
|
||||||
struct SwallowSemicolon
|
struct SwallowSemicolon
|
||||||
|
|
||||||
VTKM_ARRAY_RANGE_COMPUTE_IMPL_T(char, vtkm::cont::StorageTagBasic);
|
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());
|
vtkm::cont::DeviceAdapterId device = vtkm::cont::DeviceAdapterTagAny());
|
||||||
|
|
||||||
// Precompiled versions of ArrayRangeCompute
|
// Precompiled versions of ArrayRangeCompute
|
||||||
#define VTK_M_ARRAY_RANGE_COMPUTE_EXPORT_T(T, Storage) \
|
#define VTK_M_ARRAY_RANGE_COMPUTE_EXPORT_T(T, Storage) \
|
||||||
VTKM_CONT_EXPORT \
|
VTKM_CONT_EXPORT \
|
||||||
VTKM_CONT \
|
VTKM_CONT \
|
||||||
vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute( \
|
vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute( \
|
||||||
const vtkm::cont::ArrayHandle<T, Storage>& input, \
|
const vtkm::cont::ArrayHandle<T, Storage>& input, \
|
||||||
vtkm::cont::DeviceAdapterId device = vtkm::cont::DeviceAdapterTagAny())
|
vtkm::cont::DeviceAdapterId device = vtkm::cont::DeviceAdapterTagAny())
|
||||||
#define VTK_M_ARRAY_RANGE_COMPUTE_EXPORT_VEC(T, N, Storage) \
|
#define VTK_M_ARRAY_RANGE_COMPUTE_EXPORT_VEC(T, N, Storage) \
|
||||||
VTKM_CONT_EXPORT \
|
VTKM_CONT_EXPORT \
|
||||||
VTKM_CONT \
|
VTKM_CONT \
|
||||||
vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute( \
|
vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute( \
|
||||||
const vtkm::cont::ArrayHandle<vtkm::Vec<T, N>, Storage>& input, \
|
const vtkm::cont::ArrayHandle<vtkm::Vec<T, N>, Storage>& input, \
|
||||||
vtkm::cont::DeviceAdapterId device = vtkm::cont::DeviceAdapterTagAny())
|
vtkm::cont::DeviceAdapterId device = vtkm::cont::DeviceAdapterTagAny())
|
||||||
|
|
||||||
VTK_M_ARRAY_RANGE_COMPUTE_EXPORT_T(char, vtkm::cont::StorageTagBasic);
|
VTK_M_ARRAY_RANGE_COMPUTE_EXPORT_T(char, vtkm::cont::StorageTagBasic);
|
||||||
|
@ -50,9 +50,7 @@ AssignerPartitionedDataSet::AssignerPartitionedDataSet(vtkm::Id num_partitions)
|
|||||||
}
|
}
|
||||||
|
|
||||||
VTKM_CONT
|
VTKM_CONT
|
||||||
AssignerPartitionedDataSet::~AssignerPartitionedDataSet()
|
AssignerPartitionedDataSet::~AssignerPartitionedDataSet() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
VTKM_CONT
|
VTKM_CONT
|
||||||
void AssignerPartitionedDataSet::local_gids(int my_rank, std::vector<int>& gids) const
|
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)
|
VTKM_EXEC static vtkm::Id GetNumberOfBins(const BinsBBox& binsBBox)
|
||||||
{
|
{
|
||||||
return binsBBox.Empty() ? 0 : ((binsBBox.Max[0] - binsBBox.Min[0] + 1) *
|
return binsBBox.Empty()
|
||||||
(binsBBox.Max[1] - binsBBox.Min[1] + 1) *
|
? 0
|
||||||
(binsBBox.Max[2] - binsBBox.Min[2] + 1));
|
: ((binsBBox.Max[0] - binsBBox.Min[0] + 1) * (binsBBox.Max[1] - binsBBox.Min[1] + 1) *
|
||||||
|
(binsBBox.Max[2] - binsBBox.Min[2] + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
class BBoxIterator
|
class BBoxIterator
|
||||||
|
@ -15,8 +15,6 @@ namespace vtkm
|
|||||||
namespace cont
|
namespace cont
|
||||||
{
|
{
|
||||||
|
|
||||||
CellSet::~CellSet()
|
CellSet::~CellSet() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} // namespace vtkm::cont
|
} // namespace vtkm::cont
|
||||||
|
@ -131,9 +131,8 @@ class VTKM_ALWAYS_EXPORT CellSetExplicit : public CellSet
|
|||||||
struct ConnectivityChooser
|
struct ConnectivityChooser
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
using Chooser = typename detail::CellSetExplicitConnectivityChooser<Thisclass,
|
using Chooser = typename detail::
|
||||||
VisitTopology,
|
CellSetExplicitConnectivityChooser<Thisclass, VisitTopology, IncidentTopology>;
|
||||||
IncidentTopology>;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using ConnectivityType = typename Chooser::ConnectivityType;
|
using ConnectivityType = typename Chooser::ConnectivityType;
|
||||||
|
@ -64,18 +64,18 @@ CellSetExtrude::CellSetExtrude(const CellSetExtrude& src)
|
|||||||
}
|
}
|
||||||
|
|
||||||
CellSetExtrude::CellSetExtrude(CellSetExtrude&& src) noexcept
|
CellSetExtrude::CellSetExtrude(CellSetExtrude&& src) noexcept
|
||||||
: CellSet(std::forward<CellSet>(src)),
|
: CellSet(std::forward<CellSet>(src))
|
||||||
IsPeriodic(src.IsPeriodic),
|
, IsPeriodic(src.IsPeriodic)
|
||||||
NumberOfPointsPerPlane(src.NumberOfPointsPerPlane),
|
, NumberOfPointsPerPlane(src.NumberOfPointsPerPlane)
|
||||||
NumberOfCellsPerPlane(src.NumberOfCellsPerPlane),
|
, NumberOfCellsPerPlane(src.NumberOfCellsPerPlane)
|
||||||
NumberOfPlanes(src.NumberOfPlanes),
|
, NumberOfPlanes(src.NumberOfPlanes)
|
||||||
Connectivity(std::move(src.Connectivity)),
|
, Connectivity(std::move(src.Connectivity))
|
||||||
NextNode(std::move(src.NextNode)),
|
, NextNode(std::move(src.NextNode))
|
||||||
ReverseConnectivityBuilt(src.ReverseConnectivityBuilt),
|
, ReverseConnectivityBuilt(src.ReverseConnectivityBuilt)
|
||||||
RConnectivity(std::move(src.RConnectivity)),
|
, RConnectivity(std::move(src.RConnectivity))
|
||||||
ROffsets(std::move(src.ROffsets)),
|
, ROffsets(std::move(src.ROffsets))
|
||||||
RCounts(std::move(src.RCounts)),
|
, RCounts(std::move(src.RCounts))
|
||||||
PrevNode(std::move(src.PrevNode))
|
, PrevNode(std::move(src.PrevNode))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,9 +117,7 @@ CellSetExtrude& CellSetExtrude::operator=(CellSetExtrude&& src) noexcept
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
CellSetExtrude::~CellSetExtrude()
|
CellSetExtrude::~CellSetExtrude() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
vtkm::Int32 CellSetExtrude::GetNumberOfPlanes() const
|
vtkm::Int32 CellSetExtrude::GetNumberOfPlanes() const
|
||||||
{
|
{
|
||||||
|
@ -20,13 +20,13 @@
|
|||||||
|
|
||||||
#include <vtkm/cont/CellSetList.h>
|
#include <vtkm/cont/CellSetList.h>
|
||||||
|
|
||||||
#define VTK_M_OLD_CELL_LIST_DEFINITION(name) \
|
#define VTK_M_OLD_CELL_LIST_DEFINITION(name) \
|
||||||
struct VTKM_ALWAYS_EXPORT VTKM_DEPRECATED( \
|
struct VTKM_ALWAYS_EXPORT VTKM_DEPRECATED( \
|
||||||
1.6, \
|
1.6, \
|
||||||
"CellSetListTag" #name " replaced by CellSetList" #name ". " \
|
"CellSetListTag" #name " replaced by CellSetList" #name ". " \
|
||||||
"Note that the new CellSetList" #name " cannot be subclassed.") CellSetListTag##name \
|
"Note that the new CellSetList" #name " cannot be subclassed.") CellSetListTag##name \
|
||||||
: vtkm::internal::ListAsListTag<CellSetList##name> \
|
: vtkm::internal::ListAsListTag<CellSetList##name> \
|
||||||
{ \
|
{ \
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace vtkm
|
namespace vtkm
|
||||||
|
@ -172,9 +172,8 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using ConnectivityArrays = vtkm::cont::internal::RConnBuilderInputData<ConnectivityStorageTag,
|
using ConnectivityArrays = vtkm::cont::internal::
|
||||||
OffsetsStorageTag,
|
RConnBuilderInputData<ConnectivityStorageTag, OffsetsStorageTag, NumIndicesStorageTag>;
|
||||||
NumIndicesStorageTag>;
|
|
||||||
|
|
||||||
template <typename Device>
|
template <typename Device>
|
||||||
static ConnectivityArrays Get(const CellSetPermutationType& cellset, Device)
|
static ConnectivityArrays Get(const CellSetPermutationType& cellset, Device)
|
||||||
|
@ -61,10 +61,11 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
VTKM_CONT
|
VTKM_CONT
|
||||||
CellSetSingleType(Thisclass&& src) noexcept : Superclass(std::forward<Superclass>(src)),
|
CellSetSingleType(Thisclass&& src) noexcept
|
||||||
ExpectedNumberOfCellsAdded(-1),
|
: Superclass(std::forward<Superclass>(src))
|
||||||
CellShapeAsId(src.CellShapeAsId),
|
, ExpectedNumberOfCellsAdded(-1)
|
||||||
NumberOfPointsPerCell(src.NumberOfPointsPerCell)
|
, CellShapeAsId(src.CellShapeAsId)
|
||||||
|
, NumberOfPointsPerCell(src.NumberOfPointsPerCell)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,8 +150,9 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
CellSetStructured(CellSetStructured&& src) noexcept : CellSet(),
|
CellSetStructured(CellSetStructured&& src) noexcept
|
||||||
Structure(std::move(src.Structure))
|
: CellSet()
|
||||||
|
, Structure(std::move(src.Structure))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,13 +26,12 @@ typename CellSetStructured<DIMENSION>::SchedulingRangeType
|
|||||||
|
|
||||||
template <vtkm::IdComponent DIMENSION>
|
template <vtkm::IdComponent DIMENSION>
|
||||||
template <typename DeviceAdapter, typename VisitTopology, typename IncidentTopology>
|
template <typename DeviceAdapter, typename VisitTopology, typename IncidentTopology>
|
||||||
typename CellSetStructured<DIMENSION>::template ExecutionTypes<DeviceAdapter,
|
typename CellSetStructured<DIMENSION>::
|
||||||
VisitTopology,
|
template ExecutionTypes<DeviceAdapter, VisitTopology, IncidentTopology>::ExecObjectType
|
||||||
IncidentTopology>::ExecObjectType
|
CellSetStructured<DIMENSION>::PrepareForInput(DeviceAdapter,
|
||||||
CellSetStructured<DIMENSION>::PrepareForInput(DeviceAdapter,
|
VisitTopology,
|
||||||
VisitTopology,
|
IncidentTopology,
|
||||||
IncidentTopology,
|
vtkm::cont::Token&) const
|
||||||
vtkm::cont::Token&) const
|
|
||||||
{
|
{
|
||||||
using ConnectivityType =
|
using ConnectivityType =
|
||||||
typename ExecutionTypes<DeviceAdapter, VisitTopology, IncidentTopology>::ExecObjectType;
|
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
|
const std::string& ColorTable::GetName() const
|
||||||
|
@ -16,9 +16,7 @@ namespace cont
|
|||||||
{
|
{
|
||||||
|
|
||||||
VTKM_CONT
|
VTKM_CONT
|
||||||
DataSetBuilderExplicitIterative::DataSetBuilderExplicitIterative()
|
DataSetBuilderExplicitIterative::DataSetBuilderExplicitIterative() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
VTKM_CONT
|
VTKM_CONT
|
||||||
|
@ -16,8 +16,6 @@ namespace cont
|
|||||||
{
|
{
|
||||||
|
|
||||||
VTKM_CONT
|
VTKM_CONT
|
||||||
DataSetBuilderRectilinear::DataSetBuilderRectilinear()
|
DataSetBuilderRectilinear::DataSetBuilderRectilinear() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} // end namespace vtkm::cont
|
} // end namespace vtkm::cont
|
||||||
|
@ -16,9 +16,7 @@ namespace cont
|
|||||||
{
|
{
|
||||||
|
|
||||||
VTKM_CONT
|
VTKM_CONT
|
||||||
DataSetBuilderUniform::DataSetBuilderUniform()
|
DataSetBuilderUniform::DataSetBuilderUniform() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
VTKM_CONT
|
VTKM_CONT
|
||||||
vtkm::cont::DataSet DataSetBuilderUniform::Create(const vtkm::Id& dimension,
|
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
|
/// Creates a tag named vtkm::cont::DeviceAdapterTagName and associated MPL
|
||||||
/// structures to use this tag. Always use this macro (in the base namespace)
|
/// structures to use this tag. Always use this macro (in the base namespace)
|
||||||
/// when creating a device adapter.
|
/// when creating a device adapter.
|
||||||
#define VTKM_VALID_DEVICE_ADAPTER(Name, Id) \
|
#define VTKM_VALID_DEVICE_ADAPTER(Name, Id) \
|
||||||
namespace vtkm \
|
namespace vtkm \
|
||||||
{ \
|
{ \
|
||||||
namespace cont \
|
namespace cont \
|
||||||
{ \
|
{ \
|
||||||
struct VTKM_ALWAYS_EXPORT DeviceAdapterTag##Name : DeviceAdapterId \
|
struct VTKM_ALWAYS_EXPORT DeviceAdapterTag##Name : DeviceAdapterId \
|
||||||
{ \
|
{ \
|
||||||
constexpr DeviceAdapterTag##Name() \
|
constexpr DeviceAdapterTag##Name() \
|
||||||
: DeviceAdapterId(Id) \
|
: DeviceAdapterId(Id) \
|
||||||
{ \
|
{ \
|
||||||
} \
|
} \
|
||||||
static constexpr bool IsEnabled = true; \
|
static constexpr bool IsEnabled = true; \
|
||||||
}; \
|
}; \
|
||||||
template <> \
|
template <> \
|
||||||
struct DeviceAdapterTraits<vtkm::cont::DeviceAdapterTag##Name> \
|
struct DeviceAdapterTraits<vtkm::cont::DeviceAdapterTag##Name> \
|
||||||
{ \
|
{ \
|
||||||
static DeviceAdapterNameType GetName() { return DeviceAdapterNameType(#Name); } \
|
static DeviceAdapterNameType GetName() { return DeviceAdapterNameType(#Name); } \
|
||||||
}; \
|
}; \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Marks the tag named vtkm::cont::DeviceAdapterTagName and associated
|
/// Marks the tag named vtkm::cont::DeviceAdapterTagName and associated
|
||||||
/// structures as invalid to use. Always use this macro (in the base namespace)
|
/// structures as invalid to use. Always use this macro (in the base namespace)
|
||||||
/// when creating a device adapter.
|
/// when creating a device adapter.
|
||||||
#define VTKM_INVALID_DEVICE_ADAPTER(Name, Id) \
|
#define VTKM_INVALID_DEVICE_ADAPTER(Name, Id) \
|
||||||
namespace vtkm \
|
namespace vtkm \
|
||||||
{ \
|
{ \
|
||||||
namespace cont \
|
namespace cont \
|
||||||
{ \
|
{ \
|
||||||
struct VTKM_ALWAYS_EXPORT DeviceAdapterTag##Name : DeviceAdapterId \
|
struct VTKM_ALWAYS_EXPORT DeviceAdapterTag##Name : DeviceAdapterId \
|
||||||
{ \
|
{ \
|
||||||
constexpr DeviceAdapterTag##Name() \
|
constexpr DeviceAdapterTag##Name() \
|
||||||
: DeviceAdapterId(Id) \
|
: DeviceAdapterId(Id) \
|
||||||
{ \
|
{ \
|
||||||
} \
|
} \
|
||||||
static constexpr bool IsEnabled = false; \
|
static constexpr bool IsEnabled = false; \
|
||||||
}; \
|
}; \
|
||||||
template <> \
|
template <> \
|
||||||
struct DeviceAdapterTraits<vtkm::cont::DeviceAdapterTag##Name> \
|
struct DeviceAdapterTraits<vtkm::cont::DeviceAdapterTag##Name> \
|
||||||
{ \
|
{ \
|
||||||
static DeviceAdapterNameType GetName() { return DeviceAdapterNameType(#Name); } \
|
static DeviceAdapterNameType GetName() { return DeviceAdapterNameType(#Name); } \
|
||||||
}; \
|
}; \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
// Represents when using TryExecute that the functor
|
// 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
|
/// argument is actually a device adapter tag. (You can get weird errors
|
||||||
/// elsewhere in the code when a mistake is made.)
|
/// elsewhere in the code when a mistake is made.)
|
||||||
///
|
///
|
||||||
#define VTKM_IS_DEVICE_ADAPTER_TAG(tag) \
|
#define VTKM_IS_DEVICE_ADAPTER_TAG(tag) \
|
||||||
static_assert(std::is_base_of<vtkm::cont::DeviceAdapterId, tag>::value && \
|
static_assert(std::is_base_of<vtkm::cont::DeviceAdapterId, tag>::value && \
|
||||||
!std::is_same<vtkm::cont::DeviceAdapterId, tag>::value, \
|
!std::is_same<vtkm::cont::DeviceAdapterId, tag>::value, \
|
||||||
"Provided type is not a valid VTK-m device adapter tag.")
|
"Provided type is not a valid VTK-m device adapter tag.")
|
||||||
|
|
||||||
#endif //vtk_m_cont_DeviceAdapterTag_h
|
#endif //vtk_m_cont_DeviceAdapterTag_h
|
||||||
|
@ -326,11 +326,11 @@ struct DynamicCellSetCheck<vtkm::cont::DynamicCellSetBase<CellSetList>>
|
|||||||
using type = std::true_type;
|
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)
|
VTKM_STATIC_ASSERT(::vtkm::cont::internal::DynamicCellSetCheck<T>::type::value)
|
||||||
|
|
||||||
#define VTKM_IS_DYNAMIC_OR_STATIC_CELL_SET(T) \
|
#define VTKM_IS_DYNAMIC_OR_STATIC_CELL_SET(T) \
|
||||||
VTKM_STATIC_ASSERT(::vtkm::cont::internal::CellSetCheck<T>::type::value || \
|
VTKM_STATIC_ASSERT(::vtkm::cont::internal::CellSetCheck<T>::type::value || \
|
||||||
::vtkm::cont::internal::DynamicCellSetCheck<T>::type::value)
|
::vtkm::cont::internal::DynamicCellSetCheck<T>::type::value)
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
@ -21,8 +21,8 @@ namespace cont
|
|||||||
void throwFailedRuntimeDeviceTransfer(const std::string& className,
|
void throwFailedRuntimeDeviceTransfer(const std::string& className,
|
||||||
vtkm::cont::DeviceAdapterId deviceId)
|
vtkm::cont::DeviceAdapterId deviceId)
|
||||||
{ //Should we support typeid() instead of className?
|
{ //Should we support typeid() instead of className?
|
||||||
const std::string msg = "VTK-m was unable to transfer " + className + " to DeviceAdapter[id=" +
|
const std::string msg = "VTK-m was unable to transfer " + className +
|
||||||
std::to_string(deviceId.GetValue()) + ", name=" + deviceId.GetName() +
|
" to DeviceAdapter[id=" + std::to_string(deviceId.GetValue()) + ", name=" + deviceId.GetName() +
|
||||||
"]. This is generally caused by asking for execution on a DeviceAdapter that "
|
"]. 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 "
|
"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.";
|
"compiling source files as C++ files instead of CUDA.";
|
||||||
|
@ -57,13 +57,13 @@ struct HasPrepareForControl
|
|||||||
|
|
||||||
/// Checks that the argument is a proper execution object.
|
/// Checks that the argument is a proper execution object.
|
||||||
///
|
///
|
||||||
#define VTKM_IS_EXECUTION_AND_CONTROL_OBJECT(execObject) \
|
#define VTKM_IS_EXECUTION_AND_CONTROL_OBJECT(execObject) \
|
||||||
static_assert(::vtkm::cont::internal::IsExecutionAndControlObjectBase<execObject>::value, \
|
static_assert(::vtkm::cont::internal::IsExecutionAndControlObjectBase<execObject>::value, \
|
||||||
"Provided type is not a subclass of vtkm::cont::ExecutionAndControlObjectBase."); \
|
"Provided type is not a subclass of vtkm::cont::ExecutionAndControlObjectBase."); \
|
||||||
static_assert(::vtkm::cont::internal::HasPrepareForExecution<execObject>::value || \
|
static_assert(::vtkm::cont::internal::HasPrepareForExecution<execObject>::value || \
|
||||||
::vtkm::cont::internal::HasPrepareForExecutionDeprecated<execObject>::value, \
|
::vtkm::cont::internal::HasPrepareForExecutionDeprecated<execObject>::value, \
|
||||||
"Provided type does not have requisite PrepareForExecution method."); \
|
"Provided type does not have requisite PrepareForExecution method."); \
|
||||||
static_assert(::vtkm::cont::internal::HasPrepareForControl<execObject>::value, \
|
static_assert(::vtkm::cont::internal::HasPrepareForControl<execObject>::value, \
|
||||||
"Provided type does not have requisite PrepareForControl method.")
|
"Provided type does not have requisite PrepareForControl method.")
|
||||||
|
|
||||||
/// \brief Gets the object to use in the control environment from an ExecutionAndControlObject.
|
/// \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.
|
/// Checks that the argument is a proper execution object.
|
||||||
///
|
///
|
||||||
#define VTKM_IS_EXECUTION_OBJECT(execObject) \
|
#define VTKM_IS_EXECUTION_OBJECT(execObject) \
|
||||||
static_assert(::vtkm::cont::internal::IsExecutionObjectBase<execObject>::value, \
|
static_assert(::vtkm::cont::internal::IsExecutionObjectBase<execObject>::value, \
|
||||||
"Provided type is not a subclass of vtkm::cont::ExecutionObjectBase."); \
|
"Provided type is not a subclass of vtkm::cont::ExecutionObjectBase."); \
|
||||||
static_assert(::vtkm::cont::internal::HasPrepareForExecution<execObject>::value || \
|
static_assert(::vtkm::cont::internal::HasPrepareForExecution<execObject>::value || \
|
||||||
::vtkm::cont::internal::HasPrepareForExecutionDeprecated<execObject>::value, \
|
::vtkm::cont::internal::HasPrepareForExecutionDeprecated<execObject>::value, \
|
||||||
"Provided type does not have requisite PrepareForExecution method.")
|
"Provided type does not have requisite PrepareForExecution method.")
|
||||||
|
|
||||||
/// \brief Gets the object to use in the execution environment from an ExecutionObject.
|
/// \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
|
VTKM_CONT
|
||||||
Field::Field(vtkm::cont::Field&& src) noexcept : Name(std::move(src.Name)),
|
Field::Field(vtkm::cont::Field&& src) noexcept
|
||||||
FieldAssociation(std::move(src.FieldAssociation)),
|
: Name(std::move(src.Name))
|
||||||
Data(std::move(src.Data)),
|
, FieldAssociation(std::move(src.FieldAssociation))
|
||||||
Range(std::move(src.Range)),
|
, Data(std::move(src.Data))
|
||||||
ModifiedFlag(std::move(src.ModifiedFlag))
|
, Range(std::move(src.Range))
|
||||||
|
, ModifiedFlag(std::move(src.ModifiedFlag))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,9 +93,7 @@ void Field::PrintSummary(std::ostream& out) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
VTKM_CONT
|
VTKM_CONT
|
||||||
Field::~Field()
|
Field::~Field() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
VTKM_CONT
|
VTKM_CONT
|
||||||
|
@ -60,11 +60,12 @@ vtkm::cont::ArrayHandle<vtkm::Range> MergeRangesGlobal(
|
|||||||
|
|
||||||
using VectorOfRangesT = std::vector<vtkm::Range>;
|
using VectorOfRangesT = std::vector<vtkm::Range>;
|
||||||
|
|
||||||
vtkmdiy::Master master(comm,
|
vtkmdiy::Master master(
|
||||||
1,
|
comm,
|
||||||
-1,
|
1,
|
||||||
[]() -> void* { return new VectorOfRangesT(); },
|
-1,
|
||||||
[](void* ptr) { delete static_cast<VectorOfRangesT*>(ptr); });
|
[]() -> void* { return new VectorOfRangesT(); },
|
||||||
|
[](void* ptr) { delete static_cast<VectorOfRangesT*>(ptr); });
|
||||||
|
|
||||||
vtkmdiy::ContiguousAssigner assigner(/*num ranks*/ comm.size(),
|
vtkmdiy::ContiguousAssigner assigner(/*num ranks*/ comm.size(),
|
||||||
/*global-num-blocks*/ 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);
|
vtkmdiy::RegularAllReducePartners all_reduce_partners(decomposer, /*k*/ 2);
|
||||||
|
|
||||||
auto callback = [](
|
auto callback = [](VectorOfRangesT* data,
|
||||||
VectorOfRangesT* data, const vtkmdiy::ReduceProxy& srp, const vtkmdiy::RegularMergePartners&) {
|
const vtkmdiy::ReduceProxy& srp,
|
||||||
|
const vtkmdiy::RegularMergePartners&) {
|
||||||
const auto selfid = srp.gid();
|
const auto selfid = srp.gid();
|
||||||
// 1. dequeue.
|
// 1. dequeue.
|
||||||
std::vector<int> incoming;
|
std::vector<int> incoming;
|
||||||
|
@ -46,9 +46,7 @@ struct VtkmArg : public opt::Arg
|
|||||||
VTKM_LOG_ALWAYS_S(vtkm::cont::LogLevel::Error,
|
VTKM_LOG_ALWAYS_S(vtkm::cont::LogLevel::Error,
|
||||||
"Missing device after option '"
|
"Missing device after option '"
|
||||||
<< std::string(option.name, static_cast<size_t>(option.namelen))
|
<< std::string(option.name, static_cast<size_t>(option.namelen))
|
||||||
<< "'.\nValid devices are: "
|
<< "'.\nValid devices are: " << VtkmArg::GetValidDeviceNames() << "\n");
|
||||||
<< VtkmArg::GetValidDeviceNames()
|
|
||||||
<< "\n");
|
|
||||||
}
|
}
|
||||||
return opt::ARG_ILLEGAL;
|
return opt::ARG_ILLEGAL;
|
||||||
}
|
}
|
||||||
@ -59,12 +57,9 @@ struct VtkmArg : public opt::Arg
|
|||||||
{
|
{
|
||||||
VTKM_LOG_ALWAYS_S(vtkm::cont::LogLevel::Error,
|
VTKM_LOG_ALWAYS_S(vtkm::cont::LogLevel::Error,
|
||||||
"Unavailable device specificed after option '"
|
"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
|
<< option.arg
|
||||||
<< "'.\nValid devices are: "
|
<< "'.\nValid devices are: " << VtkmArg::GetValidDeviceNames() << "\n");
|
||||||
<< VtkmArg::GetValidDeviceNames()
|
|
||||||
<< "\n");
|
|
||||||
return opt::ARG_ILLEGAL;
|
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_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_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__
|
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__)
|
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(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__)
|
VTKM_LOG_SCOPE(static_cast<loguru::Verbosity>(level), __func__)
|
||||||
#define VTKM_LOG_ERROR_CONTEXT(desc, data) ERROR_CONTEXT(desc, data)
|
#define VTKM_LOG_ERROR_CONTEXT(desc, data) ERROR_CONTEXT(desc, data)
|
||||||
#define VTKM_LOG_ALWAYS_S(level, ...) VTKM_LOG_S(level, __VA_ARGS__)
|
#define VTKM_LOG_ALWAYS_S(level, ...) VTKM_LOG_S(level, __VA_ARGS__)
|
||||||
@ -222,42 +222,43 @@
|
|||||||
// Convenience macros:
|
// Convenience macros:
|
||||||
|
|
||||||
// Cast success:
|
// Cast success:
|
||||||
#define VTKM_LOG_CAST_SUCC(inObj, outObj) \
|
#define VTKM_LOG_CAST_SUCC(inObj, outObj) \
|
||||||
VTKM_LOG_F(vtkm::cont::LogLevel::Cast, \
|
VTKM_LOG_F(vtkm::cont::LogLevel::Cast, \
|
||||||
"Cast succeeded: %s (%p) --> %s (%p)", \
|
"Cast succeeded: %s (%p) --> %s (%p)", \
|
||||||
vtkm::cont::TypeToString(inObj).c_str(), \
|
vtkm::cont::TypeToString(inObj).c_str(), \
|
||||||
&inObj, \
|
&inObj, \
|
||||||
vtkm::cont::TypeToString(outObj).c_str(), \
|
vtkm::cont::TypeToString(outObj).c_str(), \
|
||||||
&outObj)
|
&outObj)
|
||||||
|
|
||||||
// Cast failure:
|
// Cast failure:
|
||||||
#define VTKM_LOG_CAST_FAIL(inObj, outType) \
|
#define VTKM_LOG_CAST_FAIL(inObj, outType) \
|
||||||
VTKM_LOG_F(vtkm::cont::LogLevel::Cast, \
|
VTKM_LOG_F(vtkm::cont::LogLevel::Cast, \
|
||||||
"Cast failed: %s (%p) --> %s", \
|
"Cast failed: %s (%p) --> %s", \
|
||||||
vtkm::cont::TypeToString(inObj).c_str(), \
|
vtkm::cont::TypeToString(inObj).c_str(), \
|
||||||
&inObj, \
|
&inObj, \
|
||||||
vtkm::cont::TypeToString<outType>().c_str())
|
vtkm::cont::TypeToString<outType>().c_str())
|
||||||
|
|
||||||
// TryExecute failure
|
// TryExecute failure
|
||||||
#define VTKM_LOG_TRYEXECUTE_FAIL(errorMessage, functorName, deviceId) \
|
#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, "TryExecute encountered an error: " << errorMessage); \
|
||||||
VTKM_LOG_S(vtkm::cont::LogLevel::Error, "Failing functor: " << functorName); \
|
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, "Failing device: " << deviceId.GetName())
|
||||||
|
|
||||||
// Same, but disabling device:
|
// Same, but disabling device:
|
||||||
#define VTKM_LOG_TRYEXECUTE_DISABLE(errorMessage, functorName, deviceId) \
|
#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, "TryExecute encountered an error: " << errorMessage); \
|
||||||
VTKM_LOG_S(vtkm::cont::LogLevel::Error, "Failing functor: " << functorName); \
|
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, "Failing device: " << deviceId.GetName()); \
|
||||||
VTKM_LOG_S(vtkm::cont::LogLevel::Error, "The failing device has been disabled.")
|
VTKM_LOG_S(vtkm::cont::LogLevel::Error, "The failing device has been disabled.")
|
||||||
|
|
||||||
// Custom log level
|
// Custom log level
|
||||||
#define VTKM_DEFINE_USER_LOG_LEVEL(name, offset) \
|
#define VTKM_DEFINE_USER_LOG_LEVEL(name, offset) \
|
||||||
static constexpr vtkm::cont::LogLevel name = static_cast<vtkm::cont::LogLevel>( \
|
static constexpr vtkm::cont::LogLevel name = static_cast<vtkm::cont::LogLevel>( \
|
||||||
static_cast<typename std::underlying_type<vtkm::cont::LogLevel>::type>( \
|
static_cast<typename std::underlying_type<vtkm::cont::LogLevel>::type>( \
|
||||||
vtkm::cont::LogLevel::UserFirst) + \
|
vtkm::cont::LogLevel::UserFirst) + \
|
||||||
offset % static_cast<typename std::underlying_type<vtkm::cont::LogLevel>::type>( \
|
offset % \
|
||||||
vtkm::cont::LogLevel::UserLast))
|
static_cast<typename std::underlying_type<vtkm::cont::LogLevel>::type>( \
|
||||||
|
vtkm::cont::LogLevel::UserLast))
|
||||||
|
|
||||||
#else // VTKM_ENABLE_LOGGING
|
#else // VTKM_ENABLE_LOGGING
|
||||||
|
|
||||||
@ -274,20 +275,20 @@
|
|||||||
|
|
||||||
// Always emitted. When logging is disabled, std::cerr is used.
|
// Always emitted. When logging is disabled, std::cerr is used.
|
||||||
|
|
||||||
#define VTKM_LOG_ALWAYS_S(level, ...) \
|
#define VTKM_LOG_ALWAYS_S(level, ...) \
|
||||||
(static_cast<int>(level) < 0 ? std::cerr : std::cout) << vtkm::cont::GetLogLevelName(level) \
|
(static_cast<int>(level) < 0 ? std::cerr : std::cout) \
|
||||||
<< ": " << __VA_ARGS__ << "\n"
|
<< vtkm::cont::GetLogLevelName(level) << ": " << __VA_ARGS__ << "\n"
|
||||||
|
|
||||||
// TryExecute failures are still important enough to log, but we just write to
|
// TryExecute failures are still important enough to log, but we just write to
|
||||||
// std::cerr when logging is disabled.
|
// std::cerr when logging is disabled.
|
||||||
#define VTKM_LOG_TRYEXECUTE_FAIL(errorMessage, functorName, deviceId) \
|
#define VTKM_LOG_TRYEXECUTE_FAIL(errorMessage, functorName, deviceId) \
|
||||||
std::cerr << "Error: TryExecute encountered an error: " << errorMessage << "\n" \
|
std::cerr << "Error: TryExecute encountered an error: " << errorMessage << "\n" \
|
||||||
<< "\t- Failing functor: " << functorName << "\n" \
|
<< "\t- Failing functor: " << functorName << "\n" \
|
||||||
<< "\t- Failing device: " << deviceId.GetName() << "\n\n"
|
<< "\t- Failing device: " << deviceId.GetName() << "\n\n"
|
||||||
#define VTKM_LOG_TRYEXECUTE_DISABLE(errorMessage, functorName, deviceId) \
|
#define VTKM_LOG_TRYEXECUTE_DISABLE(errorMessage, functorName, deviceId) \
|
||||||
std::cerr << "Error: TryExecute encountered an error: " << errorMessage << "\n" \
|
std::cerr << "Error: TryExecute encountered an error: " << errorMessage << "\n" \
|
||||||
<< "\t- Failing functor: " << functorName << "\n" \
|
<< "\t- Failing functor: " << functorName << "\n" \
|
||||||
<< "\t- Failing device: " << deviceId.GetName() << "\n" \
|
<< "\t- Failing device: " << deviceId.GetName() << "\n" \
|
||||||
<< "The failing device has been disabled.\n\n"
|
<< "The failing device has been disabled.\n\n"
|
||||||
|
|
||||||
#endif // VTKM_ENABLE_LOGGING
|
#endif // VTKM_ENABLE_LOGGING
|
||||||
|
@ -48,14 +48,10 @@ PartitionedDataSet::PartitionedDataSet(vtkm::Id size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
VTKM_CONT
|
VTKM_CONT
|
||||||
PartitionedDataSet::PartitionedDataSet()
|
PartitionedDataSet::PartitionedDataSet() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
VTKM_CONT
|
VTKM_CONT
|
||||||
PartitionedDataSet::~PartitionedDataSet()
|
PartitionedDataSet::~PartitionedDataSet() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
VTKM_CONT
|
VTKM_CONT
|
||||||
PartitionedDataSet& PartitionedDataSet::operator=(const vtkm::cont::PartitionedDataSet& src)
|
PartitionedDataSet& PartitionedDataSet::operator=(const vtkm::cont::PartitionedDataSet& src)
|
||||||
|
@ -44,9 +44,7 @@ RuntimeDeviceTracker::RuntimeDeviceTracker(detail::RuntimeDeviceTrackerInternals
|
|||||||
}
|
}
|
||||||
|
|
||||||
VTKM_CONT
|
VTKM_CONT
|
||||||
RuntimeDeviceTracker::~RuntimeDeviceTracker()
|
RuntimeDeviceTracker::~RuntimeDeviceTracker() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
VTKM_CONT
|
VTKM_CONT
|
||||||
void RuntimeDeviceTracker::CheckDevice(vtkm::cont::DeviceAdapterId deviceId) const
|
void RuntimeDeviceTracker::CheckDevice(vtkm::cont::DeviceAdapterId deviceId) const
|
||||||
|
@ -31,8 +31,8 @@ StorageVirtual::StorageVirtual(const StorageVirtual& src)
|
|||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
StorageVirtual::StorageVirtual(StorageVirtual&& src) noexcept
|
StorageVirtual::StorageVirtual(StorageVirtual&& src) noexcept
|
||||||
: DeviceUpToDate(src.DeviceUpToDate),
|
: DeviceUpToDate(src.DeviceUpToDate)
|
||||||
DeviceTransferState(std::move(src.DeviceTransferState))
|
, DeviceTransferState(std::move(src.DeviceTransferState))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,9 +53,7 @@ StorageVirtual& StorageVirtual::operator=(StorageVirtual&& src) noexcept
|
|||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
StorageVirtual::~StorageVirtual()
|
StorageVirtual::~StorageVirtual() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
void StorageVirtual::DropExecutionPortal()
|
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.");
|
throw vtkm::cont::ErrorBadValue("StorageTagVirtual by default doesn't support exec side writes.");
|
||||||
}
|
}
|
||||||
|
|
||||||
#define VTK_M_ARRAY_TRANSFER_VIRTUAL_INSTANTIATE(T) \
|
#define VTK_M_ARRAY_TRANSFER_VIRTUAL_INSTANTIATE(T) \
|
||||||
template class VTKM_CONT_EXPORT ArrayTransferVirtual<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, 2>>; \
|
||||||
template class VTKM_CONT_EXPORT ArrayTransferVirtual<vtkm::Vec<T, 3>>; \
|
template class VTKM_CONT_EXPORT ArrayTransferVirtual<vtkm::Vec<T, 3>>; \
|
||||||
template class VTKM_CONT_EXPORT ArrayTransferVirtual<vtkm::Vec<T, 4>>
|
template class VTKM_CONT_EXPORT ArrayTransferVirtual<vtkm::Vec<T, 4>>
|
||||||
|
|
||||||
VTK_M_ARRAY_TRANSFER_VIRTUAL_INSTANTIATE(char);
|
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
|
#undef VTK_M_ARRAY_TRANSFER_VIRTUAL_INSTANTIATE
|
||||||
|
|
||||||
#define VTK_M_STORAGE_VIRTUAL_INSTANTIATE(T) \
|
#define VTK_M_STORAGE_VIRTUAL_INSTANTIATE(T) \
|
||||||
template class VTKM_CONT_EXPORT StorageVirtualImpl<T, VTKM_DEFAULT_STORAGE_TAG>; \
|
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, 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, 3>, VTKM_DEFAULT_STORAGE_TAG>; \
|
||||||
template class VTKM_CONT_EXPORT StorageVirtualImpl<vtkm::Vec<T, 4>, VTKM_DEFAULT_STORAGE_TAG>
|
template class VTKM_CONT_EXPORT StorageVirtualImpl<vtkm::Vec<T, 4>, VTKM_DEFAULT_STORAGE_TAG>
|
||||||
|
|
||||||
VTK_M_STORAGE_VIRTUAL_INSTANTIATE(char);
|
VTK_M_STORAGE_VIRTUAL_INSTANTIATE(char);
|
||||||
|
@ -35,8 +35,8 @@ public:
|
|||||||
ArrayPortalRef() = default;
|
ArrayPortalRef() = default;
|
||||||
|
|
||||||
ArrayPortalRef(std::shared_ptr<vtkm::ArrayPortalVirtual<T>> portal, vtkm::Id numValues) noexcept
|
ArrayPortalRef(std::shared_ptr<vtkm::ArrayPortalVirtual<T>> portal, vtkm::Id numValues) noexcept
|
||||||
: vtkm::ArrayPortalRef<T>(portal.get(), numValues),
|
: vtkm::ArrayPortalRef<T>(portal.get(), numValues)
|
||||||
ManagedPortal(portal)
|
, ManagedPortal(portal)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -101,8 +101,8 @@ StorageVirtualImpl<T, S>::StorageVirtualImpl(const vtkm::cont::ArrayHandle<T, S>
|
|||||||
VTKM_CONT
|
VTKM_CONT
|
||||||
template <typename T, typename S>
|
template <typename T, typename S>
|
||||||
StorageVirtualImpl<T, S>::StorageVirtualImpl(vtkm::cont::ArrayHandle<T, S>&& ah) noexcept
|
StorageVirtualImpl<T, S>::StorageVirtualImpl(vtkm::cont::ArrayHandle<T, S>&& ah) noexcept
|
||||||
: vtkm::cont::internal::detail::StorageVirtual(),
|
: vtkm::cont::internal::detail::StorageVirtual()
|
||||||
Handle(std::move(ah))
|
, Handle(std::move(ah))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -359,10 +359,10 @@ public:
|
|||||||
|
|
||||||
#ifndef vtk_m_cont_StorageVirtual_cxx
|
#ifndef vtk_m_cont_StorageVirtual_cxx
|
||||||
|
|
||||||
#define VTK_M_ARRAY_TRANSFER_VIRTUAL_EXPORT(T) \
|
#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<T>; \
|
||||||
extern template class VTKM_CONT_TEMPLATE_EXPORT ArrayTransferVirtual<vtkm::Vec<T, 2>>; \
|
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, 3>>; \
|
||||||
extern template class VTKM_CONT_TEMPLATE_EXPORT ArrayTransferVirtual<vtkm::Vec<T, 4>>
|
extern template class VTKM_CONT_TEMPLATE_EXPORT ArrayTransferVirtual<vtkm::Vec<T, 4>>
|
||||||
|
|
||||||
VTK_M_ARRAY_TRANSFER_VIRTUAL_EXPORT(char);
|
VTK_M_ARRAY_TRANSFER_VIRTUAL_EXPORT(char);
|
||||||
|
@ -242,8 +242,9 @@ Timer::Timer(vtkm::cont::DeviceAdapterId device)
|
|||||||
if (!tracker.CanRunOn(device))
|
if (!tracker.CanRunOn(device))
|
||||||
{
|
{
|
||||||
VTKM_LOG_S(vtkm::cont::LogLevel::Error,
|
VTKM_LOG_S(vtkm::cont::LogLevel::Error,
|
||||||
"Device '" << device.GetName() << "' can not run on current Device."
|
"Device '" << device.GetName()
|
||||||
"Thus timer is not usable");
|
<< "' 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))
|
if (!tracker.CanRunOn(device))
|
||||||
{
|
{
|
||||||
VTKM_LOG_S(vtkm::cont::LogLevel::Error,
|
VTKM_LOG_S(vtkm::cont::LogLevel::Error,
|
||||||
"Device '" << device.GetName() << "' can not run on current Device."
|
"Device '" << device.GetName()
|
||||||
"Thus timer is not usable");
|
<< "' can not run on current Device."
|
||||||
|
"Thus timer is not usable");
|
||||||
}
|
}
|
||||||
|
|
||||||
this->Device = device;
|
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)
|
vtkm::cont::Token::Token(Token&& rhs)
|
||||||
: Internals(std::move(rhs.Internals))
|
: Internals(std::move(rhs.Internals))
|
||||||
|
@ -54,8 +54,8 @@ struct ControlSignatureTagCheck
|
|||||||
/// that a template argument is actually an \c ControlSignature tag. (You can
|
/// that a template argument is actually an \c ControlSignature tag. (You can
|
||||||
/// get weird errors elsewhere in the code when a mistake is made.)
|
/// get weird errors elsewhere in the code when a mistake is made.)
|
||||||
///
|
///
|
||||||
#define VTKM_IS_CONTROL_SIGNATURE_TAG(tag) \
|
#define VTKM_IS_CONTROL_SIGNATURE_TAG(tag) \
|
||||||
VTKM_STATIC_ASSERT_MSG(::vtkm::cont::arg::internal::ControlSignatureTagCheck<tag>::Valid, \
|
VTKM_STATIC_ASSERT_MSG(::vtkm::cont::arg::internal::ControlSignatureTagCheck<tag>::Valid, \
|
||||||
"Provided a type that is not a valid ControlSignature tag.")
|
"Provided a type that is not a valid ControlSignature tag.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -108,16 +108,12 @@ struct TryWholeArrayType
|
|||||||
{
|
{
|
||||||
using ArrayHandleType = vtkm::cont::ArrayHandle<T>;
|
using ArrayHandleType = vtkm::cont::ArrayHandle<T>;
|
||||||
|
|
||||||
using InTransportType = vtkm::cont::arg::Transport<vtkm::cont::arg::TransportTagWholeArrayIn,
|
using InTransportType = vtkm::cont::arg::
|
||||||
ArrayHandleType,
|
Transport<vtkm::cont::arg::TransportTagWholeArrayIn, ArrayHandleType, Device>;
|
||||||
Device>;
|
using InOutTransportType = vtkm::cont::arg::
|
||||||
using InOutTransportType =
|
Transport<vtkm::cont::arg::TransportTagWholeArrayInOut, ArrayHandleType, Device>;
|
||||||
vtkm::cont::arg::Transport<vtkm::cont::arg::TransportTagWholeArrayInOut,
|
using OutTransportType = vtkm::cont::arg::
|
||||||
ArrayHandleType,
|
Transport<vtkm::cont::arg::TransportTagWholeArrayOut, ArrayHandleType, Device>;
|
||||||
Device>;
|
|
||||||
using OutTransportType = vtkm::cont::arg::Transport<vtkm::cont::arg::TransportTagWholeArrayOut,
|
|
||||||
ArrayHandleType,
|
|
||||||
Device>;
|
|
||||||
|
|
||||||
ArrayHandleType array;
|
ArrayHandleType array;
|
||||||
array.Allocate(ARRAY_SIZE);
|
array.Allocate(ARRAY_SIZE);
|
||||||
|
@ -20,31 +20,31 @@
|
|||||||
/// A macro that can be used to check to see if there are any unchecked
|
/// A macro that can be used to check to see if there are any unchecked
|
||||||
/// CUDA errors. Will throw an ErrorCuda if there are.
|
/// CUDA errors. Will throw an ErrorCuda if there are.
|
||||||
///
|
///
|
||||||
#define VTKM_CUDA_CHECK_ASYNCHRONOUS_ERROR() \
|
#define VTKM_CUDA_CHECK_ASYNCHRONOUS_ERROR() \
|
||||||
VTKM_SWALLOW_SEMICOLON_PRE_BLOCK \
|
VTKM_SWALLOW_SEMICOLON_PRE_BLOCK \
|
||||||
{ \
|
{ \
|
||||||
const cudaError_t vtkm_cuda_check_async_error = cudaGetLastError(); \
|
const cudaError_t vtkm_cuda_check_async_error = cudaGetLastError(); \
|
||||||
if (vtkm_cuda_check_async_error != cudaSuccess) \
|
if (vtkm_cuda_check_async_error != cudaSuccess) \
|
||||||
{ \
|
{ \
|
||||||
throw ::vtkm::cont::cuda::ErrorCuda( \
|
throw ::vtkm::cont::cuda::ErrorCuda( \
|
||||||
vtkm_cuda_check_async_error, __FILE__, __LINE__, "Unchecked asynchronous error"); \
|
vtkm_cuda_check_async_error, __FILE__, __LINE__, "Unchecked asynchronous error"); \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
VTKM_SWALLOW_SEMICOLON_POST_BLOCK
|
VTKM_SWALLOW_SEMICOLON_POST_BLOCK
|
||||||
|
|
||||||
/// A macro that can be wrapped around a CUDA command and will throw an
|
/// A macro that can be wrapped around a CUDA command and will throw an
|
||||||
/// ErrorCuda exception if the CUDA command fails.
|
/// ErrorCuda exception if the CUDA command fails.
|
||||||
///
|
///
|
||||||
#define VTKM_CUDA_CALL(command) \
|
#define VTKM_CUDA_CALL(command) \
|
||||||
VTKM_CUDA_CHECK_ASYNCHRONOUS_ERROR(); \
|
VTKM_CUDA_CHECK_ASYNCHRONOUS_ERROR(); \
|
||||||
VTKM_SWALLOW_SEMICOLON_PRE_BLOCK \
|
VTKM_SWALLOW_SEMICOLON_PRE_BLOCK \
|
||||||
{ \
|
{ \
|
||||||
const cudaError_t vtkm_cuda_call_error = command; \
|
const cudaError_t vtkm_cuda_call_error = command; \
|
||||||
if (vtkm_cuda_call_error != cudaSuccess) \
|
if (vtkm_cuda_call_error != cudaSuccess) \
|
||||||
{ \
|
{ \
|
||||||
throw ::vtkm::cont::cuda::ErrorCuda(vtkm_cuda_call_error, __FILE__, __LINE__, #command); \
|
throw ::vtkm::cont::cuda::ErrorCuda(vtkm_cuda_call_error, __FILE__, __LINE__, #command); \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
VTKM_SWALLOW_SEMICOLON_POST_BLOCK
|
VTKM_SWALLOW_SEMICOLON_POST_BLOCK
|
||||||
|
|
||||||
namespace vtkm
|
namespace vtkm
|
||||||
|
@ -1183,10 +1183,11 @@ public:
|
|||||||
const vtkm::Id inSize = input.GetNumberOfValues();
|
const vtkm::Id inSize = input.GetNumberOfValues();
|
||||||
|
|
||||||
// Check if the ranges overlap and fail if they do.
|
// Check if the ranges overlap and fail if they do.
|
||||||
if (input == output && ((outputIndex >= inputStartIndex &&
|
if (input == output &&
|
||||||
outputIndex < inputStartIndex + numberOfElementsToCopy) ||
|
((outputIndex >= inputStartIndex &&
|
||||||
(inputStartIndex >= outputIndex &&
|
outputIndex < inputStartIndex + numberOfElementsToCopy) ||
|
||||||
inputStartIndex < outputIndex + numberOfElementsToCopy)))
|
(inputStartIndex >= outputIndex &&
|
||||||
|
inputStartIndex < outputIndex + numberOfElementsToCopy)))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -536,9 +536,7 @@ Buffer::Buffer(Buffer&& src)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Defined to prevent issues with CUDA
|
// Defined to prevent issues with CUDA
|
||||||
Buffer::~Buffer()
|
Buffer::~Buffer() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
// Defined to prevent issues with CUDA
|
// Defined to prevent issues with CUDA
|
||||||
Buffer& Buffer::operator=(const Buffer& src)
|
Buffer& Buffer::operator=(const Buffer& src)
|
||||||
|
@ -241,10 +241,11 @@ public:
|
|||||||
const vtkm::Id inSize = input.GetNumberOfValues();
|
const vtkm::Id inSize = input.GetNumberOfValues();
|
||||||
|
|
||||||
// Check if the ranges overlap and fail if they do.
|
// Check if the ranges overlap and fail if they do.
|
||||||
if (input == output && ((outputIndex >= inputStartIndex &&
|
if (input == output &&
|
||||||
outputIndex < inputStartIndex + numberOfElementsToCopy) ||
|
((outputIndex >= inputStartIndex &&
|
||||||
(inputStartIndex >= outputIndex &&
|
outputIndex < inputStartIndex + numberOfElementsToCopy) ||
|
||||||
inputStartIndex < outputIndex + numberOfElementsToCopy)))
|
(inputStartIndex >= outputIndex &&
|
||||||
|
inputStartIndex < outputIndex + numberOfElementsToCopy)))
|
||||||
{
|
{
|
||||||
return false;
|
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,
|
void DeviceAdapterMemoryManagerBase::Reallocate(vtkm::cont::internal::BufferInfo& buffer,
|
||||||
vtkm::BufferSizeType newSize) const
|
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
|
// The output array has one more value than the input, which holds the
|
||||||
// total sum.
|
// total sum.
|
||||||
const ValueType result =
|
const ValueType result = (index == 0) ? this->InitialValue
|
||||||
(index == 0) ? this->InitialValue : (index == this->InPortal.GetNumberOfValues())
|
: (index == this->InPortal.GetNumberOfValues())
|
||||||
? this->FinalValue
|
? this->FinalValue
|
||||||
: this->BinaryOperator(this->InitialValue, this->InPortal.Get(index - 1));
|
: this->BinaryOperator(this->InitialValue, this->InPortal.Get(index - 1));
|
||||||
|
|
||||||
|
@ -752,6 +752,7 @@ public:
|
|||||||
void Next() { std::swap(src_, dst_); }
|
void Next() { std::swap(src_, dst_); }
|
||||||
|
|
||||||
ValueType* GetResult() { return src_; }
|
ValueType* GetResult() { return src_; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
size_t max_elems_;
|
size_t max_elems_;
|
||||||
int max_threads_;
|
int max_threads_;
|
||||||
@ -894,25 +895,25 @@ public:
|
|||||||
private:
|
private:
|
||||||
};
|
};
|
||||||
|
|
||||||
#define KEY_SORT_CASE(plain_type, compare_type, unsigned_type, encoder_type) \
|
#define KEY_SORT_CASE(plain_type, compare_type, unsigned_type, encoder_type) \
|
||||||
template <typename ThreaderType> \
|
template <typename ThreaderType> \
|
||||||
class KeySort<ThreaderType, plain_type, compare_type> \
|
class KeySort<ThreaderType, plain_type, compare_type> \
|
||||||
: public KeySort<ThreaderType, \
|
: public KeySort<ThreaderType, \
|
||||||
plain_type, \
|
plain_type, \
|
||||||
compare_type, \
|
compare_type, \
|
||||||
unsigned_type, \
|
unsigned_type, \
|
||||||
encoder::Encoder##encoder_type> \
|
encoder::Encoder##encoder_type> \
|
||||||
{ \
|
{ \
|
||||||
}; \
|
}; \
|
||||||
template <typename V, typename ThreaderType> \
|
template <typename V, typename ThreaderType> \
|
||||||
class PairSort<ThreaderType, plain_type, V, compare_type> \
|
class PairSort<ThreaderType, plain_type, V, compare_type> \
|
||||||
: public PairSort<ThreaderType, \
|
: public PairSort<ThreaderType, \
|
||||||
plain_type, \
|
plain_type, \
|
||||||
V, \
|
V, \
|
||||||
compare_type, \
|
compare_type, \
|
||||||
unsigned_type, \
|
unsigned_type, \
|
||||||
encoder::Encoder##encoder_type> \
|
encoder::Encoder##encoder_type> \
|
||||||
{ \
|
{ \
|
||||||
};
|
};
|
||||||
|
|
||||||
// Unsigned integers
|
// Unsigned integers
|
||||||
@ -974,15 +975,15 @@ struct run_kx_radix_sort_keys
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#define KX_SORT_KEYS(key_type) \
|
#define KX_SORT_KEYS(key_type) \
|
||||||
template <> \
|
template <> \
|
||||||
struct run_kx_radix_sort_keys<key_type, std::less<key_type>> \
|
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) \
|
static void run(key_type* data, size_t num_elems, const std::less<key_type>& comp) \
|
||||||
{ \
|
{ \
|
||||||
(void)comp; \
|
(void)comp; \
|
||||||
kx::radix_sort(data, data + num_elems); \
|
kx::radix_sort(data, data + num_elems); \
|
||||||
} \
|
} \
|
||||||
};
|
};
|
||||||
|
|
||||||
KX_SORT_KEYS(unsigned short int);
|
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.
|
// Generate radix sort interfaces for key and key value sorts.
|
||||||
#define VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(threader_type, key_type) \
|
#define VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(threader_type, key_type) \
|
||||||
VTKM_CONT_EXPORT void parallel_radix_sort_key_values( \
|
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) \
|
key_type* keys, vtkm::Id* vals, size_t num_elems, const std::greater<key_type>& comp) \
|
||||||
{ \
|
{ \
|
||||||
using namespace vtkm::cont::internal::radix; \
|
using namespace vtkm::cont::internal::radix; \
|
||||||
PairSort<threader_type, key_type, vtkm::Id, std::greater<key_type>> ps; \
|
PairSort<threader_type, key_type, vtkm::Id, std::greater<key_type>> ps; \
|
||||||
ps.InitAndSort(keys, vals, num_elems, threader_type(), comp); \
|
ps.InitAndSort(keys, vals, num_elems, threader_type(), comp); \
|
||||||
} \
|
} \
|
||||||
VTKM_CONT_EXPORT void parallel_radix_sort_key_values( \
|
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) \
|
key_type* keys, vtkm::Id* vals, size_t num_elems, const std::less<key_type>& comp) \
|
||||||
{ \
|
{ \
|
||||||
using namespace vtkm::cont::internal::radix; \
|
using namespace vtkm::cont::internal::radix; \
|
||||||
PairSort<threader_type, key_type, vtkm::Id, std::less<key_type>> ps; \
|
PairSort<threader_type, key_type, vtkm::Id, std::less<key_type>> ps; \
|
||||||
ps.InitAndSort(keys, vals, num_elems, threader_type(), comp); \
|
ps.InitAndSort(keys, vals, num_elems, threader_type(), comp); \
|
||||||
} \
|
} \
|
||||||
VTKM_CONT_EXPORT void parallel_radix_sort( \
|
VTKM_CONT_EXPORT void parallel_radix_sort( \
|
||||||
key_type* data, size_t num_elems, const std::greater<key_type>& comp) \
|
key_type* data, size_t num_elems, const std::greater<key_type>& comp) \
|
||||||
{ \
|
{ \
|
||||||
using namespace vtkm::cont::internal::radix; \
|
using namespace vtkm::cont::internal::radix; \
|
||||||
if (!use_serial_sort_keys(data, num_elems, comp)) \
|
if (!use_serial_sort_keys(data, num_elems, comp)) \
|
||||||
{ \
|
{ \
|
||||||
KeySort<threader_type, key_type, std::greater<key_type>> ks; \
|
KeySort<threader_type, key_type, std::greater<key_type>> ks; \
|
||||||
ks.InitAndSort(data, num_elems, threader_type(), comp); \
|
ks.InitAndSort(data, num_elems, threader_type(), comp); \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
VTKM_CONT_EXPORT void parallel_radix_sort( \
|
VTKM_CONT_EXPORT void parallel_radix_sort( \
|
||||||
key_type* data, size_t num_elems, const std::less<key_type>& comp) \
|
key_type* data, size_t num_elems, const std::less<key_type>& comp) \
|
||||||
{ \
|
{ \
|
||||||
using namespace vtkm::cont::internal::radix; \
|
using namespace vtkm::cont::internal::radix; \
|
||||||
if (!use_serial_sort_keys(data, num_elems, comp)) \
|
if (!use_serial_sort_keys(data, num_elems, comp)) \
|
||||||
{ \
|
{ \
|
||||||
KeySort<threader_type, key_type, std::less<key_type>> ks; \
|
KeySort<threader_type, key_type, std::less<key_type>> ks; \
|
||||||
ks.InitAndSort(data, num_elems, threader_type(), comp); \
|
ks.InitAndSort(data, num_elems, threader_type(), comp); \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define VTKM_INSTANTIATE_RADIX_SORT_FOR_THREADER(ThreaderType) \
|
#define VTKM_INSTANTIATE_RADIX_SORT_FOR_THREADER(ThreaderType) \
|
||||||
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, short int) \
|
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, short int) \
|
||||||
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, unsigned short int) \
|
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, unsigned short int) \
|
||||||
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, int) \
|
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, int) \
|
||||||
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, unsigned int) \
|
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, unsigned int) \
|
||||||
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, long int) \
|
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, long int) \
|
||||||
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, unsigned 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, long long int) \
|
||||||
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, unsigned 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, unsigned char) \
|
||||||
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, signed char) \
|
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, signed char) \
|
||||||
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, char) \
|
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, char) \
|
||||||
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, char16_t) \
|
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, char16_t) \
|
||||||
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, char32_t) \
|
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, char32_t) \
|
||||||
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, wchar_t) \
|
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, wchar_t) \
|
||||||
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, float) \
|
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, float) \
|
||||||
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, double)
|
VTKM_INTERNAL_RADIX_SORT_INSTANTIATE(ThreaderType, double)
|
||||||
|
|
||||||
VTKM_THIRDPARTY_POST_INCLUDE
|
VTKM_THIRDPARTY_POST_INCLUDE
|
||||||
|
@ -89,9 +89,8 @@ struct sort_tag_type<T, vtkm::cont::StorageTagBasic, BinaryCompare>
|
|||||||
using PrimT = std::is_arithmetic<T>;
|
using PrimT = std::is_arithmetic<T>;
|
||||||
using LongDT = std::is_same<T, long double>;
|
using LongDT = std::is_same<T, long double>;
|
||||||
using BComp = is_valid_compare_type<BinaryCompare>;
|
using BComp = is_valid_compare_type<BinaryCompare>;
|
||||||
using type = typename std::conditional<PrimT::value && BComp::value && !LongDT::value,
|
using type = typename std::
|
||||||
RadixSortTag,
|
conditional<PrimT::value && BComp::value && !LongDT::value, RadixSortTag, PSortTag>::type;
|
||||||
PSortTag>::type;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename KeyType,
|
template <typename KeyType,
|
||||||
@ -120,33 +119,33 @@ struct sortbykey_tag_type<KeyType,
|
|||||||
PSortTag>::type;
|
PSortTag>::type;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define VTKM_INTERNAL_RADIX_SORT_DECLARE(key_type) \
|
#define VTKM_INTERNAL_RADIX_SORT_DECLARE(key_type) \
|
||||||
VTKM_CONT_EXPORT void parallel_radix_sort( \
|
VTKM_CONT_EXPORT void parallel_radix_sort( \
|
||||||
key_type* data, size_t num_elems, const std::greater<key_type>& comp); \
|
key_type* data, size_t num_elems, const std::greater<key_type>& comp); \
|
||||||
VTKM_CONT_EXPORT void parallel_radix_sort( \
|
VTKM_CONT_EXPORT void parallel_radix_sort( \
|
||||||
key_type* data, size_t num_elems, const std::less<key_type>& comp); \
|
key_type* data, size_t num_elems, const std::less<key_type>& comp); \
|
||||||
VTKM_CONT_EXPORT void parallel_radix_sort_key_values( \
|
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); \
|
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( \
|
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);
|
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.
|
// Generate radix sort interfaces for key and key value sorts.
|
||||||
#define VTKM_DECLARE_RADIX_SORT() \
|
#define VTKM_DECLARE_RADIX_SORT() \
|
||||||
VTKM_INTERNAL_RADIX_SORT_DECLARE(short int) \
|
VTKM_INTERNAL_RADIX_SORT_DECLARE(short int) \
|
||||||
VTKM_INTERNAL_RADIX_SORT_DECLARE(unsigned short int) \
|
VTKM_INTERNAL_RADIX_SORT_DECLARE(unsigned short int) \
|
||||||
VTKM_INTERNAL_RADIX_SORT_DECLARE(int) \
|
VTKM_INTERNAL_RADIX_SORT_DECLARE(int) \
|
||||||
VTKM_INTERNAL_RADIX_SORT_DECLARE(unsigned int) \
|
VTKM_INTERNAL_RADIX_SORT_DECLARE(unsigned int) \
|
||||||
VTKM_INTERNAL_RADIX_SORT_DECLARE(long int) \
|
VTKM_INTERNAL_RADIX_SORT_DECLARE(long int) \
|
||||||
VTKM_INTERNAL_RADIX_SORT_DECLARE(unsigned long int) \
|
VTKM_INTERNAL_RADIX_SORT_DECLARE(unsigned long int) \
|
||||||
VTKM_INTERNAL_RADIX_SORT_DECLARE(long 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 long long int) \
|
||||||
VTKM_INTERNAL_RADIX_SORT_DECLARE(unsigned char) \
|
VTKM_INTERNAL_RADIX_SORT_DECLARE(unsigned char) \
|
||||||
VTKM_INTERNAL_RADIX_SORT_DECLARE(signed char) \
|
VTKM_INTERNAL_RADIX_SORT_DECLARE(signed char) \
|
||||||
VTKM_INTERNAL_RADIX_SORT_DECLARE(char) \
|
VTKM_INTERNAL_RADIX_SORT_DECLARE(char) \
|
||||||
VTKM_INTERNAL_RADIX_SORT_DECLARE(char16_t) \
|
VTKM_INTERNAL_RADIX_SORT_DECLARE(char16_t) \
|
||||||
VTKM_INTERNAL_RADIX_SORT_DECLARE(char32_t) \
|
VTKM_INTERNAL_RADIX_SORT_DECLARE(char32_t) \
|
||||||
VTKM_INTERNAL_RADIX_SORT_DECLARE(wchar_t) \
|
VTKM_INTERNAL_RADIX_SORT_DECLARE(wchar_t) \
|
||||||
VTKM_INTERNAL_RADIX_SORT_DECLARE(float) \
|
VTKM_INTERNAL_RADIX_SORT_DECLARE(float) \
|
||||||
VTKM_INTERNAL_RADIX_SORT_DECLARE(double)
|
VTKM_INTERNAL_RADIX_SORT_DECLARE(double)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,9 +31,7 @@ VariantArrayHandleContainerBase::VariantArrayHandleContainerBase(const std::type
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
VariantArrayHandleContainerBase::~VariantArrayHandleContainerBase()
|
VariantArrayHandleContainerBase::~VariantArrayHandleContainerBase() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace detail
|
namespace detail
|
||||||
|
@ -274,8 +274,9 @@ private:
|
|||||||
{ // number of components do not match
|
{ // number of components do not match
|
||||||
std::ostringstream str;
|
std::ostringstream str;
|
||||||
str << "VariantArrayHandle::AsVirtual: Cannot cast from " << vtkm::cont::TypeToString<S>()
|
str << "VariantArrayHandle::AsVirtual: Cannot cast from " << vtkm::cont::TypeToString<S>()
|
||||||
<< " to " << vtkm::cont::TypeToString<D>() << "; "
|
<< " to " << vtkm::cont::TypeToString<D>()
|
||||||
"number of components must match exactly.";
|
<< "; "
|
||||||
|
"number of components must match exactly.";
|
||||||
throw vtkm::cont::ErrorBadType(str.str());
|
throw vtkm::cont::ErrorBadType(str.str());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -10,12 +10,12 @@
|
|||||||
#ifndef vtk_m_cont_internal_VirtualObjectTransferInstantiate_h
|
#ifndef vtk_m_cont_internal_VirtualObjectTransferInstantiate_h
|
||||||
#define 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>
|
template class vtkm::cont::internal::VirtualObjectTransfer<DerivedType, DeviceDapterTagType>
|
||||||
|
|
||||||
#if defined(VTKM_ENABLE_CUDA)
|
#if defined(VTKM_ENABLE_CUDA)
|
||||||
#include <vtkm/cont/cuda/internal/VirtualObjectTransferCuda.h>
|
#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)
|
VTKM_EXPLICITLY_INSTANTIATE_TRANSFER_FOR_DEVICE(DerivedType, vtkm::cont::DeviceAdapterTagCuda)
|
||||||
#else // defined(VTKM_ENABLE_CUDA)
|
#else // defined(VTKM_ENABLE_CUDA)
|
||||||
#define VTKM_EXPLICITLY_INSTANTIATE_TRANSFER_CUDA(DerivedType)
|
#define VTKM_EXPLICITLY_INSTANTIATE_TRANSFER_CUDA(DerivedType)
|
||||||
@ -23,14 +23,14 @@
|
|||||||
|
|
||||||
#if defined(VTKM_ENABLE_KOKKOS)
|
#if defined(VTKM_ENABLE_KOKKOS)
|
||||||
#include <vtkm/cont/kokkos/internal/VirtualObjectTransferKokkos.h>
|
#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)
|
VTKM_EXPLICITLY_INSTANTIATE_TRANSFER_FOR_DEVICE(DerivedType, vtkm::cont::DeviceAdapterTagKokkos)
|
||||||
#else // defined(VTKM_ENABLE_KOKKOS)
|
#else // defined(VTKM_ENABLE_KOKKOS)
|
||||||
#define VTKM_EXPLICITLY_INSTANTIATE_TRANSFER_KOKKOS(DerivedType)
|
#define VTKM_EXPLICITLY_INSTANTIATE_TRANSFER_KOKKOS(DerivedType)
|
||||||
#endif // defined(VTKM_ENABLE_KOKKOS)
|
#endif // defined(VTKM_ENABLE_KOKKOS)
|
||||||
|
|
||||||
#define VTKM_EXPLICITLY_INSTANTIATE_TRANSFER(DerivedType) \
|
#define VTKM_EXPLICITLY_INSTANTIATE_TRANSFER(DerivedType) \
|
||||||
VTKM_EXPLICITLY_INSTANTIATE_TRANSFER_CUDA(DerivedType) \
|
VTKM_EXPLICITLY_INSTANTIATE_TRANSFER_CUDA(DerivedType) \
|
||||||
VTKM_EXPLICITLY_INSTANTIATE_TRANSFER_KOKKOS(DerivedType)
|
VTKM_EXPLICITLY_INSTANTIATE_TRANSFER_KOKKOS(DerivedType)
|
||||||
|
|
||||||
#endif // vtk_m_cont_internal_VirtualObjectTransferInstantiate_h
|
#endif // vtk_m_cont_internal_VirtualObjectTransferInstantiate_h
|
||||||
|
@ -175,10 +175,11 @@ public:
|
|||||||
|
|
||||||
Kokkos::MDRangePolicy<Kokkos::Rank<3>, Kokkos::IndexType<vtkm::Id>> policy(
|
Kokkos::MDRangePolicy<Kokkos::Rank<3>, Kokkos::IndexType<vtkm::Id>> policy(
|
||||||
{ 0, 0, 0 }, { rangeMax[0], rangeMax[1], rangeMax[2] });
|
{ 0, 0, 0 }, { rangeMax[0], rangeMax[1], rangeMax[2] });
|
||||||
Kokkos::parallel_for(policy, KOKKOS_LAMBDA(vtkm::Id i, vtkm::Id j, vtkm::Id k) {
|
Kokkos::parallel_for(
|
||||||
auto flatIdx = i + (j * rangeMax[0]) + (k * rangeMax[0] * rangeMax[1]);
|
policy, KOKKOS_LAMBDA(vtkm::Id i, vtkm::Id j, vtkm::Id k) {
|
||||||
functor(vtkm::Id3(i, j, k), flatIdx);
|
auto flatIdx = i + (j * rangeMax[0]) + (k * rangeMax[0] * rangeMax[1]);
|
||||||
});
|
functor(vtkm::Id3(i, j, k), flatIdx);
|
||||||
|
});
|
||||||
|
|
||||||
CheckForErrors(errorMessageStorage);
|
CheckForErrors(errorMessageStorage);
|
||||||
}
|
}
|
||||||
|
@ -15,8 +15,9 @@
|
|||||||
//We always create the kokkos tag when included, but we only mark it as
|
//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
|
//a valid tag when VTKM_ENABLE_KOKKOS is true. This is for easier development
|
||||||
//of multi-backend systems
|
//of multi-backend systems
|
||||||
#if defined(VTKM_ENABLE_KOKKOS) && ((!defined(VTKM_KOKKOS_CUDA) || defined(VTKM_CUDA)) || \
|
#if defined(VTKM_ENABLE_KOKKOS) && \
|
||||||
!defined(VTKM_NO_ERROR_ON_MIXED_CUDA_CXX_TAG))
|
((!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);
|
VTKM_VALID_DEVICE_ADAPTER(Kokkos, VTKM_DEVICE_ADAPTER_KOKKOS);
|
||||||
#else
|
#else
|
||||||
VTKM_INVALID_DEVICE_ADAPTER(Kokkos, VTKM_DEVICE_ADAPTER_KOKKOS);
|
VTKM_INVALID_DEVICE_ADAPTER(Kokkos, VTKM_DEVICE_ADAPTER_KOKKOS);
|
||||||
|
@ -54,17 +54,19 @@ struct VirtualObjectTransfer<VirtualDerivedType, vtkm::cont::DeviceAdapterTagKok
|
|||||||
auto executionObjectPtr = this->ExecutionObject =
|
auto executionObjectPtr = this->ExecutionObject =
|
||||||
static_cast<VirtualDerivedType*>(Kokkos::kokkos_malloc(sizeof(VirtualDerivedType)));
|
static_cast<VirtualDerivedType*>(Kokkos::kokkos_malloc(sizeof(VirtualDerivedType)));
|
||||||
// Initialize the device object
|
// Initialize the device object
|
||||||
Kokkos::parallel_for("ConstructVirtualObject", 1, KOKKOS_LAMBDA(const int&) {
|
Kokkos::parallel_for(
|
||||||
new (executionObjectPtr) VirtualDerivedType(*deviceTarget);
|
"ConstructVirtualObject", 1, KOKKOS_LAMBDA(const int&) {
|
||||||
});
|
new (executionObjectPtr) VirtualDerivedType(*deviceTarget);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
else if (updateData)
|
else if (updateData)
|
||||||
{
|
{
|
||||||
auto executionObjectPtr = this->ExecutionObject;
|
auto executionObjectPtr = this->ExecutionObject;
|
||||||
// Initialize the device object
|
// Initialize the device object
|
||||||
Kokkos::parallel_for("UpdateVirtualObject", 1, KOKKOS_LAMBDA(const int&) {
|
Kokkos::parallel_for(
|
||||||
*executionObjectPtr = *deviceTarget;
|
"UpdateVirtualObject", 1, KOKKOS_LAMBDA(const int&) {
|
||||||
});
|
*executionObjectPtr = *deviceTarget;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -440,23 +440,23 @@ struct ReduceHelper
|
|||||||
#ifdef VTKM_OPENMP_USE_NATIVE_REDUCTION
|
#ifdef VTKM_OPENMP_USE_NATIVE_REDUCTION
|
||||||
|
|
||||||
// Specialize for vtkm functors with OpenMP special cases:
|
// Specialize for vtkm functors with OpenMP special cases:
|
||||||
#define VTKM_OPENMP_SPECIALIZE_REDUCE1(FunctorType, PragmaString) \
|
#define VTKM_OPENMP_SPECIALIZE_REDUCE1(FunctorType, PragmaString) \
|
||||||
template <typename PortalT, typename ReturnType> \
|
template <typename PortalT, typename ReturnType> \
|
||||||
static ReturnType Execute( \
|
static ReturnType Execute( \
|
||||||
PortalT portal, ReturnType value, FunctorType functorIn, std::true_type) \
|
PortalT portal, ReturnType value, FunctorType functorIn, std::true_type) \
|
||||||
{ \
|
{ \
|
||||||
const vtkm::Id numValues = portal.GetNumberOfValues(); \
|
const vtkm::Id numValues = portal.GetNumberOfValues(); \
|
||||||
internal::WrappedBinaryOperator<ReturnType, FunctorType> f(functorIn); \
|
internal::WrappedBinaryOperator<ReturnType, FunctorType> f(functorIn); \
|
||||||
_Pragma(#PragmaString) for (vtkm::Id i = 0; i < numValues; ++i) \
|
_Pragma(#PragmaString) for (vtkm::Id i = 0; i < numValues; ++i) \
|
||||||
{ \
|
{ \
|
||||||
value = f(value, portal.Get(i)); \
|
value = f(value, portal.Get(i)); \
|
||||||
} \
|
} \
|
||||||
return value; \
|
return value; \
|
||||||
}
|
}
|
||||||
|
|
||||||
// Constructing the pragma string inside the _Pragma call doesn't work so
|
// Constructing the pragma string inside the _Pragma call doesn't work so
|
||||||
// we jump through a hoop:
|
// 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)")
|
VTKM_OPENMP_SPECIALIZE_REDUCE1(FunctorType, "omp parallel for reduction(" #Operator ":value)")
|
||||||
|
|
||||||
// + (Add, Sum)
|
// + (Add, Sum)
|
||||||
|
@ -154,10 +154,11 @@ public:
|
|||||||
const vtkm::Id inSize = input.GetNumberOfValues();
|
const vtkm::Id inSize = input.GetNumberOfValues();
|
||||||
|
|
||||||
// Check if the ranges overlap and fail if they do.
|
// Check if the ranges overlap and fail if they do.
|
||||||
if (input == output && ((outputIndex >= inputStartIndex &&
|
if (input == output &&
|
||||||
outputIndex < inputStartIndex + numberOfElementsToCopy) ||
|
((outputIndex >= inputStartIndex &&
|
||||||
(inputStartIndex >= outputIndex &&
|
outputIndex < inputStartIndex + numberOfElementsToCopy) ||
|
||||||
inputStartIndex < outputIndex + numberOfElementsToCopy)))
|
(inputStartIndex >= outputIndex &&
|
||||||
|
inputStartIndex < outputIndex + numberOfElementsToCopy)))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -96,10 +96,11 @@ public:
|
|||||||
const vtkm::Id inSize = input.GetNumberOfValues();
|
const vtkm::Id inSize = input.GetNumberOfValues();
|
||||||
|
|
||||||
// Check if the ranges overlap and fail if they do.
|
// Check if the ranges overlap and fail if they do.
|
||||||
if (input == output && ((outputIndex >= inputStartIndex &&
|
if (input == output &&
|
||||||
outputIndex < inputStartIndex + numberOfElementsToCopy) ||
|
((outputIndex >= inputStartIndex &&
|
||||||
(inputStartIndex >= outputIndex &&
|
outputIndex < inputStartIndex + numberOfElementsToCopy) ||
|
||||||
inputStartIndex < outputIndex + numberOfElementsToCopy)))
|
(inputStartIndex >= outputIndex &&
|
||||||
|
inputStartIndex < outputIndex + numberOfElementsToCopy)))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -208,9 +208,9 @@ void parallel_quick_sort(RandomAccessIterator begin, RandomAccessIterator end, c
|
|||||||
if (my_context.is_group_execution_cancelled())
|
if (my_context.is_group_execution_cancelled())
|
||||||
do_parallel_quick_sort:
|
do_parallel_quick_sort:
|
||||||
#endif /* __TBB_TASK_GROUP_CONTEXT */
|
#endif /* __TBB_TASK_GROUP_CONTEXT */
|
||||||
parallel_for(quick_sort_range<RandomAccessIterator, Compare>(begin, end - begin, comp),
|
parallel_for(quick_sort_range<RandomAccessIterator, Compare>(begin, end - begin, comp),
|
||||||
quick_sort_body<RandomAccessIterator, Compare>(),
|
quick_sort_body<RandomAccessIterator, Compare>(),
|
||||||
auto_partitioner());
|
auto_partitioner());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
@ -208,9 +208,9 @@ void parallel_quick_sort(RandomAccessIterator begin, RandomAccessIterator end, c
|
|||||||
if (my_context.is_group_execution_cancelled())
|
if (my_context.is_group_execution_cancelled())
|
||||||
do_parallel_quick_sort:
|
do_parallel_quick_sort:
|
||||||
#endif /* __TBB_TASK_GROUP_CONTEXT */
|
#endif /* __TBB_TASK_GROUP_CONTEXT */
|
||||||
parallel_for(quick_sort_range<RandomAccessIterator, Compare>(begin, end - begin, comp),
|
parallel_for(quick_sort_range<RandomAccessIterator, Compare>(begin, end - begin, comp),
|
||||||
quick_sort_body<RandomAccessIterator, Compare>(),
|
quick_sort_body<RandomAccessIterator, Compare>(),
|
||||||
auto_partitioner());
|
auto_partitioner());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
@ -23,32 +23,32 @@
|
|||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
#define DEVICE_ASSERT_MSG(cond, message) \
|
#define DEVICE_ASSERT_MSG(cond, message) \
|
||||||
do \
|
do \
|
||||||
{ \
|
{ \
|
||||||
if (!(cond)) \
|
if (!(cond)) \
|
||||||
{ \
|
{ \
|
||||||
printf("Testing assert failed at %s:%d\n\t- Condition: %s\n\t- Subtest: %s\n", \
|
printf("Testing assert failed at %s:%d\n\t- Condition: %s\n\t- Subtest: %s\n", \
|
||||||
__FILE__, \
|
__FILE__, \
|
||||||
__LINE__, \
|
__LINE__, \
|
||||||
#cond, \
|
#cond, \
|
||||||
message); \
|
message); \
|
||||||
return false; \
|
return false; \
|
||||||
} \
|
} \
|
||||||
} while (false)
|
} while (false)
|
||||||
|
|
||||||
#define DEVICE_ASSERT(cond) \
|
#define DEVICE_ASSERT(cond) \
|
||||||
do \
|
do \
|
||||||
{ \
|
{ \
|
||||||
if (!(cond)) \
|
if (!(cond)) \
|
||||||
{ \
|
{ \
|
||||||
printf("Testing assert failed at %s:%d\n\t- Condition: %s\n", __FILE__, __LINE__, #cond); \
|
printf("Testing assert failed at %s:%d\n\t- Condition: %s\n", __FILE__, __LINE__, #cond); \
|
||||||
return false; \
|
return false; \
|
||||||
} \
|
} \
|
||||||
} while (false)
|
} while (false)
|
||||||
|
|
||||||
// Test with some trailing bits in partial last word:
|
// Test with some trailing bits in partial last word:
|
||||||
#define NUM_BITS \
|
#define NUM_BITS \
|
||||||
vtkm::Id { 7681 }
|
vtkm::Id { 7681 }
|
||||||
|
|
||||||
using vtkm::cont::BitField;
|
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::numConn, vtkm::cont::testing::ExplicitData##num::conn, \
|
||||||
vtkm::cont::testing::ExplicitData##num::numIndices, \
|
vtkm::cont::testing::ExplicitData##num::numIndices, \
|
||||||
vtkm::cont::testing::ExplicitData##num::shapes
|
vtkm::cont::testing::ExplicitData##num::shapes
|
||||||
#define TEST_NUMS(num) \
|
#define TEST_NUMS(num) \
|
||||||
vtkm::cont::testing::ExplicitData##num::numPoints, \
|
vtkm::cont::testing::ExplicitData##num::numPoints, \
|
||||||
vtkm::cont::testing::ExplicitData##num::numCells
|
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
|
vtkm::cont::testing::ExplicitData##num::numPoints, vtkm::cont::testing::ExplicitData##num::coords
|
||||||
|
|
||||||
void TestDataSetBuilderExplicit()
|
void TestDataSetBuilderExplicit()
|
||||||
|
@ -82,9 +82,8 @@ class DeviceAdapterMemoryManager<vtkm::cont::DeviceAdapterTagTestAlgorithmGenera
|
|||||||
|
|
||||||
template <typename T, class StorageTag>
|
template <typename T, class StorageTag>
|
||||||
class ArrayManagerExecution<T, StorageTag, vtkm::cont::DeviceAdapterTagTestAlgorithmGeneral>
|
class ArrayManagerExecution<T, StorageTag, vtkm::cont::DeviceAdapterTagTestAlgorithmGeneral>
|
||||||
: public vtkm::cont::internal::ArrayManagerExecution<T,
|
: public vtkm::cont::internal::
|
||||||
StorageTag,
|
ArrayManagerExecution<T, StorageTag, vtkm::cont::DeviceAdapterTagSerial>
|
||||||
vtkm::cont::DeviceAdapterTagSerial>
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
using Superclass =
|
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(msg) std::cout << "[" << comm.rank() << ":" << __LINE__ << "] " msg << std::endl;
|
||||||
|
|
||||||
#define PRINT_INFO_0(msg) \
|
#define PRINT_INFO_0(msg) \
|
||||||
if (comm.rank() == 0) \
|
if (comm.rank() == 0) \
|
||||||
{ \
|
{ \
|
||||||
std::cout << "[" << comm.rank() << ":" << __LINE__ << "] " msg << std::endl; \
|
std::cout << "[" << comm.rank() << ":" << __LINE__ << "] " msg << std::endl; \
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
@ -90,8 +90,7 @@ void Validate(const vtkm::cont::ArrayHandle<vtkm::Range>& ranges,
|
|||||||
auto portal = ranges.ReadPortal();
|
auto portal = ranges.ReadPortal();
|
||||||
auto range = portal.Get(0);
|
auto range = portal.Get(0);
|
||||||
PRINT_INFO(<< " expecting [" << min << ", " << max << "], got [" << range.Min << ", "
|
PRINT_INFO(<< " expecting [" << min << ", " << max << "], got [" << range.Min << ", "
|
||||||
<< range.Max
|
<< range.Max << "]");
|
||||||
<< "]");
|
|
||||||
VTKM_TEST_ASSERT(range.IsNonEmpty() && range.Min >= static_cast<ValueType>(min) &&
|
VTKM_TEST_ASSERT(range.IsNonEmpty() && range.Min >= static_cast<ValueType>(min) &&
|
||||||
range.Max <= static_cast<ValueType>(max),
|
range.Max <= static_cast<ValueType>(max),
|
||||||
"Got wrong range.");
|
"Got wrong range.");
|
||||||
@ -110,10 +109,7 @@ void Validate(const vtkm::cont::ArrayHandle<vtkm::Range>& ranges,
|
|||||||
{
|
{
|
||||||
auto range = portal.Get(cc);
|
auto range = portal.Get(cc);
|
||||||
PRINT_INFO(<< " [" << cc << "] expecting [" << min[cc] << ", " << max[cc] << "], got ["
|
PRINT_INFO(<< " [" << cc << "] expecting [" << min[cc] << ", " << max[cc] << "], got ["
|
||||||
<< range.Min
|
<< range.Min << ", " << range.Max << "]");
|
||||||
<< ", "
|
|
||||||
<< range.Max
|
|
||||||
<< "]");
|
|
||||||
VTKM_TEST_ASSERT(range.IsNonEmpty() && range.Min >= static_cast<T>(min[cc]) &&
|
VTKM_TEST_ASSERT(range.IsNonEmpty() && range.Min >= static_cast<T>(min[cc]) &&
|
||||||
range.Max <= static_cast<T>(max[cc]),
|
range.Max <= static_cast<T>(max[cc]),
|
||||||
"Got wrong range.");
|
"Got wrong range.");
|
||||||
|
@ -94,7 +94,7 @@ void RunTests()
|
|||||||
|
|
||||||
} // end anon namespace
|
} // end anon namespace
|
||||||
|
|
||||||
int UnitTestLogging(int, char* [])
|
int UnitTestLogging(int, char*[])
|
||||||
{
|
{
|
||||||
// Test that parameterless init works:
|
// Test that parameterless init works:
|
||||||
VTKM_LOG_S(vtkm::cont::LogLevel::Info, "Log before intialize");
|
VTKM_LOG_S(vtkm::cont::LogLevel::Info, "Log before intialize");
|
||||||
|
@ -64,16 +64,16 @@ struct TestObject
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#define CHECK_OBJECT(object, expectedTokens, expectedRefs) \
|
#define CHECK_OBJECT(object, expectedTokens, expectedRefs) \
|
||||||
VTKM_TEST_ASSERT(*(object).TokenCount == (expectedTokens), \
|
VTKM_TEST_ASSERT(*(object).TokenCount == (expectedTokens), \
|
||||||
"Expected object to have token count of ", \
|
"Expected object to have token count of ", \
|
||||||
(expectedTokens), \
|
(expectedTokens), \
|
||||||
". It actually was ", \
|
". It actually was ", \
|
||||||
*(object).TokenCount); \
|
*(object).TokenCount); \
|
||||||
VTKM_TEST_ASSERT(*(object).ReferenceCount == (expectedRefs), \
|
VTKM_TEST_ASSERT(*(object).ReferenceCount == (expectedRefs), \
|
||||||
"Expected object to have reference count of ", \
|
"Expected object to have reference count of ", \
|
||||||
(expectedRefs), \
|
(expectedRefs), \
|
||||||
". It actually was ", \
|
". It actually was ", \
|
||||||
*(object).ReferenceCount)
|
*(object).ReferenceCount)
|
||||||
|
|
||||||
void TestBasicAttachDetatch()
|
void TestBasicAttachDetatch()
|
||||||
|
@ -131,8 +131,8 @@ public:
|
|||||||
// 14: CELL_SHAPE_PYRAMID
|
// 14: CELL_SHAPE_PYRAMID
|
||||||
{ { 0, 3, 2, 1 }, { 0, 1, 4, -1 }, { 1, 2, 4, -1 },
|
{ { 0, 3, 2, 1 }, { 0, 1, 4, -1 }, { 1, 2, 4, -1 },
|
||||||
{ 2, 3, 4, -1 }, { 3, 0, 4, -1 },{ -1, -1, -1, -1 } }
|
{ 2, 3, 4, -1 }, { 3, 0, 4, -1 },{ -1, -1, -1, -1 } }
|
||||||
// clang-format on
|
// clang-format on
|
||||||
};
|
};
|
||||||
return pointsInFace[cellShapeId][faceIndex][localPointIndex];
|
return pointsInFace[cellShapeId][faceIndex][localPointIndex];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -275,9 +275,8 @@ private:
|
|||||||
using NodePortal = typename NodeArrayHandle::template ExecutionTypes<DeviceAdapter>::PortalConst;
|
using NodePortal = typename NodeArrayHandle::template ExecutionTypes<DeviceAdapter>::PortalConst;
|
||||||
using CellIdPortal =
|
using CellIdPortal =
|
||||||
typename CellIdArrayHandle::template ExecutionTypes<DeviceAdapter>::PortalConst;
|
typename CellIdArrayHandle::template ExecutionTypes<DeviceAdapter>::PortalConst;
|
||||||
using CellSetPortal = typename CellSetType::template ExecutionTypes<DeviceAdapter,
|
using CellSetPortal = typename CellSetType::
|
||||||
VisitType,
|
template ExecutionTypes<DeviceAdapter, VisitType, IncidentType>::ExecObjectType;
|
||||||
IncidentType>::ExecObjectType;
|
|
||||||
using CoordsPortal =
|
using CoordsPortal =
|
||||||
typename vtkm::cont::CoordinateSystem::MultiplexerArrayType::template ExecutionTypes<
|
typename vtkm::cont::CoordinateSystem::MultiplexerArrayType::template ExecutionTypes<
|
||||||
DeviceAdapter>::PortalConst;
|
DeviceAdapter>::PortalConst;
|
||||||
|
@ -95,7 +95,10 @@ VTKM_EXEC OutType CellMeasure(const vtkm::IdComponent& numPts,
|
|||||||
}
|
}
|
||||||
|
|
||||||
typename PointCoordVecType::ComponentType edges[4] = {
|
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] = {
|
typename PointCoordVecType::ComponentType cornerNormals[4] = {
|
||||||
@ -107,7 +110,8 @@ VTKM_EXEC OutType CellMeasure(const vtkm::IdComponent& numPts,
|
|||||||
|
|
||||||
// principal axes
|
// principal axes
|
||||||
typename PointCoordVecType::ComponentType principalAxes[2] = {
|
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
|
// Unit normal at the quadrilateral center
|
||||||
|
@ -55,8 +55,8 @@ struct ExecutionSignatureTagCheck
|
|||||||
/// that a template argument is actually an \c ExecutionSignature tag. (You can
|
/// that a template argument is actually an \c ExecutionSignature tag. (You can
|
||||||
/// get weird errors elsewhere in the code when a mistake is made.)
|
/// get weird errors elsewhere in the code when a mistake is made.)
|
||||||
///
|
///
|
||||||
#define VTKM_IS_EXECUTION_SIGNATURE_TAG(tag) \
|
#define VTKM_IS_EXECUTION_SIGNATURE_TAG(tag) \
|
||||||
VTKM_STATIC_ASSERT_MSG(::vtkm::exec::arg::internal::ExecutionSignatureTagCheck<tag>::Valid, \
|
VTKM_STATIC_ASSERT_MSG(::vtkm::exec::arg::internal::ExecutionSignatureTagCheck<tag>::Valid, \
|
||||||
"Provided a type that is not a valid ExecutionSignature tag.")
|
"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::exec::ConnectivityStructured<vtkm::TopologyElementTagCell,
|
||||||
vtkm::TopologyElementTagPoint,
|
vtkm::TopologyElementTagPoint,
|
||||||
Dimension>>;
|
Dimension>>;
|
||||||
using ConnectivityType = vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagCell,
|
using ConnectivityType = vtkm::exec::
|
||||||
vtkm::TopologyElementTagPoint,
|
ConnectivityStructured<vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint, Dimension>;
|
||||||
Dimension>;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using IndicesIncidentType = typename ConnectivityType::IndicesType;
|
using IndicesIncidentType = typename ConnectivityType::IndicesType;
|
||||||
|
@ -104,10 +104,9 @@ struct FetchArrayNeighborhoodInTests
|
|||||||
|
|
||||||
vtkm::internal::ConnectivityStructuredInternals<3> connectivityInternals;
|
vtkm::internal::ConnectivityStructuredInternals<3> connectivityInternals;
|
||||||
connectivityInternals.SetPointDimensions(POINT_DIMS);
|
connectivityInternals.SetPointDimensions(POINT_DIMS);
|
||||||
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagPoint,
|
vtkm::exec::
|
||||||
vtkm::TopologyElementTagCell,
|
ConnectivityStructured<vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell, 3>
|
||||||
3>
|
connectivity(connectivityInternals);
|
||||||
connectivity(connectivityInternals);
|
|
||||||
|
|
||||||
// Verify that 3D scheduling works with neighborhoods
|
// Verify that 3D scheduling works with neighborhoods
|
||||||
{
|
{
|
||||||
|
@ -126,10 +126,9 @@ struct FetchArrayTopologyMapInTests
|
|||||||
|
|
||||||
vtkm::internal::ConnectivityStructuredInternals<3> connectivityInternals;
|
vtkm::internal::ConnectivityStructuredInternals<3> connectivityInternals;
|
||||||
connectivityInternals.SetPointDimensions(vtkm::Id3(2, 2, 2));
|
connectivityInternals.SetPointDimensions(vtkm::Id3(2, 2, 2));
|
||||||
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagCell,
|
vtkm::exec::
|
||||||
vtkm::TopologyElementTagPoint,
|
ConnectivityStructured<vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint, 3>
|
||||||
3>
|
connectivity(connectivityInternals);
|
||||||
connectivity(connectivityInternals);
|
|
||||||
|
|
||||||
using NullType = vtkm::internal::NullType;
|
using NullType = vtkm::internal::NullType;
|
||||||
auto baseFunctionInterface = vtkm::internal::make_FunctionInterface<void>(
|
auto baseFunctionInterface = vtkm::internal::make_FunctionInterface<void>(
|
||||||
|
@ -173,7 +173,7 @@ __host__ __device__::thrust::pair<OutputIterator1, OutputIterator2> reduce_by_ke
|
|||||||
BinaryFunction binary_op)
|
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)
|
(VTKM_CUDA_VERSION_MINOR >= 5)
|
||||||
::thrust::pair<OutputIterator1, OutputIterator2> result =
|
::thrust::pair<OutputIterator1, OutputIterator2> result =
|
||||||
thrust::reduce_by_key(ThrustCudaPolicyPerThread,
|
thrust::reduce_by_key(ThrustCudaPolicyPerThread,
|
||||||
|
@ -29,97 +29,97 @@ namespace detail
|
|||||||
template <typename T, typename U>
|
template <typename T, typename U>
|
||||||
T aligned_reinterpret_cast(U u);
|
T aligned_reinterpret_cast(U u);
|
||||||
|
|
||||||
#define ALIGN_RE_T(RT) \
|
#define ALIGN_RE_T(RT) \
|
||||||
template <> \
|
template <> \
|
||||||
inline __host__ __device__ RT* aligned_reinterpret_cast(void* u) \
|
inline __host__ __device__ RT* aligned_reinterpret_cast(void* u) \
|
||||||
{ \
|
{ \
|
||||||
return reinterpret_cast<RT*>(reinterpret_cast<void*>(u)); \
|
return reinterpret_cast<RT*>(reinterpret_cast<void*>(u)); \
|
||||||
} \
|
} \
|
||||||
template <> \
|
template <> \
|
||||||
inline __host__ __device__ RT* aligned_reinterpret_cast(vtkm::UInt8* u) \
|
inline __host__ __device__ RT* aligned_reinterpret_cast(vtkm::UInt8* u) \
|
||||||
{ \
|
{ \
|
||||||
return reinterpret_cast<RT*>(reinterpret_cast<void*>(u)); \
|
return reinterpret_cast<RT*>(reinterpret_cast<void*>(u)); \
|
||||||
} \
|
} \
|
||||||
struct SwallowSemicolon
|
struct SwallowSemicolon
|
||||||
|
|
||||||
#define ALIGN_RE_VEC(RT) \
|
#define ALIGN_RE_VEC(RT) \
|
||||||
template <> \
|
template <> \
|
||||||
inline __host__ __device__ vtkm::Vec<RT, 2>* aligned_reinterpret_cast(void* u) \
|
inline __host__ __device__ vtkm::Vec<RT, 2>* aligned_reinterpret_cast(void* u) \
|
||||||
{ \
|
{ \
|
||||||
return reinterpret_cast<vtkm::Vec<RT, 2>*>(reinterpret_cast<void*>(u)); \
|
return reinterpret_cast<vtkm::Vec<RT, 2>*>(reinterpret_cast<void*>(u)); \
|
||||||
} \
|
} \
|
||||||
template <> \
|
template <> \
|
||||||
inline __host__ __device__ vtkm::Vec<RT, 3>* aligned_reinterpret_cast(void* u) \
|
inline __host__ __device__ vtkm::Vec<RT, 3>* aligned_reinterpret_cast(void* u) \
|
||||||
{ \
|
{ \
|
||||||
return reinterpret_cast<vtkm::Vec<RT, 3>*>(reinterpret_cast<void*>(u)); \
|
return reinterpret_cast<vtkm::Vec<RT, 3>*>(reinterpret_cast<void*>(u)); \
|
||||||
} \
|
} \
|
||||||
template <> \
|
template <> \
|
||||||
inline __host__ __device__ vtkm::Vec<RT, 4>* aligned_reinterpret_cast(void* u) \
|
inline __host__ __device__ vtkm::Vec<RT, 4>* aligned_reinterpret_cast(void* u) \
|
||||||
{ \
|
{ \
|
||||||
return reinterpret_cast<vtkm::Vec<RT, 4>*>(reinterpret_cast<void*>(u)); \
|
return reinterpret_cast<vtkm::Vec<RT, 4>*>(reinterpret_cast<void*>(u)); \
|
||||||
} \
|
} \
|
||||||
template <> \
|
template <> \
|
||||||
inline __host__ __device__ vtkm::Vec<vtkm::Vec<RT, 3>, 2>* aligned_reinterpret_cast(void* u) \
|
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)); \
|
return reinterpret_cast<vtkm::Vec<vtkm::Vec<RT, 3>, 2>*>(reinterpret_cast<void*>(u)); \
|
||||||
} \
|
} \
|
||||||
template <> \
|
template <> \
|
||||||
inline __host__ __device__ vtkm::Vec<vtkm::Vec<RT, 9>, 2>* aligned_reinterpret_cast(void* u) \
|
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)); \
|
return reinterpret_cast<vtkm::Vec<vtkm::Vec<RT, 9>, 2>*>(reinterpret_cast<void*>(u)); \
|
||||||
} \
|
} \
|
||||||
template <> \
|
template <> \
|
||||||
inline __host__ __device__ vtkm::Vec<RT, 2>* aligned_reinterpret_cast(vtkm::UInt8* u) \
|
inline __host__ __device__ vtkm::Vec<RT, 2>* aligned_reinterpret_cast(vtkm::UInt8* u) \
|
||||||
{ \
|
{ \
|
||||||
return reinterpret_cast<vtkm::Vec<RT, 2>*>(reinterpret_cast<void*>(u)); \
|
return reinterpret_cast<vtkm::Vec<RT, 2>*>(reinterpret_cast<void*>(u)); \
|
||||||
} \
|
} \
|
||||||
template <> \
|
template <> \
|
||||||
inline __host__ __device__ vtkm::Vec<RT, 3>* aligned_reinterpret_cast(vtkm::UInt8* u) \
|
inline __host__ __device__ vtkm::Vec<RT, 3>* aligned_reinterpret_cast(vtkm::UInt8* u) \
|
||||||
{ \
|
{ \
|
||||||
return reinterpret_cast<vtkm::Vec<RT, 3>*>(reinterpret_cast<void*>(u)); \
|
return reinterpret_cast<vtkm::Vec<RT, 3>*>(reinterpret_cast<void*>(u)); \
|
||||||
} \
|
} \
|
||||||
template <> \
|
template <> \
|
||||||
inline __host__ __device__ vtkm::Vec<RT, 4>* aligned_reinterpret_cast(vtkm::UInt8* u) \
|
inline __host__ __device__ vtkm::Vec<RT, 4>* aligned_reinterpret_cast(vtkm::UInt8* u) \
|
||||||
{ \
|
{ \
|
||||||
return reinterpret_cast<vtkm::Vec<RT, 4>*>(reinterpret_cast<void*>(u)); \
|
return reinterpret_cast<vtkm::Vec<RT, 4>*>(reinterpret_cast<void*>(u)); \
|
||||||
} \
|
} \
|
||||||
template <> \
|
template <> \
|
||||||
inline __host__ __device__ vtkm::Vec<vtkm::Vec<RT, 2>, 2>* aligned_reinterpret_cast( \
|
inline __host__ __device__ vtkm::Vec<vtkm::Vec<RT, 2>, 2>* aligned_reinterpret_cast( \
|
||||||
vtkm::UInt8* u) \
|
vtkm::UInt8* u) \
|
||||||
{ \
|
{ \
|
||||||
return reinterpret_cast<vtkm::Vec<vtkm::Vec<RT, 2>, 2>*>(reinterpret_cast<void*>(u)); \
|
return reinterpret_cast<vtkm::Vec<vtkm::Vec<RT, 2>, 2>*>(reinterpret_cast<void*>(u)); \
|
||||||
} \
|
} \
|
||||||
template <> \
|
template <> \
|
||||||
inline __host__ __device__ vtkm::Vec<vtkm::Vec<RT, 3>, 2>* aligned_reinterpret_cast( \
|
inline __host__ __device__ vtkm::Vec<vtkm::Vec<RT, 3>, 2>* aligned_reinterpret_cast( \
|
||||||
vtkm::UInt8* u) \
|
vtkm::UInt8* u) \
|
||||||
{ \
|
{ \
|
||||||
return reinterpret_cast<vtkm::Vec<vtkm::Vec<RT, 3>, 2>*>(reinterpret_cast<void*>(u)); \
|
return reinterpret_cast<vtkm::Vec<vtkm::Vec<RT, 3>, 2>*>(reinterpret_cast<void*>(u)); \
|
||||||
} \
|
} \
|
||||||
template <> \
|
template <> \
|
||||||
inline __host__ __device__ vtkm::Vec<vtkm::Vec<RT, 4>, 2>* aligned_reinterpret_cast( \
|
inline __host__ __device__ vtkm::Vec<vtkm::Vec<RT, 4>, 2>* aligned_reinterpret_cast( \
|
||||||
vtkm::UInt8* u) \
|
vtkm::UInt8* u) \
|
||||||
{ \
|
{ \
|
||||||
return reinterpret_cast<vtkm::Vec<vtkm::Vec<RT, 4>, 2>*>(reinterpret_cast<void*>(u)); \
|
return reinterpret_cast<vtkm::Vec<vtkm::Vec<RT, 4>, 2>*>(reinterpret_cast<void*>(u)); \
|
||||||
} \
|
} \
|
||||||
template <> \
|
template <> \
|
||||||
inline __host__ __device__ vtkm::Vec<vtkm::Vec<RT, 9>, 2>* aligned_reinterpret_cast( \
|
inline __host__ __device__ vtkm::Vec<vtkm::Vec<RT, 9>, 2>* aligned_reinterpret_cast( \
|
||||||
vtkm::UInt8* u) \
|
vtkm::UInt8* u) \
|
||||||
{ \
|
{ \
|
||||||
return reinterpret_cast<vtkm::Vec<vtkm::Vec<RT, 9>, 2>*>(reinterpret_cast<void*>(u)); \
|
return reinterpret_cast<vtkm::Vec<vtkm::Vec<RT, 9>, 2>*>(reinterpret_cast<void*>(u)); \
|
||||||
} \
|
} \
|
||||||
struct SwallowSemicolon
|
struct SwallowSemicolon
|
||||||
|
|
||||||
#define ALIGN_RE_PAIR(T, U) \
|
#define ALIGN_RE_PAIR(T, U) \
|
||||||
template <> \
|
template <> \
|
||||||
inline __host__ __device__ vtkm::Pair<T, U>* aligned_reinterpret_cast(void* u) \
|
inline __host__ __device__ vtkm::Pair<T, U>* aligned_reinterpret_cast(void* u) \
|
||||||
{ \
|
{ \
|
||||||
return reinterpret_cast<vtkm::Pair<T, U>*>(reinterpret_cast<void*>(u)); \
|
return reinterpret_cast<vtkm::Pair<T, U>*>(reinterpret_cast<void*>(u)); \
|
||||||
} \
|
} \
|
||||||
template <> \
|
template <> \
|
||||||
inline __host__ __device__ vtkm::Pair<T, U>* aligned_reinterpret_cast(vtkm::UInt8* u) \
|
inline __host__ __device__ vtkm::Pair<T, U>* aligned_reinterpret_cast(vtkm::UInt8* u) \
|
||||||
{ \
|
{ \
|
||||||
return reinterpret_cast<vtkm::Pair<T, U>*>(reinterpret_cast<void*>(u)); \
|
return reinterpret_cast<vtkm::Pair<T, U>*>(reinterpret_cast<void*>(u)); \
|
||||||
} \
|
} \
|
||||||
struct SwallowSemicolon
|
struct SwallowSemicolon
|
||||||
|
|
||||||
#ifndef VTKM_DONT_FIX_THRUST
|
#ifndef VTKM_DONT_FIX_THRUST
|
||||||
|
@ -241,25 +241,25 @@ struct TestWorkletErrorProxy : vtkm::exec::FunctorBase
|
|||||||
// Check behavior of InvocationToFetch helper class.
|
// Check behavior of InvocationToFetch helper class.
|
||||||
|
|
||||||
VTKM_STATIC_ASSERT(
|
VTKM_STATIC_ASSERT(
|
||||||
(std::is_same<vtkm::exec::internal::detail::
|
(std::is_same<
|
||||||
InvocationToFetch<vtkm::exec::arg::ThreadIndicesBasic, InvocationType1, 1>::type,
|
vtkm::exec::internal::detail::
|
||||||
vtkm::exec::arg::Fetch<TestFetchTagInput,
|
InvocationToFetch<vtkm::exec::arg::ThreadIndicesBasic, InvocationType1, 1>::type,
|
||||||
vtkm::exec::arg::AspectTagDefault,
|
vtkm::exec::arg::Fetch<TestFetchTagInput, vtkm::exec::arg::AspectTagDefault, TestExecObject>>::
|
||||||
TestExecObject>>::type::value));
|
type::value));
|
||||||
|
|
||||||
VTKM_STATIC_ASSERT(
|
VTKM_STATIC_ASSERT(
|
||||||
(std::is_same<vtkm::exec::internal::detail::
|
(std::is_same<
|
||||||
InvocationToFetch<vtkm::exec::arg::ThreadIndicesBasic, InvocationType1, 2>::type,
|
vtkm::exec::internal::detail::
|
||||||
vtkm::exec::arg::Fetch<TestFetchTagOutput,
|
InvocationToFetch<vtkm::exec::arg::ThreadIndicesBasic, InvocationType1, 2>::type,
|
||||||
vtkm::exec::arg::AspectTagDefault,
|
vtkm::exec::arg::Fetch<TestFetchTagOutput, vtkm::exec::arg::AspectTagDefault, TestExecObject>>::
|
||||||
TestExecObject>>::type::value));
|
type::value));
|
||||||
|
|
||||||
VTKM_STATIC_ASSERT(
|
VTKM_STATIC_ASSERT(
|
||||||
(std::is_same<vtkm::exec::internal::detail::
|
(std::is_same<
|
||||||
InvocationToFetch<vtkm::exec::arg::ThreadIndicesBasic, InvocationType2, 0>::type,
|
vtkm::exec::internal::detail::
|
||||||
vtkm::exec::arg::Fetch<TestFetchTagOutput,
|
InvocationToFetch<vtkm::exec::arg::ThreadIndicesBasic, InvocationType2, 0>::type,
|
||||||
vtkm::exec::arg::AspectTagDefault,
|
vtkm::exec::arg::Fetch<TestFetchTagOutput, vtkm::exec::arg::AspectTagDefault, TestExecObject>>::
|
||||||
TestExecObject>>::type::value));
|
type::value));
|
||||||
|
|
||||||
template <typename DeviceAdapter>
|
template <typename DeviceAdapter>
|
||||||
void TestNormalFunctorInvoke()
|
void TestNormalFunctorInvoke()
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user