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