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

Commit 1226e5c

Browse files
[SYCL][CUDA] Unoptimized stream regression test (#362)
Previously the CUDA backend would fail due to invalid atomic memory orders not being optimized out. The use of these invalid memory orders have been removed in recent changes, so this commit adds a regression test to make sure they do not resurface. Signed-off-by: Steffen Larsen <[email protected]>
1 parent 9ebd667 commit 1226e5c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -O0 -o %t.out
2+
// RUN: %HOST_RUN_PLACEHOLDER %t.out
3+
// RUN: %CPU_RUN_PLACEHOLDER %t.out
4+
// RUN: %GPU_RUN_PLACEHOLDER %t.out
5+
6+
// NOTE: The libclc target used by the CUDA backend used to generate atomic load
7+
// variants that were unsupported by NVPTX. Even if they were not used
8+
// directly, sycl::stream and other operations would keep the invalid
9+
// operations in when optimizations were disabled.
10+
11+
#include <sycl/sycl.hpp>
12+
13+
int main() {
14+
sycl::queue q;
15+
q.submit([&](sycl::handler &cgh) {
16+
sycl::stream os(1024, 256, cgh);
17+
cgh.single_task([=]() { os << "test"; });
18+
});
19+
return 0;
20+
}

0 commit comments

Comments
 (0)