Skip to content

Commit 8aa2b61

Browse files
jchlandakbenzieldrumm
authored
[UR] Document how to customize HIP directories (#12127)
Co-authored-by: Kenneth Benzie (Benie) <[email protected]> Co-authored-by: ldrumm <[email protected]>
1 parent f303cf3 commit 8aa2b61

File tree

3 files changed

+25
-6
lines changed

3 files changed

+25
-6
lines changed

sycl/doc/GetStartedGuide.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,17 @@ variable `SYCL_BUILD_PI_HIP_ROCM_DIR` which can be passed using the
261261
python $DPCPP_HOME/llvm/buildbot/configure.py --hip \
262262
--cmake-opt=-DSYCL_BUILD_PI_HIP_ROCM_DIR=/usr/local/rocm
263263
```
264+
If further customization is required — for instance when the layout of
265+
individual directories can not be inferred from `SYCL_BUILD_PI_HIP_ROCM_DIR`
266+
it is possible to specify the location of HIP include, HSA include and HIP
267+
library directories, using the following CMake variables:
268+
* `SYCL_BUILD_PI_HIP_INCLUDE_DIR`,
269+
* `SYCL_BUILD_PI_HIP_HSA_INCLUDE_DIR`,
270+
* `SYCL_BUILD_PI_HIP_LIB_DIR`.
271+
Please note that a similar customization would also be required for Unified
272+
Runtime, see [the list of options provided by its
273+
CMake](https://github.com/oneapi-src/unified-runtime#cmake-standard-options)
274+
for details.
264275

265276
[LLD](https://llvm.org/docs/AMDGPUUsage.html) is necessary for the AMDGPU
266277
compilation chain. The AMDGPU backend generates a standard ELF relocatable code

sycl/plugins/hip/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ else()
4444
set(PI_HIP_LIB_DIR "${SYCL_BUILD_PI_HIP_LIB_DIR}")
4545
endif()
4646

47+
# Set up defaults for UR
48+
set(UR_HIP_INCLUDE_DIR "${PI_HIP_INCLUDE_DIR}" CACHE PATH
49+
"Custom ROCm HIP include dir")
50+
set(UR_HIP_HSA_INCLUDE_DIRS "${PI_HIP_HSA_INCLUDE_DIR}" CACHE PATH
51+
"Custom ROCm HSA include dir")
52+
set(UR_HIP_LIB_DIR "${PI_HIP_LIB_DIR}" CACHE PATH
53+
"Custom ROCm HIP library dir")
54+
4755
# Mark override options for advanced usage
4856
mark_as_advanced(SYCL_BUILD_PI_HIP_INCLUDE_DIR SYCL_BUILD_PI_HIP_HSA_INCLUDE_DIR SYCL_BUILD_PI_HIP_LIB_DIR)
4957

sycl/plugins/unified_runtime/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ if(SYCL_PI_UR_USE_FETCH_CONTENT)
5757
include(FetchContent)
5858

5959
set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git")
60-
# commit c2d78257ba7e7bbc230333f291282d16145aaac7
61-
# Merge: 8bb539c5 b3a1d52d
60+
# commit c53953ae492587698d5adbab8ffee254d97b6a4e
61+
# Merge: 9f88cf88 66d52ace
6262
# Author: Kenneth Benzie (Benie) <[email protected]>
63-
# Date: Wed Jan 10 11:24:12 2024 +0000
64-
# Merge pull request #1129 from sarnex/adapters
65-
# [UR][L0] Make urPlatformGetBackendOption return -ze-opt-level=2 for -O1 and -O2
66-
set(UNIFIED_RUNTIME_TAG c2d78257ba7e7bbc230333f291282d16145aaac7)
63+
# Date: Wed Jan 10 14:50:23 2024 +0000
64+
# Merge pull request #1170 from jchlanda/jakub/hip_custom_dirs
65+
# [HIP] Allow custom location of ROCm components
66+
set(UNIFIED_RUNTIME_TAG c53953ae492587698d5adbab8ffee254d97b6a4e)
6767

6868
if(SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO)
6969
set(UNIFIED_RUNTIME_REPO "${SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO}")

0 commit comments

Comments
 (0)