SWDEV-523300 - Add the new option to build HIP (#179)

Add the new cmake option AMD_COMPUTE_WIN  to build HIP on Windows
from the public github. AMD_COMPUTE_WIN should point to a special
repo with the PAL static libs

[ROCm/clr commit: a3effa16f1]
Cette révision appartient à :
Andryeyev, German
2025-04-22 11:35:04 -04:00
révisé par GitHub
Parent ba5a9a5395
révision 0569c7713c
3 fichiers modifiés avec 55 ajouts et 1 suppressions
+8
Voir le fichier
@@ -33,6 +33,14 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
add_compile_options(-D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH)
endif()
endif()
if (AMD_COMPUTE_WIN)
add_compile_options("/MT")
set(AMD_LIBELF_PATH "${AMD_COMPUTE_WIN}/hsail-compiler/lib/loaders/elf/utils/libelf")
set(AMD_SC_PATH "${AMD_COMPUTE_WIN}/sc")
message("Public Compute Windows build path: ${AMD_COMPUTE_WIN}, SC: ${AMD_SC_PATH}, LibElf: ${AMD_LIBELF_PATH}")
endif()
option(CLR_BUILD_HIP "Build HIP" OFF)
option(CLR_BUILD_OCL "Build OCL" OFF)
+42
Voir le fichier
@@ -0,0 +1,42 @@
# Copyright (c) 2025 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
if(AMD_PAL_LIB_FOUND)
return()
endif()
find_path(AMD_PAL_LIB_INCLUDE_DIR pal.h
HINTS
${AMD_COMPUTE_WIN}/pal
PATHS
${CMAKE_SOURCE_DIR}/pal
${CMAKE_SOURCE_DIR}/../pal
${CMAKE_SOURCE_DIR}/../../pal
${CMAKE_SOURCE_DIR}/../../../pal
PATH_SUFFIXES
inc/core)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(AMD_PAL_LIB
"\nPAL not found"
AMD_PAL_LIB_INCLUDE_DIR)
mark_as_advanced(AMD_PAL_LIB_INCLUDE_DIR)
add_subdirectory("${AMD_PAL_LIB_INCLUDE_DIR}/../.." ${CMAKE_CURRENT_BINARY_DIR}/pal)
+5 -1
Voir le fichier
@@ -51,8 +51,12 @@ set(PAL_BUILD_PHOENIX1 ON)
# Please do not set above flags in staging and mainline in new ASICs
set(PAL_BRANCHDEFS ON)
if (AMD_COMPUTE_WIN)
find_package(AMD_PAL_LIB)
else()
find_package(AMD_PAL)
endif()
find_package(AMD_PAL)
find_package(AMD_HSA_LOADER)
target_sources(rocclr PRIVATE