Commit b10e5086 authored by Robert Maynard's avatar Robert Maynard

Update all the examples to the new CMake code.

parent 18a360b7
...@@ -24,16 +24,16 @@ ...@@ -24,16 +24,16 @@
set(CMAKE_PREFIX_PATH ${VTKm_BINARY_DIR}/${VTKm_INSTALL_CONFIG_DIR}) set(CMAKE_PREFIX_PATH ${VTKm_BINARY_DIR}/${VTKm_INSTALL_CONFIG_DIR})
add_subdirectory(clipping) add_subdirectory(clipping)
# add_subdirectory(contour_tree) add_subdirectory(contour_tree)
# add_subdirectory(cosmotools) add_subdirectory(cosmotools)
add_subdirectory(demo) add_subdirectory(demo)
# add_subdirectory(dynamic_dispatcher) add_subdirectory(dynamic_dispatcher)
add_subdirectory(game_of_life) add_subdirectory(game_of_life)
add_subdirectory(hello_world) add_subdirectory(hello_world)
# add_subdirectory(isosurface) add_subdirectory(isosurface)
add_subdirectory(multi_backend) add_subdirectory(multi_backend)
# add_subdirectory(streamline) add_subdirectory(particle_advection)
# add_subdirectory(tetrahedra)
# add_subdirectory(particle_advection)
add_subdirectory(rendering) add_subdirectory(rendering)
# add_subdirectory(unified_memory) add_subdirectory(streamline)
add_subdirectory(tetrahedra)
add_subdirectory(unified_memory)
...@@ -25,13 +25,11 @@ project(Clipping CXX) ...@@ -25,13 +25,11 @@ project(Clipping CXX)
#Find the VTK-m package #Find the VTK-m package
find_package(VTKm REQUIRED QUIET) find_package(VTKm REQUIRED QUIET)
add_executable(Clipping_SERIAL Clipping.cxx) add_executable(Clipping_SERIAL Clipping.cxx)
target_compile_definitions(Clipping_SERIAL PRIVATE target_compile_definitions(Clipping_SERIAL PRIVATE
"VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_SERIAL") "VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_SERIAL")
target_link_libraries(Clipping_SERIAL PRIVATE vtkm_cont) target_link_libraries(Clipping_SERIAL PRIVATE vtkm_cont)
if(TARGET vtkm::tbb) if(TARGET vtkm::tbb)
add_executable(Clipping_TBB Clipping.cxx) add_executable(Clipping_TBB Clipping.cxx)
target_compile_definitions(Clipping_TBB PRIVATE target_compile_definitions(Clipping_TBB PRIVATE
......
...@@ -19,57 +19,50 @@ ...@@ -19,57 +19,50 @@
## this software. ## this software.
## ##
##============================================================================= ##=============================================================================
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
project(ContourTree CXX)
#Find the VTK-m package #Find the VTK-m package
find_package(VTKm REQUIRED QUIET find_package(VTKm REQUIRED QUIET)
OPTIONAL_COMPONENTS Serial CUDA TBB
)
add_executable(ContourTreeMesh2D_SERIAL ContourTreeMesh2D.cxx) add_executable(ContourTreeMesh2D_SERIAL ContourTreeMesh2D.cxx)
target_include_directories(ContourTreeMesh2D_SERIAL PRIVATE ${VTKm_INCLUDE_DIRS}) target_link_libraries(ContourTreeMesh2D_SERIAL vtkm_cont)
target_link_libraries(ContourTreeMesh2D_SERIAL PRIVATE ${VTKm_LIBRARIES})
target_compile_options(ContourTreeMesh2D_SERIAL PRIVATE ${VTKm_COMPILE_OPTIONS})
add_executable(ContourTreeMesh3D_SERIAL ContourTreeMesh3D.cxx) add_executable(ContourTreeMesh3D_SERIAL ContourTreeMesh3D.cxx)
target_include_directories(ContourTreeMesh3D_SERIAL PRIVATE ${VTKm_INCLUDE_DIRS}) target_link_libraries(ContourTreeMesh3D_SERIAL vtkm_cont)
target_link_libraries(ContourTreeMesh3D_SERIAL PRIVATE ${VTKm_LIBRARIES})
target_compile_options(ContourTreeMesh3D_SERIAL PRIVATE ${VTKm_COMPILE_OPTIONS})
if(VTKm_CUDA_FOUND) target_compile_definitions(ContourTreeMesh2D_SERIAL PRIVATE
set(old_nvcc_flags ${CUDA_NVCC_FLAGS}) "VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_SERIAL")
set(old_cxx_flags ${CMAKE_CXX_FLAGS}) target_compile_definitions(ContourTreeMesh3D_SERIAL PRIVATE
vtkm_setup_nvcc_flags( old_nvcc_flags old_cxx_flags) "VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_SERIAL")
# Cuda compiles do not respect target_include_directories
cuda_include_directories(${VTKm_INCLUDE_DIRS})
if(TARGET vtkm::cuda)
set (cudaSource "${CMAKE_CURRENT_BINARY_DIR}/ContourTreeMesh2D.cu") set (cudaSource "${CMAKE_CURRENT_BINARY_DIR}/ContourTreeMesh2D.cu")
configure_file(ContourTreeMesh2D.cxx ${cudaSource} COPYONLY) configure_file(ContourTreeMesh2D.cxx ${cudaSource} COPYONLY)
cuda_add_executable(ContourTreeMesh2D_CUDA ${cudaSource}) add_executable(ContourTreeMesh2D_CUDA ${cudaSource})
target_include_directories(ContourTreeMesh2D_CUDA PRIVATE ${VTKm_INCLUDE_DIRS})
target_link_libraries(ContourTreeMesh2D_CUDA PRIVATE ${VTKm_LIBRARIES})
target_compile_options(ContourTreeMesh2D_CUDA PRIVATE ${VTKm_COMPILE_OPTIONS})
set (cudaSource "${CMAKE_CURRENT_BINARY_DIR}/ContourTreeMesh3D.cu") set (cudaSource "${CMAKE_CURRENT_BINARY_DIR}/ContourTreeMesh3D.cu")
configure_file(ContourTreeMesh3D.cxx ${cudaSource} COPYONLY) configure_file(ContourTreeMesh3D.cxx ${cudaSource} COPYONLY)
cuda_add_executable(ContourTreeMesh3D_CUDA ${cudaSource}) add_executable(ContourTreeMesh3D_CUDA ${cudaSource})
target_include_directories(ContourTreeMesh3D_CUDA PRIVATE ${VTKm_INCLUDE_DIRS})
target_link_libraries(ContourTreeMesh3D_CUDA PRIVATE ${VTKm_LIBRARIES}) target_link_libraries(ContourTreeMesh2D_CUDA vtkm_cont)
target_compile_options(ContourTreeMesh3D_CUDA PRIVATE ${VTKm_COMPILE_OPTIONS}) target_link_libraries(ContourTreeMesh3D_CUDA vtkm_cont)
set(CUDA_NVCC_FLAGS ${old_nvcc_flags}) target_compile_definitions(ContourTreeMesh2D_CUDA PRIVATE
set(CMAKE_CXX_FLAGS ${old_cxx_flags}) "VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_CUDA")
target_compile_definitions(ContourTreeMesh3D_CUDA PRIVATE
"VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_CUDA")
endif() endif()
if(VTKm_TBB_FOUND) if(TARGET vtkm::tbb)
add_executable(ContourTreeMesh2D_TBB ContourTreeMesh2D.cxx) add_executable(ContourTreeMesh2D_TBB ContourTreeMesh2D.cxx)
target_include_directories(ContourTreeMesh2D_TBB PRIVATE ${VTKm_INCLUDE_DIRS})
target_link_libraries(ContourTreeMesh2D_TBB PRIVATE ${VTKm_LIBRARIES})
target_compile_options(ContourTreeMesh2D_TBB PRIVATE ${VTKm_COMPILE_OPTIONS})
add_executable(ContourTreeMesh3D_TBB ContourTreeMesh3D.cxx) add_executable(ContourTreeMesh3D_TBB ContourTreeMesh3D.cxx)
target_include_directories(ContourTreeMesh3D_TBB PRIVATE ${VTKm_INCLUDE_DIRS})
target_link_libraries(ContourTreeMesh3D_TBB PRIVATE ${VTKm_LIBRARIES}) target_link_libraries(ContourTreeMesh2D_TBB vtkm_cont)
target_compile_options(ContourTreeMesh3D_TBB PRIVATE ${VTKm_COMPILE_OPTIONS}) target_link_libraries(ContourTreeMesh3D_TBB vtkm_cont)
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")
endif() endif()
...@@ -19,44 +19,30 @@ ...@@ -19,44 +19,30 @@
## this software. ## this software.
## ##
##============================================================================= ##=============================================================================
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
project(CosmoTools CXX)
#Find the VTK-m package #Find the VTK-m package
find_package(VTKm REQUIRED QUIET find_package(VTKm REQUIRED QUIET)
OPTIONAL_COMPONENTS Serial CUDA TBB
)
add_executable(CosmoCenterFinder_SERIAL CosmoCenterFinder.cxx) add_executable(CosmoCenterFinder_SERIAL CosmoCenterFinder.cxx)
target_include_directories(CosmoCenterFinder_SERIAL PRIVATE ${VTKm_INCLUDE_DIRS})
target_link_libraries(CosmoCenterFinder_SERIAL PRIVATE ${VTKm_LIBRARIES})
target_compile_options(CosmoCenterFinder_SERIAL PRIVATE ${VTKm_COMPILE_OPTIONS})
add_executable(CosmoHaloFinder_SERIAL CosmoHaloFinder.cxx) add_executable(CosmoHaloFinder_SERIAL CosmoHaloFinder.cxx)
target_include_directories(CosmoHaloFinder_SERIAL PRIVATE ${VTKm_INCLUDE_DIRS})
target_link_libraries(CosmoHaloFinder_SERIAL PRIVATE ${VTKm_LIBRARIES})
target_compile_options(CosmoHaloFinder_SERIAL PRIVATE ${VTKm_COMPILE_OPTIONS})
if(VTKm_CUDA_FOUND) target_link_libraries(CosmoCenterFinder_SERIAL PRIVATE vtkm_cont)
# Cuda compiles do not respect target_include_directories target_link_libraries(CosmoHaloFinder_SERIAL PRIVATE vtkm_cont)
cuda_include_directories(${VTKm_INCLUDE_DIRS})
cuda_add_executable(CosmoCenterFinder_CUDA CosmoCenterFinder.cu) if(TARGET vtkm::cuda)
target_include_directories(CosmoCenterFinder_CUDA PRIVATE ${VTKm_INCLUDE_DIRS}) add_executable(CosmoCenterFinder_CUDA CosmoCenterFinder.cu)
target_link_libraries(CosmoCenterFinder_CUDA PRIVATE ${VTKm_LIBRARIES}) add_executable(CosmoHaloFinder_CUDA CosmoHaloFinder.cu)
target_compile_options(CosmoCenterFinder_CUDA PRIVATE ${VTKm_COMPILE_OPTIONS})
cuda_add_executable(CosmoHaloFinder_CUDA CosmoHaloFinder.cu) target_link_libraries(CosmoCenterFinder_CUDA PRIVATE vtkm_cont)
target_include_directories(CosmoHaloFinder_CUDA PRIVATE ${VTKm_INCLUDE_DIRS}) target_link_libraries(CosmoHaloFinder_CUDA PRIVATE vtkm_cont)
target_link_libraries(CosmoHaloFinder_CUDA PRIVATE ${VTKm_LIBRARIES})
target_compile_options(CosmoHaloFinder_CUDA PRIVATE ${VTKm_COMPILE_OPTIONS})
endif() endif()
if(VTKm_TBB_FOUND) if(TARGET vtkm::tbb)
add_executable(CosmoCenterFinder_TBB CosmoCenterFinderTBB.cxx) add_executable(CosmoCenterFinder_TBB CosmoCenterFinderTBB.cxx)
target_include_directories(CosmoCenterFinder_TBB PRIVATE ${VTKm_INCLUDE_DIRS})
target_link_libraries(CosmoCenterFinder_TBB PRIVATE ${VTKm_LIBRARIES})
target_compile_options(CosmoCenterFinder_TBB PRIVATE PRIVATE ${VTKm_COMPILE_OPTIONS})
add_executable(CosmoHaloFinder_TBB CosmoHaloFinderTBB.cxx) add_executable(CosmoHaloFinder_TBB CosmoHaloFinderTBB.cxx)
target_include_directories(CosmoHaloFinder_TBB PRIVATE ${VTKm_INCLUDE_DIRS})
target_link_libraries(CosmoHaloFinder_TBB PRIVATE ${VTKm_LIBRARIES}) target_link_libraries(CosmoCenterFinder_TBB PRIVATE vtkm_cont)
target_compile_options(CosmoHaloFinder_TBB PRIVATE PRIVATE ${VTKm_COMPILE_OPTIONS}) target_link_libraries(CosmoHaloFinder_TBB PRIVATE vtkm_cont)
endif() endif()
...@@ -26,20 +26,15 @@ project(VTKmDemo CXX) ...@@ -26,20 +26,15 @@ project(VTKmDemo CXX)
find_package(VTKm REQUIRED QUIET) find_package(VTKm REQUIRED QUIET)
if(TARGET vtkm_rendering) if(TARGET vtkm_rendering)
set(backend "VTKM_DEVICE_ADAPTER_SERIAL") set(backend "VTKM_DEVICE_ADAPTER_SERIAL")
if(TARGET vtkm::cuda) if(TARGET vtkm::cuda)
set_source_files_properties(Demo.cxx PROPERTIES LANGUAGE "CUDA") set_source_files_properties(Demo.cxx PROPERTIES LANGUAGE "CUDA")
set(backend "VTKM_DEVICE_ADAPTER_CUDA") set(backend "VTKM_DEVICE_ADAPTER_CUDA")
add_executable(Demo Demo.cxx)
elseif(TARGET vtkm::tbb) elseif(TARGET vtkm::tbb)
set(backend "VTKM_DEVICE_ADAPTER_TBB") set(backend "VTKM_DEVICE_ADAPTER_TBB")
cuda_add_executable(Demo Demo.cu)
else()
cuda_add_executable(Demo Demo.cu)
endif() endif()
add_executable(Demo Demo.cxx)
target_link_libraries(Demo PRIVATE vtkm_rendering) target_link_libraries(Demo PRIVATE vtkm_rendering)
target_compile_definitions(Demo PRIVATE "VTKM_DEVICE_ADAPTER=${backend}") target_compile_definitions(Demo PRIVATE "VTKM_DEVICE_ADAPTER=${backend}")
endif() endif()
...@@ -20,8 +20,5 @@ ...@@ -20,8 +20,5 @@
## ##
##============================================================================= ##=============================================================================
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
add_executable(DynamicDispatcherExample main.cxx) add_executable(DynamicDispatcherExample main.cxx)
target_include_directories(DynamicDispatcherExample PRIVATE ${VTKm_INCLUDE_DIRS}) target_link_libraries(DynamicDispatcherExample PRIVATE vtkm_cont)
target_link_libraries(DynamicDispatcherExample PRIVATE ${VTKm_LIBRARIES})
target_compile_options(DynamicDispatcherExample PRIVATE ${VTKm_COMPILE_OPTIONS})
...@@ -31,12 +31,10 @@ if(TARGET OpenGL::GL AND ...@@ -31,12 +31,10 @@ if(TARGET OpenGL::GL AND
TARGET GLEW::GLEW) TARGET GLEW::GLEW)
if(TARGET vtkm::cuda) if(TARGET vtkm::cuda)
cuda_add_executable(GameOfLife GameOfLife.cu LoadShaders.h) add_executable(GameOfLife GameOfLife.cu LoadShaders.h)
set_source_files_properties(GameOfLife.cxx PROPERTIES LANGUAGE "CUDA")
else() else()
add_executable(GameOfLife GameOfLife.cxx LoadShaders.h) add_executable(GameOfLife GameOfLife.cxx LoadShaders.h)
endif() endif()
target_link_libraries(GameOfLife PRIVATE vtkm_cont OpenGL::GL GLEW::GLEW GLUT::GLUT) target_link_libraries(GameOfLife PRIVATE vtkm_cont OpenGL::GL GLEW::GLEW GLUT::GLUT)
endif() endif()
...@@ -19,33 +19,30 @@ ...@@ -19,33 +19,30 @@
## this software. ## this software.
## ##
##============================================================================= ##=============================================================================
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
project(IsoSurface CXX)
#Find the VTK-m package #Find the VTK-m package
find_package(VTKm REQUIRED QUIET find_package(VTKm REQUIRED QUIET)
OPTIONAL_COMPONENTS Serial CUDA TBB OpenGL GLUT vtkm_find_gl(OPTIONAL GL GLUT GLEW)
)
if(TARGET OpenGL::GL AND
TARGET GLUT::GLUT AND
TARGET GLEW::GLEW)
if(VTKm_OpenGL_FOUND AND VTKm_GLUT_FOUND)
add_executable(IsosurfaceUniformGrid_SERIAL IsosurfaceUniformGrid.cxx quaternion.h)
set_source_files_properties(quaternion.h PROPERTIES HEADER_FILE_ONLY TRUE) set_source_files_properties(quaternion.h PROPERTIES HEADER_FILE_ONLY TRUE)
target_include_directories(IsosurfaceUniformGrid_SERIAL PRIVATE ${VTKm_INCLUDE_DIRS})
target_link_libraries(IsosurfaceUniformGrid_SERIAL PRIVATE ${VTKm_LIBRARIES})
target_compile_options(IsosurfaceUniformGrid_SERIAL PRIVATE ${VTKm_COMPILE_OPTIONS})
if(VTKm_CUDA_FOUND) add_executable(IsosurfaceUniformGrid_SERIAL IsosurfaceUniformGrid.cxx quaternion.h)
target_link_libraries(IsosurfaceUniformGrid_SERIAL PRIVATE vtkm_cont OpenGL::GL GLEW::GLEW GLUT::GLUT)
# Cuda compiles do not respect target_include_directories if(TARGET vtkm::cuda)
cuda_include_directories(${VTKm_INCLUDE_DIRS}) add_executable(IsosurfaceUniformGrid_CUDA IsosurfaceUniformGrid.cu quaternion.h)
cuda_add_executable(IsosurfaceUniformGrid_CUDA IsosurfaceUniformGrid.cu quaternion.h) target_link_libraries(IsosurfaceUniformGrid_CUDA PRIVATE vtkm_cont OpenGL::GL GLEW::GLEW GLUT::GLUT)
target_link_libraries(IsosurfaceUniformGrid_CUDA PRIVATE ${VTKm_LIBRARIES})
target_compile_options(IsosurfaceUniformGrid_CUDA PRIVATE ${VTKm_COMPILE_OPTIONS})
endif() endif()
if(VTKm_ENABLE_TBB) if(TARGET vtkm::tbb)
add_executable(IsosurfaceUniformGrid_TBB IsosurfaceUniformGridTBB.cxx quaternion.h) add_executable(IsosurfaceUniformGrid_TBB IsosurfaceUniformGridTBB.cxx quaternion.h)
target_include_directories(IsosurfaceUniformGrid_TBB PRIVATE ${VTKm_INCLUDE_DIRS}) target_link_libraries(IsosurfaceUniformGrid_TBB PRIVATE vtkm_cont OpenGL::GL GLEW::GLEW GLUT::GLUT)
target_link_libraries(IsosurfaceUniformGrid_TBB PRIVATE ${VTKm_LIBRARIES})
target_compile_options(IsosurfaceUniformGrid_TBB PRIVATE ${VTKm_COMPILE_OPTIONS})
endif() endif()
endif() endif()
...@@ -19,29 +19,21 @@ ...@@ -19,29 +19,21 @@
## this software. ## this software.
## ##
##============================================================================= ##=============================================================================
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
project(ParticleAdvection CXX)
#Find the VTK-m package #Find the VTK-m package
find_package(VTKm REQUIRED QUIET find_package(VTKm REQUIRED QUIET)
OPTIONAL_COMPONENTS Serial CUDA TBB
)
add_executable(Particle_Advection_SERIAL ParticleAdvection.cxx) add_executable(Particle_Advection_SERIAL ParticleAdvection.cxx)
target_include_directories(Particle_Advection_SERIAL PRIVATE ${VTKm_INCLUDE_DIRS}) target_link_libraries(Particle_Advection_SERIAL PRIVATE vtkm_cont)
target_link_libraries(Particle_Advection_SERIAL ${VTKm_LIBRARIES})
target_compile_options(Particle_Advection_SERIAL PRIVATE ${VTKm_COMPILE_OPTIONS})
if(VTKm_TBB_FOUND) if(TARGET vtkm::tbb)
add_executable(Particle_Advection_TBB ParticleAdvectionTBB.cxx) add_executable(Particle_Advection_TBB ParticleAdvectionTBB.cxx)
target_include_directories(Particle_Advection_TBB PRIVATE ${VTKm_INCLUDE_DIRS}) target_link_libraries(Particle_Advection_TBB PRIVATE vtkm_cont)
target_link_libraries(Particle_Advection_TBB ${VTKm_LIBRARIES})
target_compile_options(Particle_Advection_TBB PRIVATE ${VTKm_COMPILE_OPTIONS})
endif() endif()
if(VTKm_CUDA_FOUND) if(TARGET vtkm::cuda)
# Cuda compiles do not respect target_include_directories add_executable(Particle_Advection_CUDA ParticleAdvection.cu)
cuda_include_directories(${VTKm_INCLUDE_DIRS}) target_link_libraries(Particle_Advection_CUDA PRIVATE vtkm_cont)
cuda_add_executable(Particle_Advection_CUDA ParticleAdvection.cu)
target_include_directories(Particle_Advection_SERIAL PRIVATE ${VTKm_INCLUDE_DIRS})
target_link_libraries(Particle_Advection_CUDA PRIVATE ${VTKm_LIBRARIES})
target_compile_options(Particle_Advection_CUDA PRIVATE ${VTKm_COMPILE_OPTIONS})
endif() endif()
...@@ -19,32 +19,28 @@ ...@@ -19,32 +19,28 @@
## this software. ## this software.
## ##
##============================================================================= ##=============================================================================
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
project(Streamline CXX)
#Find the VTK-m package #Find the VTK-m package
find_package(VTKm REQUIRED QUIET find_package(VTKm REQUIRED QUIET)
OPTIONAL_COMPONENTS Serial CUDA TBB OpenGL GLUT vtkm_find_gl(OPTIONAL GL GLUT GLEW)
)
if(VTKm_OpenGL_FOUND AND VTKm_GLUT_FOUND) if(TARGET OpenGL::GL AND
add_executable(StreamLineUniformGrid_SERIAL StreamLineUniformGrid.cxx) TARGET GLUT::GLUT AND
target_include_directories(StreamLineUniformGrid_SERIAL PRIVATE ${VTKm_INCLUDE_DIRS}) TARGET GLEW::GLEW)
target_link_libraries(StreamLineUniformGrid_SERIAL PRIVATE ${VTKm_LIBRARIES})
target_compile_options(StreamLineUniformGrid_SERIAL PRIVATE ${VTKm_COMPILE_OPTIONS})
if(VTKm_CUDA_FOUND) add_executable(StreamLineUniformGrid_SERIAL StreamLineUniformGrid.cxx)
# Cuda compiles do not respect target_include_directories target_link_libraries(StreamLineUniformGrid_SERIAL PRIVATE vtkm_cont OpenGL::GL GLEW::GLEW GLUT::GLUT)
cuda_include_directories(${VTKm_INCLUDE_DIRS})
cuda_add_executable(StreamLineUniformGrid_CUDA StreamLineUniformGrid.cu) if(TARGET vtkm::cont)
target_include_directories(StreamLineUniformGrid_SERIAL PRIVATE ${VTKm_INCLUDE_DIRS}) add_executable(StreamLineUniformGrid_CUDA StreamLineUniformGrid.cu)
target_link_libraries(StreamLineUniformGrid_CUDA PRIVATE ${VTKm_LIBRARIES}) target_link_libraries(StreamLineUniformGrid_CUDA PRIVATE vtkm_cont OpenGL::GL GLEW::GLEW GLUT::GLUT)
target_compile_options(StreamLineUniformGrid_CUDA PRIVATE ${VTKm_COMPILE_OPTIONS})
endif() endif()
if(VTKm_TBB_FOUND) if(TARGET vtkm::tbb)
add_executable(StreamLineUniformGrid_TBB StreamLineUniformGridTBB.cxx) add_executable(StreamLineUniformGrid_TBB StreamLineUniformGridTBB.cxx)
target_include_directories(StreamLineUniformGrid_TBB PRIVATE ${VTKm_INCLUDE_DIRS}) target_link_libraries(StreamLineUniformGrid_TBB PRIVATE vtkm_cont OpenGL::GL GLEW::GLEW GLUT::GLUT)
target_link_libraries(StreamLineUniformGrid_TBB PRIVATE ${VTKm_LIBRARIES})
target_compile_options(StreamLineUniformGrid_TBB PRIVATE ${VTKm_COMPILE_OPTIONS})
endif() endif()
endif() endif()
...@@ -19,31 +19,24 @@ ...@@ -19,31 +19,24 @@
## this software. ## this software.
## ##
##============================================================================= ##=============================================================================
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
project(TauTiming CXX)
#Find the VTK-m package #Find the VTK-m package
find_package(VTKm REQUIRED QUIET find_package(VTKm REQUIRED QUIET)
OPTIONAL_COMPONENTS Serial CUDA TBB Rendering
)
add_executable(Tau_timing_SERIAL TauTiming.cxx) if(TARGET vtkm_rendering)
target_include_directories(Tau_timing_SERIAL PRIVATE ${VTKm_INCLUDE_DIRS})
target_link_libraries(Tau_timing_SERIAL ${VTKm_LIBRARIES})
target_compile_options(Tau_timing_SERIAL PRIVATE ${VTKm_COMPILE_OPTIONS})
if(VTKm_TBB_FOUND) add_executable(Tau_timing_SERIAL TauTiming.cxx)
add_executable(Tau_timing_TBB TauTimingTBB.cxx) target_link_libraries(Tau_timing_SERIAL vtkm_cont)
target_include_directories(Tau_timing_TBB PRIVATE ${VTKm_INCLUDE_DIRS})
target_link_libraries(Tau_timing_TBB ${VTKm_LIBRARIES}) if(TARGET vtkm::tbb)
target_compile_options(Tau_timing_TBB PRIVATE ${VTKm_COMPILE_OPTIONS}) add_executable(Tau_timing_TBB TauTimingTBB.cxx)
endif() target_link_libraries(Tau_timing_TBB vtkm_cont)
endif()
if(VTKm_OpenGL_FOUND) if(TARGET vtkm::cuda)
if(VTKm_CUDA_FOUND) add_executable(Tau_timing_CUDA TauTiming.cu)
# Cuda compiles do not respect target_include_directories target_link_libraries(Tau_timing_CUDA PRIVATE vtkm_cont)
cuda_include_directories(${VTKm_INCLUDE_DIRS})
cuda_add_executable(Tau_timing_CUDA TauTiming.cu)
target_include_directories(Tau_timing_SERIAL PRIVATE ${VTKm_INCLUDE_DIRS})
target_link_libraries(Tau_timing_CUDA PRIVATE ${VTKm_LIBRARIES})
target_compile_options(Tau_timing_CUDA PRIVATE ${VTKm_COMPILE_OPTIONS})
endif() endif()
endif() endif()
...@@ -19,79 +19,47 @@ ...@@ -19,79 +19,47 @@
## this software. ## this software.
## ##
##============================================================================= ##=============================================================================
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
project(Tetrahedra CXX)
#Find the VTK-m package #Find the VTK-m package
find_package(VTKm REQUIRED QUIET find_package(VTKm REQUIRED QUIET)
OPTIONAL_COMPONENTS Serial CUDA TBB OpenGL GLUT vtkm_find_gl(OPTIONAL GL GLUT GLEW)
)
if(TARGET OpenGL::GL AND
if(VTKm_OpenGL_FOUND AND VTKm_GLUT_FOUND) TARGET GLUT::GLUT AND
TARGET GLEW::GLEW)
add_executable(TetrahedralizeExplicitGrid_SERIAL TetrahedralizeExplicitGrid.cxx) add_executable(TetrahedralizeExplicitGrid_SERIAL TetrahedralizeExplicitGrid.cxx)
target_include_directories(TetrahedralizeExplicitGrid_SERIAL PRIVATE ${VTKm_INCLUDE_DIRS})
target_link_libraries(TetrahedralizeExplicitGrid_SERIAL PRIVATE ${VTKm_LIBRARIES})
target_compile_options(TetrahedralizeExplicitGrid_SERIAL PRIVATE ${VTKm_COMPILE_OPTIONS})
add_executable(TriangulateExplicitGrid_SERIAL TriangulateExplicitGrid.cxx) add_executable(TriangulateExplicitGrid_SERIAL TriangulateExplicitGrid.cxx)
target_include_directories(TriangulateExplicitGrid_SERIAL PRIVATE ${VTKm_INCLUDE_DIRS})
target_link_libraries(TriangulateExplicitGrid_SERIAL PRIVATE ${VTKm_LIBRARIES})
target_compile_options(TriangulateExplicitGrid_SERIAL PRIVATE ${VTKm_COMPILE_OPTIONS})
add_executable(TetrahedralizeUniformGrid_SERIAL TetrahedralizeUniformGrid.cxx) add_executable(TetrahedralizeUniformGrid_SERIAL TetrahedralizeUniformGrid.cxx)
target_include_directories(TetrahedralizeUniformGrid_SERIAL PRIVATE ${VTKm_INCLUDE_DIRS})
target_link_libraries(TetrahedralizeUniformGrid_SERIAL PRIVATE ${VTKm_LIBRARIES})
target_compile_options(TetrahedralizeUniformGrid_SERIAL PRIVATE ${VTKm_COMPILE_OPTIONS})
add_executable(TriangulateUniformGrid_SERIAL TriangulateUniformGrid.cxx) add_executable(TriangulateUniformGrid_SERIAL TriangulateUniformGrid.cxx)
target_include_directories(TriangulateUniformGrid_SERIAL PRIVATE ${VTKm_INCLUDE_DIRS})
target_link_libraries(TriangulateUniformGrid_SERIAL PRIVATE ${VTKm_LIBRARIES})
target_compile_options(TriangulateUniformGrid_SERIAL PRIVATE ${VTKm_COMPILE_OPTIONS})
if(VTKm_CUDA_FOUND)
# Cuda compiles do not respect target_include_directories
cuda_include_directories(${VTKm_INCLUDE_DIRS})
cuda_add_executable(TetrahedralizeExplicitGrid_CUDA TetrahedralizeExplicitGrid.cu)
target_include_directories(TetrahedralizeExplicitGrid_CUDA PRIVATE ${VTKm_INCLUDE_DIRS})
target_link_libraries(TetrahedralizeExplicitGrid_CUDA PRIVATE ${VTKm_LIBRARIES})
target_compile_options(TetrahedralizeExplicitGrid_CUDA PRIVATE ${VTKm_COMPILE_OPTIONS})
cuda_add_executable(TriangulateExplicitGrid_CUDA TriangulateExplicitGrid.cu)
target_include_directories(TriangulateExplicitGrid_CUDA PRIVATE ${VTKm_INCLUDE_DIRS})
target_link_libraries(TriangulateExplicitGrid_CUDA PRIVATE ${VTKm_LIBRARIES})
target_compile_options(TriangulateExplicitGrid_CUDA PRIVATE ${VTKm_COMPILE_OPTIONS})
cuda_add_executable(TetrahedralizeUniformGrid_CUDA TetrahedralizeUniformGrid.cu) target_link_libraries(TetrahedralizeExplicitGrid_SERIAL PRIVATE vtkm_cont OpenGL::GL GLEW::GLEW GLUT::GLUT)
target_include_directories(TetrahedralizeUniformGrid_CUDA PRIVATE ${VTKm_INCLUDE_DIRS}) target_link_libraries(TriangulateExplicitGrid_SERIAL PRIVATE vtkm_cont OpenGL::GL GLEW::GLEW GLUT::GLUT)
target_link_libraries(TetrahedralizeUniformGrid_CUDA PRIVATE ${VTKm_LIBRARIES}) target_link_libraries(TetrahedralizeUniformGrid_SERIAL PRIVATE vtkm_cont OpenGL::GL GLEW::GLEW GLUT::GLUT)
target_compile_options(TetrahedralizeUniformGrid_CUDA PRIVATE ${VTKm_COMPILE_OPTIONS}) target_link_libraries(TriangulateUniformGrid_SERIAL PRIVATE vtkm_cont OpenGL::GL GLEW::GLEW GLUT::GLUT)
cuda_add_executable(TriangulateUniformGrid_CUDA TriangulateUniformGrid.cu) if(TARGET vtkm::cuda)
target_include_directories(TriangulateUniformGrid_CUDA PRIVATE ${VTKm_INCLUDE_DIRS}) add_executable(TetrahedralizeExplicitGrid_CUDA TetrahedralizeExplicitGrid.cu)
target_link_libraries(TriangulateUniformGrid_CUDA PRIVATE ${VTKm_LIBRARIES}) add_executable(TriangulateExplicitGrid_CUDA TriangulateExplicitGrid.cu)
target_compile_options(TriangulateUniformGrid_CUDA PRIVATE ${VTKm_COMPILE_OPTIONS}) add_executable(TetrahedralizeUniformGrid_CUDA TetrahedralizeUniformGrid.cu)
add_executable(TriangulateUniformGrid_CUDA TriangulateUniformGrid.cu)
target_link_libraries(TetrahedralizeExplicitGrid_CUDA PRIVATE vtkm_cont OpenGL::GL GLEW::GLEW GLUT::GLUT)
target_link_libraries(TriangulateExplicitGrid_CUDA PRIVATE vtkm_cont OpenGL::GL GLEW::GLEW GLUT::GLUT)
target_link_libraries(TetrahedralizeUniformGrid_CUDA PRIVATE vtkm_cont OpenGL::GL GLEW::GLEW GLUT::GLUT)
target_link_libraries(TriangulateUniformGrid_CUDA PRIVATE vtkm_cont OpenGL::GL GLEW::GLEW GLUT::GLUT)
endif() endif()
if(VTKm_ENABLE_TBB) if(TARGET vtkm::tbb)
add_executable(TetrahedralizeExplicitGrid_TBB TetrahedralizeExplicitGridTBB.cxx) add_executable(TetrahedralizeExplicitGrid_TBB TetrahedralizeExplicitGridTBB.cxx)
target_include_directories(TetrahedralizeExplicitGrid_TBB PRIVATE ${VTKm_INCLUDE_DIRS})
target_link_libraries(TetrahedralizeExplicitGrid_TBB PRIVATE ${VTKm_LIBRARIES})
target_compile_options(TetrahedralizeExplicitGrid_TBB PRIVATE ${VTKm_COMPILE_OPTIONS})
add_executable(TriangulateExplicitGrid_TBB TriangulateExplicitGridTBB.cxx) add_executable(TriangulateExplicitGrid_TBB TriangulateExplicitGridTBB.cxx)
target_include_directories(TriangulateExplicitGrid_TBB PRIVATE ${VTKm_INCLUDE_DIRS})
target_link_libraries(TriangulateExplicitGrid_TBB PRIVATE ${VTKm_LIBRARIES})
target_compile_options(TriangulateExplicitGrid_TBB PRIVATE ${VTKm_COMPILE_OPTIONS})
add_executable(TetrahedralizeUniformGrid_TBB TetrahedralizeUniformGridTBB.cxx) add_executable(TetrahedralizeUniformGrid_TBB TetrahedralizeUniformGridTBB.cxx)
target_include_directories(TetrahedralizeUniformGrid_TBB PRIVATE ${VTKm_INCLUDE_DIRS})
target_link_libraries(TetrahedralizeUniformGrid_TBB PRIVATE ${VTKm_LIBRARIES})
target_compile_options(TetrahedralizeUniformGrid_TBB PRIVATE ${VTKm_COMPILE_OPTIONS})
add_executable(TriangulateUniformGrid_TBB TriangulateUniformGridTBB.cxx) add_executable(TriangulateUniformGrid_TBB TriangulateUniformGridTBB.cxx)
target_include_directories(TriangulateUniformGrid_TBB PRIVATE ${VTKm_INCLUDE_DIRS})
target_link_libraries(TriangulateUniformGrid_TBB PRIVATE ${VTKm_LIBRARIES})
target_compile_options(TriangulateUniformGrid_TBB PRIVATE ${VTKm_COMPILE_OPTIONS})
endif()
target_link_libraries(TetrahedralizeExplicitGrid_TBB PRIVATE vtkm_cont OpenGL::GL GLEW::GLEW GLUT::GLUT)
target_link_libraries(TriangulateExplicitGrid_TBB PRIVATE vtkm_cont OpenGL::GL GLEW::GLEW GLUT::GLUT)
target_link_libraries(TetrahedralizeUniformGrid_TBB PRIVATE vtkm_cont OpenGL::GL GLEW::GLEW GLUT::GLUT)
target_link_libraries(TriangulateUniformGrid_TBB PRIVATE vtkm_cont OpenGL::GL GLEW::GLEW GLUT::GLUT)
endif()
endif() endif()
...@@ -19,18 +19,14 @@ ...@@ -19,18 +19,14 @@
## this software. ## this software.
## ##
##============================================================================= ##=============================================================================
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
project(UnifiedMemory CXX)
#Find the VTK-m package #Find the VTK-m package
find_package(VTKm REQUIRED QUIET find_package(VTKm REQUIRED QUIET)
OPTIONAL_COMPONENTS Serial CUDA TBB OpenGL GLUT
)
if(VTKm_CUDA_FOUND) if(TARGET vtkm::cuda)
add_executable(UnifiedMemory_CUDA UnifiedMemory.cu)
# Cuda compiles do not respect target_include_directories target_link_libraries(UnifiedMemory_CUDA PRIVATE vtkm_cont)
cuda_include_directories(${VTKm_INCLUDE_DIRS})
cuda_add_executable(UnifiedMemory_CUDA UnifiedMemory.cu)
target_link_libraries(UnifiedMemory_CUDA PRIVATE ${VTKm_LIBRARIES})
target_compile_options(UnifiedMemory_CUDA PRIVATE ${VTKm_COMPILE_OPTIONS})
endif() endif()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment