Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

Fix OpenCL headers 2021.04.29 compatibility #25

Open
wants to merge 102 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
c370349
SWDEV-273235 - Initial support for Windows CMake
vsytch May 11, 2021
d53a119
SWDEV-287137 - Add blocking signal logic
gandryey May 27, 2021
48e9672
SWDEV-2 - Change OpenCL version number from 3315 to 3316
chaunceyhui May 28, 2021
520374b
SWDEV-273235 - Fix Windows CMake build
vsytch May 27, 2021
25c8018
SWDEV-2 - Change OpenCL version number from 3316 to 3317
chaunceyhui May 29, 2021
54a73ab
SWDEV-240804 - Add coarse grain memory support
gandryey May 31, 2021
a61fe25
SWDEV-283267 - Fix a bug where rocclr appends compiler options twice
Jun 2, 2021
a1de4a0
SWDEV-2 - Change OpenCL version number from 3317 to 3318
chaunceyhui Jun 3, 2021
ab6de44
SWDEV-273235 - Find UGL headers based on AMD_DRIVERS_PATH
vsytch Jun 2, 2021
75ab9f7
SWDEV-240804 - Update ReadMostly attribute
gandryey Jun 3, 2021
2876b4b
SWDEV-288690 - Updating the return value with roc::Device::init
kjayapra-amd May 28, 2021
5afdc36
SWDEV-2 - Change OpenCL version number from 3318 to 3319
chaunceyhui Jun 4, 2021
ba99d85
SWDEV-286092 - Enable handler for marker always
saleelk Jun 2, 2021
a6e6b2a
SWDEV-2 - Change OpenCL version number from 3319 to 3320
chaunceyhui Jun 5, 2021
0b8c154
SWDEV-289548 - [PAL] Revive Raven 2 support
vsytch Jun 3, 2021
322c009
SWDEV-2 - Change OpenCL version number from 3320 to 3321
chaunceyhui Jun 6, 2021
7c0b956
SWDEV-284671 - Add HW event wait to improve hipDeviceSynchronize
gandryey Jun 7, 2021
512ff9e
SWDEV-276396 - Implement hipDeviceReset
chrispaquot Jun 7, 2021
ee3eaeb
SWDEV-289250 - Should return a nullptr for PAL so we can assume it's …
Jun 9, 2021
d1bbfab
SWDEV-2 - Change OpenCL version number from 3321 to 3322
chaunceyhui Jun 10, 2021
154fb79
SWDEV-247372 - Active wait timeout env var
saleelk Jun 9, 2021
c841045
SWDEV-290306 - [LNX][Navi24][mainline]clinfo test failed on Navi24
AlexXAmd May 5, 2021
b79ae29
SWDEV-286092 - Use Barrier Header for event
saleelk Jun 10, 2021
282e191
SWDEV-290371 - Add lock protection for signal
gandryey Jun 10, 2021
4c2e7ca
SWDEV-290474 - [Lnx][VanGogh] Add VanGogh support
aaliuamd Jun 11, 2021
6c41e69
SWDEV-2 - Change OpenCL version number from 3322 to 3323
chaunceyhui Jun 11, 2021
0a9065b
SWDEV-247372 - Reset hasPendingDispatch
saleelk Jun 14, 2021
5129eae
SWDEV-2 - Change OpenCL version number from 3323 to 3324
chaunceyhui Jun 15, 2021
995513a
SWDEV-286446 - This patch enables stream operations on vega10, vega20…
Jun 4, 2021
be3ec5c
SWDEV-2 - Change OpenCL version number from 3324 to 3325
chaunceyhui Jun 16, 2021
b15799c
SWDEV-290160 - Don't send notification for batch markers
gandryey Jun 16, 2021
115f7a3
SWDEV-240806 - Release resources in Command::terminate for HIP
chrispaquot Jun 16, 2021
3352fc9
SWDEV-2 - Change OpenCL version number from 3325 to 3326
chaunceyhui Jun 17, 2021
91e48d7
SWDEV-247372 - Add logging for debug
saleelk Jun 17, 2021
3e46c18
SWDEV-2 - Change OpenCL version number from 3326 to 3327
chaunceyhui Jun 18, 2021
990d056
SWDEV-290122 - OpenGL tests fails with CL_MEM_ALLOCATION_ERROR
AlexXAmd Jun 15, 2021
18ff9bc
SWDEV-290160 - Switch to global HSA signals
gandryey Jun 18, 2021
3a2bbad
SWDEV-2 - Change OpenCL version number from 3327 to 3328
chaunceyhui Jun 22, 2021
83309d8
SWDEV-290901 - update ROC_ACTIVE_WAIT_TIMEOUT to 50us
Jun 17, 2021
97c20f4
SWDEV-287088 - Workaround VM page fault on Windows
JasonTTang Jun 20, 2021
71ed43e
SWDEV-2 - Change OpenCL version number from 3328 to 3329
chaunceyhui Jun 23, 2021
00ea40d
SWDEV-274815 - [PAL] Navi24 support
vsytch Jun 10, 2021
7c8b93b
SWDEV-292018 - Avoid marker if queue is empty
gandryey Jun 23, 2021
73f0002
SWDEV-2 - Change OpenCL version number from 3329 to 3330
chaunceyhui Jun 25, 2021
f259dd5
SWDEV-285333 - Introduce Address sanitizer hostcall service
pvellien May 7, 2021
debd929
SWDEV-2 - Change OpenCL version number from 3330 to 3331
chaunceyhui Jun 29, 2021
de621fd
SWDEV-286322 - Add .gitattribute
jujiang-del Jun 28, 2021
0c400c4
SWDEV-2 - Change OpenCL version number from 3331 to 3332
chaunceyhui Jun 30, 2021
5d71744
SWDEV-289378 - Avoid CPU TS overwrite if GPU TS is available
gandryey Jun 30, 2021
2df4bac
SWDEV-289378 - Avoid CPU TS overwrite if GPU TS is available
gandryey Jul 6, 2021
65c1c12
SWDEV-260448 - Honor NUMACTL for Direct Dispatch
saleelk Jul 2, 2021
471e665
SWDEV-2 - Change OpenCL version number from 3332 to 3333
chaunceyhui Jul 7, 2021
3ed980b
SWDEV-293742 - Update copyright end year VDI repo
agunashe Jul 2, 2021
678a33b
SWDEV-2 - Change OpenCL version number from 3333 to 3334
chaunceyhui Jul 8, 2021
3dc344c
SWDEV-273235 - Restore missing LinuxPro option
vsytch Jul 9, 2021
bd6a2c5
SWDEV-2 - Change OpenCL version number from 3334 to 3335
chaunceyhui Jul 10, 2021
f9d6df3
SWDEV-292820 - Add a new notify lock
gandryey Jul 9, 2021
d9ef43f
SWDEV-273235 - Remove dependency on ADL
vsytch Jul 9, 2021
764f916
SWDEV-2 - Change OpenCL version number from 3335 to 3336
chaunceyhui Jul 13, 2021
d7a7aa6
SWDEV-290685 - Dispatch a barrier packet with acquire system scope to…
Jul 13, 2021
e5100cf
SWDEV-2 - Change OpenCL version number from 3336 to 3337
chaunceyhui Jul 14, 2021
177776b
SWDEV-290495 - Add HSA_AMD_AGENT_INFO_SVM_DIRECT_HOST_ACCESS query
gandryey Jul 13, 2021
b280643
SWDEV-295144 - Typecast arena mem ptr(0x2) to void*, otherwise result…
kjayapra-amd Jul 14, 2021
e0e379a
SWDEV-2 - Change OpenCL version number from 3337 to 3338
chaunceyhui Jul 15, 2021
94c6696
SWDEV-273235 - [PAL] Ignore system headers on Linux
vsytch Jul 14, 2021
9fbe7c0
SWDEV-290685 - Relacing release fence instead of acquire for hipStrea…
Jul 14, 2021
2cdadae
SWDEV-292018 - Switch to internal signals for markers
gandryey Jul 14, 2021
e62e229
SWDEV-2 - Change OpenCL version number from 3338 to 3339
chaunceyhui Jul 16, 2021
6324e3c
SWDEV-290384 - Disable HSA callback for any host wait
gandryey Jul 16, 2021
ffbf6e0
SWDEV-294514 - Limit HIP-GL interop logic to HIP
vsytch Jul 16, 2021
3c0a478
SWDEV-283981 - [PAL] Support hostcall SQ interrupt
vsytch Jun 28, 2021
cc17b1f
SWDEV-290384 - Enable active wait on CPU if HIP requested
gandryey Jul 19, 2021
95b4993
SWDEV-291787 - Fix persistent direct map
jujiang-del Jul 13, 2021
5b485e0
SWDEV-291787 - Fix Windows build
vsytch Jul 19, 2021
ff997c7
SWDEV-2 - Change OpenCL version number from 3339 to 3340
chaunceyhui Jul 20, 2021
ac1f5a8
SWDEV-283981 - Revert "SWDEV-283981 - [PAL] Support hostcall SQ inter…
vsytch Jul 20, 2021
871e8f8
SWDEV-2 - Change OpenCL version number from 3340 to 3341
chaunceyhui Jul 21, 2021
dd3fed2
SWDEV-292523 - [vdi]Change in the signature of streamOperations APIs,…
Jul 16, 2021
1c46ab4
SWDEV-292021 - Fix Device Reset
satyanveshd Jul 20, 2021
5911c06
SWDEV-2 - Change OpenCL version number from 3341 to 3342
chaunceyhui Jul 22, 2021
37d8711
SWDEV-294027 - [Lnx][YC] Add Yellow Carp support
aaliuamd Jul 7, 2021
36b5908
SWDEV-2 - Change OpenCL version number from 3342 to 3343
chaunceyhui Jul 23, 2021
b11e88c
SWDEV-295251 - Remove waitEvent check in append
Jul 26, 2021
bedef4c
SWDEV-240806 - Add methods to update kernel command parameters
Jul 22, 2021
cfe013d
SWDEV-2 - Change OpenCL version number from 3343 to 3344
chaunceyhui Jul 27, 2021
f96fa05
SWDEV-293519 - [PAL] Limit mgpu SVM logic only to mgpu cases
vsytch Jul 27, 2021
6cb3c1c
SWDEV-240806 - Fix Windows build
vsytch Jul 28, 2021
6615299
SWDEV-295251 - Avoid marker if queue is empty for DD to fix MT issue
Jul 27, 2021
691e495
SWDEV-2 - Change OpenCL version number from 3344 to 3345
chaunceyhui Jul 29, 2021
69a02ff
SWDEV-295144 - Change uint64_t to size_t to fix failure on 32-bit ope…
kjayapra-amd Jul 26, 2021
882ed49
SWDEV-288853 - [OpenCL]: ASIC 1013 Bringup
AlexXAmd May 31, 2021
375e4c6
SWDEV-296911 - Enable clgl interop for both MesaGL and OrcaGL
JasonTTang Jul 28, 2021
a70d777
SWDEV-293742 - Remove external refs
gargrahul Jul 29, 2021
035733c
SWDEV-2 - Change OpenCL version number from 3345 to 3346
chaunceyhui Jul 30, 2021
0afd6e1
SWDEV-273235 - Add ROCclrCompilerOptions cmake module
vsytch Jul 30, 2021
ab15da4
SWDEV-283981 - [PAL] Support hostcall SQ interrupt
vsytch Jul 30, 2021
152a816
SWDEV-2 - Change OpenCL version number from 3346 to 3347
chaunceyhui Jul 31, 2021
613cf58
SWDEV-297215 - Set image descriptor as per the HSA specification for …
Jul 30, 2021
100ddb5
SWDEV-2 - Change OpenCL version number from 3347 to 3348
chaunceyhui Aug 2, 2021
d14ee44
SWDEV-296329 - Add lock protection for Timestamp update
gandryey Jul 30, 2021
96724e0
SWDEV-2 - Change OpenCL version number from 3348 to 3349
chaunceyhui Aug 3, 2021
8243fe4
Fix OpenCL headers 2021.04.29 compatibility
devurandom Sep 6, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Set the default behavior, in case people don't have core.autolf set.
* text=auto

# Explicitly declare text files you want to always be normalized and converted
# to have LF line endings on checkout.
*.c text eol=lf
*.cpp text eol=lf
*.cc text eol=lf
*.h text eol=lf
*.hpp text eol=lf
*.txt text eol=lf

# Define files to support auto-remove trailing white space
# Need to run the command below, before add modified file(s) to the staging area
# git config filter.trimspace.clean 'sed -e "s/[[:space:]]*$//g"'
*.cpp filter=trimspace
*.c filter=trimspace
*.h filter=trimspacecpp
*.hpp filter=trimspace
*.md filter=trimspace

318 changes: 6 additions & 312 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Advanced Micro Devices, Inc. All Rights Reserved.
# Copyright (c) 2017 - 2021 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
Expand All @@ -20,317 +20,11 @@

cmake_minimum_required(VERSION 3.5)

project(ROCclr VERSION "1.0.0" LANGUAGES C CXX)
project(ROCclr)

include(CMakePackageConfigHelpers)

#decide whether .so is to be build or .a
set(BUILD_SHARED_LIBS ON CACHE BOOL "Build shared library (.so) or not.")

#example command:

#cmake -DOPENCL_DIR=/path to/opencl ..

set(ROCCLR_CONFIG_NAME ROCclrConfig.cmake)
set(ROCCLR_TARGETS_NAME rocclr-targets.cmake)
set(ROCCLR_VERSION_NAME rocclr-config-version.cmake)
set(ROCCLR_PACKAGE_PREFIX lib/cmake/rocclr)
set(ROCCLR_PREFIX_CODE)
set(ROCCLR_TARGETS_PATH
"${CMAKE_CURRENT_BINARY_DIR}/${ROCCLR_PACKAGE_PREFIX}/${ROCCLR_TARGETS_NAME}")
set(ROCCLR_VERSION_PATH
"${CMAKE_CURRENT_BINARY_DIR}/${ROCCLR_PACKAGE_PREFIX}/${ROCCLR_VERSION_NAME}")

# Generate the build-tree package.
configure_file("cmake/${ROCCLR_CONFIG_NAME}.in"
"${ROCCLR_PACKAGE_PREFIX}/${ROCCLR_CONFIG_NAME}"
@ONLY)

write_basic_package_version_file("${ROCCLR_VERSION_PATH}"
VERSION "${ROCclr_VERSION}"
COMPATIBILITY SameMajorVersion)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")

# FIXME: Handling legacy custom boolean matching "yes" or "no"
if(DEFINED USE_COMGR_LIBRARY)
if(${USE_COMGR_LIBRARY} MATCHES "yes")
set(USE_COMGR_LIBRARY ON)
elseif(${USE_COMGR_LIBRARY} MATCHES "no")
set(USE_COMGR_LIBRARY OFF)
endif()
endif()

option(USE_COMGR_LIBRARY "Use comgr library" ON)

find_package(amd_comgr REQUIRED CONFIG
PATHS
/opt/rocm/
PATH_SUFFIXES
cmake/amd_comgr
lib/cmake/amd_comgr
)
message(STATUS "Code Object Manager found at ${amd_comgr_DIR}.")

find_package(hsa-runtime64 1.3 REQUIRED CONFIG
PATHS
/opt/rocm/
PATH_SUFFIXES
cmake/hsa-runtime64
lib/cmake/hsa-runtime64
lib64/cmake/hsa-runtime64
)
message(STATUS "HSA Runtime found at ${hsa-runtime64_DIR}.")

if( NOT OPENCL_DIR )
find_path(OPENCL_INCLUDE_DIR
NAMES OpenCL/cl.h CL/cl.h
PATH_SUFFIXES include opencl/include inc include/x86_64 include/x64
PATHS /opt/rocm
DOC "OpenCL include header OpenCL/cl.h or CL/cl.h"
)

if( NOT OPENCL_INCLUDE_DIR )
unset(OPENCL_INCLUDE_DIR CACHE)
set(OPENCL_INCLUDE_DIR "" CACHE PATH "" FORCE )
endif()
message(STATUS "Opencl found at ${OPENCL_INCLUDE_DIR}.")
endif()



set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR
(CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
add_definitions(
# Enabling -Wextra or -pedantic will cause
# thousands of warnings. Keep things simple for now.
-Wall
# Makefile build adds -fno-strict-aliasing instead.
-Wno-strict-aliasing
# This one seems impossible to fix for now.
# There are hundreds of instances of unused vars/functions
# throughout the code base.
-Wno-unused-variable)
endif()

add_definitions(-D__x86_64__ -DOPENCL_MAJOR=2 -DOPENCL_MINOR=1 -DCL_TARGET_OPENCL_VERSION=220 -DATI_OS_LINUX -DATI_ARCH_X86 -DLITTLEENDIAN_CPU -DATI_BITS_64 -DWITH_TARGET_AMDGCN -DOPENCL_EXPORTS -DCL_USE_DEPRECATED_OPENCL_1_0_APIS -DCL_USE_DEPRECATED_OPENCL_1_1_APIS -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_USE_DEPRECATED_OPENCL_2_0_APIS -DWITH_LIGHTNING_COMPILER)
add_definitions(-DOPENCL_C_MAJOR=2 -DOPENCL_C_MINOR=0)

set(CMAKE_SHARED_LINKER_FLAGS "-Wl,-Bsymbolic -Wl,--unresolved-symbols=report-all")
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)

if(CMAKE_BUILD_TYPE MATCHES "^Debug$")
add_definitions(-DDEBUG)
endif()

if(DEV_LOG_ENABLE MATCHES "yes")
add_definitions(-DDEV_LOG_ENABLE)
endif()

option(BUILD_LINUXPRO "Build LinuxPro" OFF)
if (BUILD_LINUXPRO)
message(STATUS "Building LinuxPro")
add_definitions(-DROCCLR_DISABLE_PREVEGA)
add_definitions(-DROCCLR_ENABLE_GL_SHARING)
endif()

option(BUILD_PAL "Build PAL backend" OFF)
if (BUILD_PAL)
add_subdirectory(device/pal)

add_subdirectory(compiler/sc/HSAIL)
else ()
add_subdirectory(device/rocm)
endif()

set(oclruntime_src
thread/thread.cpp
thread/monitor.cpp
thread/semaphore.cpp
utils/flags.cpp
utils/debug.cpp
device/appprofile.cpp
device/device.cpp
device/hwdebug.cpp
device/blitcl.cpp
device/blit.cpp
device/devkernel.cpp
device/devwavelimiter.cpp
device/devprogram.cpp
device/devhcprintf.cpp
device/devhcmessages.cpp
device/devhostcall.cpp
device/comgrctx.cpp
device/hsailctx.cpp
platform/activity.cpp
platform/kernel.cpp
platform/context.cpp
platform/command.cpp
platform/ndrange.cpp
platform/runtime.cpp
platform/memory.cpp
platform/program.cpp
platform/commandqueue.cpp
platform/agent.cpp
os/os_win32.cpp
os/alloc.cpp
os/os.cpp
os/os_posix.cpp
compiler/lib/utils/options.cpp
elf/elf.cpp
)

add_library(amdrocclr_static STATIC ${oclruntime_src})

set_target_properties(amdrocclr_static PROPERTIES POSITION_INDEPENDENT_CODE ON)

target_include_directories(amdrocclr_static
PUBLIC
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/device>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/device/rocm>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/compiler/lib/include>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/compiler/lib>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/compiler/lib/backends/common>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/elf>
$<BUILD_INTERFACE:${OPENCL_DIR}>
# GL and EGL headers.
$<BUILD_INTERFACE:${OPENCL_DIR}/khronos/headers>
$<BUILD_INTERFACE:${OPENCL_DIR}/khronos/headers/opencl2.2>
$<TARGET_PROPERTY:amd_comgr,INTERFACE_INCLUDE_DIRECTORIES>)

if(USE_COMGR_LIBRARY)
# FIXME: This should not be part of the public interface. Downstream
# users need to add these definitions. This should be defined in a
# config header here so other builds don't need to be aware of this.
if(${BUILD_SHARED_LIBS})
target_compile_definitions(amdrocclr_static PUBLIC USE_COMGR_LIBRARY COMGR_DYN_DLL)
else()
target_compile_definitions(amdrocclr_static PUBLIC USE_COMGR_LIBRARY)
endif()
#Needed here to export as transitive dependency in rocclr-targets.cmake
target_link_libraries(amdrocclr_static PRIVATE amd_comgr)
if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
message(AUTHOR_WARNING "ROCclr is being built as a standalone project. This isn't supported anymore.")
endif()

target_link_libraries(amdrocclr_static PUBLIC Threads::Threads)
target_link_libraries(amdrocclr_static PUBLIC dl)


if (BUILD_PAL)
target_sources(amdrocclr_static PRIVATE $<TARGET_OBJECTS:rocclrpal>)
target_link_libraries(amdrocclr_static PRIVATE amdhsaloader)
target_link_libraries(amdrocclr_static PRIVATE pal)

target_compile_definitions(amdrocclr_static PRIVATE WITH_PAL_DEVICE)

export(TARGETS amdrocclr_static rocclrpal amdhsaloader amdhsacode pal addrlib vam metrohash cwpack gpuopen ddCore tiny_printf mpack rapidjson
FILE ${ROCCLR_TARGETS_PATH})
else()
target_compile_definitions(amdrocclr_static PRIVATE WITH_HSA_DEVICE)

#ROCclr being static lib shall not link hsa-runtime64.
#Needed here to export as transitive dependency in rocclr-targets.cmake
target_link_libraries(amdrocclr_static PRIVATE hsa-runtime64::hsa-runtime64)
target_sources(amdrocclr_static PRIVATE $<TARGET_OBJECTS:oclrocm>)
export(TARGETS amdrocclr_static
FILE ${ROCCLR_TARGETS_PATH})
endif()

if (UNIX)
set(ROCclr_DEFAULT_INSTALL_PREFIX "/opt/rocm/rocclr")

find_library(LIBRT rt)
if (LIBRT)
target_link_libraries(amdrocclr_static PUBLIC ${LIBRT})
endif()

if (LIBNUMA)
target_link_libraries(amdrocclr_static PUBLIC ${LIBNUMA})
endif()
endif()
#comment out as it's not available in cmake 3.5
#if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
if(NOT CMAKE_INSTALL_PREFIX)
if(CMAKE_BUILD_TYPE MATCHES Debug)
set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH "Installation path for rocclr" FORCE)
#elseif(CMAKE_BUILD_TYPE MATCHES Release)
else()
set(CMAKE_INSTALL_PREFIX ${ROCclr_DEFAULT_INSTALL_PREFIX} CACHE PATH "Installation path for rocclr" FORCE)
# message(FATAL_ERROR "Invalid CMAKE_BUILD_TYPE specified. Valid values are Debug and Release")
endif()
#endif()
endif()


install( TARGETS amdrocclr_static
EXPORT rocclr
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
COMPONENT applications)

install (
DIRECTORY include/
DESTINATION include)
install (
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/elf"
DESTINATION include
FILES_MATCHING PATTERN "*.h*")
install (
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/compiler"
DESTINATION include
FILES_MATCHING PATTERN "*.h*")
install (
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/utils"
DESTINATION include
FILES_MATCHING PATTERN "*.h*")
install (
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/platform"
DESTINATION include
FILES_MATCHING PATTERN "*.h*")
install (
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/thread"
DESTINATION include
FILES_MATCHING PATTERN "*.h*")
install (
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/os"
DESTINATION include
FILES_MATCHING PATTERN "*.h*")
install (
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/device"
DESTINATION include
FILES_MATCHING PATTERN "*.h*")

# Generate the install-tree package.
set(ROCCLR_PREFIX_CODE "
# Derive absolute install prefix from config file path.
get_filename_component(ROCCLR_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)")
string(REGEX REPLACE "/" ";" count "${ROCCLR_PACKAGE_PREFIX}")
foreach(p ${count})
set(ROCCLR_PREFIX_CODE "${ROCCLR_PREFIX_CODE}
get_filename_component(ROCCLR_PREFIX \"\${ROCCLR_PREFIX}\" PATH)")
endforeach()

configure_file("cmake/${ROCCLR_CONFIG_NAME}.in"
"${CMAKE_CURRENT_BINARY_DIR}/${ROCCLR_CONFIG_NAME}.install"
@ONLY)

install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/${ROCCLR_CONFIG_NAME}.install"
DESTINATION "${ROCCLR_PACKAGE_PREFIX}"
RENAME "${ROCCLR_CONFIG_NAME}")
install(EXPORT rocclr
DESTINATION "${ROCCLR_PACKAGE_PREFIX}"
FILE "${ROCCLR_TARGETS_NAME}")
install(FILES
"${ROCCLR_VERSION_PATH}"
DESTINATION "${ROCCLR_PACKAGE_PREFIX}")
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(ROCclr)
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2008-2021 Advanced Micro Devices, Inc.
Copyright (c) 2008 - 2021 Advanced Micro Devices, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading