Skip to content

Commit

Permalink
Fix warnings in CUDA code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Beck committed May 15, 2021
1 parent 0edda5d commit 16a6e4f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmake/Modules/FindMrtCUDA.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ else()
set(_CUDA_HOST_COMPILER "g++-9")
endif()

if(POLICY CMP0104)
cmake_policy(SET CMP0104 NEW)
endif()

if(NOT TARGET cuda_compiler_flags)
add_library(cuda_compiler_flags INTERFACE IMPORTED)
if(${CMAKE_VERSION} VERSION_LESS "3.9.0")
Expand Down
9 changes: 9 additions & 0 deletions cmake/Modules/FindMrtVTK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,13 @@ else()
find_package(VTK)
endif()

# Wrap all VTK_DEFINITIONS so that they are not used in CUDA code. This will prevent
# warnings generated by nvcc.
set(NEW_VTK_DEFINITION)
foreach(VTK_DEFINITION ${VTK_DEFINITIONS})
list(APPEND NEW_VTK_DEFINITION "$<$<NOT:$<COMPILE_LANGUAGE:CUDA>>:${VTK_DEFINITION}>")
endforeach()
set(VTK_DEFINITIONS ${NEW_VTK_DEFINITION})
unset(NEW_VTK_DEFINITION)

include(${VTK_USE_FILE})

0 comments on commit 16a6e4f

Please sign in to comment.