Skip to content

Commit

Permalink
[SYCL][hip] Fix HSA headers lookup (intel#12234)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ldrumm authored Dec 22, 2023
1 parent e629656 commit a6d3445
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion sycl/plugins/hip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ else()
endif()

if("${SYCL_BUILD_PI_HIP_HSA_INCLUDE_DIR}" STREQUAL "")
set(PI_HIP_HSA_INCLUDE_DIR "${SYCL_BUILD_PI_HIP_ROCM_DIR}/hsa/include")
# pre v6 versions of ROCM prefix their include directory with /hsa but this
# was fixed in v6 to act like a well-behaved package
foreach (SUF hsa/include include)
if (EXISTS "${SYCL_BUILD_PI_HIP_ROCM_DIR}/${SUF}")
set(PI_HIP_HSA_INCLUDE_DIR "${SYCL_BUILD_PI_HIP_ROCM_DIR}/${SUF}")
break()
endif()
endforeach()
else()
set(PI_HIP_HSA_INCLUDE_DIR "${SYCL_BUILD_PI_HIP_INCLUDE_DIR}")
endif()
Expand Down

0 comments on commit a6d3445

Please sign in to comment.