blob: 09b4160ba6d7a2ac48b6a7425a8ecdc13984b5c8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
comgr does unnecessary heavy-lifting trying to fill `--rocm-path=` with something.
However default value is already good, and custom code searches clang in a wrong directory.
--- a/src/comgr-compiler.cpp
+++ b/src/comgr-compiler.cpp
@@ -1060,39 +1060,6 @@ amd_comgr_status_t AMDGPUCompiler::addCompilationFlags() {
amd_comgr_status_t AMDGPUCompiler::addDeviceLibraries() {
NoGpuLib = false;
-
- SmallString<256> ClangBinaryPath(env::getLLVMPath());
- sys::path::append(ClangBinaryPath, "bin", "clang");
-
- std::string ClangResourceDir = Driver::GetResourcesPath(ClangBinaryPath);
-
- SmallString<256> DeviceLibPath(ClangResourceDir);
- sys::path::append(DeviceLibPath, "lib");
-
- SmallString<256> DeviceCodeDir(DeviceLibPath);
- sys::path::append(DeviceCodeDir, "amdgcn", "bitcode");
-
- if (llvm::sys::fs::exists(DeviceCodeDir)) {
- Args.push_back(Saver.save(Twine("--rocm-path=") + DeviceLibPath).data());
- } else {
- llvm::SmallString<128> FakeRocmDir = TmpDir;
- path::append(FakeRocmDir, "rocm");
- llvm::SmallString<128> DeviceLibsDir = FakeRocmDir;
- path::append(DeviceLibsDir, "amdgcn", "bitcode");
- if (fs::create_directory(InputDir)) {
- return AMD_COMGR_STATUS_ERROR;
- }
- Args.push_back(Saver.save(Twine("--rocm-path=") + FakeRocmDir).data());
-
- for (auto DeviceLib : getDeviceLibraries()) {
- llvm::SmallString<128> DeviceLibPath = DeviceLibsDir;
- path::append(DeviceLibPath, std::get<0>(DeviceLib));
- if (auto Status = outputToFile(std::get<1>(DeviceLib), DeviceLibPath)) {
- return Status;
- }
- }
- }
-
return AMD_COMGR_STATUS_SUCCESS;
}
|