Removes the default device macros from VTK-m

Fixes #116
This commit is contained in:
Robert Maynard 2019-04-09 09:52:53 -04:00
parent 3fc0f11df3
commit ff30684c8e
158 changed files with 554 additions and 1587 deletions

@ -41,7 +41,7 @@ add_subdirectory(rendering)
add_subdirectory(streamline)
add_subdirectory(temporal_advection)
add_subdirectory(tetrahedra)
add_subdirectory(unified_memory)
# add_subdirectory(unified_memory)
if (VTKm_ENABLE_TESTING)

@ -25,23 +25,9 @@ project(Clipping CXX)
#Find the VTK-m package
find_package(VTKm REQUIRED QUIET)
add_executable(Clipping_SERIAL Clipping.cxx)
target_compile_definitions(Clipping_SERIAL PRIVATE
"VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_SERIAL")
target_link_libraries(Clipping_SERIAL PRIVATE vtkm_filter)
if(TARGET vtkm::tbb)
add_executable(Clipping_TBB Clipping.cxx)
target_compile_definitions(Clipping_TBB PRIVATE
"VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_TBB")
target_link_libraries(Clipping_TBB PRIVATE vtkm_filter)
endif()
add_executable(Clipping Clipping.cxx)
target_link_libraries(Clipping PRIVATE vtkm_filter)
if(TARGET vtkm::cuda)
vtkm_compile_as_cuda(cudaSource Clipping.cxx)
add_executable(Clipping_CUDA ${cudaSource})
target_compile_definitions(Clipping_CUDA PRIVATE
"VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_CUDA")
target_link_libraries(Clipping_CUDA PRIVATE vtkm_filter)
set_source_files_properties(Clipping.cxx PROPERTIES LANGUAGE "CUDA")
endif()

@ -19,7 +19,9 @@
//============================================================================
#include <vtkm/cont/ArrayHandleCast.h>
#include <vtkm/cont/DataSet.h>
#include <vtkm/cont/Initialize.h>
#include <vtkm/cont/Timer.h>
#include <vtkm/io/reader/VTKDataSetReader.h>
#include <vtkm/io/writer/VTKDataSetWriter.h>
@ -69,10 +71,13 @@ struct FieldMapper
int main(int argc, char* argv[])
{
auto opts = vtkm::cont::InitializeOptions::DefaultAnyDevice;
vtkm::cont::InitializeResult config = vtkm::cont::Initialize(argc, argv, opts);
if (argc < 4)
{
std::cout << "Usage: " << std::endl
<< "$ " << argv[0] << " <input_vtk_file> [fieldName] <isoval> <output_vtk_file>"
<< "$ " << argv[0]
<< " [-d device] <input_vtk_file> [fieldName] <isoval> <output_vtk_file>"
<< std::endl;
return 1;
}

@ -25,42 +25,12 @@ project(ContourTree CXX)
#Find the VTK-m package
find_package(VTKm REQUIRED QUIET)
add_executable(ContourTreeMesh2D_SERIAL ContourTreeMesh2D.cxx)
target_link_libraries(ContourTreeMesh2D_SERIAL vtkm_filter)
add_executable(ContourTreeMesh2D ContourTreeMesh2D.cxx)
target_link_libraries(ContourTreeMesh2D vtkm_filter)
add_executable(ContourTreeMesh3D_SERIAL ContourTreeMesh3D.cxx)
target_link_libraries(ContourTreeMesh3D_SERIAL vtkm_filter)
target_compile_definitions(ContourTreeMesh2D_SERIAL PRIVATE
"VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_SERIAL")
target_compile_definitions(ContourTreeMesh3D_SERIAL PRIVATE
"VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_SERIAL")
add_executable(ContourTreeMesh3D ContourTreeMesh3D.cxx)
target_link_libraries(ContourTreeMesh3D vtkm_filter)
if(TARGET vtkm::cuda)
vtkm_compile_as_cuda(cudaSource ContourTreeMesh2D.cxx)
add_executable(ContourTreeMesh2D_CUDA ${cudaSource})
vtkm_compile_as_cuda(cudaSource ContourTreeMesh3D.cxx)
add_executable(ContourTreeMesh3D_CUDA ${cudaSource})
target_link_libraries(ContourTreeMesh2D_CUDA vtkm_filter)
target_link_libraries(ContourTreeMesh3D_CUDA vtkm_filter)
target_compile_definitions(ContourTreeMesh2D_CUDA PRIVATE
"VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_CUDA")
target_compile_definitions(ContourTreeMesh3D_CUDA PRIVATE
"VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_CUDA")
endif()
if(TARGET vtkm::tbb)
add_executable(ContourTreeMesh2D_TBB ContourTreeMesh2D.cxx)
add_executable(ContourTreeMesh3D_TBB ContourTreeMesh3D.cxx)
target_link_libraries(ContourTreeMesh2D_TBB vtkm_filter)
target_link_libraries(ContourTreeMesh3D_TBB vtkm_filter)
target_compile_definitions(ContourTreeMesh2D_TBB PRIVATE
"VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_TBB")
target_compile_definitions(ContourTreeMesh3D_TBB PRIVATE
"VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_TBB")
set_source_files_properties(ContourTreeMesh2D.cxx ContourTreeMesh3D.cxx PROPERTIES LANGUAGE "CUDA")
endif()

@ -64,13 +64,11 @@
// Proceedings of the IEEE Symposium on Large Data Analysis and Visualization
// (LDAV), October 2016, Baltimore, Maryland.
#ifndef VTKM_DEVICE_ADAPTER
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_SERIAL
#endif
#include <vtkm/cont/DataSet.h>
#include <vtkm/cont/DataSetBuilderUniform.h>
#include <vtkm/cont/DataSetFieldAdd.h>
#include <vtkm/cont/Initialize.h>
#include <vtkm/filter/ContourTreeUniform.h>
#include <fstream>
@ -81,9 +79,12 @@ int main(int argc, char* argv[])
{
std::cout << "ContourTreeMesh2D Example" << std::endl;
auto opts = vtkm::cont::InitializeOptions::DefaultAnyDevice;
vtkm::cont::InitializeResult config = vtkm::cont::Initialize(argc, argv, opts);
if (argc != 2)
{
std::cout << "Parameter is fileName" << std::endl;
std::cout << "Usage: "
<< "$ " << argv[0] << " [-d device] input_file" << std::endl;
std::cout << "File is expected to be ASCII with xdim ydim integers " << std::endl;
std::cout << "followed by vector data last dimension varying fastest" << std::endl;
return 0;

@ -64,13 +64,11 @@
// Proceedings of the IEEE Symposium on Large Data Analysis and Visualization
// (LDAV), October 2016, Baltimore, Maryland.
#ifndef VTKM_DEVICE_ADAPTER
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_SERIAL
#endif
#include <vtkm/cont/DataSet.h>
#include <vtkm/cont/DataSetBuilderUniform.h>
#include <vtkm/cont/DataSetFieldAdd.h>
#include <vtkm/cont/Initialize.h>
#include <vtkm/filter/ContourTreeUniform.h>
#include <fstream>
@ -80,10 +78,13 @@
int main(int argc, char* argv[])
{
std::cout << "ContourTreeMesh3D Example" << std::endl;
auto opts = vtkm::cont::InitializeOptions::DefaultAnyDevice;
vtkm::cont::InitializeResult config = vtkm::cont::Initialize(argc, argv, opts);
if (argc != 2)
{
std::cout << "Parameter is fileName" << std::endl;
std::cout << "Usage: "
<< "$ " << argv[0] << " [-d device] input_file" << std::endl;
std::cout << "File is expected to be ASCII with xdim ydim zdim integers " << std::endl;
std::cout << "followed by vector data last dimension varying fastest" << std::endl;
return 0;

@ -66,60 +66,20 @@
#Find the VTK-m package
find_package(VTKm REQUIRED QUIET)
# MAKE DEBUG BUILD
# set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g3 -g -fsanitize=address")
# MAKE OPTIMIZED BUILD
# set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O3")
####################################
# Serial builds
####################################
# Serial 2D / 3D / MC
add_executable(ContourTree_PPP2_SERIAL ContourTreeApp.cxx)
target_link_libraries(ContourTree_PPP2_SERIAL vtkm_filter)
target_compile_definitions(ContourTree_PPP2_SERIAL PRIVATE
"VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_SERIAL")
add_executable(ContourTree ContourTreeApp.cxx)
target_link_libraries(ContourTree vtkm_filter)
####################################
# Serial debug builds
# Debug algorithm build
####################################
# Debug Serial 2D / 3D / MC
add_executable(ContourTree_PPP2_SERIAL_DEBUG ContourTreeApp.cxx)
target_link_libraries(ContourTree_PPP2_SERIAL_DEBUG vtkm_filter)
target_compile_definitions(ContourTree_PPP2_SERIAL_DEBUG PRIVATE
"VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_SERIAL" "DEBUG_PRINT")
# target_compile_definitions(ContourTree PRIVATE DEBUG_PRINT)
if(TARGET vtkm::tbb)
# TBB 2D/3D/MC
add_executable(ContourTree_PPP2_TBB ContourTreeApp.cxx)
target_link_libraries(ContourTree_PPP2_TBB vtkm_filter)
target_compile_definitions(ContourTree_PPP2_TBB PRIVATE
"VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_TBB" "ENABLE_SET_NUM_THREADS")
# TBB 2D/3D/MC DEBUG
add_executable(ContourTree_PPP2_TBB_DEBUG ContourTreeApp.cxx)
target_link_libraries(ContourTree_PPP2_TBB_DEBUG vtkm_filter)
target_compile_definitions(ContourTree_PPP2_TBB_DEBUG PRIVATE
"VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_TBB" "ENABLE_SET_NUM_THREADS" "DEBUG_PRINT")
target_compile_definitions(ContourTree PRIVATE ENABLE_SET_NUM_THREADS)
endif()
if(TARGET vtkm::cuda)
# CUDA 2D/3D/MC
vtkm_compile_as_cuda(cudaSource ContourTreeApp.cxx)
add_executable(ContourTree_PPP2_CUDA ${cudaSource})
target_link_libraries(ContourTree_PPP2_CUDA vtkm_filter)
target_compile_definitions(ContourTree_PPP2_CUDA PRIVATE
"VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_CUDA")
# CUDA 2D/3D/MC
# vtkm_compile_as_cuda(cudaSource ContourTreeApp.cxx)
add_executable(ContourTree_PPP2_CUDA_DEBUG ${cudaSource})
target_link_libraries(ContourTree_PPP2_CUDA_DEBUG vtkm_filter)
target_compile_definitions(ContourTree_PPP2_CUDA_DEBUG PRIVATE
"VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_CUDA" "DEBUG_PRINT")
set_source_files_properties(ContourTreeApp.cxx PROPERTIES LANGUAGE "CUDA")
endif()

@ -71,7 +71,9 @@
#include <vtkm/cont/DataSet.h>
#include <vtkm/cont/DataSetBuilderUniform.h>
#include <vtkm/cont/DataSetFieldAdd.h>
#include <vtkm/cont/Initialize.h>
#include <vtkm/cont/Timer.h>
#include <vtkm/filter/ContourTreeUniformAugmented.h>
#include <vtkm/worklet/contourtree_augmented/PrintVectors.h>
#include <vtkm/worklet/contourtree_augmented/ProcessContourTree.h>
@ -145,11 +147,13 @@ private:
// Compute and render an isosurface for a uniform grid example
int main(int argc, char* argv[])
{
auto opts = vtkm::cont::InitializeOptions::DefaultAnyDevice;
vtkm::cont::InitializeResult config = vtkm::cont::Initialize(argc, argv, opts);
vtkm::cont::Timer totalTime;
totalTime.Start();
vtkm::Float64 prevTime = 0;
vtkm::Float64 currTime = 0;
std::cout << "ContourTreePPP2Mesh <options> <fileName>" << std::endl;
////////////////////////////////////////////
// Parse the command line options
@ -200,9 +204,11 @@ int main(int argc, char* argv[])
std::cout << "--numThreads Specify the number of threads to use. Available only with TBB."
<< std::endl;
#endif
std::cout << config.Usage << std::endl;
return 0;
}
std::cout << "ContourTree <options> <fileName>" << std::endl;
std::cout << "Settings:" << std::endl;
std::cout << " filename=" << filename << std::endl;
std::cout << " mc=" << useMarchingCubes << std::endl;
@ -211,6 +217,7 @@ int main(int argc, char* argv[])
#ifdef ENABLE_SET_NUM_THREADS
std::cout << " numThreads=" << numThreads << std::endl;
#endif
std::cout << config.Usage << std::endl;
std::cout << std::endl;

@ -25,16 +25,11 @@ project(CosmoTools CXX)
#Find the VTK-m package
find_package(VTKm REQUIRED QUIET)
if(TARGET vtkm::cuda)
vtkm_compile_as_cuda(cu_srcs CosmoCenterFinder.cxx)
add_executable(CosmoCenterFinder ${cu_srcs})
vtkm_compile_as_cuda(cu_srcs CosmoHaloFinder.cxx)
add_executable(CosmoHaloFinder ${cu_srcs})
else()
add_executable(CosmoCenterFinder CosmoCenterFinder.cxx)
add_executable(CosmoHaloFinder CosmoHaloFinder.cxx)
endif()
add_executable(CosmoCenterFinder CosmoCenterFinder.cxx)
add_executable(CosmoHaloFinder CosmoHaloFinder.cxx)
target_link_libraries(CosmoCenterFinder PRIVATE vtkm_filter)
target_link_libraries(CosmoHaloFinder PRIVATE vtkm_filter)
if(TARGET vtkm::cuda)
set_source_files_properties(CosmoCenterFinder.cxx CosmoCenterFinder.cxx PROPERTIES LANGUAGE "CUDA")
endif()

@ -123,11 +123,14 @@ int main(int argc, char* argv[])
{
vtkm::cont::SetLogLevelName(CosmoLogLevel, "Cosmo");
vtkm::cont::SetStderrLogLevel(CosmoLogLevel);
vtkm::cont::Initialize(argc, argv);
auto opts = vtkm::cont::InitializeOptions::DefaultAnyDevice;
vtkm::cont::InitializeResult config = vtkm::cont::Initialize(argc, argv, opts);
if (argc < 2)
{
std::cout << "Usage: " << std::endl << "$ " << argv[0] << " <input_file>" << std::endl;
std::cout << config.Usage << std::endl;
return 1;
}

@ -117,11 +117,14 @@ int main(int argc, char* argv[])
{
vtkm::cont::SetLogLevelName(CosmoLogLevel, "Cosmo");
vtkm::cont::SetStderrLogLevel(CosmoLogLevel);
vtkm::cont::Initialize(argc, argv);
auto opts = vtkm::cont::InitializeOptions::DefaultAnyDevice;
vtkm::cont::InitializeResult config = vtkm::cont::Initialize(argc, argv, opts);
if (argc < 2)
{
std::cout << "Usage: " << std::endl << "$ " << argv[0] << " <input_file>" << std::endl;
std::cout << config.Usage << std::endl;
return 1;
}

@ -19,8 +19,10 @@
//============================================================================
#include <vtkm/cont/DeviceAdapter.h>
#include <vtkm/cont/Initialize.h>
#include <vtkm/cont/testing/MakeTestDataSet.h>
#include <vtkm/cont/testing/Testing.h>
#include <vtkm/rendering/Actor.h>
#include <vtkm/rendering/CanvasRayTracer.h>
#include <vtkm/rendering/MapperRayTracer.h>
@ -54,6 +56,9 @@ void makeScene(const vtkm::cont::DataSet& inputData,
int main(int argc, char* argv[])
{
auto opts = vtkm::cont::InitializeOptions::DefaultAnyDevice;
vtkm::cont::InitializeResult config = vtkm::cont::Initialize(argc, argv, opts);
// Input variable declarations
vtkm::cont::DataSet inputData;
vtkm::Float32 isovalue;
@ -73,7 +78,7 @@ int main(int argc, char* argv[])
vtkm::io::reader::VTKDataSetReader reader(argv[1]);
inputData = reader.ReadDataSet();
isovalue = static_cast<vtkm::Float32>(atof(argv[2]));
fieldName = "SCALARS:pointvar";
fieldName = "pointvar";
}
using Mapper = vtkm::rendering::MapperRayTracer;

@ -29,11 +29,10 @@ vtkm_find_gl(OPTIONAL GL GLUT GLEW)
if(TARGET OpenGL::GL AND
TARGET GLUT::GLUT AND
TARGET GLEW::GLEW)
if(TARGET vtkm::cuda)
add_executable(GameOfLife GameOfLife.cu LoadShaders.h)
else()
add_executable(GameOfLife GameOfLife.cxx LoadShaders.h)
endif()
add_executable(GameOfLife GameOfLife.cxx LoadShaders.h)
if(TARGET vtkm::cuda)
set_source_files_properties(GameOfLife.cxx PROPERTIES LANGUAGE "CUDA")
endif()
target_link_libraries(GameOfLife PRIVATE vtkm_filter OpenGL::GL GLEW::GLEW GLUT::GLUT)
endif()

@ -1,20 +0,0 @@
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2014 UT-Battelle, LLC.
// Copyright 2014 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software.
//
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#include "GameOfLife.cxx"

@ -315,7 +315,9 @@ void populate(std::vector<vtkm::UInt8>& input_state,
int main(int argc, char** argv)
{
vtkm::cont::Initialize(argc, argv);
auto opts =
vtkm::cont::InitializeOptions::DefaultAnyDevice | vtkm::cont::InitializeOptions::Strict;
vtkm::cont::Initialize(argc, argv, opts);
glewExperimental = GL_TRUE;
glutInit(&argc, argv);

@ -32,10 +32,9 @@ if(TARGET OpenGL::GL AND
set(gl_libs OpenGL::GL GLEW::GLEW GLUT::GLUT)
add_executable(HelloWorld HelloWorld.cxx LoadShaders.h)
if(TARGET vtkm::cuda)
add_executable(HelloWorld HelloWorld.cu LoadShaders.h)
else()
add_executable(HelloWorld HelloWorld.cxx LoadShaders.h)
set_source_files_properties(HelloWorld.cxx PROPERTIES LANGUAGE "CUDA")
endif()
target_link_libraries(HelloWorld PRIVATE vtkm_filter ${gl_libs})

@ -1,23 +0,0 @@
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2014 UT-Battelle, LLC.
// Copyright 2014 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software.
//
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_CUDA
#include "HelloWorld.cxx"

@ -196,7 +196,9 @@ void idle()
int main(int argc, char** argv)
{
vtkm::cont::Initialize(argc, argv);
auto opts =
vtkm::cont::InitializeOptions::DefaultAnyDevice | vtkm::cont::InitializeOptions::Strict;
vtkm::cont::Initialize(argc, argv, opts);
std::cout << "Running Hello World example: " << std::endl;
glewExperimental = GL_TRUE;

@ -25,24 +25,10 @@ project(Histogram CXX)
#Find the VTK-m package
find_package(VTKm REQUIRED QUIET)
if (VTKm_ENABLE_MPI)
add_executable(Histogram_SERIAL Histogram.cxx HistogramMPI.h HistogramMPI.hxx)
target_compile_definitions(Histogram_SERIAL PRIVATE
"VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_SERIAL")
target_link_libraries(Histogram_SERIAL PRIVATE vtkm_filter)
if(TARGET vtkm::tbb)
add_executable(Histogram_TBB Histogram.cxx HistogramMPI.h HistogramMPI.hxx)
target_compile_definitions(Histogram_TBB PRIVATE
"VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_TBB")
target_link_libraries(Histogram_TBB PRIVATE vtkm_filter)
endif()
add_executable(Histogram Histogram.cxx HistogramMPI.h HistogramMPI.hxx)
target_link_libraries(Histogram PRIVATE vtkm_filter)
if(TARGET vtkm::cuda)
vtkm_compile_as_cuda(cudaSource Histogram.cxx)
add_executable(Histogram_CUDA ${cudaSource} HistogramMPI.h HistogramMPI.hxx)
target_compile_definitions(Histogram_CUDA PRIVATE
"VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_CUDA")
target_link_libraries(Histogram_CUDA PRIVATE vtkm_filter)
set_source_files_properties(Histogram.cxx PROPERTIES LANGUAGE "CUDA")
endif()
endif()

@ -30,6 +30,7 @@
#include <vtkm/cont/ArrayPortalToIterators.h>
#include <vtkm/cont/DataSetFieldAdd.h>
#include <vtkm/cont/EnvironmentTracker.h>
#include <vtkm/cont/Initialize.h>
#include <vtkm/thirdparty/diy/diy.h>
@ -61,6 +62,11 @@ VTKM_CONT vtkm::cont::ArrayHandle<T> CreateArray(T min, T max, vtkm::Id numVals)
int main(int argc, char* argv[])
{
//parse out all vtk-m related command line options
auto opts =
vtkm::cont::InitializeOptions::DefaultAnyDevice | vtkm::cont::InitializeOptions::Strict;
vtkm::cont::Initialize(argc, argv, opts);
// setup MPI environment.
MPI_Init(&argc, &argv);

@ -30,20 +30,12 @@ if(TARGET OpenGL::GL AND
TARGET GLUT::GLUT AND
TARGET GLEW::GLEW)
set_source_files_properties(quaternion.h PROPERTIES HEADER_FILE_ONLY TRUE)
set(gl_libs OpenGL::GL OpenGL::GLU GLEW::GLEW GLUT::GLUT)
add_executable(IsosurfaceUniformGrid_SERIAL IsosurfaceUniformGrid.cxx quaternion.h)
target_link_libraries(IsosurfaceUniformGrid_SERIAL PRIVATE vtkm_filter ${gl_libs})
add_executable(IsosurfaceUniformGrid IsosurfaceUniformGrid.cxx quaternion.h)
target_link_libraries(IsosurfaceUniformGrid PRIVATE vtkm_filter ${gl_libs})
if(TARGET vtkm::cuda)
add_executable(IsosurfaceUniformGrid_CUDA IsosurfaceUniformGrid.cu quaternion.h)
target_link_libraries(IsosurfaceUniformGrid_CUDA PRIVATE vtkm_filter ${gl_libs})
endif()
if(TARGET vtkm::tbb)
add_executable(IsosurfaceUniformGrid_TBB IsosurfaceUniformGridTBB.cxx quaternion.h)
target_link_libraries(IsosurfaceUniformGrid_TBB PRIVATE vtkm_filter ${gl_libs})
set_source_files_properties(IsosurfaceUniformGrid.cxx PROPERTIES LANGUAGE "CUDA")
endif()
endif()

@ -1,23 +0,0 @@
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2014 UT-Battelle, LLC.
// Copyright 2014 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software.
//
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_CUDA
#include "IsosurfaceUniformGrid.cxx"

@ -18,12 +18,6 @@
// this software.
//============================================================================
//We first check if VTKM_DEVICE_ADAPTER is defined, so that when TBB and CUDA
//includes this file we use the device adapter that they have set.
#ifndef VTKM_DEVICE_ADAPTER
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_SERIAL
#endif
#include <vtkm/filter/MarchingCubes.h>
#include <vtkm/worklet/DispatcherMapField.h>
@ -31,6 +25,7 @@
#include <vtkm/cont/ArrayHandleCounting.h>
#include <vtkm/cont/CellSetExplicit.h>
#include <vtkm/cont/DataSet.h>
#include <vtkm/cont/Initialize.h>
//Suppress warnings about glut being deprecated on OSX
#if (defined(VTKM_GCC) || defined(VTKM_CLANG))
@ -240,6 +235,11 @@ void mouseCall(int button, int state, int x, int y)
// Compute and render an isosurface for a uniform grid example
int main(int argc, char* argv[])
{
//parse out all vtk-m related command line options
auto opts =
vtkm::cont::InitializeOptions::DefaultAnyDevice | vtkm::cont::InitializeOptions::Strict;
vtkm::cont::Initialize(argc, argv, opts);
vtkm::cont::DataSet dataSet = MakeIsosurfaceTestDataSet(dims);
vtkm::filter::MarchingCubes filter;

@ -1,23 +0,0 @@
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2014 UT-Battelle, LLC.
// Copyright 2014 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software.
//
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_TBB
#include "IsosurfaceUniformGrid.cxx"

@ -19,11 +19,14 @@
## this software.
##
##=============================================================================
cmake_minimum_required(VERSION 3.8...3.14 FATAL_ERROR)
#Find the VTK-m package
find_package(VTKm REQUIRED QUIET)
add_executable(Lagrangian_SERIAL lagrangian.cxx ABCfield.h)
target_compile_definitions(Lagrangian_SERIAL PRIVATE "VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_SERIAL")
target_link_libraries(Lagrangian_SERIAL PRIVATE vtkm_filter)
target_link_libraries(Lagrangian_SERIAL ${VTKm_LIBRARIES})
if(TARGET vtkm::cuda)
set_source_files_properties(lagrangian.cxx PROPERTIES LANGUAGE "CUDA")
endif()
add_executable(Lagrangian lagrangian.cxx ABCfield.h)
target_link_libraries(Lagrangian PRIVATE vtkm_filter)

@ -27,12 +27,10 @@
#include <vtkm/cont/DataSetBuilderRectilinear.h>
#include <vtkm/cont/DataSetBuilderUniform.h>
#include <vtkm/cont/DataSetFieldAdd.h>
#include <vtkm/cont/Initialize.h>
#include <vtkm/filter/Lagrangian.h>
using namespace std;
#ifndef VTKM_DEVICE_ADAPTER
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_SERIAL
#endif
vtkm::cont::DataSet make3DRectilinearDataSet(double time)
{
@ -88,8 +86,12 @@ vtkm::cont::DataSet make3DRectilinearDataSet(double time)
}
int main()
int main(int argc, char** argv)
{
auto opts =
vtkm::cont::InitializeOptions::DefaultAnyDevice | vtkm::cont::InitializeOptions::Strict;
vtkm::cont::Initialize(argc, argv, opts);
vtkm::filter::Lagrangian lagrangianFilter;
lagrangianFilter.SetResetParticles(true);
vtkm::Float32 stepSize = 0.01f;

@ -42,8 +42,7 @@ set(srcs
)
if(TARGET vtkm::cuda)
vtkm_compile_as_cuda(cuda_srcs ${device_srcs})
set(device_srcs ${cuda_srcs})
set_source_files_properties(${device_srcs} PROPERTIES LANGUAGE "CUDA")
endif()
add_executable(MultiBackend ${device_srcs} ${srcs} ${headers})

@ -21,6 +21,7 @@
#include <iostream>
#include <thread>
#include <vtkm/cont/Initialize.h>
#include <vtkm/cont/MultiBlock.h>
#include "IOGenerator.h"
@ -48,8 +49,12 @@
//threads, and 5 threads for heavy 'task' work.
void multiblock_processing(TaskQueue<vtkm::cont::MultiBlock>& queue);
int main(int, char**)
int main(int argc, char** argv)
{
auto opts =
vtkm::cont::InitializeOptions::DefaultAnyDevice | vtkm::cont::InitializeOptions::Strict;
vtkm::cont::Initialize(argc, argv, opts);
//Step 1. Construct the two primary 'main loops'. The threads
//share a queue object so we need to explicitly pass it
//by reference (the std::ref call)

@ -20,6 +20,7 @@
#include <vtkm/cont/RuntimeDeviceTracker.h>
#include <vtkm/cont/cuda/DeviceAdapterCuda.h>
#include <vtkm/cont/openmp/DeviceAdapterOpenMP.h>
#include <vtkm/cont/tbb/DeviceAdapterTBB.h>
#include <vtkm/filter/Gradient.h>
@ -69,6 +70,34 @@ void process_block_tbb(RuntimeTaskQueue& queue)
}
}
void process_block_openMP(RuntimeTaskQueue& queue)
{
//Step 1. Set the device adapter to this thread to TBB.
//This makes sure that any vtkm::filters used by our
//task operate only on TBB. The "global" thread tracker
//is actually thread-local, so we can use that.
//
vtkm::cont::GetRuntimeDeviceTracker().ForceDevice(vtkm::cont::DeviceAdapterTagOpenMP{});
while (queue.hasTasks())
{
//Step 2. Get the task to run on TBB
auto task = queue.pop();
//Step 3. Run the task on TBB. We check the validity
//of the task since we could be given an empty task
//when the queue is empty and we are shutting down
if (task != nullptr)
{
task();
}
//Step 4. Notify the queue that we finished processing this task
queue.completedTask();
std::cout << "finished a block on tbb (" << std::this_thread::get_id() << ")" << std::endl;
}
}
void process_block_cuda(RuntimeTaskQueue& queue, int gpuId)
{
//Step 1. Set the device adapter to this thread to cuda.
@ -108,8 +137,9 @@ VTKM_CONT MultiDeviceGradient::MultiDeviceGradient()
{
//Step 1. Determine the number of workers we want
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
const bool runOnTbb = tracker.CanRunOn(vtkm::cont::DeviceAdapterTagTBB{});
const bool runOnCuda = tracker.CanRunOn(vtkm::cont::DeviceAdapterTagCuda{});
const bool runOnOpenMP = tracker.CanRunOn(vtkm::cont::DeviceAdapterTagOpenMP{});
const bool runOnTbb = tracker.CanRunOn(vtkm::cont::DeviceAdapterTagTBB{});
//Note currently the virtual implementation has some issues
//In a multi-threaded environment only cuda can be used or
@ -135,7 +165,15 @@ VTKM_CONT MultiDeviceGradient::MultiDeviceGradient()
this->Workers.emplace_back(std::bind(process_block_cuda, std::ref(this->Queue), i));
}
}
//Step 3. Launch a worker that will use tbb (if enabled).
//Step 3. Launch a worker that will use openMP (if enabled).
//The threads share a queue object so we need to explicitly pass it
//by reference (the std::ref call)
else if (runOnOpenMP)
{
std::cout << "adding a openMP worker" << std::endl;
this->Workers.emplace_back(std::bind(process_block_openMP, std::ref(this->Queue)));
}
//Step 4. Launch a worker that will use tbb (if enabled).
//The threads share a queue object so we need to explicitly pass it
//by reference (the std::ref call)
else if (runOnTbb)

@ -25,22 +25,9 @@ project(Oscillator CXX)
#Find the VTK-m package
find_package(VTKm REQUIRED QUIET)
add_executable(Oscillator_SERIAL Oscillator.cxx)
target_compile_definitions(Oscillator_SERIAL PRIVATE
"VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_SERIAL")
target_link_libraries(Oscillator_SERIAL PRIVATE vtkm_filter)
if (TARGET vtkm::tbb)
add_executable(Oscillator_TBB Oscillator.cxx)
target_compile_definitions(Oscillator_TBB PRIVATE
"VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_TBB")
target_link_libraries(Oscillator_TBB PRIVATE vtkm_filter)
endif()
if (TARGET vtkm::cuda)
vtkm_compile_as_cuda(oscillatorCudaSrc Oscillator.cxx)
add_executable(Oscillator_CUDA ${oscillatorCudaSrc})
target_compile_definitions(Oscillator_CUDA PRIVATE
"VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_CUDA")
target_link_libraries(Oscillator_CUDA PRIVATE vtkm_filter)
set_source_files_properties(Oscillator.cxx PROPERTIES LANGUAGE "CUDA")
endif()
add_executable(Oscillator Oscillator.cxx)
target_link_libraries(Oscillator PRIVATE vtkm_filter)

@ -23,18 +23,16 @@
#include <iostream>
#include <sstream>
#include "vtkm/Math.h"
#include "vtkm/cont/ArrayHandle.h"
#include "vtkm/cont/DataSetBuilderUniform.h"
#include <vtkm/Math.h>
#include <vtkm/cont/ArrayHandle.h>
#include <vtkm/cont/DataSetBuilderUniform.h>
#include <vtkm/cont/Initialize.h>
#include "vtkm/filter/FilterDataSet.h"
#include <vtkm/filter/FilterDataSet.h>
#include "vtkm/cont/TryExecute.h"
#include "vtkm/cont/cuda/DeviceAdapterCuda.h"
#include "vtkm/cont/serial/DeviceAdapterSerial.h"
#include "vtkm/cont/tbb/DeviceAdapterTBB.h"
#include <vtkm/cont/TryExecute.h>
#include "vtkm/filter/OscillatorSource.h"
#include <vtkm/filter/OscillatorSource.h>
#if !defined(_WIN32) || defined(__CYGWIN__)
#include <unistd.h> /* unlink */
@ -48,20 +46,6 @@
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
//This is the list of devices to compile in support for. The order of the
//devices determines the runtime preference.
struct DevicesToTry : vtkm::ListTagBase<vtkm::cont::DeviceAdapterTagCuda,
vtkm::cont::DeviceAdapterTagTBB,
vtkm::cont::DeviceAdapterTagSerial>
{
};
// ----------------------------------------------------------------------------
struct OscillatorPolicy : public vtkm::filter::PolicyBase<OscillatorPolicy>
{
using DeviceAdapterList = DevicesToTry;
};
// trim() from http://stackoverflow.com/a/217605/44738
static inline std::string& ltrim(std::string& s)
@ -235,18 +219,17 @@ void writeData(std::string& basePath, int timestep, int iSize, int jSize, int kS
// ----------------------------------------------------------------------------
void printUsage()
void printUsage(const std::string& vtkm_options)
{
std::cout << "Usage: Oscillator [options]\n"
<< std::endl
<< "Options:\n"
<< std::endl
<< " -s, --shape POINT domain shape [default: 64x64x64]" << std::endl
<< " -t, --dt FLOAT time step [default: 0.01]" << std::endl
<< " -f, --config STRING oscillator file (required)" << std::endl
<< " --t-end FLOAT end time [default: 10]" << std::endl
std::cout << "Usage: Oscillator [options]\n\n"
<< "Options:\n\n"
<< " -s, --shape POINT domain shape [default: 64x64x64]\n"
<< " -t, --dt FLOAT time step [default: 0.01]\n"
<< " -f, --config STRING oscillator file (required)\n"
<< " --t-end FLOAT end time [default: 10]\n"
<< " -o, --output STRING directory to output data\n"
<< std::endl;
<< "General VTK-m Options:\n\n"
<< vtkm_options << std::endl;
}
// ----------------------------------------------------------------------------
@ -264,6 +247,9 @@ int main(int argc, char** argv)
float currentTime = startTime;
bool generateOutput = false;
// Process vtk-m general args
auto opts = vtkm::cont::InitializeOptions::DefaultAnyDevice;
auto initializeResults = vtkm::cont::Initialize(argc, argv, opts);
// Process args
int nbOptions = argc - 1;
for (int i = 1; i < nbOptions; i += 2)
@ -315,7 +301,7 @@ int main(int argc, char** argv)
if (oscillatorConfigFile.size() < 2)
{
printUsage();
printUsage(initializeResults.Usage);
return 0;
}
@ -338,7 +324,7 @@ int main(int argc, char** argv)
while (currentTime < endTime)
{
filter.SetTime(currentTime);
vtkm::cont::DataSet rdata = filter.Execute(dataset, OscillatorPolicy());
vtkm::cont::DataSet rdata = filter.Execute(dataset);
if (generateOutput)
{
vtkm::cont::ArrayHandle<vtkm::Float64> tmp;

@ -25,15 +25,13 @@ project(ParticleAdvection CXX)
#Find the VTK-m package
find_package(VTKm REQUIRED QUIET)
add_executable(Particle_Advection_SERIAL ParticleAdvection.cxx)
target_link_libraries(Particle_Advection_SERIAL PRIVATE vtkm_filter)
add_executable(Particle_Advection ParticleAdvection.cxx)
target_link_libraries(Particle_Advection PRIVATE vtkm_filter)
if(TARGET vtkm::tbb)
add_executable(Particle_Advection_TBB ParticleAdvectionTBB.cxx)
target_link_libraries(Particle_Advection_TBB PRIVATE vtkm_filter)
target_compile_definitions(Particle_Advection PRIVATE BUILDING_TBB_VERSION)
endif()
if(TARGET vtkm::cuda)
add_executable(Particle_Advection_CUDA ParticleAdvection.cu)
target_link_libraries(Particle_Advection_CUDA PRIVATE vtkm_filter)
set_source_files_properties(ParticleAdvection.cxx PROPERTIES LANGUAGE "CUDA")
endif()

@ -1,23 +0,0 @@
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2014 UT-Battelle, LLC.
// Copyright 2014 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software.
//
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_CUDA
#include "ParticleAdvection.cxx"

@ -19,19 +19,21 @@
//============================================================================
#include <vtkm/cont/DataSet.h>
#include <vtkm/cont/Initialize.h>
#include <vtkm/cont/Timer.h>
#include <vtkm/worklet/ParticleAdvection.h>
#include <vtkm/worklet/particleadvection/GridEvaluators.h>
#include <vtkm/worklet/particleadvection/Integrators.h>
#include <vtkm/worklet/particleadvection/ParticleAdvectionWorklets.h>
#include <vtkm/worklet/particleadvection/Particles.h>
#include <vtkm/cont/Timer.h>
#include <vtkm/io/reader/BOVDataSetReader.h>
#include <chrono>
#include <vector>
#ifdef __BUILDING_TBB_VERSION__
#ifdef BUILDING_TBB_VERSION
#include <tbb/task_scheduler_init.h>
#endif
@ -138,7 +140,7 @@ void RunTest(const std::string& fname,
seeds.push_back(p);
}
#ifdef __BUILDING_TBB_VERSION__
#ifdef BUILDING_TBB_VERSION
int nT = tbb::task_scheduler_init::default_num_threads();
if (numThreads != -1)
nT = (int)numThreads;
@ -172,6 +174,7 @@ void RunTest(const std::string& fname,
bool ParseArgs(int argc,
char** argv,
const vtkm::cont::InitializeResult& config,
vtkm::Id& numSeeds,
vtkm::Id& numSteps,
vtkm::Float32& stepSize,
@ -192,7 +195,7 @@ bool ParseArgs(int argc,
particlesPerRound = -1;
numThreads = -1;
dataFile = "";
pgmType = "UNKNOWN";
pgmType = config.Device.GetName();
dumpOutput = false;
seeding = SPARSE;
@ -206,18 +209,12 @@ bool ParseArgs(int argc,
std::cerr << " -streamline steps_per_round (-1 = 0 rounds): particle history" << std::endl;
std::cerr << " -t #numThreads" << std::endl;
std::cerr << " -file dataFile" << std::endl;
std::cerr << " -dump : dump output points" << std::endl;
std::cerr << " -dump : dump output points" << std::endl << std::endl;
std::cerr << "General VTK-m Options" << std::endl;
std::cerr << config.Usage << std::endl;
return false;
}
std::string pgm = argv[0];
if (pgm.find("SERIAL") != std::string::npos)
pgmType = "SER";
else if (pgm.find("TBB") != std::string::npos)
pgmType = "TBB";
else if (pgm.find("CUDA") != std::string::npos)
pgmType = "CUD";
for (int i = 1; i < argc; i++)
{
std::string arg = argv[i];
@ -284,6 +281,10 @@ bool ParseArgs(int argc,
int main(int argc, char** argv)
{
// Process vtk-m general args
auto opts = vtkm::cont::InitializeOptions::DefaultAnyDevice;
auto config = vtkm::cont::Initialize(argc, argv, opts);
vtkm::Id numSeeds = 100, numSteps = 100, advectType = 0, numThreads = -1, stepsPerRound = -1,
particlesPerRound = -1;
vtkm::Float32 stepSize = 0.1f;
@ -293,6 +294,7 @@ int main(int argc, char** argv)
if (!ParseArgs(argc,
argv,
config,
numSeeds,
numSteps,
stepSize,

@ -1,25 +0,0 @@
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2014 UT-Battelle, LLC.
// Copyright 2014 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software.
//
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_TBB
#define __BUILDING_TBB_VERSION__
#include "ParticleAdvection.cxx"

@ -24,23 +24,9 @@ project(RedistributePoints CXX)
#Find the VTK-m package
find_package(VTKm REQUIRED QUIET)
add_executable(RedistributePoints_SERIAL RedistributePoints.cxx RedistributePoints.h)
target_compile_definitions(RedistributePoints_SERIAL PRIVATE
"VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_SERIAL")
target_link_libraries(RedistributePoints_SERIAL PRIVATE vtkm_filter)
if(TARGET vtkm::tbb)
add_executable(RedistributePoints_TBB RedistributePoints.cxx RedistributePoints.h)
target_compile_definitions(RedistributePoints_TBB PRIVATE
"VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_TBB")
target_link_libraries(RedistributePoints_TBB PRIVATE vtkm_filter)
endif()
add_executable(RedistributePoints RedistributePoints.cxx RedistributePoints.h)
target_link_libraries(RedistributePoints PRIVATE vtkm_filter)
if(TARGET vtkm::cuda)
vtkm_compile_as_cuda(cudaSource RedistributePoints.cxx)
add_executable(RedistributePoints_CUDA ${cudaSource} RedistributePoints.h)
target_compile_definitions(RedistributePoints_CUDA PRIVATE
"VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_CUDA")
target_link_libraries(RedistributePoints_CUDA PRIVATE vtkm_filter)
set_source_files_properties(RedistributePoints.cxx PROPERTIES LANGUAGE "CUDA")
endif()

@ -20,6 +20,8 @@
#include <vtkm/cont/DataSet.h>
#include <vtkm/cont/EnvironmentTracker.h>
#include <vtkm/cont/Initialize.h>
#include <vtkm/io/reader/VTKDataSetReader.h>
#include <vtkm/io/writer/VTKDataSetWriter.h>
@ -33,6 +35,10 @@ using std::endl;
int main(int argc, char* argv[])
{
// Process vtk-m general args
auto opts = vtkm::cont::InitializeOptions::DefaultAnyDevice;
auto config = vtkm::cont::Initialize(argc, argv, opts);
vtkmdiy::mpi::environment env(argc, argv);
auto comm = vtkmdiy::mpi::communicator(MPI_COMM_WORLD);
vtkm::cont::EnvironmentTracker::SetCommunicator(comm);
@ -40,7 +46,8 @@ int main(int argc, char* argv[])
if (argc != 3)
{
cout << "Usage: " << endl
<< "$ " << argv[0] << " <input-vtk-file> <output-file-prefix>" << endl;
<< "$ " << argv[0] << " [options] <input-vtk-file> <output-file-prefix>" << endl;
cout << config.Usage << endl;
return EXIT_FAILURE;
}

@ -34,12 +34,5 @@ if(NOT TARGET GLUT::GLUT)
return()
endif()
add_executable(RenderingExample_SERIAL Rendering.cxx)
target_link_libraries(RenderingExample_SERIAL PRIVATE vtkm_rendering GLUT::GLUT)
if(TARGET vtkm::tbb)
add_executable(RenderingExample_TBB Rendering.cxx)
target_compile_definitions(Rendering_TBB PRIVATE
"VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_TBB")
target_link_libraries(RenderingExample_TBB PRIVATE vtkm_rendering GLUT::GLUT)
endif()
add_executable(RenderingExample Rendering.cxx)
target_link_libraries(RenderingExample PRIVATE vtkm_rendering GLUT::GLUT)

@ -18,12 +18,6 @@
// this software.
//============================================================================
//We first check if VTKM_DEVICE_ADAPTER is defined, so that when TBB and CUDA
//includes this file we use the device adapter that they have set.
#ifndef VTKM_DEVICE_ADAPTER
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_SERIAL
#endif
#include <vtkm/Math.h>
#include <vtkm/cont/DataSet.h>
#include <vtkm/cont/testing/MakeTestDataSet.h>
@ -119,6 +113,10 @@ void mouseCall(int button, int state, int vtkmNotUsed(x), int vtkmNotUsed(y))
// Compute and render an isosurface for a uniform grid example
int main(int argc, char* argv[])
{
auto opts =
vtkm::cont::InitializeOptions::DefaultAnyDevice | vtkm::cont::InitializeOptions::Strict;
vtkm::cont::Initialize(argc, argv, opts);
vtkm::cont::testing::MakeTestDataSet maker;
vtkm::cont::DataSet ds = maker.Make3DUniformDataSet0();

@ -32,17 +32,11 @@ if(TARGET OpenGL::GL AND
set(gl_libs OpenGL::GL OpenGL::GLU GLEW::GLEW GLUT::GLUT)
add_executable(StreamLineUniformGrid_SERIAL StreamLineUniformGrid.cxx)
target_link_libraries(StreamLineUniformGrid_SERIAL PRIVATE vtkm_filter ${gl_libs})
add_executable(StreamLineUniformGrid StreamLineUniformGrid.cxx)
target_link_libraries(StreamLineUniformGrid PRIVATE vtkm_filter ${gl_libs})
if(TARGET vtkm::cont)
add_executable(StreamLineUniformGrid_CUDA StreamLineUniformGrid.cu)
target_link_libraries(StreamLineUniformGrid_CUDA PRIVATE vtkm_filter ${gl_libs})
endif()
if(TARGET vtkm::tbb)
add_executable(StreamLineUniformGrid_TBB StreamLineUniformGridTBB.cxx)
target_link_libraries(StreamLineUniformGrid_TBB PRIVATE vtkm_filter ${gl_libs})
if(TARGET vtkm::cuda)
set_source_files_properties(StreamLineUniformGrid.cxx PROPERTIES LANGUAGE "CUDA")
endif()
endif()

@ -1,23 +0,0 @@
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2014 UT-Battelle, LLC.
// Copyright 2014 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software.
//
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_CUDA
#include "StreamLineUniformGrid.cxx"

@ -18,14 +18,12 @@
// this software.
//============================================================================
#ifndef VTKM_DEVICE_ADAPTER
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_SERIAL
#endif
#include <vtkm/Math.h>
#include <vtkm/cont/ArrayCopy.h>
#include <vtkm/cont/ArrayHandle.h>
#include <vtkm/cont/DataSet.h>
#include <vtkm/cont/Initialize.h>
#include <vtkm/worklet/DispatcherMapField.h>
#include <vtkm/worklet/StreamLineUniformGrid.h>
@ -49,17 +47,15 @@
#include "../isosurface/quaternion.h"
using DeviceAdapter = VTKM_DEFAULT_DEVICE_ADAPTER_TAG;
// Output data set shared with opengl
static vtkm::worklet::StreamLineFilterUniformGrid<vtkm::Float32, DeviceAdapter>* streamLineFilter;
static vtkm::worklet::StreamLineFilterUniformGrid<vtkm::Float32>* streamLineFilter;
static vtkm::cont::DataSet outDataSet;
// Input parameters
const vtkm::Id nSeeds = 25;
const vtkm::Id nSteps = 2000;
const vtkm::Float32 tStep = 0.5f;
const vtkm::Id direction = vtkm::worklet::internal::BOTH;
const vtkm::Id direction = vtkm::worklet::streamline::BOTH;
// Point location of vertices from a CastAndCall but needs a static cast eventually
static vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float32, 3>> vertexArray;
@ -200,12 +196,17 @@ VTKM_EXEC_CONT vtkm::Vec<T, 3> Normalize(vtkm::Vec<T, 3> v)
// Run streamlines on a uniform grid of vector data
int main(int argc, char* argv[])
{
auto opts = vtkm::cont::InitializeOptions::DefaultAnyDevice;
auto config = vtkm::cont::Initialize(argc, argv, opts);
std::cout << "StreamLineUniformGrid Example" << std::endl;
std::cout << "Parameters are fileName [numSeeds maxSteps timeStep direction]" << std::endl
std::cout << "Parameters are [options] fileName [numSeeds maxSteps timeStep direction]"
<< std::endl
<< std::endl;
std::cout << "Direction is FORWARD=0 BACKWARD=1 BOTH=2" << std::endl << std::endl;
std::cout << "File is expected to be binary with xdim ydim zdim as 32 bit integers " << std::endl;
std::cout << "followed by vector data per dimension point as 32 bit float" << std::endl;
std::cout << config.Usage << std::endl;
// Read in the vector data for testing
FILE* pFile = fopen(argv[1], "rb");
@ -262,7 +263,7 @@ int main(int argc, char* argv[])
inDataSet.AddCellSet(inCellSet);
// Create and run the filter
streamLineFilter = new vtkm::worklet::StreamLineFilterUniformGrid<vtkm::Float32, DeviceAdapter>();
streamLineFilter = new vtkm::worklet::StreamLineFilterUniformGrid<vtkm::Float32>();
outDataSet = streamLineFilter->Run(inDataSet, direction, nSeeds, nSteps, tStep);
// Render the output dataset of polylines

@ -1,23 +0,0 @@
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2014 UT-Battelle, LLC.
// Copyright 2014 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software.
//
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_TBB
#include "StreamLineUniformGrid.cxx"

@ -27,16 +27,10 @@ find_package(VTKm REQUIRED QUIET)
if(TARGET vtkm_rendering)
add_executable(Tau_timing_SERIAL TauTiming.cxx)
target_link_libraries(Tau_timing_SERIAL vtkm_cont)
if(TARGET vtkm::tbb)
add_executable(Tau_timing_TBB TauTimingTBB.cxx)
target_link_libraries(Tau_timing_TBB vtkm_cont)
endif()
add_executable(Tau_timing TauTiming.cxx)
target_link_libraries(Tau_timing vtkm_cont)
if(TARGET vtkm::cuda)
add_executable(Tau_timing_CUDA TauTiming.cu)
target_link_libraries(Tau_timing_CUDA PRIVATE vtkm_cont)
set_source_files_properties(TauTiming.cxx PROPERTIES LANGUAGE "CUDA")
endif()
endif()

@ -1,23 +0,0 @@
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2014 UT-Battelle, LLC.
// Copyright 2014 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software.
//
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_CUDA
#include "TauTiming.cxx"

@ -17,11 +17,6 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef VTKM_DEVICE_ADAPTER
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_SERIAL
#endif
#include <vtkm/filter/MarchingCubes.h>
#include <vtkm/io/reader/VTKDataSetReader.h>
#include <vtkm/io/writer/VTKDataSetWriter.h>
@ -32,8 +27,8 @@
#include <vtkm/cont/ArrayHandle.h>
#include <vtkm/cont/DataSetBuilderUniform.h>
#include <vtkm/cont/DataSetFieldAdd.h>
#include <vtkm/cont/Initiailize.h>
#include <vtkm/cont/DeviceAdapter.h>
#include <vtkm/cont/testing/Testing.h>
#include <vtkm/rendering/Actor.h>
#include <vtkm/rendering/CanvasRayTracer.h>
@ -63,8 +58,6 @@ VTKM_EXEC_CONT vtkm::Vec<T, 3> Normalize(vtkm::Vec<T, 3> v)
return one / magnitude * v;
}
using DeviceAdapter = VTKM_DEFAULT_DEVICE_ADAPTER_TAG;
class TangleField : public vtkm::worklet::WorkletMapField
{
public:
@ -321,8 +314,8 @@ void StreamlineTest(vtkm::cont::DataSet& ds, int N)
const vtkm::Float32 tStep = 0.05f;
const vtkm::Id direction = vtkm::worklet::internal::FORWARD; //vtkm::worklet::internal::BOTH;
vtkm::worklet::StreamLineFilterUniformGrid<vtkm::Float32, DeviceAdapter>* streamLineFilter;
streamLineFilter = new vtkm::worklet::StreamLineFilterUniformGrid<vtkm::Float32, DeviceAdapter>();
vtkm::worklet::StreamLineFilterUniformGrid<vtkm::Float32>* streamLineFilter;
streamLineFilter = new vtkm::worklet::StreamLineFilterUniformGrid<vtkm::Float32>();
std::cout << "Streamline test: " << N << std::endl;
for (int i = 0; i < N; i++)
@ -403,19 +396,15 @@ streamlines: vector field must be named "vecData"
*/
int main(int argc, char** argv)
{
if (0)
{
int d = 16;
if (argc > 1)
d = atoi(argv[1]);
CreateData(d);
return 0;
}
// Process vtk-m general args
auto opts = vtkm::cont::InitializeOptions::DefaultAnyDevice;
auto config = vtkm::cont::Initialize(argc, argv, opts);
if (argc != 5)
{
std::cout << "Error: " << argv[0] << " <algo:iso/sl/ext/rt/vol> N SZ <ftype:reg/rect/expl>"
<< std::endl;
std::cout << "Error: " << argv[0]
<< " [options] <algo:iso/sl/ext/rt/vol> N SZ <ftype:reg/rect/expl>" << std::endl;
std::cout << "General Options: \n" << config.Usage << std::endl;
return -1;
}

@ -1,23 +0,0 @@
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2014 UT-Battelle, LLC.
// Copyright 2014 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software.
//
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_TBB
#include "TauTiming.cxx"

@ -27,15 +27,9 @@ project(TemporalAdvection CXX)
#Find the VTK-m package
find_package(VTKm REQUIRED QUIET)
add_executable(Temporal_Advection_SERIAL TemporalAdvection.cxx)
target_link_libraries(Temporal_Advection_SERIAL PRIVATE vtkm_filter)
if(TARGET vtkm::tbb)
add_executable(Temporal_Advection_TBB TemporalAdvectionTBB.cxx)
target_link_libraries(Temporal_Advection_TBB PRIVATE vtkm_filter)
endif()
add_executable(Temporal_Advection TemporalAdvection.cxx)
target_link_libraries(Temporal_Advection PRIVATE vtkm_filter)
if(TARGET vtkm::cuda)
add_executable(Temporal_Advection_CUDA TemporalAdvection.cu)
target_link_libraries(Temporal_Advection_CUDA PRIVATE vtkm_filter)
set_source_files_properties(TemporalAdvection.cxx PROPERTIES LANGUAGE "CUDA")
endif()

@ -1,23 +0,0 @@
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2014 UT-Battelle, LLC.
// Copyright 2014 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software.
//
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_CUDA
#include "TemporalAdvection.cxx"

@ -19,6 +19,8 @@
//============================================================================
#include <vtkm/cont/DataSet.h>
#include <vtkm/cont/Initialize.h>
#include <vtkm/worklet/ParticleAdvection.h>
#include <vtkm/worklet/particleadvection/Integrators.h>
#include <vtkm/worklet/particleadvection/ParticleAdvectionWorklets.h>
@ -115,6 +117,13 @@ void RunTest(vtkm::Id numSteps, vtkm::Float32 stepSize, vtkm::Id advectType)
int main(int argc, char** argv)
{
auto opts = vtkm::cont::InitializeOptions::DefaultAnyDevice;
auto config = vtkm::cont::Initialize(argc, argv, opts);
std::cout << "TemporalAdvection Example" << std::endl;
std::cout << "Parameters are [options] numSteps stepSize advectionType" << std::endl << std::endl;
std::cout << "advectionType Particles=0 Streamlines=1" << std::endl;
vtkm::Id numSteps;
vtkm::Float32 stepSize;
vtkm::Id advectionType;

@ -1,23 +0,0 @@
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2014 UT-Battelle, LLC.
// Copyright 2014 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software.
//
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_TBB
#include "TemporalAdvection.cxx"

@ -32,37 +32,21 @@ if(TARGET OpenGL::GL AND
set(gl_libs OpenGL::GL OpenGL::GLU GLEW::GLEW GLUT::GLUT)
add_executable(TetrahedralizeExplicitGrid_SERIAL TetrahedralizeExplicitGrid.cxx)
add_executable(TriangulateExplicitGrid_SERIAL TriangulateExplicitGrid.cxx)
add_executable(TetrahedralizeUniformGrid_SERIAL TetrahedralizeUniformGrid.cxx)
add_executable(TriangulateUniformGrid_SERIAL TriangulateUniformGrid.cxx)
add_executable(TetrahedralizeExplicitGrid TetrahedralizeExplicitGrid.cxx)
add_executable(TriangulateExplicitGrid TriangulateExplicitGrid.cxx)
add_executable(TetrahedralizeUniformGrid TetrahedralizeUniformGrid.cxx)
add_executable(TriangulateUniformGrid TriangulateUniformGrid.cxx)
target_link_libraries(TetrahedralizeExplicitGrid_SERIAL PRIVATE vtkm_filter ${gl_libs})
target_link_libraries(TriangulateExplicitGrid_SERIAL PRIVATE vtkm_filter ${gl_libs})
target_link_libraries(TetrahedralizeUniformGrid_SERIAL PRIVATE vtkm_filter ${gl_libs})
target_link_libraries(TriangulateUniformGrid_SERIAL PRIVATE vtkm_filter ${gl_libs})
target_link_libraries(TetrahedralizeExplicitGrid PRIVATE vtkm_filter ${gl_libs})
target_link_libraries(TriangulateExplicitGrid PRIVATE vtkm_filter ${gl_libs})
target_link_libraries(TetrahedralizeUniformGrid PRIVATE vtkm_filter ${gl_libs})
target_link_libraries(TriangulateUniformGrid PRIVATE vtkm_filter ${gl_libs})
if(TARGET vtkm::cuda)
add_executable(TetrahedralizeExplicitGrid_CUDA TetrahedralizeExplicitGrid.cu)
add_executable(TriangulateExplicitGrid_CUDA TriangulateExplicitGrid.cu)
add_executable(TetrahedralizeUniformGrid_CUDA TetrahedralizeUniformGrid.cu)
add_executable(TriangulateUniformGrid_CUDA TriangulateUniformGrid.cu)
target_link_libraries(TetrahedralizeExplicitGrid_CUDA PRIVATE vtkm_filter ${gl_libs})
target_link_libraries(TriangulateExplicitGrid_CUDA PRIVATE vtkm_filter ${gl_libs})
target_link_libraries(TetrahedralizeUniformGrid_CUDA PRIVATE vtkm_filter ${gl_libs})
target_link_libraries(TriangulateUniformGrid_CUDA PRIVATE vtkm_filter ${gl_libs})
set_source_files_properties(TetrahedralizeExplicitGrid.cxx
TriangulateExplicitGrid.cxx
TetrahedralizeUniformGrid.cxx
TriangulateUniformGrid.cxx PROPERTIES LANGUAGE "CUDA")
endif()
if(TARGET vtkm::tbb)
add_executable(TetrahedralizeExplicitGrid_TBB TetrahedralizeExplicitGridTBB.cxx)
add_executable(TriangulateExplicitGrid_TBB TriangulateExplicitGridTBB.cxx)
add_executable(TetrahedralizeUniformGrid_TBB TetrahedralizeUniformGridTBB.cxx)
add_executable(TriangulateUniformGrid_TBB TriangulateUniformGridTBB.cxx)
target_link_libraries(TetrahedralizeExplicitGrid_TBB PRIVATE vtkm_filter ${gl_libs})
target_link_libraries(TriangulateExplicitGrid_TBB PRIVATE vtkm_filter ${gl_libs})
target_link_libraries(TetrahedralizeUniformGrid_TBB PRIVATE vtkm_filter ${gl_libs})
target_link_libraries(TriangulateUniformGrid_TBB PRIVATE vtkm_filter ${gl_libs})
endif()
endif()

@ -1,23 +0,0 @@
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2014 UT-Battelle, LLC.
// Copyright 2014 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software.
//
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_CUDA
#include "TetrahedralizeExplicitGrid.cxx"

@ -17,16 +17,11 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef VTKM_DEVICE_ADAPTER
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_SERIAL
#endif
#include <vtkm/Math.h>
#include <vtkm/cont/DataSet.h>
#include <vtkm/cont/DataSetBuilderExplicit.h>
#include <vtkm/cont/Initialize.h>
#include <vtkm/filter/Tetrahedralize.h>
#include <vtkm/worklet/DispatcherMapField.h>
#include <vtkm/cont/testing/Testing.h>
@ -44,8 +39,6 @@
#include "../isosurface/quaternion.h"
using DeviceAdapter = VTKM_DEFAULT_DEVICE_ADAPTER_TAG;
namespace
{
@ -262,6 +255,9 @@ void mouseCall(int button, int state, int x, int y)
// Tetrahedralize and render uniform grid example
int main(int argc, char* argv[])
{
auto opts =
vtkm::cont::InitializeOptions::DefaultAnyDevice | vtkm::cont::InitializeOptions::Strict;
vtkm::cont::Initialize(argc, argv, opts);
std::cout << "TetrahedralizeExplicitGrid Example" << std::endl;
// Create the input explicit cell set

@ -1,23 +0,0 @@
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2014 UT-Battelle, LLC.
// Copyright 2014 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software.
//
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_TBB
#include "TetrahedralizeExplicitGrid.cxx"

@ -1,23 +0,0 @@
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2014 UT-Battelle, LLC.
// Copyright 2014 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software.
//
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_CUDA
#include "TetrahedralizeUniformGrid.cxx"

@ -17,15 +17,10 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef VTKM_DEVICE_ADAPTER
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_SERIAL
#endif
#include <vtkm/Math.h>
#include <vtkm/cont/DataSet.h>
#include <vtkm/cont/Initialize.h>
#include <vtkm/filter/Tetrahedralize.h>
#include <vtkm/worklet/DispatcherMapField.h>
#include <vtkm/cont/testing/Testing.h>
@ -43,8 +38,6 @@
#include "../isosurface/quaternion.h"
using DeviceAdapter = VTKM_DEFAULT_DEVICE_ADAPTER_TAG;
// Default size of the example
static vtkm::Id3 dims(4, 4, 4);
static vtkm::Id cellsToDisplay = 64;
@ -233,8 +226,14 @@ void mouseCall(int button, int state, int x, int y)
// Tetrahedralize and render uniform grid example
int main(int argc, char* argv[])
{
// Process vtk-m general args
auto opts = vtkm::cont::InitializeOptions::DefaultAnyDevice;
auto config = vtkm::cont::Initialize(argc, argv, opts);
std::cout << "TetrahedralizeUniformGrid Example" << std::endl;
std::cout << "Parameters are [xdim ydim zdim [# of cellsToDisplay]]" << std::endl << std::endl;
std::cout << "Parameters are [options] [xdim ydim zdim [# of cellsToDisplay]]" << std::endl;
std::cout << config.Usage << std::endl << std::endl;
// Set the problem size and number of cells to display from command line
if (argc >= 4)

@ -1,23 +0,0 @@
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2014 UT-Battelle, LLC.
// Copyright 2014 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software.
//
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_TBB
#include "TetrahedralizeUniformGrid.cxx"

@ -1,23 +0,0 @@
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2014 UT-Battelle, LLC.
// Copyright 2014 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software.
//
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_CUDA
#include "TriangulateExplicitGrid.cxx"

@ -18,13 +18,10 @@
// this software.
//============================================================================
#ifndef VTKM_DEVICE_ADAPTER
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_SERIAL
#endif
#include <vtkm/cont/CellSetExplicit.h>
#include <vtkm/cont/DataSet.h>
#include <vtkm/cont/DataSetBuilderExplicit.h>
#include <vtkm/cont/Initialize.h>
#include <vtkm/filter/Triangulate.h>
#include <vtkm/cont/testing/Testing.h>
@ -41,14 +38,11 @@
#include <GL/glut.h>
#endif
using DeviceAdapter = VTKM_DEFAULT_DEVICE_ADAPTER_TAG;
namespace
{
// Takes input uniform grid and outputs unstructured grid of triangles
static vtkm::cont::DataSet outDataSet;
static vtkm::Id numberOfInPoints;
} // anonymous namespace
@ -181,6 +175,9 @@ void displayCall()
// Triangulate and render explicit grid example
int main(int argc, char* argv[])
{
auto opts =
vtkm::cont::InitializeOptions::DefaultAnyDevice | vtkm::cont::InitializeOptions::Strict;
vtkm::cont::Initialize(argc, argv, opts);
std::cout << "TrianguleExplicitGrid Example" << std::endl;
// Create the input uniform cell set
@ -188,8 +185,6 @@ int main(int argc, char* argv[])
vtkm::cont::CellSetExplicit<> inCellSet;
inDataSet.GetCellSet(0).CopyTo(inCellSet);
numberOfInPoints = inCellSet.GetNumberOfPoints();
// Convert 2D explicit cells to triangles
vtkm::filter::Triangulate triangulate;
outDataSet = triangulate.Execute(inDataSet);

@ -1,23 +0,0 @@
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2014 UT-Battelle, LLC.
// Copyright 2014 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software.
//
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_TBB
#include "TriangulateExplicitGrid.cxx"

@ -1,23 +0,0 @@
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2014 UT-Battelle, LLC.
// Copyright 2014 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software.
//
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_CUDA
#include "TriangulateUniformGrid.cxx"

@ -18,14 +18,10 @@
// this software.
//============================================================================
#ifndef VTKM_DEVICE_ADAPTER
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_SERIAL
#endif
#include <vtkm/Math.h>
#include <vtkm/cont/DataSet.h>
#include <vtkm/cont/Initialize.h>
#include <vtkm/filter/Triangulate.h>
#include <vtkm/worklet/DispatcherMapField.h>
#include <vtkm/cont/testing/Testing.h>
@ -41,8 +37,6 @@
#include <GL/glut.h>
#endif
using DeviceAdapter = VTKM_DEFAULT_DEVICE_ADAPTER_TAG;
// Default size of the example
static vtkm::Id2 dims(4, 4);
static vtkm::Id cellsToDisplay = 16;
@ -139,9 +133,13 @@ void displayCall()
// Triangulate and render uniform grid example
int main(int argc, char* argv[])
{
std::cout << "TrianguleUniformGrid Example" << std::endl;
std::cout << "Parameters are [xdim ydim [# of cellsToDisplay]]" << std::endl << std::endl;
// Process vtk-m general args
auto opts = vtkm::cont::InitializeOptions::DefaultAnyDevice;
auto config = vtkm::cont::Initialize(argc, argv, opts);
std::cout << "TrianguleUniformGrid Example" << std::endl;
std::cout << "Parameters are [options] [xdim ydim [# of cellsToDisplay]]" << std::endl;
std::cout << config.Usage << std::endl << std::endl;
// Set the problem size and number of cells to display from command line
if (argc >= 3)
{

@ -1,23 +0,0 @@
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2014 UT-Battelle, LLC.
// Copyright 2014 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software.
//
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_TBB
#include "TriangulateUniformGrid.cxx"

@ -52,8 +52,9 @@ public:
// Run a simple worklet, and compute an isosurface
int main(int argc, char* argv[])
{
vtkm::cont::Initialize(argc, argv);
auto opts =
vtkm::cont::InitializeOptions::DefaultAnyDevice | vtkm::cont::InitializeOptions::Strict;
vtkm::cont::Initialize(argc, argv, opts);
vtkm::Int64 N = 4 * 512 * 512 * 512;
if (argc > 1)

@ -25,10 +25,15 @@
// succeed of the order is changed.) Turn off formatting to keep the order.
// clang-format off
#include <vtkm/cont/internal/DeviceAdapterDefaultSelection.h>
#include <vtkm/cont/cuda/DeviceAdapterCuda.h>
#include <vtkm/cont/openmp/DeviceAdapterOpenMP.h>
#include <vtkm/cont/serial/DeviceAdapterSerial.h>
#include <vtkm/cont/tbb/DeviceAdapterTBB.h>
#include <vtkm/cont/DeviceAdapterAlgorithm.h>
#include <vtkm/cont/DeviceAdapterTag.h>
#include <vtkm/cont/internal/ArrayManagerExecution.h>
// clang-format on
namespace vtkm
@ -43,23 +48,23 @@ namespace cont
/// mechanisms to run algorithms on a type of parallel device. The tag
/// DeviceAdapterTag___ does not actually exist. Rather, this documentation is
/// provided to describe the interface for a DeviceAdapter. Loading the
/// vtkm/cont/DeviceAdapter.h header file will set a default device adapter
/// appropriate for the current compile environment. You can specify the
/// default device adapter by first setting the \c VTKM_DEVICE_ADAPTER macro.
/// Valid values for \c VTKM_DEVICE_ADAPTER are the following:
/// vtkm/cont/DeviceAdapter.h header file will import all device adapters
/// appropriate for the current compile environment.
///
/// \li \c VTKM_DEVICE_ADAPTER_SERIAL Runs all algorithms in serial. Can be
/// \li \c vtkm::cont::DeviceAdapterTagSerial Runs all algorithms in serial. Can be
/// helpful for debugging.
/// \li \c VTKM_DEVICE_ADAPTER_CUDA Dispatches and runs algorithms on a GPU
/// \li \c vtkm::cont::DeviceAdapterTagCuda Dispatches and runs algorithms on a GPU
/// using CUDA. Must be compiling with a CUDA compiler (nvcc).
/// \li \c VTKM_DEVICE_ADAPTER_OPENMP Dispatches an algorithm over multiple
/// \li \c vtkm::cont::DeviceAdapterTagOpenMP Dispatches an algorithm over multiple
/// CPU cores using OpenMP compiler directives. Must be compiling with an
/// OpenMP-compliant compiler with OpenMP pragmas enabled.
/// \li \c VTKM_DEVICE_ADAPTER_TBB Dispatches and runs algorithms on multiple
/// \li \c vtkm::cont::DeviceAdapterTagTBB Dispatches and runs algorithms on multiple
/// threads using the Intel Threading Building Blocks (TBB) libraries. Must
/// have the TBB headers available and the resulting code must be linked with
/// the TBB libraries.
///
/// To execute algorithms on any device, see Algorithm.h which allows
/// for abitrary device execution.
/// See the ArrayManagerExecution.h and DeviceAdapterAlgorithm.h files for
/// documentation on all the functions and classes that must be
/// overloaded/specialized to create a new device adapter.

@ -29,6 +29,19 @@
#include <string>
#ifdef VTKM_DEVICE_ADAPTER
// Rather than use defines to specify the default device adapter
// VTK-m now builds for all device adapters and uses runtime controls
// to determine where execution occurs
#error The VTKM_DEVICE_ADAPTER define is no longer obeyed and needs to be removed
#endif
#ifdef VTKM_DEFAULT_DEVICE_ADAPTER_TAG
// Rather than use device adapter tag that had no shared parent
// VTK-m now uses a runtime device adapter implementation that
// allows for runtime execution selection of what device to execute on
#error The VTKM_DEFAULT_DEVICE_ADAPTER_TAG define is no longer required and needs to be removed
#endif
#define VTKM_DEVICE_ADAPTER_ERROR -2
#define VTKM_DEVICE_ADAPTER_UNDEFINED -1
#define VTKM_DEVICE_ADAPTER_SERIAL 1

@ -24,16 +24,6 @@
#include <vtkm/cont/DeviceAdapter.h>
#if ((VTKM_DEVICE_ADAPTER > 0) && (VTKM_DEVICE_ADAPTER < VTKM_MAX_DEVICE_ADAPTER_ID))
// Use the default device adapter tag for testing whether execution objects are valid.
#define VTK_M_DEVICE_ADAPTER_TO_TEST_EXEC_OBJECT VTKM_DEFAULT_DEVICE_ADAPTER_TAG
#else
// The default device adapter is invalid. Perhaps the error device adapter is being used.
// In this case, try the serial device adapter instead. It should always be valid.
#include <vtkm/cont/serial/DeviceAdapterSerial.h>
#define VTK_M_DEVICE_ADAPTER_TO_TEST_EXEC_OBJECT ::vtkm::cont::DeviceAdapterTagSerial
#endif
namespace vtkm
{
namespace cont
@ -59,8 +49,7 @@ struct CheckPrepareForExecution
{
template <typename T>
static auto check(T* p)
-> decltype(p->PrepareForExecution(VTK_M_DEVICE_ADAPTER_TO_TEST_EXEC_OBJECT()),
std::true_type());
-> decltype(p->PrepareForExecution(vtkm::cont::DeviceAdapterTagSerial{}), std::true_type());
template <typename T>
static auto check(...) -> std::false_type;

@ -21,6 +21,8 @@
#include <sstream>
#include <typeindex>
#include <vtkm/cont/DeviceAdapter.h>
#include <vtkm/cont/ErrorBadValue.h>
#include <vtkm/cont/VariantArrayHandle.h>

@ -92,7 +92,8 @@ void TryArrayInOutTransport(Device)
void TestArrayInOutTransport()
{
TryArrayInOutTransport(VTKM_DEFAULT_DEVICE_ADAPTER_TAG());
std::cout << "Trying ArrayInOut transport with serial device." << std::endl;
TryArrayInOutTransport(vtkm::cont::DeviceAdapterTagSerial());
}
} // anonymous namespace

@ -202,7 +202,7 @@ void TryArrayOutTransport(Device)
void TestWholeArrayTransport()
{
std::cout << "Trying WholeArray transport." << std::endl;
TryArrayOutTransport(VTKM_DEFAULT_DEVICE_ADAPTER_TAG());
TryArrayOutTransport(vtkm::cont::DeviceAdapterTagSerial());
}
} // Anonymous namespace

@ -18,11 +18,6 @@
// this software.
//============================================================================
// Make sure that the tested code is using the device adapter specified. This
// is important in the long run so we don't, for example, use the CUDA device
// for a part of an operation where the TBB device was specified.
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/cuda/DeviceAdapterCuda.h>
#include <vtkm/cont/testing/TestingArrayHandles.h>

@ -18,11 +18,6 @@
// this software.
//============================================================================
// Make sure that the tested code is using the device adapter specified. This
// is important in the long run so we don't, for example, use the CUDA device
// for a part of an operation where the TBB device was specified.
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/cuda/DeviceAdapterCuda.h>
#include <vtkm/cont/cuda/internal/testing/Testing.h>

@ -18,11 +18,6 @@
// this software.
//============================================================================
// Make sure that the tested code is using the device adapter specified. This
// is important in the long run so we don't, for example, use the CUDA device
// for a part of an operation where the TBB device was specified.
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/cuda/DeviceAdapterCuda.h>
#include <vtkm/cont/testing/TestingArrayHandleVirtualCoordinates.h>

@ -17,12 +17,6 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
// Make sure that the tested code is using the device adapter specified. This
// is important in the long run so we don't, for example, use the CUDA device
// for a part of an operation where the TBB device was specified.
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/cuda/DeviceAdapterCuda.h>
#include <vtkm/cont/testing/TestingBitField.h>

@ -18,11 +18,6 @@
// this software.
//============================================================================
// Make sure that the tested code is using the device adapter specified. This
// is important in the long run so we don't, for example, use the CUDA device
// for a part of an operation where the TBB device was specified.
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/testing/TestingCellLocatorRectilinearGrid.h>
int UnitTestCudaCellLocatorRectilinearGrid(int argc, char* argv[])

@ -18,11 +18,6 @@
// this software.
//============================================================================
// Make sure that the tested code is using the device adapter specified. This
// is important in the long run so we don't, for example, use the CUDA device
// for a part of an operation where the TBB device was specified.
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/testing/TestingCellLocatorUniformBins.h>
int UnitTestCudaCellLocatorUniformBins(int argc, char* argv[])

@ -18,11 +18,6 @@
// this software.
//============================================================================
// Make sure that the tested code is using the device adapter specified. This
// is important in the long run so we don't, for example, use the CUDA device
// for a part of an operation where the TBB device was specified.
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/testing/TestingCellLocatorUniformGrid.h>
int UnitTestCudaCellLocatorUniformGrid(int argc, char* argv[])

@ -18,11 +18,6 @@
// this software.
//============================================================================
// Make sure that the tested code is using the device adapter specified. This
// is important in the long run so we don't, for example, use the CUDA device
// for a part of an operation where the TBB device was specified.
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/cuda/DeviceAdapterCuda.h>
#include <vtkm/cont/testing/TestingColorTable.h>

@ -18,11 +18,6 @@
// this software.
//============================================================================
// Make sure that the tested code is using the device adapter specified. This
// is important in the long run so we don't, for example, use the CUDA device
// for a part of an operation where the TBB device was specified.
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/cuda/DeviceAdapterCuda.h>
#include <vtkm/cont/cuda/internal/testing/Testing.h>

@ -18,11 +18,6 @@
// this software.
//============================================================================
// Make sure that the tested code is using the device adapter specified. This
// is important in the long run so we don't, for example, use the CUDA device
// for a part of an operation where the TBB device was specified.
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/cuda/DeviceAdapterCuda.h>
#include <vtkm/cont/cuda/internal/testing/Testing.h>
#include <vtkm/cont/testing/TestingDataSetExplicit.h>

@ -18,11 +18,6 @@
// this software.
//============================================================================
// Make sure that the tested code is using the device adapter specified. This
// is important in the long run so we don't, for example, use the CUDA device
// for a part of an operation where the TBB device was specified.
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/cuda/DeviceAdapterCuda.h>
#include <vtkm/cont/cuda/internal/testing/Testing.h>

@ -18,11 +18,6 @@
// this software.
//============================================================================
// Make sure that the tested code is using the device adapter specified. This
// is important in the long run so we don't, for example, use the CUDA device
// for a part of an operation where the TBB device was specified.
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/RuntimeDeviceTracker.h>
#include <vtkm/cont/cuda/DeviceAdapterCuda.h>
#include <vtkm/cont/cuda/internal/testing/Testing.h>

@ -20,11 +20,6 @@
//
//=============================================================================
// Make sure that the tested code is using the device adapter specified. This
// is important in the long run so we don't, for example, use the CUDA device
// for a part of an operation where the TBB device was specified.
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/RuntimeDeviceTracker.h>
#include <vtkm/cont/cuda/DeviceAdapterCuda.h>
#include <vtkm/testing/TestingGeometry.h>

@ -18,11 +18,6 @@
// this software.
//============================================================================
// Make sure that the tested code is using the device adapter specified. This
// is important in the long run so we don't, for example, use the CUDA device
// for a part of an operation where the TBB device was specified.
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/testing/TestingImplicitFunction.h>
namespace

@ -20,11 +20,6 @@
//
//=============================================================================
// Make sure that the tested code is using the device adapter specified. This
// is important in the long run so we don't, for example, use the CUDA device
// for a part of an operation where the TBB device was specified.
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/RuntimeDeviceTracker.h>
#include <vtkm/cont/cuda/DeviceAdapterCuda.h>
#include <vtkm/testing/TestingMath.h>

@ -18,11 +18,6 @@
// this software.
//============================================================================
// Make sure that the tested code is using the device adapter specified. This
// is important in the long run so we don't, for example, use the CUDA device
// for a part of an operation where the TBB device was specified.
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/testing/TestingPointLocatorUniformGrid.h>
int UnitTestCudaPointLocatorUniformGrid(int argc, char* argv[])

@ -18,11 +18,6 @@
// this software.
//============================================================================
// Make sure that the tested code is using the device adapter specified. This
// is important in the long run so we don't, for example, use the CUDA device
// for a part of an operation where the TBB device was specified.
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/cuda/internal/testing/Testing.h>
#include <vtkm/cont/ArrayHandle.h>

@ -17,11 +17,6 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
// Make sure that the tested code is using the device adapter specified. This
// is important in the long run so we don't, for example, use the CUDA device
// for a part of an operation where the TBB device was specified.
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/RuntimeDeviceTracker.h>
#include <vtkm/cont/testing/TestingVirtualObjectHandle.h>

@ -33,7 +33,6 @@ set(headers
ConnectivityExplicitInternals.h
DeviceAdapterAlgorithmGeneral.h
DeviceAdapterAtomicArrayImplementation.h
DeviceAdapterDefaultSelection.h
DeviceAdapterError.h
DeviceAdapterListHelpers.h
DynamicTransform.h

@ -1,100 +0,0 @@
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2017 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2017 UT-Battelle, LLC.
// Copyright 2017 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software.
//
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
/* This file contains the logic to automatically determine and include a
* default device adapter. */
#ifndef vtk_m_cont_internal_DeviceAdapterDefaultSelection_h
#define vtk_m_cont_internal_DeviceAdapterDefaultSelection_h
#include <vtkm/cont/DeviceAdapterTag.h>
#include <vtkm/internal/Configure.h>
//-----------------------------------------------------------------------------
// Select the default devices based on available options.
#ifndef VTKM_DEVICE_ADAPTER
#ifdef VTKM_CUDA
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_CUDA
#elif defined(VTKM_ENABLE_TBB) // !VTKM_CUDA
// Unfortunately, VTKM_ENABLE_TBB does not guarantee that TBB is (or isn't)
// available, but there is no way to check for sure in a header library.
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_TBB
#elif defined(VTKM_ENABLE_OPENMP)
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_OPENMP
#else // !VTKM_CUDA && !VTKM_ENABLE_TBB && !VTKM_ENABLE_OPENMP
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_SERIAL
#endif // !VTKM_CUDA && !VTKM_ENABLE_TBB
#endif // VTKM_DEVICE_ADAPTER
//-----------------------------------------------------------------------------
// Bring in the appropriate device adapter tags for the default device:
//
// Serial:
#if VTKM_DEVICE_ADAPTER == VTKM_DEVICE_ADAPTER_SERIAL
#include <vtkm/cont/serial/internal/ArrayManagerExecutionSerial.h>
#include <vtkm/cont/serial/internal/DeviceAdapterAlgorithmSerial.h>
#include <vtkm/cont/serial/internal/DeviceAdapterTagSerial.h>
#define VTKM_DEFAULT_DEVICE_ADAPTER_TAG ::vtkm::cont::DeviceAdapterTagSerial
// Cuda:
#elif VTKM_DEVICE_ADAPTER == VTKM_DEVICE_ADAPTER_CUDA
#include <vtkm/cont/cuda/internal/ArrayManagerExecutionCuda.h>
#include <vtkm/cont/cuda/internal/DeviceAdapterAlgorithmCuda.h>
#include <vtkm/cont/cuda/internal/DeviceAdapterTagCuda.h>
#define VTKM_DEFAULT_DEVICE_ADAPTER_TAG ::vtkm::cont::DeviceAdapterTagCuda
// TBB:
#elif VTKM_DEVICE_ADAPTER == VTKM_DEVICE_ADAPTER_TBB
#include <vtkm/cont/tbb/internal/ArrayManagerExecutionTBB.h>
#include <vtkm/cont/tbb/internal/DeviceAdapterAlgorithmTBB.h>
#include <vtkm/cont/tbb/internal/DeviceAdapterTagTBB.h>
#define VTKM_DEFAULT_DEVICE_ADAPTER_TAG ::vtkm::cont::DeviceAdapterTagTBB
// OpenMP:
#elif VTKM_DEVICE_ADAPTER == VTKM_DEVICE_ADAPTER_OPENMP
#include <vtkm/cont/openmp/internal/ArrayManagerExecutionOpenMP.h>
#include <vtkm/cont/openmp/internal/DeviceAdapterAlgorithmOpenMP.h>
#include <vtkm/cont/openmp/internal/DeviceAdapterTagOpenMP.h>
#define VTKM_DEFAULT_DEVICE_ADAPTER_TAG ::vtkm::cont::DeviceAdapterTagOpenMP
// Error:
#elif VTKM_DEVICE_ADAPTER == VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/internal/DeviceAdapterError.h>
#define VTKM_DEFAULT_DEVICE_ADAPTER_TAG ::vtkm::cont::DeviceAdapterTagError
// Unknown:
#elif (VTKM_DEVICE_ADAPTER == VTKM_DEVICE_ADAPTER_UNDEFINED) || !defined(VTKM_DEVICE_ADAPTER)
#ifndef VTKM_DEFAULT_DEVICE_ADAPTER_TAG
#warning If device adapter is undefined, VTKM_DEFAULT_DEVICE_ADAPTER_TAG must be defined.
#endif
#else
#warning Unrecognized device adapter given.
#endif
#endif // vtk_m_cont_internal_DeviceAdapterDefaultSelection_h

@ -17,9 +17,6 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/openmp/DeviceAdapterOpenMP.h>
#include <vtkm/cont/testing/TestingArrayHandles.h>

@ -17,9 +17,6 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/openmp/DeviceAdapterOpenMP.h>
#include <vtkm/cont/testing/TestingFancyArrayHandles.h>

@ -17,9 +17,6 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/openmp/DeviceAdapterOpenMP.h>
#include <vtkm/cont/testing/TestingArrayHandleVirtualCoordinates.h>

@ -17,9 +17,6 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/openmp/DeviceAdapterOpenMP.h>
#include <vtkm/cont/testing/TestingBitField.h>

@ -18,11 +18,6 @@
// this software.
//============================================================================
// Make sure that the tested code is using the device adapter specified. This
// is important in the long run so we don't, for example, use the CUDA device
// for a part of an operation where the TBB device was specified.
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/testing/TestingCellLocatorRectilinearGrid.h>
int UnitTestOpenMPCellLocatorRectilinearGrid(int argc, char* argv[])

@ -17,9 +17,6 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/openmp/DeviceAdapterOpenMP.h>
#include <vtkm/cont/testing/TestingCellLocatorUniformBins.h>

@ -18,11 +18,6 @@
// this software.
//============================================================================
// Make sure that the tested code is using the device adapter specified. This
// is important in the long run so we don't, for example, use the CUDA device
// for a part of an operation where the TBB device was specified.
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/testing/TestingCellLocatorUniformGrid.h>
int UnitTestOpenMPCellLocatorUniformGrid(int argc, char* argv[])

@ -17,9 +17,6 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/openmp/DeviceAdapterOpenMP.h>
#include <vtkm/cont/testing/TestingColorTable.h>

@ -17,9 +17,6 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/openmp/DeviceAdapterOpenMP.h>
#include <vtkm/cont/testing/TestingComputeRange.h>

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