Skip to content

Commit

Permalink
Merge fix for no-circular-deps header compilation for CUDA
Browse files Browse the repository at this point in the history
This PR makes sure that all CUDA headers are being compiled with nvcc in the no-circular-deps mode.

Related PR: #783
  • Loading branch information
upsj authored Jun 7, 2021
2 parents 6f33ce7 + f87cd50 commit b6fa8bf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmake/build_helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ function(ginkgo_check_headers target)
list(FILTER HIP_HEADERS EXCLUDE REGEX "^test.*")

set(SOURCES "")
# if we have any CUDA files in there, compile everything as CUDA
if (CUDA_HEADERS)
set(CUDA_HEADERS ${CUDA_HEADERS} ${CXX_HEADERS})
set(CXX_HEADERS "")
if (HIP_HEADERS)
message(FATAL_ERROR "Mixing CUDA and HIP files in header check")
endif()
endif()
foreach(HEADER ${CUDA_HEADERS})
set(HEADER_SOURCEFILE "${CMAKE_CURRENT_BINARY_DIR}/${HEADER}.cu")
file(WRITE "${HEADER_SOURCEFILE}" "#include \"${HEADER}\"")
Expand Down

0 comments on commit b6fa8bf

Please sign in to comment.