Warning, /acts/Traccc/extern/rocThrust/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 # TRACCC library, part of the ACTS project (R&D line)
0002 #
0003 # (c) 2024-2026 CERN for the benefit of the ACTS project
0004 #
0005 # Mozilla Public License Version 2.0
0006
0007 # CMake include(s).
0008 cmake_minimum_required(VERSION 3.25)
0009 include(FetchContent)
0010
0011 # Tell the user what's happening.
0012 message(STATUS "Building rocThrust as part of the TRACCC project")
0013
0014 # Declare where to get rocThrust from.
0015 set(TRACCC_ROCTHRUST_SOURCE
0016 "URL;https://github.com/ROCm/rocThrust/archive/refs/tags/rocm-6.1.1.tar.gz;URL_MD5;038abf313688c00555fe1efc51e1307b"
0017 CACHE STRING
0018 "Source for rocThrust, when built as part of this project"
0019 )
0020 set(TRACCC_ROCTHRUST_PATCH
0021 "PATCH_COMMAND;patch;-p1;<;${CMAKE_CURRENT_SOURCE_DIR}/rocm-6.1.1.patch"
0022 CACHE STRING
0023 "Patch for rocThrust, when built as part of this project"
0024 )
0025 mark_as_advanced(TRACCC_ROCTHRUST_SOURCE TRACCC_ROCTHRUST_PATCH)
0026 FetchContent_Declare(
0027 rocThrust
0028 SYSTEM
0029 ${TRACCC_ROCTHRUST_SOURCE}
0030 ${TRACCC_ROCTHRUST_PATCH}
0031 )
0032
0033 # Settings for the rocThrust build.
0034 set(BUILD_TESTING FALSE)
0035 set(ROCM_WARN_TOOLCHAIN_VAR FALSE CACHE BOOL "Don't print ROCm warnings")
0036 set(ROCM_ERROR_TOOLCHAIN_VAR FALSE CACHE BOOL "Don't print ROCm errors")
0037 mark_as_advanced(ROCM_WARN_TOOLCHAIN_VAR ROCM_ERROR_TOOLCHAIN_VAR)
0038
0039 # The following is pretty horrendous. :-( If we let HIP_PLATFORM="amd" propagate
0040 # to the ROCm CMake files, at least with ROCm 6.0, the hip::device target gets
0041 # set up such that linking against it automatically adds "-x hip" to the
0042 # compiler flags of the client. Whether or not the source file is HIP or not.
0043 # I worked around this by telling rocThrust to "always use the NVIDIA platform".
0044 # In which case it doesn't try to be cute about such compiler flags. And then I
0045 # let the higher level configs (from CMake or Alpaka) sort out how
0046 # they would configure the build of various source files.
0047 set(HIP_PLATFORM "nvidia")
0048
0049 # Get it into the current directory.
0050 FetchContent_MakeAvailable(rocThrust)
0051
0052 # Set up an alias with the "imported name" of the rocThrust library.
0053 add_library(roc::rocthrust ALIAS rocthrust)