Skip to content

Commit 9d55361

Browse files
committed
[SYCL] Enable rand with CUDA and HIP
This enables building rand for CUDA and HIP and enables the test.
1 parent 610d42a commit 9d55361

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

libdevice/crt_wrapper.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@
1212

1313
#include <cstdint>
1414

15-
#ifndef __NVPTX__
1615
#define RAND_NEXT_LEN 1024
1716
DeviceGlobal<uint64_t[RAND_NEXT_LEN]> RandNext;
18-
#endif
1917

2018
#if defined(__SPIR__) || defined(__SPIRV__) || defined(__NVPTX__) || \
2119
defined(__AMDGCN__)
@@ -34,7 +32,6 @@ int memcmp(const void *s1, const void *s2, size_t n) {
3432
return __devicelib_memcmp(s1, s2, n);
3533
}
3634

37-
#ifndef __NVPTX__
3835

3936
// This simple rand is for ease of use only, the implementation aligns with
4037
// LLVM libc rand which is based on xorshift64star pseudo random number
@@ -107,7 +104,6 @@ void srand(unsigned int seed) {
107104
RAND_NEXT_ACC[gid1] = seed;
108105
}
109106

110-
#endif
111107

112108
#if defined(_WIN32)
113109
// Truncates a wide (16 or 32 bit) string (wstr) into an ASCII string (str).

sycl/test-e2e/DeviceLib/rand_test.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// RUN: %{build} -o %t.out
22
// RUN: %{run} %t.out
33

4-
// UNSUPPORTED: target-nvidia || target-amd
5-
64
#include <sycl/builtins.hpp>
75
#include <sycl/detail/core.hpp>
86

0 commit comments

Comments
 (0)