Skip to content

Commit 4673ca4

Browse files
authored
[SYCL] Enable rand with CUDA and HIP (#19001)
This enables building rand for CUDA and HIP and enables the test.
1 parent 9830842 commit 4673ca4

File tree

3 files changed

+1
-10
lines changed

3 files changed

+1
-10
lines changed

libdevice/crt_wrapper.cpp

Lines changed: 0 additions & 6 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,8 +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__
38-
3935
// This simple rand is for ease of use only, the implementation aligns with
4036
// LLVM libc rand which is based on xorshift64star pseudo random number
4137
// generator. If work item number <= 1024, each work item has its own internal
@@ -107,8 +103,6 @@ void srand(unsigned int seed) {
107103
RAND_NEXT_ACC[gid1] = seed;
108104
}
109105

110-
#endif
111-
112106
#if defined(_WIN32)
113107
// Truncates a wide (16 or 32 bit) string (wstr) into an ASCII string (str).
114108
// Any non-ASCII characters are replaced by question mark '?'.

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

sycl/test/e2e_test_requirements/no-unsupported-without-info.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
// tests to match the required format and in that case you should just update
5555
// (i.e. reduce) the number and the list below.
5656
//
57-
// NUMBER-OF-UNSUPPORTED-WITHOUT-INFO: 254
57+
// NUMBER-OF-UNSUPPORTED-WITHOUT-INFO: 253
5858
//
5959
// List of improperly UNSUPPORTED tests.
6060
// Remove the CHECK once the test has been properly UNSUPPORTED.
@@ -114,7 +114,6 @@
114114
// CHECK-NEXT: DeviceLib/imf_half_type_cast.cpp
115115
// CHECK-NEXT: DeviceLib/imf_half_type_cast.cpp
116116
// CHECK-NEXT: DeviceLib/imf_simd_emulate_test.cpp
117-
// CHECK-NEXT: DeviceLib/rand_test.cpp
118117
// CHECK-NEXT: DeviceLib/separate_compile_test.cpp
119118
// CHECK-NEXT: ESIMD/PerformanceTests/BitonicSortK.cpp
120119
// CHECK-NEXT: ESIMD/PerformanceTests/BitonicSortKv2.cpp

0 commit comments

Comments
 (0)