[libc-commits] [libc] [libc][gpu] Add fixed point compile options to GPUs' loaders. (PR #81820)

via libc-commits libc-commits at lists.llvm.org
Wed Feb 14 20:50:09 PST 2024


https://github.com/lntue updated https://github.com/llvm/llvm-project/pull/81820

>From 98132c45c85d531cf413c9dba3e1b2e0e6a2e641 Mon Sep 17 00:00:00 2001
From: Tue Ly <lntue.h at gmail.com>
Date: Thu, 15 Feb 2024 04:44:01 +0000
Subject: [PATCH 1/2] [libc][gpu] Add fixed point compile options to GPUs'
 loaders.

---
 libc/utils/gpu/loader/nvptx/CMakeLists.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libc/utils/gpu/loader/nvptx/CMakeLists.txt b/libc/utils/gpu/loader/nvptx/CMakeLists.txt
index 0c76c49fa30985..991ca4749ad39c 100644
--- a/libc/utils/gpu/loader/nvptx/CMakeLists.txt
+++ b/libc/utils/gpu/loader/nvptx/CMakeLists.txt
@@ -4,6 +4,9 @@ add_dependencies(nvptx_loader libc.src.__support.RPC.rpc)
 if(NOT LLVM_ENABLE_RTTI)
   target_compile_options(nvptx_loader PRIVATE -fno-rtti)
 endif()
+if(LIBC_COMPILER_HAS_FIXED_POINT)
+  target_compile_options(amdhsa_loader PRIVATE "-ffixed-point")
+endif()
 target_include_directories(nvptx_loader PRIVATE ${LLVM_INCLUDE_DIRS})
 target_link_libraries(nvptx_loader
   PRIVATE

>From 45b894893907e8ab484770f266256687f8894943 Mon Sep 17 00:00:00 2001
From: Tue Ly <lntue.h at gmail.com>
Date: Thu, 15 Feb 2024 04:49:33 +0000
Subject: [PATCH 2/2] Add fixed point flag for AMD loader.

---
 libc/utils/gpu/loader/amdgpu/CMakeLists.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libc/utils/gpu/loader/amdgpu/CMakeLists.txt b/libc/utils/gpu/loader/amdgpu/CMakeLists.txt
index 8e9c9a2bdc7d27..bc9acee2155f46 100644
--- a/libc/utils/gpu/loader/amdgpu/CMakeLists.txt
+++ b/libc/utils/gpu/loader/amdgpu/CMakeLists.txt
@@ -7,3 +7,7 @@ target_link_libraries(amdhsa_loader
   gpu_loader
   llvmlibc_rpc_server
 )
+
+if(LIBC_COMPILER_HAS_FIXED_POINT)
+  target_compile_options(amdhsa_loader "-ffixed-point")
+endif()



More information about the libc-commits mailing list