Skip to content

Commit 462ad3e

Browse files
committed
[ROCm][Windows] Fix finding ROCm/HIP version (pytorch#156486)
This commit fixes Windows build issue related to trying to use rocm-core (rocm-core doesn't exist on HIP SDK) Pull Request resolved: pytorch#156486 Approved by: https://github.com/jeffdaily, https://github.com/stellaraccident
1 parent c140442 commit 462ad3e

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

cmake/public/LoadHIP.cmake

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,16 @@ if(HIP_FOUND)
9393
# hip (lower-case) package. Both are probed above and will be in
9494
# ROCM_INCLUDE_DIRS if available.
9595
find_file(ROCM_VERSION_HEADER_PATH
96-
NAMES rocm-core/rocm_version.h
96+
NAMES rocm-core/rocm_version.h hip/hip_version.h
9797
NO_DEFAULT_PATH
9898
PATHS ${ROCM_INCLUDE_DIRS}
9999
)
100-
set(ROCM_LIB_NAME "ROCM")
101-
if(NOT ROCM_VERSION_HEADER_PATH)
102-
find_file(ROCM_VERSION_HEADER_PATH
103-
NAMES hip/hip_version.h
104-
NO_DEFAULT_PATH
105-
PATHS ${ROCM_INCLUDE_DIRS}
106-
)
100+
if(ROCM_VERSION_HEADER_PATH MATCHES "rocm-core/rocm_version.h$")
101+
set(ROCM_LIB_NAME "ROCM")
102+
else()
107103
set(ROCM_LIB_NAME "HIP")
108104
endif()
105+
109106
if(NOT ROCM_VERSION_HEADER_PATH)
110107
message(FATAL_ERROR "Could not find hip/hip_version.h or rocm-core/rocm_version.h in ${ROCM_INCLUDE_DIRS}")
111108
endif()

0 commit comments

Comments
 (0)