Skip to content

[libc] Change the GPU loaders to LLVM executables #101442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions libc/utils/gpu/loader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ target_include_directories(gpu_loader PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
${LIBC_SOURCE_DIR}/include
${LIBC_SOURCE_DIR}
${LLVM_MAIN_INCLUDE_DIR}
${LLVM_BINARY_DIR}/include)
)

find_package(hsa-runtime64 QUIET 1.2.0 HINTS ${CMAKE_INSTALL_PREFIX} PATHS /opt/rocm)
Expand Down
9 changes: 8 additions & 1 deletion libc/utils/gpu/loader/amdgpu/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
add_executable(amdhsa-loader Loader.cpp)
set(LLVM_LINK_COMPONENTS
BinaryFormat
Object
Option
Support
)

add_llvm_executable(amdhsa-loader amdhsa-loader.cpp)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this be copied into <build-dir>/bin?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's also installed into <install>/bin.

target_link_libraries(amdhsa-loader
PRIVATE
Expand Down
16 changes: 8 additions & 8 deletions libc/utils/gpu/loader/nvptx/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
add_executable(nvptx-loader Loader.cpp)
set(LLVM_LINK_COMPONENTS
BinaryFormat
Object
Option
Support
)

add_llvm_executable(nvptx-loader nvptx-loader.cpp)

if(NOT LLVM_ENABLE_RTTI)
target_compile_options(nvptx-loader PRIVATE -fno-rtti)
endif()
target_include_directories(nvptx-loader PRIVATE
${LLVM_MAIN_INCLUDE_DIR} ${LLVM_BINARY_DIR}/include)
target_link_libraries(nvptx-loader
PRIVATE
gpu_loader
llvmlibc_rpc_server
CUDA::cuda_driver
LLVMObject
LLVMSupport
)
Loading