Commit 5a1acf7
authored
[Clang][AMDGPU] Fix early exit when finding hip dlls AMDGPUArchByHIP.cpp (#166238)
To find the greatest versioned `amdhip64_n.dll`, We iterate through
`SearchPaths` and the files within each path.
The `if (!DLLNames.empty())` check will return true if the first
`SearchPath` contains a dll - this will result in the break statement
executing and all other SearchPaths being skipped, potentially missing
out on a greater versioned dll.
Removing the check and break allows for all `SearchPaths` to get checked
and `DLLNames` to cover the complete set of dlls presents.
Also, the current `compareVersions` function was not removing the .dll
portion of the VerStr resulting in incorrect comparisons between VtA and
VtB. Updated the function to handle the case - test ouput is as follows
(ignore SearchPath and DLLName logging).
```
offload-arch.exe
SearchPath: C:\Users\rocm\harry\llvm-project\build\Debug\bin
SearchPath: C:\Windows\system32
SearchPath: C:\Windows
SearchPath: C:\Windows\system32
SearchPath: C:\Windows
SearchPath: C:\Windows\System32\Wbem
SearchPath: C:\Windows\System32\WindowsPowerShell\v1.0\
SearchPath: C:\Windows\System32\OpenSSH\
SearchPath: C:\Program Files\Git\cmd
SearchPath: C:\Program Files\CMake\bin
SearchPath: C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\
SearchPath: C:\Users\rocm\harry\.venv\Lib\site-packages\_rocm_sdk_core\bin
SearchPath: C:\Users\rocm\AppData\Local\Microsoft\WindowsApps
SearchPath:
DLLName: C:/Windows/system32/amdhip64_6.dll
DLLName: C:/Windows/system32/amdhip64_7.dll
DLLName: C:/Windows/system32/amdhip64_6.dll
DLLName: C:/Windows/system32/amdhip64_7.dll
DLLName: C:/Users/rocm/harry/.venv/Lib/site-packages/_rocm_sdk_core/bin/amdhip64_7.dll
HIP Library Path: C:\Windows\system32\amdhip64_7.dll
gfx11511 parent 87e094d commit 5a1acf7
1 file changed
+10
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
103 | 111 | | |
104 | 112 | | |
105 | 113 | | |
| |||
135 | 143 | | |
136 | 144 | | |
137 | 145 | | |
138 | | - | |
139 | | - | |
140 | 146 | | |
141 | 147 | | |
142 | 148 | | |
| |||
0 commit comments