Skip to content

Commit 6df2d88

Browse files
committed
Fix typos and remove the tests from the list of improperly XFAIL-ed tests
1 parent b5471f8 commit 6df2d88

File tree

3 files changed

+113
-39
lines changed

3 files changed

+113
-39
lines changed

\

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
// RUN: %{build} -o %t.out
2+
// RUN: %{run} %t.out
3+
//
4+
// REQUIRES: aspect-usm_shared_allocations
5+
#include <numeric>
6+
7+
#include <sycl/detail/core.hpp>
8+
9+
#include <sycl/sycl_span.hpp>
10+
#include <sycl/usm.hpp>
11+
#include <sycl/usm/usm_allocator.hpp>
12+
13+
using namespace sycl;
14+
15+
void testSpanCapture() {
16+
// This test creates spans that are backed by USM.
17+
// ensures they can be captured by device lambda
18+
// and that read and write operations function correctly
19+
// across capture.
20+
queue Q;
21+
22+
constexpr long numReadTests = 2;
23+
const range<1> NumberOfReadTestsRange(numReadTests);
24+
buffer<int, 1> SpanRead(NumberOfReadTestsRange);
25+
26+
// span from a vector
27+
// We will create a vector, backed by a USM allocator. And a span from that.
28+
using vec_alloc = usm_allocator<int, usm::alloc::shared>;
29+
// Create allocator for device associated with q
30+
vec_alloc myAlloc(Q);
31+
// Create std vector with the allocator
32+
std::vector<int, vec_alloc> vecUSM(4, myAlloc);
33+
std::iota(vecUSM.begin(), vecUSM.end(), 1);
34+
sycl::span<int> vecUSM_span{vecUSM};
35+
vecUSM_span[0] += 100; // 101 modify first value using span affordance.
36+
37+
// span from USM memory
38+
auto *usm_data = malloc_shared<int>(4, Q);
39+
sycl::span<int> usm_span(usm_data, 4);
40+
std::iota(usm_span.begin(), usm_span.end(), 1);
41+
usm_span[0] += 100; // 101 modify first value using span affordance.
42+
43+
event E = Q.submit([&](handler &cgh) {
44+
auto can_read_from_span_acc = SpanRead.get_access<access::mode::write>(cgh);
45+
cgh.single_task<class hi>([=] {
46+
// read from the spans.
47+
can_read_from_span_acc[0] = vecUSM_span[0];
48+
can_read_from_span_acc[1] = usm_span[0];
49+
50+
// write to the spans
51+
vecUSM_span[1] += 1000;
52+
usm_span[1] += 1000;
53+
});
54+
});
55+
E.wait();
56+
57+
// check out the read operations, should have gotten 101 from each
58+
host_accessor can_read_from_span_acc(SpanRead, read_only);
59+
for (int i = 0; i < numReadTests; i++) {
60+
assert(can_read_from_span_acc[i] == 101 &&
61+
"read check should have gotten 100");
62+
}
63+
64+
// were the spans successfully modified via write?
65+
assert(vecUSM_span[1] == 1002 &&
66+
"vecUSM_span write check should have gotten 1001");
67+
assert(usm_span[1] == 1002 && "usm_span write check should have gotten 1001");
68+
69+
free(usm_data, Q);
70+
}
71+
72+
void set_all_span_values(sycl::span<int> container, int v) {
73+
for (auto &e : container)
74+
e = v;
75+
}
76+
77+
void testSpanOnDevice() {
78+
// this test creates a simple span on device,
79+
// passes it to a function that operates on it
80+
// and ensures it worked correctly
81+
queue Q;
82+
constexpr long numReadTests = 4;
83+
const range<1> NumberOfReadTestsRange(numReadTests);
84+
buffer<int, 1> SpanRead(NumberOfReadTestsRange);
85+
86+
event E = Q.submit([&](handler &cgh) {
87+
auto can_read_from_span_acc = SpanRead.get_access<access::mode::write>(cgh);
88+
cgh.single_task<class ha>([=] {
89+
// create a span on device, pass it to function that modifies it
90+
// read values back out.
91+
int a[]{1, 2, 3, 4};
92+
sycl::span<int> a_span{a};
93+
set_all_span_values(a_span, 10);
94+
for (int i = 0; i < numReadTests; i++)
95+
can_read_from_span_acc[i] = a_span[i];
96+
});
97+
});
98+
E.wait();
99+
100+
// check out the read operations, should have gotten 10 from each
101+
host_accessor can_read_from_span_acc(SpanRead, read_only);
102+
for (int i = 0; i < numReadTests; i++) {
103+
assert(can_read_from_span_acc[i] == 10 &&
104+
"read check should have gotten 10");
105+
}
106+
}
107+
108+
int main() {
109+
testSpanCapture();
110+
testSpanOnDevice();
111+
112+
return 0;
113+
}

sycl/test-e2e/Basic/queue/release.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// RUN: %{build} -o %t.out
22
// RUN: env SYCL_UR_TRACE=2 %{run} %t.out | FileCheck %s %if !windows %{--check-prefixes=CHECK-RELEASE%}
3-
//
4-
// XFAIL: hip_nvidia
5-
// XFAIL-TRACKER: https://github.com/intel/llvm/issues/16197
63

74
#include <sycl/detail/core.hpp>
85
int main() {

sycl/test/e2e_test_requirements/no-xfail-without-tracker.cpp

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -58,33 +58,14 @@
5858
//
5959
// CHECK: AddressSanitizer/nullpointer/private_nullptr.cpp
6060
// CHECK-NEXT: Basic/aspects.cpp
61-
// CHECK-NEXT: Basic/buffer/reinterpret.cpp
6261
// CHECK-NEXT: Basic/device_event.cpp
6362
// CHECK-NEXT: Basic/diagnostics/handler.cpp
6463
// CHECK-NEXT: Basic/max_linear_work_group_size_props.cpp
6564
// CHECK-NEXT: Basic/max_work_group_size_props.cpp
6665
// CHECK-NEXT: Basic/partition_supported.cpp
67-
// CHECK-NEXT: Basic/queue/queue.cpp
68-
// CHECK-NEXT: Basic/queue/release.cpp
69-
// CHECK-NEXT: Basic/span.cpp
70-
// CHECK-NEXT: Basic/stream/auto_flush.cpp
71-
// CHECK-NEXT: DeprecatedFeatures/queue_old_interop.cpp
72-
// CHECK-NEXT: DeviceCodeSplit/split-per-kernel.cpp
73-
// CHECK-NEXT: DeviceCodeSplit/split-per-source-main.cpp
7466
// CHECK-NEXT: DeviceLib/assert-windows.cpp
7567
// CHECK-NEXT: ESIMD/hardware_dispatch.cpp
76-
// CHECK-NEXT: GroupAlgorithm/root_group.cpp
77-
// CHECK-NEXT: GroupLocalMemory/group_local_memory.cpp
78-
// CHECK-NEXT: GroupLocalMemory/no_early_opt.cpp
7968
// CHECK-NEXT: InlineAsm/asm_multiple_instructions.cpp
80-
// CHECK-NEXT: InvokeSimd/Feature/ImplicitSubgroup/invoke_simd_struct.cpp
81-
// CHECK-NEXT: InvokeSimd/Feature/invoke_simd_struct.cpp
82-
// CHECK-NEXT: InvokeSimd/Spec/ImplicitSubgroup/tuple.cpp
83-
// CHECK-NEXT: InvokeSimd/Spec/ImplicitSubgroup/tuple_return.cpp
84-
// CHECK-NEXT: InvokeSimd/Spec/ImplicitSubgroup/tuple_vadd.cpp
85-
// CHECK-NEXT: InvokeSimd/Spec/tuple.cpp
86-
// CHECK-NEXT: InvokeSimd/Spec/tuple_return.cpp
87-
// CHECK-NEXT: InvokeSimd/Spec/tuple_vadd.cpp
8869
// CHECK-NEXT: KernelAndProgram/kernel-bundle-merge-options.cpp
8970
// CHECK-NEXT: Matrix/SG32/joint_matrix_annotated_ptr.cpp
9071
// CHECK-NEXT: Matrix/SG32/joint_matrix_bfloat16_colmajorA_colmajorB.cpp
@@ -108,28 +89,11 @@
10889
// CHECK-NEXT: Printf/mixed-address-space.cpp
10990
// CHECK-NEXT: Printf/percent-symbol.cpp
11091
// CHECK-NEXT: Reduction/reduction_big_data.cpp
111-
// CHECK-NEXT: Reduction/reduction_nd_N_queue_shortcut.cpp
112-
// CHECK-NEXT: Reduction/reduction_nd_conditional.cpp
113-
// CHECK-NEXT: Reduction/reduction_nd_dw.cpp
114-
// CHECK-NEXT: Reduction/reduction_nd_ext_double.cpp
115-
// CHECK-NEXT: Reduction/reduction_nd_ext_half.cpp
116-
// CHECK-NEXT: Reduction/reduction_nd_queue_shortcut.cpp
11792
// CHECK-NEXT: Reduction/reduction_nd_reducer_skip.cpp
118-
// CHECK-NEXT: Reduction/reduction_nd_rw.cpp
119-
// CHECK-NEXT: Reduction/reduction_range_queue_shortcut.cpp
120-
// CHECK-NEXT: Reduction/reduction_range_usm_dw.cpp
12193
// CHECK-NEXT: Reduction/reduction_reducer_op_eq.cpp
122-
// CHECK-NEXT: Reduction/reduction_span_pack.cpp
123-
// CHECK-NEXT: Reduction/reduction_usm.cpp
124-
// CHECK-NEXT: Reduction/reduction_usm_dw.cpp
12594
// CHECK-NEXT: Regression/build_log.cpp
12695
// CHECK-NEXT: Regression/complex_global_object.cpp
12796
// CHECK-NEXT: Regression/context_is_destroyed_after_exception.cpp
12897
// CHECK-NEXT: Regression/kernel_bundle_ignore_sycl_external.cpp
12998
// CHECK-NEXT: Regression/multiple-targets.cpp
13099
// CHECK-NEXT: Regression/reduction_resource_leak_dw.cpp
131-
// CHECK-NEXT: Scheduler/InOrderQueueDeps.cpp
132-
// CHECK-NEXT: Scheduler/MemObjRemapping.cpp
133-
// CHECK-NEXT: Scheduler/MultipleDevices.cpp
134-
// CHECK-NEXT: Scheduler/ReleaseResourcesTest.cpp
135-
// CHECK-NEXT: Tracing/buffer_printers.cpp

0 commit comments

Comments
 (0)