Skip to content

Commit 684eb10

Browse files
sommerlukaskbenzie
authored andcommitted
[SYCL][UR] Fix include for COMGR (#12286)
The code object finalization for kernel fusion uses the AMD COMGR. The location of the corresponding header changed between ROCm version 4 and 5. This PR fixes the include for ROCm version 4. --------- Signed-off-by: Lukas Sommer <[email protected]>
1 parent 6ca2cd3 commit 684eb10

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

sycl/plugins/hip/CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,21 @@ if("${SYCL_BUILD_PI_HIP_PLATFORM}" STREQUAL "AMD")
128128
target_link_libraries(pi_hip PUBLIC rocmdrv)
129129

130130
if(SYCL_ENABLE_COMGR)
131+
set(PI_COMGR_VERSION5_HEADER "${PI_HIP_INCLUDE_DIR}/amd_comgr/amd_comgr.h")
132+
set(PI_COMGR_VERSION4_HEADER "${PI_HIP_INCLUDE_DIR}/amd_comgr.h")
133+
# The COMGR header changed location between ROCm version 4 and 5.
134+
# Check for the existence in the version 5 location or fallback to version 4
135+
if(NOT EXISTS "${PI_COMGR_VERSION5_HEADER}")
136+
if(NOT EXISTS "${PI_COMGR_VERSION4_HEADER}")
137+
message(FATAL_ERROR "Could not find AMD COMGR header at "
138+
"${PI_COMGR_VERSION5_HEADER} or "
139+
"${PI_COMGR_VERSION4_HEADER}, "
140+
"check ROCm installation")
141+
else()
142+
target_compile_definitions(pi_hip PRIVATE UR_COMGR_VERSION4_INCLUDE)
143+
endif()
144+
endif()
145+
131146
add_library(amd_comgr SHARED IMPORTED GLOBAL)
132147
set_target_properties(
133148
amd_comgr PROPERTIES

sycl/plugins/unified_runtime/CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +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 aaa4661f5c32e6dcb43248ed7575de6971852cc3
60+
# commit c311fe82256a7bc7f6ddd19cb86c8d555ce401bc
61+
# Merge: eee75a29 d398d4ae
6162
# Author: Kenneth Benzie (Benie) <[email protected]>
62-
# Date: Fri Dec 15 16:05:36 2023 +0000
63-
# Set version to v0.8.2
64-
set(UNIFIED_RUNTIME_TAG aaa4661f5c32e6dcb43248ed7575de6971852cc3)
63+
# Date: Thu Jan 4 15:12:54 2024 +0000
64+
# Merge pull request #1222 from sommerlukas/lukas/comgr-include-rocm4
65+
# [UR][HIP] Fix include for AMD COMGR
66+
set(UNIFIED_RUNTIME_TAG c311fe82256a7bc7f6ddd19cb86c8d555ce401bc)
6567

6668
if(SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO)
6769
set(UNIFIED_RUNTIME_REPO "${SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO}")

0 commit comments

Comments
 (0)