[libc-commits] [libc] [libc] Only include GPU utils when targeting GPU (PR #84999)

via libc-commits libc-commits at lists.llvm.org
Tue Mar 12 17:13:51 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Petr Hosek (petrhosek)

<details>
<summary>Changes</summary>

This code shouldn't be needed on non-GPU platforms.

---
Full diff: https://github.com/llvm/llvm-project/pull/84999.diff


1 Files Affected:

- (modified) libc/src/stdlib/rand_util.h (+2) 


``````````diff
diff --git a/libc/src/stdlib/rand_util.h b/libc/src/stdlib/rand_util.h
index cadd6b5cdcbb8c..036d6331b47f43 100644
--- a/libc/src/stdlib/rand_util.h
+++ b/libc/src/stdlib/rand_util.h
@@ -9,7 +9,9 @@
 #ifndef LLVM_LIBC_SRC_STDLIB_RAND_UTIL_H
 #define LLVM_LIBC_SRC_STDLIB_RAND_UTIL_H
 
+#ifdef LIBC_TARGET_ARCH_IS_GPU
 #include "src/__support/GPU/utils.h"
+#endif
 #include "src/__support/macros/attributes.h"
 
 namespace LIBC_NAMESPACE {

``````````

</details>


https://github.com/llvm/llvm-project/pull/84999


More information about the libc-commits mailing list