Back to home page

EIC code displayed by LXR

 
 

    


Warning, /acts/Detray/tests/unit_tests/device/hip/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 # This file is part of the ACTS project.
0002 #
0003 # Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 #
0005 # This Source Code Form is subject to the terms of the Mozilla Public
0006 # License, v. 2.0. If a copy of the MPL was not distributed with this
0007 # file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 message(STATUS "Building detray HIP unit tests")
0010 
0011 cmake_minimum_required(VERSION 3.21) # HIP language support requires minimum 3.21
0012 
0013 find_package(HIPToolkit)
0014 
0015 # Enable HIP as a language.
0016 enable_language(HIP)
0017 
0018 include(detray-compiler-options-hip)
0019 
0020 # make unit tests for multiple algebras
0021 # Currently vc and smatrix is not supported
0022 set(algebras "array")
0023 
0024 if(DETRAY_EIGEN_PLUGIN)
0025     list(APPEND algebras "eigen")
0026 endif()
0027 
0028 foreach(algebra ${algebras})
0029     detray_add_unit_test(hip_${CMAKE_HIP_PLATFORM}_${algebra}
0030        "detector_hip_kernel.hpp"
0031        "detector_hip.cpp"
0032        "detector_hip_kernel.hip"
0033 
0034        LINK_LIBRARIES GTest::gtest_main HIP::hiprt vecmem::hip detray::core
0035        detray::algebra_${algebra} detray::test_common detray::test_utils
0036     )
0037 
0038     # Make hipcc interpret .cpp files as .hip files to make linking work
0039     # (only needed for the amd backend)
0040     if(
0041         ("${CMAKE_HIP_PLATFORM}" STREQUAL "hcc")
0042         OR ("${CMAKE_HIP_PLATFORM}" STREQUAL "amd")
0043     )
0044         set_source_files_properties(detector_hip.cpp PROPERTIES LANGUAGE HIP)
0045     endif()
0046 
0047     # Add definitions for HIP + algebra
0048     target_compile_definitions(
0049         detray_unit_test_hip_${CMAKE_HIP_PLATFORM}_${algebra}
0050         PRIVATE ${algebra}=${algebra}
0051     )
0052 endforeach()