Warning, /acts/Detray/cmake/detray-compiler-options-hip.cmake 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 cmake_minimum_required(VERSION 3.21)
0010
0011 if(PROJECT_IS_TOP_LEVEL)
0012 include(detray-functions)
0013
0014 #find HIP
0015 find_package(HIP REQUIRED)
0016
0017 set(CMAKE_HIP_ARCHITECTURES gfx1031)
0018
0019 # Basic flags for all build modes.
0020 if(
0021 ("${CMAKE_HIP_PLATFORM}" STREQUAL "hcc")
0022 OR ("${CMAKE_HIP_PLATFORM}" STREQUAL "amd")
0023 )
0024 detray_add_flag( CMAKE_HIP_FLAGS "-Wall" )
0025 detray_add_flag( CMAKE_HIP_FLAGS "-Wextra" )
0026 detray_add_flag( CMAKE_HIP_FLAGS "-Wshadow" )
0027 detray_add_flag( CMAKE_HIP_FLAGS "-Wunused-local-typedefs" )
0028 detray_add_flag( CMAKE_HIP_FLAGS "-pedantic" )
0029 endif()
0030 # Generate debug symbols for the device code as well in a debug build.
0031 if(
0032 ("${CMAKE_HIP_PLATFORM}" STREQUAL "nvcc")
0033 OR ("${CMAKE_HIP_PLATFORM}" STREQUAL "nvidia")
0034 )
0035 detray_add_flag( CMAKE_HIP_FLAGS_DEBUG "-G" )
0036 detray_add_flag( CMAKE_HIP_FLAGS "--expt-relaxed-constexpr" )
0037 endif()
0038
0039 # Fail on warnings, if asked for that behaviour.
0040 if(DETRAY_FAIL_ON_WARNINGS)
0041 if(
0042 ("${CMAKE_HIP_PLATFORM}" STREQUAL "hcc")
0043 OR ("${CMAKE_HIP_PLATFORM}" STREQUAL "amd")
0044 )
0045 detray_add_flag( CMAKE_HIP_FLAGS "-Werror" )
0046 elseif(
0047 ("${CMAKE_HIP_PLATFORM}" STREQUAL "nvcc")
0048 OR ("${CMAKE_HIP_PLATFORM}" STREQUAL "nvidia")
0049 )
0050 detray_add_flag( CMAKE_HIP_FLAGS "-Werror all-warnings" )
0051 endif()
0052 endif()
0053 endif()