From ee368d0d68b74c10939515122fac338b7981f550 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Mon, 25 Jan 2016 10:57:04 -0500 Subject: [PATCH] Do not add c++ compiler optimizations to all compilers, but on a target basis. As reported in Issue #54 the add_compile_options pollutes the global compile flags. Instead we provided cmake flags for people to use. --- CMake/VTKmCompilerOptimizations.cmake | 25 ++++--- CMake/VTKmConfig.cmake.in | 5 ++ CMake/VTKmMacros.cmake | 8 +++ CMakeLists.txt | 2 +- examples/clipping/CMakeLists.txt | 3 + examples/hello_world/CMakeLists.txt | 3 + examples/isosurface/CMakeLists.txt | 3 + examples/lots_of_args/CMakeLists.txt | 25 +++++++ examples/lots_of_args/main.cxx | 96 +++++++++++++++++++++++++++ examples/multi_backend/CMakeLists.txt | 1 + examples/streamline/CMakeLists.txt | 3 + examples/tetrahedra/CMakeLists.txt | 12 ++++ 12 files changed, 174 insertions(+), 12 deletions(-) create mode 100644 examples/lots_of_args/CMakeLists.txt create mode 100644 examples/lots_of_args/main.cxx diff --git a/CMake/VTKmCompilerOptimizations.cmake b/CMake/VTKmCompilerOptimizations.cmake index fb3e44375..8121ba6b2 100644 --- a/CMake/VTKmCompilerOptimizations.cmake +++ b/CMake/VTKmCompilerOptimizations.cmake @@ -74,7 +74,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") #common flags for the avx instructions for the gcc compiler set_property(GLOBAL PROPERTY VTKm_NATIVE_FLAGS -march=native) set_property(GLOBAL PROPERTY VTKm_AVX_FLAGS -mavx) - set_property(GLOBAL PROPERTY VTKm_AVX2_FLAGS -mf16c -mavx2 -mfma -mlzcnt -mbmi -mbmi2) + set_property(GLOBAL PROPERTY VTKm_AVX2_FLAGS "-mf16c -mavx2 -mfma -mlzcnt -mbmi -mbmi2") if (CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.7 OR CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.7) @@ -83,24 +83,24 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") elseif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.1) #if GNU is less than 5.1 you get avx, avx2, and some avx512 list(APPEND vec_levels avx2 avx512) - set_property(GLOBAL PROPERTY VTKm_AVX512_FLAGS -mavx512f -mavx512pf -mavx512er -mavx512cd) + set_property(GLOBAL PROPERTY VTKm_AVX512_FLAGS "-mavx512f -mavx512pf -mavx512er -mavx512cd") else() #if GNU is 5.1+ you get avx, avx2, and more avx512 list(APPEND vec_levels avx2 avx512) - set_property(GLOBAL PROPERTY VTKm_AVX512_FLAGS -mavx512f -mavx512pf -mavx512er -mavx512cd -mavx512vl -mavx512bw -mavx512dq -mavx512ifma -mavx512vbmi) + set_property(GLOBAL PROPERTY VTKm_AVX512_FLAGS "-mavx512f -mavx512pf -mavx512er -mavx512cd -mavx512vl -mavx512bw -mavx512dq -mavx512ifma -mavx512vbmi") endif() elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") list(APPEND vec_levels avx avx2 avx512) set_property(GLOBAL PROPERTY VTKm_NATIVE_FLAGS -march=native) set_property(GLOBAL PROPERTY VTKm_AVX_FLAGS -mavx) - set_property(GLOBAL PROPERTY VTKm_AVX2_FLAGS -mf16c -mavx2 -mfma -mlzcnt -mbmi -mbmi2) + set_property(GLOBAL PROPERTY VTKm_AVX2_FLAGS "-mf16c -mavx2 -mfma -mlzcnt -mbmi -mbmi2") set_property(GLOBAL PROPERTY VTKm_AVX512_FLAGS -mavx512) elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") #While Clang support AVX512, no version of AppleClang has that support yet list(APPEND vec_levels avx avx2) set_property(GLOBAL PROPERTY VTKm_NATIVE_FLAGS -march=native) set_property(GLOBAL PROPERTY VTKm_AVX_FLAGS -mavx) - set_property(GLOBAL PROPERTY VTKm_AVX2_FLAGS -mf16c -mavx2 -mfma -mlzcnt -mbmi -mbmi2) + set_property(GLOBAL PROPERTY VTKm_AVX2_FLAGS "-mf16c -mavx2 -mfma -mlzcnt -mbmi -mbmi2") elseif(CMAKE_CXX_COMPILER_ID STREQUAL "PGI") #I can't find documentation to explicitly state the level of vectorization #support I want from the PGI compiler @@ -141,15 +141,18 @@ elseif(VTKm_Vectorization STREQUAL "avx") elseif(VTKm_Vectorization STREQUAL "avx2") get_property(avx GLOBAL PROPERTY VTKm_AVX_FLAGS) get_property(avx2 GLOBAL PROPERTY VTKm_AVX2_FLAGS) - set(flags ${avx} ${avx2}) + set(flags "${avx} ${avx2}") elseif(VTKm_Vectorization STREQUAL "avx512") get_property(avx GLOBAL PROPERTY VTKm_AVX_FLAGS) get_property(avx2 GLOBAL PROPERTY VTKm_AVX2_FLAGS) get_property(avx512 GLOBAL PROPERTY VTKm_AVX512_FLAGS) - set(flags ${avx} ${avx2} ${avx512}) + set(flags "${avx} ${avx2} ${avx512}") endif() -#have to specify each compile option separately, can't do them in bulk -foreach(flag ${flags}) - add_compile_options( ${flag} ) -endforeach() +#guard against adding the flags multiple times, which happens when multiple +#backends include this file +if(NOT VTKm_Vectorization_flags_added) + set(VTKm_Vectorization_flags_added true) + set_property(GLOBAL PROPERTY VTKm_Vectorization_FLAGS "${flags}") + list(APPEND VTKm_COMPILE_OPTIONS ${flags}) +endif() diff --git a/CMake/VTKmConfig.cmake.in b/CMake/VTKmConfig.cmake.in index 1e871e5ea..d80bccba3 100644 --- a/CMake/VTKmConfig.cmake.in +++ b/CMake/VTKmConfig.cmake.in @@ -65,3 +65,8 @@ if(VTKm_ENABLE_TBB) # default device. In that case, the TBB device is required. vtkm_configure_device(TBB ${vtkm_is_required}) endif() + +# Extra compile options that VTKm has generated, such as vectorization settings. +# This should be specified to any target with the CMake command target_compile_options +# that uses VTK-m. +set(VTKm_COMPILE_OPTIONS "@VTKm_COMPILE_OPTIONS@") diff --git a/CMake/VTKmMacros.cmake b/CMake/VTKmMacros.cmake index f83247ebd..37f9bbe7f 100644 --- a/CMake/VTKmMacros.cmake +++ b/CMake/VTKmMacros.cmake @@ -268,6 +268,8 @@ function(vtkm_unit_tests) target_link_libraries(${test_prog} ${VTKm_UT_LIBRARIES}) + target_compile_options(${test_prog} PRIVATE ${VTKm_COMPILE_OPTIONS}) + if(MSVC) vtkm_setup_msvc_properties(${test_prog}) endif() @@ -393,6 +395,9 @@ function(vtkm_worklet_unit_tests device_adapter) target_link_libraries(${test_prog} ${VTKm_LIBRARIES}) endif() + #add the specific compile options for this executable + target_compile_options(${test_prog} PRIVATE ${VTKm_COMPILE_OPTIONS}) + #add a test for each worklet test file. We will inject the device #adapter type into the test name so that it is easier to see what #exact device a test is failing on. @@ -524,6 +529,9 @@ function(vtkm_benchmarks device_adapter) vtkm_setup_msvc_properties(${benchmark_prog}) endif() + #add the specific compile options for this executable + target_compile_options(${benchmark_prog} PRIVATE ${VTKm_COMPILE_OPTIONS}) + #increase warning level if needed, we are going to skip cuda here #to remove all the false positive unused function warnings that cuda #generates diff --git a/CMakeLists.txt b/CMakeLists.txt index ab88f453e..ca58032e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ ## this software. ##============================================================================ -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 2.8.12) #setup policy rules for CMake 3.0 while we have a minimum required of 2.8.X if(POLICY CMP0025) diff --git a/examples/clipping/CMakeLists.txt b/examples/clipping/CMakeLists.txt index f8c8fb95f..3eec0a355 100644 --- a/examples/clipping/CMakeLists.txt +++ b/examples/clipping/CMakeLists.txt @@ -21,6 +21,7 @@ ##============================================================================= add_executable(Clipping_SERIAL Clipping.cxx) +target_compile_options(Clipping_SERIAL PRIVATE ${VTKm_COMPILE_OPTIONS}) set_property( TARGET Clipping_SERIAL @@ -35,6 +36,7 @@ if(VTKm_Cuda_FOUND) vtkm_disable_troublesome_thrust_warnings() cuda_add_executable(Clipping_CUDA ${cudaSource}) + target_compile_options(Clipping_CUDA PRIVATE ${VTKm_COMPILE_OPTIONS}) set(CUDA_NVCC_FLAGS ${old_nvcc_flags}) @@ -44,6 +46,7 @@ if(VTKm_ENABLE_TBB) add_executable(Clipping_TBB Clipping.cxx) target_include_directories(Clipping_TBB PRIVATE ${VTKm_INCLUDE_DIRS}) target_link_libraries(Clipping_TBB ${VTKm_LIBRARIES}) + target_compile_options(Clipping_TBB PRIVATE PRIVATE ${VTKm_COMPILE_OPTIONS}) set_property( TARGET Clipping_TBB APPEND diff --git a/examples/hello_world/CMakeLists.txt b/examples/hello_world/CMakeLists.txt index 44aa8d3b1..fd05f20a8 100644 --- a/examples/hello_world/CMakeLists.txt +++ b/examples/hello_world/CMakeLists.txt @@ -25,17 +25,20 @@ if(OPENGL_FOUND AND GLUT_FOUND) add_executable(HelloWorld_SERIAL HelloWorld.cxx) target_include_directories(HelloWorld_SERIAL PRIVATE ${OPENGL_INCLUDE_DIR} ${GLEW_INCLUDE_DIR} ${GLUT_INCLUDE_DIR}) target_link_libraries(HelloWorld_SERIAL ${OPENGL_LIBRARIES} ${GLEW_LIBRARIES} ${GLUT_LIBRARIES} ${VTKm_LIBRARIES}) + target_compile_options(HelloWorld_SERIAL PRIVATE ${VTKm_COMPILE_OPTIONS}) if(VTKm_Cuda_FOUND) vtkm_disable_troublesome_thrust_warnings() cuda_add_executable(HelloWorld_CUDA HelloWorld.cu) target_link_libraries(HelloWorld_CUDA ${OPENGL_LIBRARIES} ${GLEW_LIBRARIES} ${GLUT_LIBRARIES} ${VTKm_LIBRARIES}) + target_compile_options(HelloWorld_CUDA PRIVATE ${VTKm_COMPILE_OPTIONS}) endif() if(VTKm_TBB_FOUND) add_executable(HelloWorld_TBB HelloWorld.cxx) target_include_directories(HelloWorld_TBB PRIVATE ${OPENGL_INCLUDE_DIR} ${GLEW_INCLUDE_DIR} ${GLUT_INCLUDE_DIR}) target_link_libraries(HelloWorld_TBB ${OPENGL_LIBRARIES} ${GLEW_LIBRARIES} ${GLUT_LIBRARIES} ${VTKm_LIBRARIES}) + target_compile_options(HelloWorld_TBB PRIVATE ${VTKm_COMPILE_OPTIONS}) endif() endif() diff --git a/examples/isosurface/CMakeLists.txt b/examples/isosurface/CMakeLists.txt index 7d8c69a60..fcb72ab85 100644 --- a/examples/isosurface/CMakeLists.txt +++ b/examples/isosurface/CMakeLists.txt @@ -24,17 +24,20 @@ if(OPENGL_FOUND AND GLUT_FOUND) add_executable(IsosurfaceUniformGrid_SERIAL IsosurfaceUniformGrid.cxx) target_include_directories(IsosurfaceUniformGrid_SERIAL PRIVATE ${GLUT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}) target_link_libraries(IsosurfaceUniformGrid_SERIAL ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} ${VTKm_LIBRARIES}) + target_compile_options(IsosurfaceUniformGrid_SERIAL PRIVATE ${VTKm_COMPILE_OPTIONS}) if(VTKm_Cuda_FOUND) vtkm_disable_troublesome_thrust_warnings() cuda_add_executable(IsosurfaceUniformGrid_CUDA IsosurfaceUniformGrid.cu) target_link_libraries(IsosurfaceUniformGrid_CUDA ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} ${VTKm_LIBRARIES}) + target_compile_options(IsosurfaceUniformGrid_CUDA PRIVATE ${VTKm_COMPILE_OPTIONS}) endif() if(VTKm_ENABLE_TBB) add_executable(IsosurfaceUniformGrid_TBB IsosurfaceUniformGridTBB.cxx) target_include_directories(IsosurfaceUniformGrid_TBB PRIVATE ${GLUT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}) target_link_libraries(IsosurfaceUniformGrid_TBB ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} ${VTKm_LIBRARIES}) + target_compile_options(IsosurfaceUniformGrid_TBB PRIVATE ${VTKm_COMPILE_OPTIONS}) endif() endif() diff --git a/examples/lots_of_args/CMakeLists.txt b/examples/lots_of_args/CMakeLists.txt new file mode 100644 index 000000000..da7c7e2c1 --- /dev/null +++ b/examples/lots_of_args/CMakeLists.txt @@ -0,0 +1,25 @@ +##============================================================================= +## +## 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 2015 Sandia Corporation. +## Copyright 2015 UT-Battelle, LLC. +## Copyright 2015 Los Alamos National Security. +## +## Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +## 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_directories(${CMAKE_CURRENT_SOURCE_DIR}) +add_executable(DispatcherTest main.cxx) +target_link_libraries(DispatcherTest ${VTKm_LIBRARIES}) diff --git a/examples/lots_of_args/main.cxx b/examples/lots_of_args/main.cxx new file mode 100644 index 000000000..a23cdb6c3 --- /dev/null +++ b/examples/lots_of_args/main.cxx @@ -0,0 +1,96 @@ +//============================================================================ +// 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 Sandia Corporation. +// Copyright 2014 UT-Battelle, LLC. +// Copyright 2014 Los Alamos National Security. +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// 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. +//============================================================================ + +#ifndef VTKM_DEVICE_ADAPTER +#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_SERIAL +#endif + +#include + +#include +#include +#include +#include + +struct ExampleFieldWorklet : public vtkm::worklet::WorkletMapField +{ + typedef void ControlSignature( FieldIn<>, FieldIn<>, FieldIn<>, + FieldOut<>, FieldOut<>, FieldOut<> ); + typedef void ExecutionSignature( _1, _2, _3, _4, _5, _6 ); + + template + VTKM_EXEC_EXPORT + void operator()( const vtkm::Vec< T, 3 > & vec, + const U & scalar1, + const V& scalar2, + vtkm::Vec& out_vec, + U& out_scalar1, + V& out_scalar2 ) const + { + out_vec = vec * scalar1; + out_scalar1 = scalar1 + scalar2; + out_scalar2 = scalar2; + } + + template + VTKM_EXEC_EXPORT + void operator()( const T & vec, + const U & scalar1, + const V& scalar2, + W& out_vec, + X& out_scalar, + Y& ) const + { + //no-op + } +}; + + +int main(int argc, char** argv) +{ + std::vector< vtkm::Vec > inputVec; + std::vector< vtkm::Int32 > inputScalar1; + std::vector< vtkm::Float64 > inputScalar2; + + vtkm::cont::ArrayHandle< vtkm::Vec > handleV = + vtkm::cont::make_ArrayHandle(inputVec); + + vtkm::cont::ArrayHandle< vtkm::Vec > handleS1 = + vtkm::cont::make_ArrayHandle(inputVec); + + vtkm::cont::ArrayHandle< vtkm::Vec > handleS2 = + vtkm::cont::make_ArrayHandle(inputVec); + + vtkm::cont::ArrayHandle< vtkm::Vec > handleOV; + vtkm::cont::ArrayHandle< vtkm::Vec > handleOS1; + vtkm::cont::ArrayHandle< vtkm::Vec > handleOS2; + + std::cout << "Making 3 output DynamicArrayHandles " << std::endl; + vtkm::cont::DynamicArrayHandle out1(handleOV), out2(handleOS1), out3(handleOS2); + + typedef vtkm::worklet::DispatcherMapField DispatcherType; + + std::cout << "Invoking ExampleFieldWorklet" << std::endl; + DispatcherType dispatcher; + + dispatcher.Invoke(handleV, handleS1, handleS2, out1, out2, out3); + +} + diff --git a/examples/multi_backend/CMakeLists.txt b/examples/multi_backend/CMakeLists.txt index b3027c1a5..8011d6d3b 100644 --- a/examples/multi_backend/CMakeLists.txt +++ b/examples/multi_backend/CMakeLists.txt @@ -26,6 +26,7 @@ else() add_executable(MultiBackend MultiBackend.cxx) endif() +target_compile_options(MultiBackend PRIVATE ${VTKm_COMPILE_OPTIONS}) if(VTKm_TBB_FOUND) target_link_libraries(MultiBackend ${VTKm_LIBRARIES}) endif() diff --git a/examples/streamline/CMakeLists.txt b/examples/streamline/CMakeLists.txt index 0faedd599..707b665d3 100644 --- a/examples/streamline/CMakeLists.txt +++ b/examples/streamline/CMakeLists.txt @@ -24,16 +24,19 @@ if(OPENGL_FOUND AND GLUT_FOUND) add_executable(StreamLineUniformGrid_SERIAL StreamLineUniformGrid.cxx) target_include_directories(StreamLineUniformGrid_SERIAL PRIVATE ${GLUT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}) target_link_libraries(StreamLineUniformGrid_SERIAL ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES}) + target_compile_options(StreamLineUniformGrid_SERIAL PRIVATE ${VTKm_COMPILE_OPTIONS}) if(VTKm_Cuda_FOUND) cuda_add_executable(StreamLineUniformGrid_CUDA StreamLineUniformGrid.cu) target_link_libraries(StreamLineUniformGrid_CUDA ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES}) + target_compile_options(StreamLineUniformGrid_CUDA PRIVATE ${VTKm_COMPILE_OPTIONS}) endif() if(VTKm_ENABLE_TBB) add_executable(StreamLineUniformGrid_TBB StreamLineUniformGridTBB.cxx) target_include_directories(StreamLineUniformGrid_TBB PRIVATE ${GLUT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR} ${TBB_INCLUDE_DIRS}) target_link_libraries(StreamLineUniformGrid_TBB ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} ${TBB_LIBRARIES}) + target_compile_options(StreamLineUniformGrid_TBB PRIVATE ${VTKm_COMPILE_OPTIONS}) endif() endif() diff --git a/examples/tetrahedra/CMakeLists.txt b/examples/tetrahedra/CMakeLists.txt index 399427201..73166428f 100644 --- a/examples/tetrahedra/CMakeLists.txt +++ b/examples/tetrahedra/CMakeLists.txt @@ -24,49 +24,61 @@ if(OPENGL_FOUND AND GLUT_FOUND) add_executable(TetrahedralizeExplicitGrid_SERIAL TetrahedralizeExplicitGrid.cxx) target_include_directories(TetrahedralizeExplicitGrid_SERIAL PRIVATE ${GLUT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}) target_link_libraries(TetrahedralizeExplicitGrid_SERIAL ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} ${VTKm_LIBRARIES}) + target_compile_options(TetrahedralizeExplicitGrid_SERIAL PRIVATE ${VTKm_COMPILE_OPTIONS}) add_executable(TriangulateExplicitGrid_SERIAL TriangulateExplicitGrid.cxx) target_include_directories(TriangulateExplicitGrid_SERIAL PRIVATE ${GLUT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}) target_link_libraries(TriangulateExplicitGrid_SERIAL ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} ${VTKm_LIBRARIES}) + target_compile_options(TriangulateExplicitGrid_SERIAL PRIVATE ${VTKm_COMPILE_OPTIONS}) add_executable(TetrahedralizeUniformGrid_SERIAL TetrahedralizeUniformGrid.cxx) target_include_directories(TetrahedralizeUniformGrid_SERIAL PRIVATE ${GLUT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}) target_link_libraries(TetrahedralizeUniformGrid_SERIAL ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} ${VTKm_LIBRARIES}) + target_compile_options(TetrahedralizeUniformGrid_SERIAL PRIVATE ${VTKm_COMPILE_OPTIONS}) add_executable(TriangulateUniformGrid_SERIAL TriangulateUniformGrid.cxx) target_include_directories(TriangulateUniformGrid_SERIAL PRIVATE ${GLUT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}) target_link_libraries(TriangulateUniformGrid_SERIAL ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} ${VTKm_LIBRARIES}) + target_compile_options(TriangulateUniformGrid_SERIAL PRIVATE ${VTKm_COMPILE_OPTIONS}) if(VTKm_Cuda_FOUND) cuda_add_executable(TetrahedralizeExplicitGrid_CUDA TetrahedralizeExplicitGrid.cu) target_link_libraries(TetrahedralizeExplicitGrid_CUDA ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} ${VTKm_LIBRARIES}) + target_compile_options(TetrahedralizeExplicitGrid_CUDA PRIVATE ${VTKm_COMPILE_OPTIONS}) cuda_add_executable(TriangulateExplicitGrid_CUDA TriangulateExplicitGrid.cu) target_link_libraries(TriangulateExplicitGrid_CUDA ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} ${VTKm_LIBRARIES}) + target_compile_options(TriangulateExplicitGrid_CUDA PRIVATE ${VTKm_COMPILE_OPTIONS}) cuda_add_executable(TetrahedralizeUniformGrid_CUDA TetrahedralizeUniformGrid.cu) target_link_libraries(TetrahedralizeUniformGrid_CUDA ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} ${VTKm_LIBRARIES}) + target_compile_options(TetrahedralizeUniformGrid_CUDA PRIVATE ${VTKm_COMPILE_OPTIONS}) cuda_add_executable(TriangulateUniformGrid_CUDA TriangulateUniformGrid.cu) target_link_libraries(TriangulateUniformGrid_CUDA ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} ${VTKm_LIBRARIES}) + target_compile_options(TriangulateUniformGrid_CUDA PRIVATE ${VTKm_COMPILE_OPTIONS}) endif() if(VTKm_ENABLE_TBB) add_executable(TetrahedralizeExplicitGrid_TBB TetrahedralizeExplicitGridTBB.cxx) target_include_directories(TetrahedralizeExplicitGrid_TBB PRIVATE ${GLUT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}) target_link_libraries(TetrahedralizeExplicitGrid_TBB ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} ${VTKm_LIBRARIES}) + target_compile_options(TetrahedralizeExplicitGrid_TBB PRIVATE ${VTKm_COMPILE_OPTIONS}) add_executable(TriangulateExplicitGrid_TBB TriangulateExplicitGridTBB.cxx) target_include_directories(TriangulateExplicitGrid_TBB PRIVATE ${GLUT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}) target_link_libraries(TriangulateExplicitGrid_TBB ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} ${VTKm_LIBRARIES}) + target_compile_options(TriangulateExplicitGrid_TBB PRIVATE ${VTKm_COMPILE_OPTIONS}) add_executable(TetrahedralizeUniformGrid_TBB TetrahedralizeUniformGridTBB.cxx) target_include_directories(TetrahedralizeUniformGrid_TBB PRIVATE ${GLUT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}) target_link_libraries(TetrahedralizeUniformGrid_TBB ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} ${VTKm_LIBRARIES}) + target_compile_options(TetrahedralizeUniformGrid_TBB PRIVATE ${VTKm_COMPILE_OPTIONS}) add_executable(TriangulateUniformGrid_TBB TriangulateUniformGridTBB.cxx) target_include_directories(TriangulateUniformGrid_TBB PRIVATE ${GLUT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}) target_link_libraries(TriangulateUniformGrid_TBB ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} ${VTKm_LIBRARIES}) + target_compile_options(TriangulateUniformGrid_TBB PRIVATE ${VTKm_COMPILE_OPTIONS}) endif() endif()