Skip to content

Commit a6d3445

Browse files
authored
[SYCL][hip] Fix HSA headers lookup (#12234)
ROCm installations prior to v6 don't respect the traditional installation layout and install the HSA headers to `$PREFIX/hsa/include/hsa` whereas in rocm6 it looks like they're putting it in the right place at `$PREFIX/include/hsa`. That cleanup from AMD is good news, but it means that our workarounds now break and we need to check both places. This is a companion to oneapi-src/unified-runtime#1208
1 parent e629656 commit a6d3445

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

sycl/plugins/hip/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,14 @@ else()
2424
endif()
2525

2626
if("${SYCL_BUILD_PI_HIP_HSA_INCLUDE_DIR}" STREQUAL "")
27-
set(PI_HIP_HSA_INCLUDE_DIR "${SYCL_BUILD_PI_HIP_ROCM_DIR}/hsa/include")
27+
# pre v6 versions of ROCM prefix their include directory with /hsa but this
28+
# was fixed in v6 to act like a well-behaved package
29+
foreach (SUF hsa/include include)
30+
if (EXISTS "${SYCL_BUILD_PI_HIP_ROCM_DIR}/${SUF}")
31+
set(PI_HIP_HSA_INCLUDE_DIR "${SYCL_BUILD_PI_HIP_ROCM_DIR}/${SUF}")
32+
break()
33+
endif()
34+
endforeach()
2835
else()
2936
set(PI_HIP_HSA_INCLUDE_DIR "${SYCL_BUILD_PI_HIP_INCLUDE_DIR}")
3037
endif()

0 commit comments

Comments
 (0)