Skip to content

Commit

Permalink
Add hip headers to build ROCm backend without the SDK.
Browse files Browse the repository at this point in the history
  • Loading branch information
monorimet authored and powderluv committed Aug 26, 2023
1 parent 020dfe7 commit 6ff0758
Show file tree
Hide file tree
Showing 5 changed files with 1,496 additions and 3 deletions.
2 changes: 2 additions & 0 deletions build_tools/python_deploy/build_linux_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,12 @@ function build_iree_runtime() {
export IREE_RUNTIME_BUILD_TRACY=ON
# We install the needed build deps below for the tools.
export IREE_RUNTIME_BUILD_TRACY_TOOLS=ON
export IREE_EXTERNAL_HAL_DRIVERS="rocm"
build_wheel runtime/
}

function build_iree_compiler() {
export IREE_TARGET_BACKEND_ROCM=ON
build_wheel compiler/
}

Expand Down
2 changes: 2 additions & 0 deletions build_tools/python_deploy/build_windows_packages.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@ function run() {
function build_iree_runtime() {
param($python_version)
$env:IREE_HAL_DRIVER_VULKAN = "ON"
$env:IREE_EXTERNAL_HAL_DRIVERS = "rocm"
& py -${python_version} -m pip wheel -v -w $output_dir $repo_root/runtime/
}

function build_iree_compiler() {
param($python_version)
$env:IREE_TARGET_BACKEND_ROCM= "ON"
py -${python_version} -m pip wheel -v -w $output_dir $repo_root/compiler/
}

Expand Down
4 changes: 2 additions & 2 deletions experimental/rocm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ set(IREE_ROCM_BC_DIR "${IREE_ROCM_BC_DIR_DEFAULT}" CACHE STRING
iree_add_all_subdirs()

if(NOT ROCM_HEADERS_API_ROOT)
set(ROCM_HEADERS_API_ROOT "/opt/rocm/include")
set(ROCM_HEADERS_API_ROOT ${CMAKE_CURRENT_LIST_DIR})
endif()

if(EXISTS ${ROCM_HEADERS_API_ROOT})
Expand Down Expand Up @@ -68,7 +68,7 @@ iree_cc_library(
INCLUDES
"${CMAKE_CURRENT_LIST_DIR}/../.."
"${PROJECT_BINARY_DIR}"
"${ROCM_HEADERS_API_ROOT}"
"${ROCM_HEADERS_API_ROOT}/.."
DEPS
::dynamic_symbols
iree::base
Expand Down
Loading

0 comments on commit 6ff0758

Please sign in to comment.