Skip to content

[libc][docs] List rand and srand as supported on the GPU #96757

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

jhuber6
Copy link
Contributor

@jhuber6 jhuber6 commented Jun 26, 2024

Summary:
I initially didn't report these as supported because they didn't provide
expected behavior and were very wasteful. The recent patch moved them to
a lock-free atomic implementation so they can now actually be used.

Summary:
I initially didn't report these as supported because they didn't provide
expected behavior and were very wasteful. The recent patch moved them to
a lock-free atomic implementation so they can now actually be used.
@llvmbot
Copy link
Member

llvmbot commented Jun 26, 2024

@llvm/pr-subscribers-libc

Author: Joseph Huber (jhuber6)

Changes

Summary:
I initially didn't report these as supported because they didn't provide
expected behavior and were very wasteful. The recent patch moved them to
a lock-free atomic implementation so they can now actually be used.


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

2 Files Affected:

  • (modified) libc/docs/gpu/support.rst (+2)
  • (modified) libc/src/stdlib/rand_util.cpp (+1-1)
diff --git a/libc/docs/gpu/support.rst b/libc/docs/gpu/support.rst
index 31bbdc41090be..1044b005de0ee 100644
--- a/libc/docs/gpu/support.rst
+++ b/libc/docs/gpu/support.rst
@@ -190,6 +190,8 @@ strtold        |check|
 strtoll        |check|
 strtoul        |check|
 strtoull       |check|
+srand          |check|
+rand           |check|
 =============  =========  ============
 
 inttypes.h
diff --git a/libc/src/stdlib/rand_util.cpp b/libc/src/stdlib/rand_util.cpp
index 81ee358935716..ff3478db70003 100644
--- a/libc/src/stdlib/rand_util.cpp
+++ b/libc/src/stdlib/rand_util.cpp
@@ -12,7 +12,7 @@
 
 namespace LIBC_NAMESPACE {
 
-//  C standard 7.10p2: If 'rand' is called before 'srand' it is to
+// C standard 7.10p2: If 'rand' is called before 'srand' it is to
 // proceed as if the 'srand' function was called with a value of '1'.
 cpp::Atomic<unsigned long> rand_next = 1;
 

@jhuber6 jhuber6 changed the title [libc] List rand and srand as supported on the GPU [libc][docs] List rand and srand as supported on the GPU Jun 26, 2024
@jhuber6 jhuber6 requested a review from nickdesaulniers June 26, 2024 15:32
@jhuber6 jhuber6 merged commit e1015ae into llvm:main Jun 26, 2024
9 checks passed
lravenclaw pushed a commit to lravenclaw/llvm-project that referenced this pull request Jul 3, 2024
)

Summary:
I initially didn't report these as supported because they didn't provide
expected behavior and were very wasteful. The recent patch moved them to
a lock-free atomic implementation so they can now actually be used.
AlexisPerry pushed a commit to llvm-project-tlp/llvm-project that referenced this pull request Jul 9, 2024
)

Summary:
I initially didn't report these as supported because they didn't provide
expected behavior and were very wasteful. The recent patch moved them to
a lock-free atomic implementation so they can now actually be used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants