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

via libc-commits libc-commits at lists.llvm.org
Thu Feb 15 04:38:30 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/3] [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/3] 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()

>From e81f11d8d8c374d1a2b0e42ed67711859365f78f Mon Sep 17 00:00:00 2001
From: Tue Ly <lntue.h at gmail.com>
Date: Thu, 15 Feb 2024 12:38:12 +0000
Subject: [PATCH 3/3] Address comment.

---
 libc/utils/gpu/loader/amdgpu/CMakeLists.txt | 2 +-
 libc/utils/gpu/loader/nvptx/CMakeLists.txt  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libc/utils/gpu/loader/amdgpu/CMakeLists.txt b/libc/utils/gpu/loader/amdgpu/CMakeLists.txt
index bc9acee2155f46..dee1c3618ec5a7 100644
--- a/libc/utils/gpu/loader/amdgpu/CMakeLists.txt
+++ b/libc/utils/gpu/loader/amdgpu/CMakeLists.txt
@@ -9,5 +9,5 @@ target_link_libraries(amdhsa_loader
 )
 
 if(LIBC_COMPILER_HAS_FIXED_POINT)
-  target_compile_options(amdhsa_loader "-ffixed-point")
+  target_compile_options(amdhsa_loader PRIVATE "-ffixed-point")
 endif()
diff --git a/libc/utils/gpu/loader/nvptx/CMakeLists.txt b/libc/utils/gpu/loader/nvptx/CMakeLists.txt
index 991ca4749ad39c..94c232209c8ecd 100644
--- a/libc/utils/gpu/loader/nvptx/CMakeLists.txt
+++ b/libc/utils/gpu/loader/nvptx/CMakeLists.txt
@@ -5,7 +5,7 @@ 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")
+  target_compile_options(nvptx_loader PRIVATE "-ffixed-point")
 endif()
 target_include_directories(nvptx_loader PRIVATE ${LLVM_INCLUDE_DIRS})
 target_link_libraries(nvptx_loader



More information about the libc-commits mailing list