Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit a9f1c67

Browse files
Merge branch 'intel' of https://github.com/intel/llvm-test-suite into esimd_emulator_ignore_cm_warnings
2 parents 01d4ff1 + 191a7f0 commit a9f1c67

File tree

143 files changed

+4784
-559
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+4784
-559
lines changed

.github/CODEOWNERS

Lines changed: 19 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,35 @@
11
* @vladimirlaz @romanovvlad @bader
22

3-
# AOT compilation
4-
SYCL/AOT @AGindinson @dm-vodopyanov @AlexeySachkov @romanovvlad
3+
# Use runtime team as the umbrella for most of the tests
4+
SYCL @intel/llvm-reviewers-runtime
55

6-
# Atomics
7-
SYCL/AtomicRef @AGindinson
6+
# AOT compilation
7+
SYCL/AOT @intel/dpcpp-tools-reviewers
88

9-
# SYCL RT specific tests
10-
SYCL/Assert @intel/llvm-reviewers-runtime
11-
SYCL/Basic @intel/llvm-reviewers-runtime
12-
SYCL/Config @intel/llvm-reviewers-runtime
13-
SYCL/DiscardEvents @intel/llvm-reviewers-runtime
14-
SYCL/FilterSelector @intel/llvm-reviewers-runtime
15-
SYCL/HostInteropTask @intel/llvm-reviewers-runtime
16-
SYCL/InorderQueue @intel/llvm-reviewers-runtime
17-
SYCL/KernelAndProgram @intel/llvm-reviewers-runtime
18-
SYCL/KernelParams @intel/llvm-reviewers-runtime
19-
SYCL/Scheduler @intel/llvm-reviewers-runtime
20-
SYCL/Tracing @intel/llvm-reviewers-runtime
9+
#BFloat16 conversion
10+
SYCL/BFloat16 @AlexeySotkin @intel/dpcpp-tools-reviewers
2111

2212
# Device code split
23-
SYCL/DeviceCodeSplit @AlexeySachkov @Fznamznon
24-
25-
# Device library
26-
SYCL/DeviceLib @vzakhari
27-
SYCL/DeviceLib/ITTAnnotations @vzakhari @MrSidims @AGindinson
28-
29-
# dot_product API
30-
SYCL/DotProduct @rdeodhar
13+
SYCL/DeviceCodeSplit @intel/dpcpp-tools-reviewers
3114

3215
# Explicit SIMD
33-
SYCL/ESIMD @kbobrovs @v-klochkov @sndmitriev
34-
35-
# Functor
36-
SYCL/Functor @AlexeySachkov
16+
SYCL/ESIMD @intel/dpcpp-esimd-reviewers
3717

3818
# Group algorithms
39-
SYCL/GroupAlgorithm @Pennycook @AlexeySachkov
40-
SYCL/SubGroup @Pennycook @AlexeySachkov
41-
SYCL/SubGroupMask @Pennycook @vladimilaz
42-
43-
# Group local memory
44-
SYCL/GroupLocalMemory @sergey-semenov @Pennycook
45-
46-
# Hierarchical parallelism
47-
SYCL/HierPar @kbobrovs
19+
SYCL/GroupAlgorithm @Pennycook @intel/llvm-reviewers-runtime
20+
SYCL/SubGroup @Pennycook @intel/llvm-reviewers-runtime
21+
SYCL/SubGroupMask @Pennycook @intel/llvm-reviewers-runtime
22+
SYCL/GroupLocalMemory @Pennycook @intel/llvm-reviewers-runtime
4823

49-
# Inline assembler
50-
SYCL/InlineAsm @AlexeySachkov
24+
# Plugin interface for Level Zero
25+
SYCL/Plugin/*level-zero* @intel/dpcpp-l0-pi-reviewers
26+
SYCL/Plugin/*level_zero* @intel/dpcpp-l0-pi-reviewers
5127

52-
# Online compiler
53-
SYCL/OnlineCompiler @v-klochkov
54-
55-
# Plugin interface
56-
SYCL/Plugin @smaslov-intel
57-
58-
# Reduction algorithms
59-
SYCL/Reduction @v-klochkov
60-
61-
# Image sampler
62-
SYCL/Sampler @cperkinsintel
28+
# Printf
29+
SYCL/Printf @intel/dpcpp-tools-reviewers
6330

6431
# Separate compilation
65-
SYCL/SeparateCompile @AlexeySachkov @Fznamznon
32+
SYCL/SeparateCompile @intel/dpcpp-tools-reviewers
6633

6734
# Specialization constant
68-
SYCL/SpecConstants @kbobrovs
69-
70-
# Unified Shared Memory (USM)
71-
SYCL/USM @jbrodman @sergey-semenov
72-
73-
# Stream
74-
SYCL/Basic/stream @againull
75-
76-
#BFloat16 conversion
77-
SYCL/BFloat16 @AlexeySotkin @MrSidims
78-
79-
# Deprecated features
80-
SYCL/DeprecatedFeatures @intel/llvm-reviewers-runtime
35+
SYCL/SpecConstants @intel/dpcpp-tools-reviewers

SYCL/AtomicRef/add.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,14 @@ using namespace sycl;
1212

1313
// Floating-point types do not support pre- or post-increment
1414
template <> void add_test<float>(queue q, size_t N) {
15-
add_fetch_test<::sycl::ext::oneapi::atomic_ref, float>(q, N);
16-
add_fetch_test<::sycl::atomic_ref, float>(q, N);
17-
add_plus_equal_test<::sycl::ext::oneapi::atomic_ref, float>(q, N);
18-
add_plus_equal_test<::sycl::atomic_ref, float>(q, N);
15+
add_fetch_test<::sycl::ext::oneapi::atomic_ref,
16+
access::address_space::global_space, float>(q, N);
17+
add_fetch_test<::sycl::atomic_ref, access::address_space::global_space,
18+
float>(q, N);
19+
add_plus_equal_test<::sycl::ext::oneapi::atomic_ref,
20+
access::address_space::global_space, float>(q, N);
21+
add_plus_equal_test<::sycl::atomic_ref, access::address_space::global_space,
22+
float>(q, N);
1923
}
2024

2125
int main() {

SYCL/AtomicRef/add.h

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ using namespace sycl::ext::oneapi;
1111

1212
template <template <typename, memory_order, memory_scope, access::address_space>
1313
class AtomicRef,
14-
typename T, typename Difference = T>
14+
access::address_space address_space, typename T,
15+
typename Difference = T>
1516
void add_fetch_test(queue q, size_t N) {
1617
T sum = 0;
1718
std::vector<T> output(N);
@@ -27,7 +28,7 @@ void add_fetch_test(queue q, size_t N) {
2728
cgh.parallel_for(range<1>(N), [=](item<1> it) {
2829
int gid = it.get_id(0);
2930
auto atm = AtomicRef<T, memory_order::relaxed, memory_scope::device,
30-
access::address_space::global_space>(sum[0]);
31+
address_space>(sum[0]);
3132
out[gid] = atm.fetch_add(Difference(1));
3233
});
3334
});
@@ -48,7 +49,8 @@ void add_fetch_test(queue q, size_t N) {
4849

4950
template <template <typename, memory_order, memory_scope, access::address_space>
5051
class AtomicRef,
51-
typename T, typename Difference = T>
52+
access::address_space address_space, typename T,
53+
typename Difference = T>
5254
void add_plus_equal_test(queue q, size_t N) {
5355
T sum = 0;
5456
std::vector<T> output(N);
@@ -64,7 +66,7 @@ void add_plus_equal_test(queue q, size_t N) {
6466
cgh.parallel_for(range<1>(N), [=](item<1> it) {
6567
int gid = it.get_id(0);
6668
auto atm = AtomicRef<T, memory_order::relaxed, memory_scope::device,
67-
access::address_space::global_space>(sum[0]);
69+
address_space>(sum[0]);
6870
out[gid] = atm += Difference(1);
6971
});
7072
});
@@ -85,7 +87,8 @@ void add_plus_equal_test(queue q, size_t N) {
8587

8688
template <template <typename, memory_order, memory_scope, access::address_space>
8789
class AtomicRef,
88-
typename T, typename Difference = T>
90+
access::address_space address_space, typename T,
91+
typename Difference = T>
8992
void add_pre_inc_test(queue q, size_t N) {
9093
T sum = 0;
9194
std::vector<T> output(N);
@@ -101,7 +104,7 @@ void add_pre_inc_test(queue q, size_t N) {
101104
cgh.parallel_for(range<1>(N), [=](item<1> it) {
102105
int gid = it.get_id(0);
103106
auto atm = AtomicRef<T, memory_order::relaxed, memory_scope::device,
104-
access::address_space::global_space>(sum[0]);
107+
address_space>(sum[0]);
105108
out[gid] = ++atm;
106109
});
107110
});
@@ -122,7 +125,8 @@ void add_pre_inc_test(queue q, size_t N) {
122125

123126
template <template <typename, memory_order, memory_scope, access::address_space>
124127
class AtomicRef,
125-
typename T, typename Difference = T>
128+
access::address_space address_space, typename T,
129+
typename Difference = T>
126130
void add_post_inc_test(queue q, size_t N) {
127131
T sum = 0;
128132
std::vector<T> output(N);
@@ -138,7 +142,7 @@ void add_post_inc_test(queue q, size_t N) {
138142
cgh.parallel_for(range<1>(N), [=](item<1> it) {
139143
int gid = it.get_id(0);
140144
auto atm = AtomicRef<T, memory_order::relaxed, memory_scope::device,
141-
access::address_space::global_space>(sum[0]);
145+
address_space>(sum[0]);
142146
out[gid] = atm++;
143147
});
144148
});
@@ -159,12 +163,34 @@ void add_post_inc_test(queue q, size_t N) {
159163

160164
template <typename T, typename Difference = T>
161165
void add_test(queue q, size_t N) {
162-
add_fetch_test<::sycl::ext::oneapi::atomic_ref, T, Difference>(q, N);
163-
add_fetch_test<::sycl::atomic_ref, T, Difference>(q, N);
164-
add_plus_equal_test<::sycl::ext::oneapi::atomic_ref, T, Difference>(q, N);
165-
add_plus_equal_test<::sycl::atomic_ref, T, Difference>(q, N);
166-
add_pre_inc_test<::sycl::ext::oneapi::atomic_ref, T, Difference>(q, N);
167-
add_pre_inc_test<::sycl::atomic_ref, T, Difference>(q, N);
168-
add_post_inc_test<::sycl::ext::oneapi::atomic_ref, T, Difference>(q, N);
169-
add_post_inc_test<::sycl::atomic_ref, T, Difference>(q, N);
166+
add_fetch_test<::sycl::ext::oneapi::atomic_ref,
167+
access::address_space::global_space, T, Difference>(q, N);
168+
add_fetch_test<::sycl::atomic_ref, access::address_space::global_space, T,
169+
Difference>(q, N);
170+
add_plus_equal_test<::sycl::ext::oneapi::atomic_ref,
171+
access::address_space::global_space, T, Difference>(q, N);
172+
add_plus_equal_test<::sycl::atomic_ref, access::address_space::global_space,
173+
T, Difference>(q, N);
174+
add_pre_inc_test<::sycl::ext::oneapi::atomic_ref,
175+
access::address_space::global_space, T, Difference>(q, N);
176+
add_pre_inc_test<::sycl::atomic_ref, access::address_space::global_space, T,
177+
Difference>(q, N);
178+
add_post_inc_test<::sycl::ext::oneapi::atomic_ref,
179+
access::address_space::global_space, T, Difference>(q, N);
180+
add_post_inc_test<::sycl::atomic_ref, access::address_space::global_space, T,
181+
Difference>(q, N);
182+
}
183+
184+
template <typename T, typename Difference = T>
185+
void add_generic_test(queue q, size_t N) {
186+
add_fetch_test<::sycl::atomic_ref, access::address_space::generic_space, T,
187+
Difference>(q, N);
188+
add_plus_equal_test<::sycl::atomic_ref, access::address_space::generic_space,
189+
T, Difference>(q, N);
190+
add_pre_inc_test<::sycl::atomic_ref, access::address_space::generic_space, T,
191+
Difference>(q, N);
192+
add_post_inc_test<::sycl::atomic_ref, access::address_space::generic_space, T,
193+
Difference>(q, N);
194+
add_post_inc_test<::sycl::atomic_ref, access::address_space::global_space, T,
195+
Difference>(q, N);
170196
}

SYCL/AtomicRef/add_atomic64.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@ using namespace sycl;
1111

1212
// Floating-point types do not support pre- or post-increment
1313
template <> void add_test<double>(queue q, size_t N) {
14-
add_fetch_test<::sycl::ext::oneapi::atomic_ref, double>(q, N);
15-
add_fetch_test<::sycl::atomic_ref, double>(q, N);
16-
add_plus_equal_test<::sycl::ext::oneapi::atomic_ref, double>(q, N);
17-
add_plus_equal_test<::sycl::atomic_ref, double>(q, N);
14+
add_fetch_test<::sycl::ext::oneapi::atomic_ref,
15+
access::address_space::global_space, double>(q, N);
16+
add_fetch_test<::sycl::atomic_ref, access::address_space::global_space,
17+
double>(q, N);
18+
add_plus_equal_test<::sycl::ext::oneapi::atomic_ref,
19+
access::address_space::global_space, double>(q, N);
20+
add_plus_equal_test<::sycl::atomic_ref, access::address_space::global_space,
21+
double>(q, N);
1822
}
1923

2024
int main() {
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s -o %t.out \
2+
// RUN: -Xsycl-target-backend=nvptx64-nvidia-cuda --cuda-gpu-arch=sm_60
3+
// RUN: %HOST_RUN_PLACEHOLDER %t.out
4+
// RUN: %GPU_RUN_PLACEHOLDER %t.out
5+
// RUN: %CPU_RUN_PLACEHOLDER %t.out
6+
// RUN: %ACC_RUN_PLACEHOLDER %t.out
7+
8+
// CUDA backend has had no support for the generic address space yet
9+
// XFAIL: cuda || hip
10+
11+
#include "add.h"
12+
#include <iostream>
13+
using namespace sycl;
14+
15+
// Floating-point types do not support pre- or post-increment
16+
template <> void add_generic_test<double>(queue q, size_t N) {
17+
add_fetch_test<::sycl::atomic_ref, access::address_space::generic_space,
18+
double>(q, N);
19+
add_plus_equal_test<::sycl::atomic_ref, access::address_space::generic_space,
20+
double>(q, N);
21+
}
22+
23+
int main() {
24+
queue q;
25+
26+
if (!q.get_device().has(aspect::atomic64)) {
27+
std::cout << "Skipping test\n";
28+
return 0;
29+
}
30+
31+
constexpr int N = 32;
32+
add_generic_test<double>(q, N);
33+
34+
// Include long tests if they are 64 bits wide
35+
if constexpr (sizeof(long) == 8) {
36+
add_generic_test<long>(q, N);
37+
add_generic_test<unsigned long>(q, N);
38+
}
39+
40+
// Include long long tests if they are 64 bits wide
41+
if constexpr (sizeof(long long) == 8) {
42+
add_generic_test<long long>(q, N);
43+
add_generic_test<unsigned long long>(q, N);
44+
}
45+
46+
// Include pointer tests if they are 64 bits wide
47+
if constexpr (sizeof(char *) == 8) {
48+
add_generic_test<char *, ptrdiff_t>(q, N);
49+
}
50+
51+
std::cout << "Test passed." << std::endl;
52+
}

SYCL/AtomicRef/add_generic.cpp

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s -o %t.out \
2+
// RUN: -Xsycl-target-backend=nvptx64-nvidia-cuda --cuda-gpu-arch=sm_60
3+
// RUN: %HOST_RUN_PLACEHOLDER %t.out
4+
// RUN: %GPU_RUN_PLACEHOLDER %t.out
5+
// RUN: %CPU_RUN_PLACEHOLDER %t.out
6+
// RUN: %ACC_RUN_PLACEHOLDER %t.out
7+
8+
// CUDA backend has had no support for the generic address space yet
9+
// XFAIL: cuda || hip
10+
11+
#include "add.h"
12+
#include <iostream>
13+
using namespace sycl;
14+
15+
// Floating-point types do not support pre- or post-increment
16+
template <> void add_generic_test<float>(queue q, size_t N) {
17+
add_fetch_test<::sycl::atomic_ref, access::address_space::generic_space,
18+
float>(q, N);
19+
add_plus_equal_test<::sycl::atomic_ref, access::address_space::generic_space,
20+
float>(q, N);
21+
}
22+
23+
int main() {
24+
queue q;
25+
26+
constexpr int N = 32;
27+
add_generic_test<int>(q, N);
28+
add_generic_test<unsigned int>(q, N);
29+
add_generic_test<float>(q, N);
30+
31+
// Include long tests if they are 32 bits wide
32+
if constexpr (sizeof(long) == 4) {
33+
add_generic_test<long>(q, N);
34+
add_generic_test<unsigned long>(q, N);
35+
}
36+
37+
// Include pointer tests if they are 32 bits wide
38+
if constexpr (sizeof(char *) == 4) {
39+
add_generic_test<char *, ptrdiff_t>(q, N);
40+
}
41+
42+
std::cout << "Test passed." << std::endl;
43+
}

SYCL/AtomicRef/assignment.h

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ using namespace sycl::ext::oneapi;
1111

1212
template <template <typename, memory_order, memory_scope, access::address_space>
1313
class AtomicRef,
14-
typename T>
14+
access::address_space address_space, typename T>
1515
class assignment_kernel;
1616

1717
template <template <typename, memory_order, memory_scope, access::address_space>
1818
class AtomicRef,
19-
typename T>
19+
access::address_space address_space, typename T>
2020
void assignment_test(queue q, size_t N) {
2121
T initial = T(N);
2222
T assignment = initial;
@@ -25,11 +25,11 @@ void assignment_test(queue q, size_t N) {
2525
q.submit([&](handler &cgh) {
2626
auto st =
2727
assignment_buf.template get_access<access::mode::read_write>(cgh);
28-
cgh.parallel_for<assignment_kernel<AtomicRef, T>>(
28+
cgh.parallel_for<assignment_kernel<AtomicRef, address_space, T>>(
2929
range<1>(N), [=](item<1> it) {
3030
size_t gid = it.get_id(0);
3131
auto atm = AtomicRef<T, memory_order::relaxed, memory_scope::device,
32-
access::address_space::global_space>(st[0]);
32+
address_space>(st[0]);
3333
atm = T(gid);
3434
});
3535
});
@@ -42,6 +42,13 @@ void assignment_test(queue q, size_t N) {
4242
}
4343

4444
template <typename T> void assignment_test(queue q, size_t N) {
45-
assignment_test<::sycl::ext::oneapi::atomic_ref, T>(q, N);
46-
assignment_test<::sycl::atomic_ref, T>(q, N);
45+
assignment_test<::sycl::ext::oneapi::atomic_ref,
46+
access::address_space::global_space, T>(q, N);
47+
assignment_test<::sycl::atomic_ref, access::address_space::global_space, T>(
48+
q, N);
49+
}
50+
51+
template <typename T> void assignment_generic_test(queue q, size_t N) {
52+
assignment_test<::sycl::atomic_ref, access::address_space::generic_space, T>(
53+
q, N);
4754
}

0 commit comments

Comments
 (0)