Skip to content

Commit

Permalink
CMake updates, copyright
Browse files Browse the repository at this point in the history
  • Loading branch information
Stewart Martin-Haugh stewart.martin-haugh@stfc.ac.uk committed May 16, 2024
1 parent 1ffe1d8 commit 84c3f24
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ jobs:
container: ghcr.io/acts-project/ubuntu2004:v30
options: -DTRACCC_USE_ROOT=FALSE
- name: HIP
container: ghcr.io/acts-project/ubuntu2204_rocm_clang
options: -DTRACCC_BUILD_HIP=TRUE
container: ghcr.io/acts-project/ubuntu2204_rocm_clang:sha-3a6b0b2
options: -DTRACCC_BUILD_HIP=TRUE -DTRACCC_SETUP_ROCTHRUST=TRUE
- name: CUDA
container: ghcr.io/acts-project/ubuntu2004_cuda:v30
options: -DTRACCC_BUILD_CUDA=TRUE
Expand Down
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,12 @@ set( TRACCC_THRUST_OPTIONS "" CACHE STRING
mark_as_advanced( TRACCC_THRUST_OPTIONS )
thrust_create_target( traccc::Thrust ${TRACCC_THRUST_OPTIONS} )

option( TRACCC_SETUP_ROCTHRUST
"Set up the rocThrust target(s) explicitly" FALSE )
option( TRACCC_USE_SYSTEM_ROCTHRUST
"Pick up an existing installation of rocThrust from the build environment"
${TRACCC_USE_SYSTEM_LIBS} )
if( TRACCC_BUILD_HIP )
if( TRACCC_SETUP_ROCTHRUST )
if( TRACCC_USE_SYSTEM_ROCTHRUST )
find_package( rocThrust REQUIRED )
else()
Expand Down
12 changes: 0 additions & 12 deletions cmake/traccc-compiler-options-hip.cmake

This file was deleted.

1 change: 0 additions & 1 deletion device/alpaka/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ if(alpaka_ACC_GPU_CUDA_ENABLE)
elseif(alpaka_ACC_GPU_HIP_ENABLE)
enable_language(HIP)
find_package( HIPToolkit REQUIRED )
include( traccc-compiler-options-hip )
list(APPEND PRIVATE_LIBRARIES HIP::hiprt vecmem::hip)
endif()

Expand Down
1 change: 0 additions & 1 deletion examples/run/alpaka/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ if(alpaka_ACC_GPU_CUDA_ENABLE)
list (APPEND LIBRARIES vecmem::cuda traccc::cuda)
elseif(alpaka_ACC_GPU_HIP_ENABLE)
enable_language(HIP)
include( traccc-compiler-options-hip )
find_package( HIPToolkit REQUIRED )
list(APPEND LIBRARIES HIP::hiprt vecmem::hip)
endif()
Expand Down
19 changes: 17 additions & 2 deletions extern/rocThrust/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,25 @@ message( STATUS "Building rocThrust as part of the TRACCC project" )

# Declare where to get rocThrust from.
set( TRACCC_ROCTHRUST_SOURCE
"GIT_REPOSITORY;https://github.com/ROCm/rocThrust;GIT_TAG;rocm-6.1.0"
"GIT_REPOSITORY;https://github.com/ROCm/rocThrust.git;GIT_TAG;rocm-6.1.0"
CACHE STRING "Source for Thrust, when built as part of this project" )
mark_as_advanced( TRACCC_ROCTHRUST_SOURCE )
FetchContent_Declare( rocThrust ${TRACCC_ROCTHRUST_SOURCE} )

#Turn off build testing
if( DEFINED CACHE{BUILD_TESTING} )
set( _buildTestingValue ${BUILD_TESTING} )
endif()
set( BUILD_TESTING FALSE CACHE INTERNAL "Forceful setting of BUILD_TESTING" )

# Get it into the current directory.
FetchContent_MakeAvailable( rocthrust )
FetchContent_MakeAvailable( rocThrust )

# Reset the BUILD_TESTING variable.
if( DEFINED _buildTestingValue )
set( BUILD_TESTING ${_buildTestingValue} CACHE BOOL "Turn tests on/off"
FORCE )
unset( _buildTestingValue )
else()
unset( BUILD_TESTING CACHE )
endif()
7 changes: 6 additions & 1 deletion tests/alpaka/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ if(alpaka_ACC_GPU_CUDA_ENABLE)
elseif(alpaka_ACC_GPU_HIP_ENABLE)
enable_language(HIP)
set_source_files_properties(alpaka_basic.cpp PROPERTIES LANGUAGE HIP)
include( traccc-compiler-options-hip )
list(APPEND DEVICE_LIBRARIES vecmem::hip)
endif()

Expand All @@ -24,3 +23,9 @@ traccc_add_test( alpaka
vecmem::core
${DEVICE_LIBRARIES}
)

#Can only do this once target is defined, so need another if here
if(alpaka_ACC_GPU_HIP_ENABLE)
set_target_properties( traccc_test_alpaka PROPERTIES
POSITION_INDEPENDENT_CODE TRUE )
endif()
10 changes: 9 additions & 1 deletion tests/hip/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# TRACCC library, part of the ACTS project (R&D line)
#
# (c) 2024 CERN for the benefit of the ACTS project
#
# Mozilla Public License Version 2.0

enable_language(HIP)
include( traccc-compiler-options-hip )
traccc_add_test(
hip
# Define the sources for the test.
Expand All @@ -10,3 +15,6 @@ traccc_add_test(
vecmem::core
vecmem::hip
)

set_target_properties( traccc_test_hip PROPERTIES
POSITION_INDEPENDENT_CODE TRUE )
2 changes: 1 addition & 1 deletion tests/hip/test_thrust.hip
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** TRACCC library, part of the ACTS project (R&D line)
*
* (c) 2023 CERN for the benefit of the ACTS project
* (c) 2024 CERN for the benefit of the ACTS project
*
* Mozilla Public License Version 2.0
*/
Expand Down

0 comments on commit 84c3f24

Please sign in to comment.