Skip to content

Commit

Permalink
Fix HIP source
Browse files Browse the repository at this point in the history
  • Loading branch information
sethrj committed Feb 5, 2024
1 parent f856f79 commit 7c4d97c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
12 changes: 11 additions & 1 deletion cmake/CeleritasAddTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ function(celeritas_add_test SOURCE_FILE)
add_executable(${_TARGET} "${SOURCE_FILE}" ${PARSE_SOURCES})

# Note: for static linking the library order is relevant.

celeritas_target_link_libraries(${_TARGET}
${CELERITASTEST_LINK_LIBRARIES}
${PARSE_LINK_LIBRARIES}
Expand Down Expand Up @@ -365,6 +364,17 @@ function(celeritas_add_test SOURCE_FILE)
list(APPEND _LABELS gpu)
endif()
endif()
if(PARSE_SOURCES AND CELERITAS_USE_HIP)
celeritas_sources_contains_cuda(_cuda_sources ${PARSE_SOURCES})
if(_cuda_sources)
# When building Celeritas libraries, we put HIP/CUDA files in shared .cu
# suffixed files. Override the language if using HIP.
set_source_files_properties(
${_cuda_sources}
PROPERTIES LANGUAGE HIP
)
endif()
endif()
if(PARSE_TIMEOUT)
list(APPEND _COMMON_PROPS TIMEOUT ${PARSE_TIMEOUT})
endif()
Expand Down
11 changes: 0 additions & 11 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,6 @@ celeritas_target_include_directories(testcel_harness
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
)

#-----------------------------------------------------------------------------#
# HIP SUPPORT
#-----------------------------------------------------------------------------#

if(CELERITAS_USE_HIP)
file(GLOB_RECURSE _cufiles "${CMAKE_CURRENT_SOURCE_DIR}/*.cu")
set_source_files_properties(${_cufiles}
PROPERTIES LANGUAGE HIP
)
endif()

#-----------------------------------------------------------------------------#
# TEST OPTIONS
#-----------------------------------------------------------------------------#
Expand Down

0 comments on commit 7c4d97c

Please sign in to comment.