Skip to content

Commit ed8c660

Browse files
committed
[release/2.6][ROCm] cmake 4 workaround for hiprtc (pytorch#150324)
Pull Request resolved: pytorch#150324 Approved by: https://github.com/jeffdaily, https://github.com/atalman, https://github.com/malfet
1 parent 2fd46f8 commit ed8c660

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

cmake/public/LoadHIP.cmake

+9-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,15 @@ if(HIP_FOUND)
157157
find_package_and_print_version(hipcub REQUIRED)
158158
find_package_and_print_version(rocthrust REQUIRED)
159159
find_package_and_print_version(hipsolver REQUIRED)
160-
find_package_and_print_version(hiprtc REQUIRED)
160+
# workaround cmake 4 build issue
161+
if(CMAKE_VERSION VERSION_GREATER_EQUAL "4.0.0")
162+
message(WARNING "Work around hiprtc cmake failure for cmake >= 4")
163+
set(CMAKE_POLICY_VERSION_MINIMUM 3.5)
164+
find_package_and_print_version(hiprtc REQUIRED)
165+
unset(CMAKE_POLICY_VERSION_MINIMUM)
166+
else()
167+
find_package_and_print_version(hiprtc REQUIRED)
168+
endif()
161169

162170
if(UNIX)
163171
find_package_and_print_version(rccl)

0 commit comments

Comments
 (0)