Commit da1fb632 authored by Robert Maynard's avatar Robert Maynard Committed by Kitware Robot

Merge topic 'remove_default_device_macros'

ff30684c Removes the default device macros from VTK-m
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !1641
parents 3df4ab6a ff30684c
......@@ -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")
add_executable(ContourTree ContourTreeApp.cxx)
target_link_libraries(ContourTree vtkm_filter)
# MAKE OPTIMIZED BUILD
# set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O3")
####################################
# Serial builds
# Debug algorithm build
####################################
# 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")
####################################
# Serial debug builds
####################################
# 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)
add_executable(GameOfLife GameOfLife.cxx LoadShaders.h)
if(TARGET vtkm::cuda)
add_executable(GameOfLife GameOfLife.cu LoadShaders.h)
else()
add_executable(GameOfLife GameOfLife.cxx LoadShaders.h)
set_source_files_properties(GameOfLife.cxx PROPERTIES LANGUAGE "CUDA")
endif()
target_link_libraries(GameOfLife PRIVATE vtkm_filter OpenGL::GL GLEW::GLEW GLUT::GLUT)
endif()
//============================================================================
// 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})
......
//============================================================================
// 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()
//============================================================================
// 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;
......
//============================================================================
// 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)
}