Skip to content

Commit

Permalink
fix no-circular-deps header compilation for CUDA
Browse files Browse the repository at this point in the history
  • Loading branch information
upsj committed Jun 4, 2021
1 parent b621017 commit 553e6b1
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 553e6b1

Please sign in to comment.