[libc-commits] [PATCH] D155615: [libc] Default the GPU build to the default memory utilities

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Jul 18 08:49:42 PDT 2023


jhuber6 created this revision.
Herald added projects: libc-project, All.
Herald added a subscriber: libc-commits.
jhuber6 requested review of this revision.

A previous patch made this cause an error on the GPU. We have not yet
dedicated time towards an optimial implementaiton there but we do not
want it to cause an error. We simply use the fallback routines.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D155615

Files:
  libc/src/string/memory_utils/bcmp_implementations.h
  libc/src/string/memory_utils/memcmp_implementations.h
  libc/src/string/memory_utils/memcpy_implementations.h
  libc/src/string/memory_utils/memmove_implementations.h
  libc/src/string/memory_utils/memset_implementations.h


Index: libc/src/string/memory_utils/memset_implementations.h
===================================================================
--- libc/src/string/memory_utils/memset_implementations.h
+++ libc/src/string/memory_utils/memset_implementations.h
@@ -27,6 +27,8 @@
 #elif defined(LIBC_TARGET_ARCH_IS_ANY_RISCV)
 #include "src/string/memory_utils/riscv/memset_implementations.h"
 #define LIBC_SRC_STRING_MEMORY_UTILS_MEMSET inline_memset_riscv
+#elif defined(LIBC_TARGET_ARCH_IS_GPU)
+// TODO: Define a more optimal GPU impolementation.
 #else
 #error "Unsupported architecture"
 #endif
Index: libc/src/string/memory_utils/memmove_implementations.h
===================================================================
--- libc/src/string/memory_utils/memmove_implementations.h
+++ libc/src/string/memory_utils/memmove_implementations.h
@@ -23,6 +23,8 @@
 #elif defined(LIBC_TARGET_ARCH_IS_ANY_RISCV)
 #include "src/string/memory_utils/riscv/memmove_implementations.h"
 #define LIBC_SRC_STRING_MEMORY_UTILS_MEMMOVE inline_memmove_riscv
+#elif defined(LIBC_TARGET_ARCH_IS_GPU)
+// TODO: Define a more optimal GPU impolementation.
 #else
 #error "Unsupported architecture"
 #endif
Index: libc/src/string/memory_utils/memcpy_implementations.h
===================================================================
--- libc/src/string/memory_utils/memcpy_implementations.h
+++ libc/src/string/memory_utils/memcpy_implementations.h
@@ -31,6 +31,8 @@
 #elif defined(LIBC_TARGET_ARCH_IS_ANY_RISCV)
 #include "src/string/memory_utils/riscv/memcpy_implementations.h"
 #define LIBC_SRC_STRING_MEMORY_UTILS_MEMCPY inline_memcpy_riscv
+#elif defined(LIBC_TARGET_ARCH_IS_GPU)
+// TODO: Define a more optimal GPU impolementation.
 #else
 #error "Unsupported architecture"
 #endif
Index: libc/src/string/memory_utils/memcmp_implementations.h
===================================================================
--- libc/src/string/memory_utils/memcmp_implementations.h
+++ libc/src/string/memory_utils/memcmp_implementations.h
@@ -27,6 +27,8 @@
 #elif defined(LIBC_TARGET_ARCH_IS_ANY_RISCV)
 #include "src/string/memory_utils/riscv/memcmp_implementations.h"
 #define LIBC_SRC_STRING_MEMORY_UTILS_MEMCMP inline_memcmp_riscv
+#elif defined(LIBC_TARGET_ARCH_IS_GPU)
+// TODO: Define a more optimal GPU impolementation.
 #else
 #error "Unsupported architecture"
 #endif
Index: libc/src/string/memory_utils/bcmp_implementations.h
===================================================================
--- libc/src/string/memory_utils/bcmp_implementations.h
+++ libc/src/string/memory_utils/bcmp_implementations.h
@@ -26,6 +26,8 @@
 #elif defined(LIBC_TARGET_ARCH_IS_ANY_RISCV)
 #include "src/string/memory_utils/riscv/bcmp_implementations.h"
 #define LIBC_SRC_STRING_MEMORY_UTILS_BCMP inline_bcmp_riscv
+#elif defined(LIBC_TARGET_ARCH_IS_GPU)
+// TODO: Define a more optimal GPU impolementation.
 #else
 #error "Unsupported architecture"
 #endif


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155615.541578.patch
Type: text/x-patch
Size: 2914 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230718/31e48822/attachment.bin>


More information about the libc-commits mailing list