Skip to content

Commit 8370f2e

Browse files
authored
Merge branch 'main' into maxime/imm-cmd-list-support
2 parents 4a084c8 + 42874bc commit 8370f2e

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

.github/workflows/coverity.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ jobs:
5353
-DCUDA_CUDA_LIBRARY=/usr/local/cuda/lib64/stubs/libcuda.so
5454
-DUR_BUILD_ADAPTER_NATIVE_CPU=ON
5555
-DUR_BUILD_ADAPTER_HIP=ON
56+
-DUR_BUILD_ADAPTER_OPENCL=ON
5657
5758
- name: Run Coverity
5859
run: |

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ List of options provided by CMake:
137137
| UR_ENABLE_COMGR | Enable comgr lib usage | AMD/NVIDIA | AMD |
138138
| UR_DPCXX | Path of the DPC++ compiler executable to build CTS device binaries | File path | `""` |
139139
| UR_SYCL_LIBRARY_DIR | Path of the SYCL runtime library directory to build CTS device binaries | Directory path | `""` |
140+
| UR_HIP_ROCM_DIR | Path of the default ROCm HIP installation | Directory path | `/opt/rocm` |
141+
| UR_HIP_INCLUDE_DIR | Path of the ROCm HIP include directory | Directory path | `${UR_HIP_ROCM_DIR}/include` |
142+
| UR_HIP_HSA_INCLUDE_DIRS | Path of the ROCm HSA include directory | Directory path | `${UR_HIP_ROCM_DIR}/hsa/include;${UR_HIP_ROCM_DIR}/include` |
143+
| UR_HIP_LIB_DIR | Path of the ROCm HIP library directory | Directory path | `${UR_HIP_ROCM_DIR}/lib` |
140144

141145
### Additional make targets
142146

source/adapters/hip/CMakeLists.txt

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ set(UR_HIP_PLATFORM "AMD" CACHE STRING "UR HIP platform, AMD or NVIDIA")
1010

1111
# Set default ROCm installation directory
1212
set(UR_HIP_ROCM_DIR "/opt/rocm" CACHE STRING "ROCm installation dir")
13-
14-
set(UR_HIP_INCLUDE_DIR "${UR_HIP_ROCM_DIR}/include")
15-
13+
# Allow custom location of HIP/HSA include and HIP library directories
14+
set(UR_HIP_INCLUDE_DIR "${UR_HIP_ROCM_DIR}/include" CACHE PATH
15+
"Custom ROCm HIP include dir")
1616
set(UR_HIP_HSA_INCLUDE_DIRS
17-
"${UR_HIP_ROCM_DIR}/hsa/include;${UR_HIP_ROCM_DIR}/include")
18-
19-
# Set HIP lib dir
20-
set(UR_HIP_LIB_DIR "${UR_HIP_ROCM_DIR}/lib")
17+
"${UR_HIP_ROCM_DIR}/hsa/include;${UR_HIP_ROCM_DIR}/include" CACHE FILEPATH
18+
"Custom ROCm HSA include dir")
19+
set(UR_HIP_LIB_DIR "${UR_HIP_ROCM_DIR}/lib" CACHE PATH
20+
"Custom ROCm HIP library dir")
2121

2222
# Check if HIP library path exists (AMD platform only)
2323
if("${UR_HIP_PLATFORM}" STREQUAL "AMD")
@@ -31,7 +31,8 @@ if("${UR_HIP_PLATFORM}" STREQUAL "AMD")
3131
" please check ROCm installation.")
3232
endif()
3333

34-
# Check if HSA include path exists
34+
# Check if HSA include path exists. In rocm-6.0.0 the layout of HSA
35+
# directory has changed, check for the new location as well.
3536
foreach(D IN LISTS UR_HIP_HSA_INCLUDE_DIRS)
3637
if(EXISTS "${D}")
3738
set(UR_HIP_HSA_INCLUDE_DIR "${D}")

source/adapters/opencl/CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,14 @@ if(UR_OPENCL_ICD_LOADER_LIBRARY)
6767
set(OpenCLICDLoaderLibrary ${UR_OPENCL_ICD_LOADER_LIBRARY})
6868
else()
6969
find_package(OpenCL 3.0)
70-
if(OpenCL_FOUND)
71-
set(OpenCLICDLoaderLibrary OpenCL::OpenCL)
72-
else()
70+
if(NOT OpenCL_FOUND)
7371
FetchContent_Declare(OpenCL-ICD-Loader
7472
GIT_REPOSITORY "https://github.com/KhronosGroup/OpenCL-ICD-Loader.git"
7573
GIT_TAG main
7674
)
7775
FetchContent_MakeAvailable(OpenCL-ICD-Loader)
78-
set(OpenCLICDLoaderLibrary ${PROJECT_BINARY_DIR}/lib/libOpenCL.so)
7976
endif()
77+
set(OpenCLICDLoaderLibrary OpenCL::OpenCL)
8078
endif()
8179

8280
message(STATUS "OpenCL Include Directory: ${OpenCLIncludeDirectory}")

0 commit comments

Comments
 (0)