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

Commit

Permalink
SWDEV-330775 - SWDEV-334083 - Compiler file re-org
Browse files Browse the repository at this point in the history
  - device-libs
    - Move amdgcn to lib/llvm/lib/clang/<ver>/lib/amdgcn
    - Create symlink amdgcn -> lib/llvm/lib/clang/<ver>/lib/amdgcn

Change-Id: I6cd7116b556920d2500edfa65e0e147a27dbda57
  • Loading branch information
kzhuravl committed Oct 17, 2023
1 parent 80cfbd1 commit e44fe3a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
20 changes: 20 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,28 @@ if (NOT PREPARE_BUILTINS)
set (PREPARE_BUILTINS $<TARGET_FILE:prepare-builtins>)
endif()

# Following variables are required for ROCM backwards compatibility,
# and should be removed in ROCM 7.0 release.
set(ROCM_DEVICE_LIBS_BITCODE_INSTALL_LOC_NEW "" CACHE STRING "New bitcode install location relative to CMAKE_INSTALL_PREFIX")
set(ROCM_DEVICE_LIBS_BITCODE_INSTALL_LOC_OLD "" CACHE STRING "Old bitcode install location relative to CMAKE_INSTALL_PREFIX")

include(OCL)

if (NOT ROCM_DEVICE_LIBS_BITCODE_INSTALL_LOC_NEW STREQUAL "" AND
NOT ROCM_DEVICE_LIBS_BITCODE_INSTALL_LOC_OLD STREQUAL "")
set(ROCM_DEVICE_LIBS_WRAPPER_DIR ${CMAKE_CURRENT_BINARY_DIR}/wrapper_dir)
file(MAKE_DIRECTORY ${ROCM_DEVICE_LIBS_WRAPPER_DIR})
add_custom_target(
FILE_REORG_ROCM_6_0 ALL
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E create_symlink
${ROCM_DEVICE_LIBS_BITCODE_INSTALL_LOC_NEW}
${ROCM_DEVICE_LIBS_WRAPPER_DIR}/${ROCM_DEVICE_LIBS_BITCODE_INSTALL_LOC_OLD})
install(
FILES ${ROCM_DEVICE_LIBS_WRAPPER_DIR}/${ROCM_DEVICE_LIBS_BITCODE_INSTALL_LOC_OLD}
DESTINATION .)
endif()

set(AMDGCN_LIB_LIST)
set(AMDGCN_DEP_LIST)
add_subdirectory(irif)
Expand Down
4 changes: 4 additions & 0 deletions cmake/OCL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ set (STRIP_SUFFIX ".strip${BC_EXT}")
set (FINAL_SUFFIX "${BC_EXT}")
set (INSTALL_ROOT_SUFFIX "amdgcn/bitcode")

if (NOT ROCM_DEVICE_LIBS_BITCODE_INSTALL_LOC_NEW STREQUAL "")
set(INSTALL_ROOT_SUFFIX "${ROCM_DEVICE_LIBS_BITCODE_INSTALL_LOC_NEW}/bitcode")
endif()

# Set `inc_options` to contain Clang command-line for include directories for
# current source directory.
macro(set_inc_options)
Expand Down

0 comments on commit e44fe3a

Please sign in to comment.