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

Commit dbe4ce8

Browse files
authored
[SYCL] Enable asserts for cuda (#1070)
1 parent b24c43c commit dbe4ce8

12 files changed

+42
-38
lines changed

SYCL/Assert/assert_in_kernels.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// REQUIRES: linux
2-
// FIXME unsupported on CUDA and HIP until fallback libdevice becomes available
3-
// UNSUPPORTED: cuda || hip
2+
// FIXME unsupported on HIP until fallback libdevice becomes available
3+
// UNSUPPORTED: hip
44
// RUN: %clangxx -DSYCL_FALLBACK_ASSERT=1 -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
55
// RUN: %CPU_RUN_PLACEHOLDER %t.out &> %t.txt || true
66
// RUN: %CPU_RUN_PLACEHOLDER FileCheck %s --input-file %t.txt
@@ -11,12 +11,12 @@
1111
// RUN: %ACC_RUN_PLACEHOLDER FileCheck %s --check-prefix=CHECK-ACC --input-file %t.txt
1212
//
1313
// CHECK-NOT: One shouldn't see this message
14-
// CHECK: {{.*}}assert_in_kernels.hpp:26: void kernelFunc2(int *, int): global id: [{{[0,2]}},0,0], local id: [0,0,0]
14+
// CHECK: {{.*}}assert_in_kernels.hpp:26: void kernelFunc2(int *, int): {{.*}} [{{[0,2]}},0,0], {{.*}} [0,0,0]
1515
// CHECK-SAME: Assertion `Buf[wiID] == 0 && "from assert statement"` failed.
1616
// CHECK-NOT: test aborts earlier, one shouldn't see this message
1717
// CHECK-NOT: The test ended.
1818
//
19-
// CHECK-ACC-NOT: {{.*}}assert_in_kernels.hpp:26: void kernelFunc2(int *, int): global id: [{{[0,2]}},0,0], local id: [0,0,0]
19+
// CHECK-ACC-NOT: {{.*}}assert_in_kernels.hpp:26: void kernelFunc2(int *, int): {{.*}} [{{[0,2]}},0,0], {{.*}} [0,0,0]
2020
// CHECK-ACC: The test ended.
2121

2222
#include "assert_in_kernels.hpp"

SYCL/Assert/assert_in_kernels_win.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// REQUIRES: windows
2-
// UNSUPPORTED: cuda || hip
2+
// UNSUPPORTED: hip
33
// RUN: %clangxx -DSYCL_FALLBACK_ASSERT=1 -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
44
// RUN: %CPU_RUN_PLACEHOLDER %t.out &> %t.txt || true
55
// RUN: %CPU_RUN_PLACEHOLDER FileCheck %s --input-file %t.txt
@@ -12,12 +12,12 @@
1212
// CHECK-NOT: One shouldn't see this message
1313
// FIXME Windows version prints '(null)' instead of '<unknown func>' once in a
1414
// while for some insane reason.
15-
// CHECK: {{.*}}assert_in_kernels.hpp:26: {{<unknown func>|(null)}}: global id: [{{[0,2]}},0,0], local id: [0,0,0]
15+
// CHECK: {{.*}}assert_in_kernels.hpp:26: {{<unknown func>|(null)}}: {{.*}} [{{[0,2]}},0,0], {{.*}} [0,0,0]
1616
// CHECK-SAME: Assertion `Buf[wiID] == 0 && "from assert statement"` failed.
1717
// CHECK-NOT: test aborts earlier, one shouldn't see this message
1818
// CHECK-NOT: The test ended.
1919
//
20-
// CHECK-ACC-NOT: {{.*}}assert_in_kernels.hpp:26: {{<unknown func>|(null)}}: global id: [{{[0,2]}},0,0], local id: [0,0,0]
20+
// CHECK-ACC-NOT: {{.*}}assert_in_kernels.hpp:26: {{<unknown func>|(null)}}: {{.*}} [{{[0,2]}},0,0], {{.*}} [0,0,0]
2121
// CHECK-ACC: The test ended.
2222

2323
#include "assert_in_kernels.hpp"

SYCL/Assert/assert_in_multiple_tus.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// REQUIRES: linux
2-
// FIXME unsupported on CUDA and HIP until fallback libdevice becomes available
3-
// UNSUPPORTED: cuda || hip
2+
// FIXME unsupported on HIP until fallback libdevice becomes available
3+
// UNSUPPORTED: hip
44
// RUN: %clangxx -DSYCL_FALLBACK_ASSERT=1 -fsycl -fsycl-targets=%sycl_triple -I %S/Inputs %s %S/Inputs/kernels_in_file2.cpp -o %t.out
55
// RUN: %CPU_RUN_PLACEHOLDER %t.out &> %t.txt || true
66
// RUN: %CPU_RUN_PLACEHOLDER FileCheck %s --input-file %t.txt
@@ -10,7 +10,9 @@
1010
// RUN: %ACC_RUN_PLACEHOLDER %t.out &> %t.txt
1111
// RUN: %ACC_RUN_PLACEHOLDER FileCheck %s --check-prefix=CHECK-ACC --input-file %t.txt
1212
//
13-
// CHECK: {{.*}}kernels_in_file2.cpp:15: int calculus(int): global id: [5,0,0], local id: [1,0,0]
13+
// CUDA uses block/thread vs global/local id for SYCL, also it shows the
14+
// position of a thread within the block, not the absolute ID.
15+
// CHECK: {{.*}}kernels_in_file2.cpp:15: int calculus(int): {{global id: \[5|block: \[1}},0,0], {{local id|thread}}: [1,0,0]
1416
// CHECK-SAME: Assertion `X && "this message from calculus"` failed.
1517
// CHECK-NOT: this message from file2
1618
// CHECK-NOT: The test ended.
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// REQUIRES: linux
2-
// FIXME unsupported on CUDA and HIP until fallback libdevice becomes available
3-
// UNSUPPORTED: cuda || hip
2+
// FIXME unsupported on HIP until fallback libdevice becomes available
3+
// UNSUPPORTED: hip
44
// RUN: %clangxx -DSYCL_FALLBACK_ASSERT=1 -fsycl -fsycl-targets=%sycl_triple -DDEFINE_NDEBUG_INFILE2 -I %S/Inputs %S/assert_in_multiple_tus.cpp %S/Inputs/kernels_in_file2.cpp -o %t.out
55
// RUN: %CPU_RUN_PLACEHOLDER %t.out &> %t.txt || true
66
// RUN: %CPU_RUN_PLACEHOLDER FileCheck %s --input-file %t.txt
@@ -11,10 +11,12 @@
1111
// RUN: %ACC_RUN_PLACEHOLDER FileCheck %s --check-prefix=CHECK-ACC --input-file %t.txt
1212
//
1313
// CHECK-NOT: this message from calculus
14-
// CHECK: {{.*}}assert_in_multiple_tus.hpp:20: int checkFunction(): global id: [5,0,0],
15-
// CHECK-SAME: local id: [1,0,0] Assertion `X && "Nil in result"` failed.
14+
// CUDA uses block/thread vs global/local id for SYCL, also it shows the
15+
// position of a thread within the block, not the absolute ID.
16+
// CHECK: {{.*}}assert_in_multiple_tus.hpp:20: int checkFunction(): {{global id: \[5|block: \[1}},0,0],
17+
// CHECK-SAME: {{.*}} [1,0,0] Assertion `X && "Nil in result"` failed.
1618
// CHECK-NOT: this message from file2
1719
// CHECK-NOT: The test ended.
1820
//
19-
// CHECK-ACC-NOT: {{.*}}assert_in_multiple_tus.hpp:20: int checkFunction(): global id: [5,0,0],
21+
// CHECK-ACC-NOT: {{.*}}assert_in_multiple_tus.hpp:20: int checkFunction(): {{.*}}
2022
// CHECK-ACC: The test ended.

SYCL/Assert/assert_in_multiple_tus_one_ndebug_win.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// REQUIRES: windows
2-
// UNSUPPORTED: cuda || hip
2+
// UNSUPPORTED: hip
33
// RUN: %clangxx -DSYCL_FALLBACK_ASSERT=1 -fsycl -fsycl-targets=%sycl_triple -DDEFINE_NDEBUG_INFILE2 -I %S/Inputs %S/assert_in_multiple_tus.cpp %S/Inputs/kernels_in_file2.cpp -o %t.out
44
// RUN: %CPU_RUN_PLACEHOLDER %t.out &> %t.txt || true
55
// RUN: %CPU_RUN_PLACEHOLDER FileCheck %s --input-file %t.txt
@@ -12,10 +12,10 @@
1212
// CHECK-NOT: this message from calculus
1313
// FIXME Windows version prints '(null)' instead of '<unknown func>' once in a
1414
// while for some insane reason.
15-
// CHECK: {{.*}}assert_in_multiple_tus.hpp:20: {{<unknown func>|(null)}}: global id: [5,0,0],
16-
// CHECK-SAME: local id: [1,0,0] Assertion `X && "Nil in result"` failed.
15+
// CHECK: {{.*}}assert_in_multiple_tus.hpp:20: {{<unknown func>|(null)}}: {{.*}} [5,0,0],
16+
// CHECK-SAME: {{.*}} [1,0,0] Assertion `X && "Nil in result"` failed.
1717
// CHECK-NOT: this message from file2
1818
// CHECK-NOT: The test ended.
1919
//
20-
// CHECK-ACC-NOT: {{.*}}assert_in_multiple_tus.hpp:20: {{<unknown func>|(null)}}: global id: [5,0,0],
20+
// CHECK-ACC-NOT: {{.*}}assert_in_multiple_tus.hpp:20: {{<unknown func>|(null)}}: {{.*}} [5,0,0],
2121
// CHECK-ACC: The test ended.

SYCL/Assert/assert_in_multiple_tus_win.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// REQUIRES: windows
2-
// UNSUPPORTED: cuda || hip
2+
// UNSUPPORTED: hip
33
// RUN: %clangxx -DSYCL_FALLBACK_ASSERT=1 -fsycl -fsycl-targets=%sycl_triple -I %S/Inputs %s %S/Inputs/kernels_in_file2.cpp -o %t.out
44
// RUN: %CPU_RUN_PLACEHOLDER %t.out &> %t.txt || true
55
// RUN: %CPU_RUN_PLACEHOLDER FileCheck %s --input-file %t.txt
@@ -11,12 +11,12 @@
1111
//
1212
// FIXME Windows version prints '(null)' instead of '<unknown func>' once in a
1313
// while for some insane reason.
14-
// CHECK: {{.*}}kernels_in_file2.cpp:15: {{<unknown func>|(null)}}: global id: [5,0,0], local id: [1,0,0]
14+
// CHECK: {{.*}}kernels_in_file2.cpp:15: {{<unknown func>|(null)}}: {{.*}} [5,0,0], {{.*}} [1,0,0]
1515
// CHECK-SAME: Assertion `X && "this message from calculus"` failed.
1616
// CHECK-NOT: this message from file2
1717
// CHECK-NOT: The test ended.
1818
//
19-
// CHECK-ACC-NOT: {{.*}}kernels_in_file2.cpp:15: {{<unknown func>|(null)}}: global id: [5,0,0], local id: [1,0,0]
19+
// CHECK-ACC-NOT: {{.*}}kernels_in_file2.cpp:15: {{<unknown func>|(null)}}: {{.*}} [5,0,0], {{.*}} [1,0,0]
2020
// CHECK-ACC: The test ended.
2121

2222
#include "assert_in_multiple_tus.hpp"

SYCL/Assert/assert_in_one_kernel.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// REQUIRES: linux
2-
// FIXME unsupported on CUDA and HIP until fallback libdevice becomes available
3-
// UNSUPPORTED: cuda || hip
2+
// FIXME unsupported on HIP until fallback libdevice becomes available
3+
// UNSUPPORTED: hip
44
// RUN: %clangxx -DSYCL_FALLBACK_ASSERT=1 -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
55
// RUN: %CPU_RUN_PLACEHOLDER %t.out &> %t.txt || true
66
// RUN: %CPU_RUN_PLACEHOLDER FileCheck %s --input-file %t.txt
@@ -10,11 +10,11 @@
1010
// RUN: %ACC_RUN_PLACEHOLDER %t.out &> %t.txt
1111
// RUN: %ACC_RUN_PLACEHOLDER FileCheck %s --check-prefix=CHECK-ACC --input-file %t.txt
1212
//
13-
// CHECK: {{.*}}assert_in_one_kernel.hpp:10: void kernelFunc(int *, int): global id: [{{[0-3]}},0,0], local id: [0,0,0]
13+
// CHECK: {{.*}}assert_in_one_kernel.hpp:10: void kernelFunc(int *, int): {{.*}} [{{[0-3]}},0,0], {{.*}} [0,0,0]
1414
// CHECK-SAME: Assertion `Buf[wiID] != 0 && "from assert statement"` failed.
1515
// CHECK-NOT: The test ended.
1616
//
17-
// CHECK-ACC-NOT: {{.*}}assert_in_one_kernel.hpp:10: void kernelFunc(int *, int): global id: [{{[0-3]}},0,0], local id: [0,0,0]
17+
// CHECK-ACC-NOT: {{.*}}assert_in_one_kernel.hpp:10: void kernelFunc(int *, int): {{.*}} [{{[0-3]}},0,0], {{.*}} [0,0,0]
1818
// CHECK-ACC: The test ended.
1919

2020
#include "assert_in_one_kernel.hpp"

SYCL/Assert/assert_in_one_kernel_win.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// REQUIRES: windows
2-
// UNSUPPORTED: cuda || hip
2+
// UNSUPPORTED: hip
33
// RUN: %clangxx -DSYCL_FALLBACK_ASSERT=1 -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
44
// RUN: %CPU_RUN_PLACEHOLDER %t.out &> %t.txt || true
55
// RUN: %CPU_RUN_PLACEHOLDER FileCheck %s --input-file %t.txt
@@ -11,11 +11,11 @@
1111
//
1212
// FIXME Windows version prints '(null)' instead of '<unknown func>' once in a
1313
// while for some insane reason.
14-
// CHECK: {{.*}}assert_in_one_kernel.hpp:10: {{<unknown func>|(null)}}: global id: [{{[0-3]}},0,0], local id: [0,0,0]
14+
// CHECK: {{.*}}assert_in_one_kernel.hpp:10: {{<unknown func>|(null)}}: {{.*}} [{{[0-3]}},0,0], {{.*}} [0,0,0]
1515
// CHECK-SAME: Assertion `Buf[wiID] != 0 && "from assert statement"` failed.
1616
// CHECK-NOT: The test ended.
1717
//
18-
// CHECK-ACC-NOT: {{.*}}assert_in_one_kernel.hpp:10: {{<unknown func>|(null)}}: global id: [{{[0-3]}},0,0], local id: [0,0,0]
18+
// CHECK-ACC-NOT: {{.*}}assert_in_one_kernel.hpp:10: {{<unknown func>|(null)}}: {{.*}} [{{[0-3]}},0,0], {{.*}} [0,0,0]
1919
// CHECK-ACC: The test ended.
2020

2121
#include "assert_in_one_kernel.hpp"

SYCL/Assert/assert_in_simultaneous_kernels.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// REQUIRES: linux
2-
// FIXME unsupported on CUDA and HIP until fallback libdevice becomes available
3-
// UNSUPPORTED: cuda || hip
2+
// FIXME unsupported on HIP until fallback libdevice becomes available
3+
// UNSUPPORTED: hip
44
// RUN: %clangxx -DSYCL_FALLBACK_ASSERT=1 -fsycl -fsycl-targets=%sycl_triple %s -o %t.out %threads_lib
55
// RUN: %CPU_RUN_PLACEHOLDER %t.out &> %t.txt || true
66
// RUN: %CPU_RUN_PLACEHOLDER FileCheck %s --input-file %t.txt
@@ -16,11 +16,11 @@
1616
// RUN: %ACC_RUN_PLACEHOLDER %t.out &> %t.txt
1717
// RUN: %ACC_RUN_PLACEHOLDER FileCheck %s --check-prefix=CHECK-ACC --input-file %t.txt
1818
//
19-
// CHECK: {{.*}}assert_in_simultaneous_kernels.hpp:13: void assertFunc(): global id: [9,7,0], local id: [0,0,0]
19+
// CHECK: {{.*}}assert_in_simultaneous_kernels.hpp:13: void assertFunc(): {{.*}}[9,7,0], {{.*}}[0,0,0]
2020
// CHECK-SAME: Assertion `false && "from assert statement"` failed.
2121
// CHECK-NOT: The test ended.
2222
//
23-
// CHECK-ACC-NOT: {{.*}}assert_in_simultaneous_kernels.hpp:13: void assertFunc(): global id: [9,7,0], local id: [0,0,0]
23+
// CHECK-ACC-NOT: {{.*}}assert_in_simultaneous_kernels.hpp:13: void assertFunc(): {{.*}} [9,7,0], {{.*}} [0,0,0]
2424
// CHECK-ACC: The test ended.
2525

2626
#include "assert_in_simultaneous_kernels.hpp"

SYCL/Assert/assert_in_simultaneous_kernels_win.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// REQUIRES: windows
2-
// UNSUPPORTED: cuda || hip
2+
// UNSUPPORTED: hip
33
// RUN: %clangxx -DSYCL_FALLBACK_ASSERT=1 -fsycl -fsycl-targets=%sycl_triple %s -o %t.out %threads_lib
44
// RUN: %CPU_RUN_PLACEHOLDER %t.out &> %t.txt || true
55
// RUN: %CPU_RUN_PLACEHOLDER FileCheck %s --input-file %t.txt

SYCL/Assert/assert_in_simultaneously_multiple_tus.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// FIXME unsupported on CUDA and HIP until fallback libdevice becomes available
1+
// FIXME unsupported on HIP until fallback libdevice becomes available
22
// FIXME flaky output on Level Zero
3-
// UNSUPPORTED: cuda || hip || level_zero
3+
// UNSUPPORTED: hip || level_zero
44
// RUN: %clangxx -DSYCL_FALLBACK_ASSERT=1 -fsycl -fsycl-targets=%sycl_triple -I %S/Inputs %s %S/Inputs/kernels_in_file2.cpp -o %t.out %threads_lib
55
// RUN: %CPU_RUN_PLACEHOLDER %t.out &> %t.txt || true
66
// RUN: %CPU_RUN_PLACEHOLDER FileCheck %s --input-file %t.txt

SYCL/Assert/assert_in_simultaneously_multiple_tus_one_ndebug.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// FIXME unsupported on CUDA and HIP until fallback libdevice becomes available
2-
// UNSUPPORTED: cuda || hip
1+
// FIXME unsupported on HIP until fallback libdevice becomes available
2+
// UNSUPPORTED: hip
33
// RUN: %clangxx -DSYCL_FALLBACK_ASSERT=1 -fsycl -fsycl-targets=%sycl_triple -DDEFINE_NDEBUG_INFILE2 -I %S/Inputs %S/assert_in_simultaneously_multiple_tus.cpp %S/Inputs/kernels_in_file2.cpp -o %t.out %threads_lib
44
// RUN: %CPU_RUN_PLACEHOLDER %t.out &> %t.txt || true
55
// RUN: %CPU_RUN_PLACEHOLDER FileCheck %s --input-file %t.txt

0 commit comments

Comments
 (0)