Skip to content

Commit

Permalink
Add IntelLLVM to CMake generator expressions where missing.
Browse files Browse the repository at this point in the history
  • Loading branch information
breyerml committed Dec 5, 2024
1 parent 0ab97d9 commit ac80299
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ if (OpenMP_FOUND)
else ()
# disable warning for unknown OpenMP pragmas if no OpenMP could be found
target_compile_options(${PLSSVM_BASE_LIBRARY_NAME} PUBLIC
$<$<COMPILE_LANG_AND_ID:CXX,GNU,Clang>:-Wno-unknown-pragmas>
$<$<COMPILE_LANG_AND_ID:CXX,GNU,Clang,IntelLLVM>:-Wno-unknown-pragmas>
$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/wd4068>
)
# issue warning that multi-GPU execution will be serialized
Expand Down
2 changes: 1 addition & 1 deletion bindings/Python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ target_link_libraries(${PLSSVM_PYTHON_BINDINGS_LIBRARY_NAME} PRIVATE ${PLSSVM_AL
target_compile_definitions(${PLSSVM_PYTHON_BINDINGS_LIBRARY_NAME} PRIVATE PYBIND11_DETAILED_ERROR_MESSAGES)

# disable clang compiler warning
target_compile_options(${PLSSVM_BASE_LIBRARY_NAME} PUBLIC $<$<COMPILE_LANG_AND_ID:CXX,Clang>:-Wno-self-assign-overloaded>)
target_compile_options(${PLSSVM_BASE_LIBRARY_NAME} PUBLIC $<$<COMPILE_LANG_AND_ID:CXX,Clang,IntelLLVM>:-Wno-self-assign-overloaded>)
target_compile_options(${PLSSVM_BASE_LIBRARY_NAME} PUBLIC -fPIC)

# append pybind11 bindings library to installed targets
Expand Down
2 changes: 2 additions & 0 deletions src/plssvm/backends/CUDA/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ set(CMAKE_CUDA_STANDARD 17)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)

if (CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA")
message(STATUS "Using nvcc as CUDA compiler.")
# use nvcc to compile CUDA code
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xcompiler '-fPIC' -Xcudafe \"--diag_suppress=unsigned_compare_with_zero --diag_suppress=128\" -lineinfo")
# build type specific flags
Expand All @@ -55,6 +56,7 @@ if (CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA")
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xcompiler '-fopenmp'")
endif ()
elseif (CMAKE_CUDA_COMPILER_ID STREQUAL "Clang")
message(STATUS "Using Clang as CUDA compiler.")
# use clang to compile CUDA code
# build type specific flags
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Wall -Wextra -Wdouble-promotion -Wshadow -Wcast-qual -Wnull-dereference -Wextra-semi -Wunreachable-code -Wuninitialized -Wmost -Wconversion")
Expand Down
2 changes: 1 addition & 1 deletion src/plssvm/backends/HPX/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ add_library(${PLSSVM_HPX_BACKEND_LIBRARY_NAME} SHARED ${PLSSVM_HPX_SOURCES})
target_link_libraries(${PLSSVM_HPX_BACKEND_LIBRARY_NAME} PUBLIC HPX::hpx)

# additional compilation flags
target_compile_options(${PLSSVM_HPX_BACKEND_LIBRARY_NAME} PRIVATE $<$<COMPILE_LANG_AND_ID:CXX,GNU,Clang>:-Wconversion>)
target_compile_options(${PLSSVM_HPX_BACKEND_LIBRARY_NAME} PRIVATE $<$<COMPILE_LANG_AND_ID:CXX,GNU,Clang,IntelLLVM>:-Wconversion>)

# link base library against HPX library
target_link_libraries(${PLSSVM_HPX_BACKEND_LIBRARY_NAME} PUBLIC ${PLSSVM_BASE_LIBRARY_NAME})
Expand Down
2 changes: 1 addition & 1 deletion src/plssvm/backends/OpenMP/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ else ()
endif ()

# additional compilation flags
target_compile_options(${PLSSVM_OPENMP_BACKEND_LIBRARY_NAME} PRIVATE $<$<COMPILE_LANG_AND_ID:CXX,GNU,Clang>:-Wconversion>)
target_compile_options(${PLSSVM_OPENMP_BACKEND_LIBRARY_NAME} PRIVATE $<$<COMPILE_LANG_AND_ID:CXX,GNU,Clang,IntelLLVM>:-Wconversion>)

# work-around since hipcc doesn't define _OPENMP
if (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
Expand Down

0 comments on commit ac80299

Please sign in to comment.