SWDEV-361630 - Enable hip build
Change-Id: Icdeaeff555d46e495c3de954b614168995a82a9f
[ROCm/clr commit: 1bc186323f]
Dieser Commit ist enthalten in:
@@ -0,0 +1,66 @@
|
||||
# Copyright (c) 2022 - 2023 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.
|
||||
|
||||
project(clr)
|
||||
cmake_minimum_required(VERSION 3.16.8)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
##########
|
||||
# Defaults
|
||||
##########
|
||||
if(NOT DEFINED ROCM_PATH)
|
||||
set(ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory.")
|
||||
endif()
|
||||
message(STATUS "ROCM Installation path(ROCM_PATH): ${ROCM_PATH}")
|
||||
|
||||
if(UNIX)
|
||||
set(CLR_DEFAULT_INSTALL_PREFIX "${ROCM_PATH}")
|
||||
endif()
|
||||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
set(CMAKE_INSTALL_PREFIX ${CLR_DEFAULT_INSTALL_PREFIX} CACHE PATH "Installation path for HIP and OCL" FORCE)
|
||||
endif()
|
||||
set(CPACK_INSTALL_PREFIX ${CLR_DEFAULT_INSTALL_PREFIX} CACHE PATH "Package Installation path for HIP and OCL")
|
||||
|
||||
if(IS_ABSOLUTE ${CMAKE_INSTALL_PREFIX})
|
||||
message(STATUS "HIP and OCL will be installed in: " ${CMAKE_INSTALL_PREFIX})
|
||||
else()
|
||||
message(FATAL_ERROR "Don't know where to install HIP and OCL. Please specify absolute path using -DCMAKE_INSTALL_PREFIX")
|
||||
endif()
|
||||
|
||||
set(CPACK_SET_DESTDIR ON CACHE BOOL "Installer package will install HIP and OCL to CMAKE_INSTALL_PREFIX instead of CPACK_PACKAGING_INSTALL_PREFIX")
|
||||
if (NOT CPACK_SET_DESTDIR)
|
||||
set(CPACK_PACKAGING_INSTALL_PREFIX "${ROCM_PATH}" CACHE PATH "Default installation path of HIP and OCL installer package")
|
||||
endif()
|
||||
|
||||
option(CLR_BUILD_HIP "Build HIP" ON)
|
||||
option(CLR_BUILD_OCL "Build OCL" OFF)
|
||||
|
||||
#############
|
||||
# Build steps
|
||||
#############
|
||||
if(CLR_BUILD_HIP OR CLR_BUILD_OCL)
|
||||
add_subdirectory(rocclr)
|
||||
endif()
|
||||
if(CLR_BUILD_HIP)
|
||||
add_subdirectory(hipamd)
|
||||
endif()
|
||||
if(CLR_BUILD_OCL)
|
||||
add_subdirectory(opencl)
|
||||
endif()
|
||||
@@ -52,15 +52,15 @@ if(HIP_PLATFORM STREQUAL "amd" )
|
||||
|
||||
#TODO:This do not belong in BINARY package.
|
||||
#Keeping it as is for now
|
||||
install(FILES ${CMAKE_BINARY_DIR}/.hipInfo DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT binary)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/hipamd/.hipInfo DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT binary)
|
||||
|
||||
install(FILES ${CMAKE_BINARY_DIR}/hip-config.cmake ${CMAKE_BINARY_DIR}/hip-config-version.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/hip COMPONENT binary)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/hipamd/hip-config.cmake ${CMAKE_BINARY_DIR}/hipamd/hip-config-version.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/hip COMPONENT binary)
|
||||
install ( EXPORT hip-targets FILE hip-targets.cmake NAMESPACE hip:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/hip COMPONENT binary)
|
||||
|
||||
install(FILES ${CMAKE_BINARY_DIR}/src/hip-lang-config.cmake ${CMAKE_BINARY_DIR}/src/hip-lang-config-version.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/hip-lang COMPONENT binary)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/hipamd/src/hip-lang-config.cmake ${CMAKE_BINARY_DIR}/hipamd/src/hip-lang-config-version.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/hip-lang COMPONENT binary)
|
||||
install ( EXPORT hip-lang-targets FILE hip-lang-targets.cmake NAMESPACE hip-lang:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/hip-lang COMPONENT binary)
|
||||
|
||||
install(FILES ${CMAKE_BINARY_DIR}/hiprtc-config.cmake ${CMAKE_BINARY_DIR}/hiprtc-config-version.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/hiprtc COMPONENT binary)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/hipamd/hiprtc-config.cmake ${CMAKE_BINARY_DIR}/hipamd/hiprtc-config-version.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/hiprtc COMPONENT binary)
|
||||
install ( EXPORT hiprtc-targets FILE hiprtc-targets.cmake NAMESPACE hiprtc:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/hiprtc COMPONENT binary)
|
||||
|
||||
endif()#End HIP_PLATFORM = "amd"
|
||||
@@ -85,11 +85,11 @@ install(DIRECTORY ${hip_SOURCE_DIR}/include/hip/amd_detail
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hip COMPONENT dev)
|
||||
install(DIRECTORY ${hip_SOURCE_DIR}/include/hip/nvidia_detail
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hip COMPONENT dev)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/include/hip/amd_detail/hip_prof_str.h
|
||||
install(FILES ${CMAKE_BINARY_DIR}/hipamd/include/hip/amd_detail/hip_prof_str.h
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hip/amd_detail COMPONENT dev)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/include/hip/hip_version.h
|
||||
install(FILES ${CMAKE_BINARY_DIR}/hipamd/include/hip/hip_version.h
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hip COMPONENT dev)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/.hipVersion DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT dev)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/hipamd/.hipVersion DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT dev)
|
||||
install(DIRECTORY ${HIP_COMMON_DIR}/cmake/ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/hip COMPONENT dev)
|
||||
#End dev files install
|
||||
|
||||
|
||||
@@ -56,7 +56,6 @@ option(DISABLE_DIRECT_DISPATCH "Disable Direct Dispatch" OFF)
|
||||
option(BUILD_SHARED_LIBS "Build the shared library" ON)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
|
||||
find_package(ROCclr)
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
add_library(amdhip64 SHARED)
|
||||
@@ -215,7 +214,7 @@ option(USE_PROF_API "Enable roctracer integration" ON)
|
||||
# Enable profiling API
|
||||
if(USE_PROF_API)
|
||||
set(PROF_API_STR "${PROJECT_BINARY_DIR}/include/hip/amd_detail/hip_prof_str.h")
|
||||
set(PROF_API_STR_IN "${CMAKE_SOURCE_DIR}/include/hip/amd_detail/hip_prof_str.h")
|
||||
set(PROF_API_STR_IN "${CMAKE_SOURCE_DIR}/hipamd/include/hip/amd_detail/hip_prof_str.h")
|
||||
set(PROF_API_HDR "${HIP_COMMON_INCLUDE_DIR}/hip/hip_runtime_api.h")
|
||||
set(PROF_API_SRC "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
set(PROF_API_GEN "${CMAKE_CURRENT_SOURCE_DIR}/hip_prof_gen.py")
|
||||
|
||||
@@ -44,7 +44,6 @@ if(ADDRESS_SANITIZER)
|
||||
endif()
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
|
||||
find_package(ROCclr)
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
add_library(amdocl SHARED)
|
||||
|
||||
@@ -40,7 +40,7 @@ find_package(Threads REQUIRED)
|
||||
|
||||
find_package(AMD_OPENCL)
|
||||
|
||||
add_library(rocclr STATIC)
|
||||
add_library(rocclr OBJECT)
|
||||
|
||||
include(ROCclrCompilerOptions)
|
||||
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren