[libc-commits] [PATCH] D151282: [libc] Add initial support for 'puts' and 'fputs' to the GPU

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri Jun 2 17:31:18 PDT 2023


sivachandra added inline comments.


================
Comment at: libc/src/__support/File/file.h:43
+// out the buffering portions of the code in the general implementation.
+#if defined(LIBC_TARGET_ARCH_IS_GPU)
+  static constexpr bool ENABLE_BUFFER = false;
----------------
Sorry, forgot to mention this in the earlier post: Just pointing out that files opened even with `fopencookie` will become unbuffered.

That we have new switch means we should add tests for it on non-GPU platforms also. So, one way would be to do something like this:
1. Add a compile option, say `LIBC_COPT_UNBUFFERED_FILE` and update this conditional to:
```
#if defined(LIBC_TARGET_ARCH_IS_GPU) || defined(LIBC_COPT_UNBUFFERED_FILE)
```
2. The above flag will allow to setup up a separate platform independent test only target for unbuffered files.
3. Add a test for unbuffered files which depends on the ubuffered file target.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151282/new/

https://reviews.llvm.org/D151282



More information about the libc-commits mailing list