[PATCH] D150807: [Clang] Remove direct linking of offloading runtimes from the arch tools
Joseph Huber via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed May 17 11:26:43 PDT 2023
jhuber6 updated this revision to Diff 523125.
jhuber6 added a comment.
Remove now unused definitions
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150807/new/
https://reviews.llvm.org/D150807
Files:
clang/tools/amdgpu-arch/AMDGPUArch.cpp
clang/tools/amdgpu-arch/CMakeLists.txt
clang/tools/nvptx-arch/CMakeLists.txt
clang/tools/nvptx-arch/NVPTXArch.cpp
Index: clang/tools/nvptx-arch/NVPTXArch.cpp
===================================================================
--- clang/tools/nvptx-arch/NVPTXArch.cpp
+++ clang/tools/nvptx-arch/NVPTXArch.cpp
@@ -30,7 +30,6 @@
// and -help) will be hidden.
static cl::OptionCategory NVPTXArchCategory("nvptx-arch options");
-#if DYNAMIC_CUDA
typedef enum cudaError_enum {
CUDA_SUCCESS = 0,
CUDA_ERROR_NO_DEVICE = 100,
@@ -75,12 +74,6 @@
#undef DYNAMIC_INIT
return llvm::Error::success();
}
-#else
-
-#include "cuda.h"
-llvm::Error loadCUDA() { return llvm::Error::success(); }
-
-#endif
static int handleError(CUresult Err) {
const char *ErrStr = nullptr;
Index: clang/tools/nvptx-arch/CMakeLists.txt
===================================================================
--- clang/tools/nvptx-arch/CMakeLists.txt
+++ clang/tools/nvptx-arch/CMakeLists.txt
@@ -9,12 +9,4 @@
set(LLVM_LINK_COMPONENTS Support)
add_clang_tool(nvptx-arch NVPTXArch.cpp)
-find_package(CUDAToolkit QUIET)
-
-# If we found the CUDA library directly we just dynamically link against it.
-if(CUDAToolkit_FOUND AND NOT (LLVM_BUILD_32_BITS OR CMAKE_SIZEOF_VOID_P EQUAL 4))
- target_link_libraries(nvptx-arch PRIVATE CUDA::cuda_driver clangBasic)
-else()
- target_compile_definitions(nvptx-arch PRIVATE "DYNAMIC_CUDA")
- target_link_libraries(nvptx-arch PRIVATE clangBasic)
-endif()
+target_link_libraries(nvptx-arch PRIVATE clangBasic)
Index: clang/tools/amdgpu-arch/CMakeLists.txt
===================================================================
--- clang/tools/amdgpu-arch/CMakeLists.txt
+++ clang/tools/amdgpu-arch/CMakeLists.txt
@@ -10,12 +10,4 @@
add_clang_tool(amdgpu-arch AMDGPUArch.cpp)
-# If we find the HSA runtime we link with it directly.
-find_package(hsa-runtime64 QUIET 1.2.0 HINTS ${CMAKE_INSTALL_PREFIX} PATHS /opt/rocm)
-if(hsa-runtime64_FOUND AND NOT (LLVM_BUILD_32_BITS OR CMAKE_SIZEOF_VOID_P EQUAL 4))
- set_target_properties(amdgpu-arch PROPERTIES INSTALL_RPATH_USE_LINK_PATH ON)
- target_link_libraries(amdgpu-arch PRIVATE hsa-runtime64::hsa-runtime64 clangBasic)
-else()
- target_compile_definitions(amdgpu-arch PRIVATE "DYNAMIC_HSA")
- target_link_libraries(amdgpu-arch PRIVATE clangBasic)
-endif()
+target_link_libraries(amdgpu-arch PRIVATE clangBasic)
Index: clang/tools/amdgpu-arch/AMDGPUArch.cpp
===================================================================
--- clang/tools/amdgpu-arch/AMDGPUArch.cpp
+++ clang/tools/amdgpu-arch/AMDGPUArch.cpp
@@ -30,7 +30,6 @@
OS << clang::getClangToolFullVersion("amdgpu-arch") << '\n';
}
-#if DYNAMIC_HSA
typedef enum {
HSA_STATUS_SUCCESS = 0x0,
} hsa_status_t;
@@ -80,18 +79,6 @@
#undef DYNAMIC_INIT
return llvm::Error::success();
}
-#else
-
-#if defined(__has_include)
-#if __has_include("hsa/hsa.h")
-#include "hsa/hsa.h"
-#elif __has_include("hsa.h")
-#include "hsa.h"
-#endif
-#endif
-
-llvm::Error loadHSA() { return llvm::Error::success(); }
-#endif
static hsa_status_t iterateAgentsCallback(hsa_agent_t Agent, void *Data) {
hsa_device_type_t DeviceType;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150807.523125.patch
Type: text/x-patch
Size: 3050 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230517/39198438/attachment.bin>
More information about the cfe-commits
mailing list