Skip to content

Commit cceb98f

Browse files
[SYCL][E2E] Switch Assert/* tests to use <sycl/detail/core.hpp> (#13117)
1 parent 6b6eee4 commit cceb98f

14 files changed

+36
-22
lines changed

sycl/test-e2e/Assert/Inputs/kernels_in_file2.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
#include <sycl/sycl.hpp>
1+
#include <sycl/detail/core.hpp>
2+
3+
#include <sycl/builtins.hpp>
24

35
SYCL_EXTERNAL int calculus(int X);
46

sycl/test-e2e/Assert/assert_in_kernels.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
// RUN: %{run} %t.out &> %t.txt ; FileCheck %s --input-file %t.txt %if fpga %{ --check-prefix=CHECK-ACC %}
1212
//
1313
// CHECK-NOT: One shouldn't see this message
14-
// CHECK: {{.*}}assert_in_kernels.hpp:25: void kernelFunc2(int *, int): {{.*}} [{{[0,2]}},0,0], {{.*}} [0,0,0]
14+
// CHECK: {{.*}}assert_in_kernels.hpp:27: 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:25: void kernelFunc2(int *, int): {{.*}} [{{[0,2]}},0,0], {{.*}} [0,0,0]
19+
// CHECK-ACC-NOT: {{.*}}assert_in_kernels.hpp:27: 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/test-e2e/Assert/assert_in_kernels.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#include <cassert>
22
#include <iostream>
3-
#include <sycl/sycl.hpp>
3+
#include <sycl/detail/core.hpp>
4+
5+
#include <sycl/builtins.hpp>
46

57
using namespace sycl;
68
using namespace sycl::access;

sycl/test-e2e/Assert/assert_in_kernels_win.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
// CHECK-NOT: One shouldn't see this message
99
// FIXME Windows version prints '(null)' instead of '<unknown func>' once in a
1010
// while for some insane reason.
11-
// CHECK: {{.*}}assert_in_kernels.hpp:25: {{<unknown func>|(null)}}: {{.*}} [{{[0,2]}},0,0], {{.*}} [0,0,0]
11+
// CHECK: {{.*}}assert_in_kernels.hpp:27: {{<unknown func>|(null)}}: {{.*}} [{{[0,2]}},0,0], {{.*}} [0,0,0]
1212
// CHECK-SAME: Assertion `Buf[wiID] == 0 && "from assert statement"` failed.
1313
// CHECK-NOT: test aborts earlier, one shouldn't see this message
1414
// CHECK-NOT: The test ended.
1515
//
16-
// CHECK-ACC-NOT: {{.*}}assert_in_kernels.hpp:25: {{<unknown func>|(null)}}: {{.*}} [{{[0,2]}},0,0], {{.*}} [0,0,0]
16+
// CHECK-ACC-NOT: {{.*}}assert_in_kernels.hpp:27: {{<unknown func>|(null)}}: {{.*}} [{{[0,2]}},0,0], {{.*}} [0,0,0]
1717
// CHECK-ACC: The test ended.
1818

1919
#include "assert_in_kernels.hpp"

sycl/test-e2e/Assert/assert_in_multiple_tus.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#include "Inputs/kernels_in_file2.hpp"
22
#include <iostream>
3-
#include <sycl/sycl.hpp>
3+
#include <sycl/detail/core.hpp>
4+
5+
#include <sycl/builtins.hpp>
46

57
#ifdef DEFINE_NDEBUG_INFILE1
68
#define NDEBUG

sycl/test-e2e/Assert/assert_in_multiple_tus_one_ndebug.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
// CHECK-NOT: this message from calculus
1717
// CUDA uses block/thread vs global/local id for SYCL, also it shows the
1818
// position of a thread within the block, not the absolute ID.
19-
// CHECK: {{.*}}assert_in_multiple_tus.hpp:20: int checkFunction(): {{global id: \[5|block: \[1}},0,0],
19+
// CHECK: {{.*}}assert_in_multiple_tus.hpp:22: int checkFunction(): {{global id: \[5|block: \[1}},0,0],
2020
// CHECK-SAME: {{.*}} [1,0,0] Assertion `X && "Nil in result"` failed
2121
// CHECK-NOT: this message from file2
2222
// CHECK-NOT: The test ended.
2323
//
24-
// CHECK-ACC-NOT: {{.*}}assert_in_multiple_tus.hpp:20: int checkFunction(): {{.*}}
24+
// CHECK-ACC-NOT: {{.*}}assert_in_multiple_tus.hpp:22: int checkFunction(): {{.*}}
2525
// CHECK-ACC: The test ended.

sycl/test-e2e/Assert/assert_in_multiple_tus_one_ndebug_win.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
// CHECK-NOT: this message from calculus
99
// FIXME Windows version prints '(null)' instead of '<unknown func>' once in a
1010
// while for some insane reason.
11-
// CHECK: {{.*}}assert_in_multiple_tus.hpp:20: {{<unknown func>|(null)}}: {{.*}} [5,0,0],
11+
// CHECK: {{.*}}assert_in_multiple_tus.hpp:22: {{<unknown func>|(null)}}: {{.*}} [5,0,0],
1212
// CHECK-SAME: {{.*}} [1,0,0] Assertion `X && "Nil in result"` failed.
1313
// CHECK-NOT: this message from file2
1414
// CHECK-NOT: The test ended.
1515
//
16-
// CHECK-ACC-NOT: {{.*}}assert_in_multiple_tus.hpp:20: {{<unknown func>|(null)}}: {{.*}} [5,0,0],
16+
// CHECK-ACC-NOT: {{.*}}assert_in_multiple_tus.hpp:22: {{<unknown func>|(null)}}: {{.*}} [5,0,0],
1717
// CHECK-ACC: The test ended.

sycl/test-e2e/Assert/assert_in_one_kernel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
// Shouldn't fail on ACC as fallback assert isn't enqueued there
1111
// RUN: %{run} %t.out &> %t.txt ; FileCheck %s --input-file %t.txt %if fpga %{ --check-prefix=CHECK-ACC %}
1212
//
13-
// CHECK: {{.*}}assert_in_one_kernel.hpp:10: void kernelFunc(int *, int): {{.*}} [{{[0-3]}},0,0], {{.*}} [0,0,0]
13+
// CHECK: {{.*}}assert_in_one_kernel.hpp:12: 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): {{.*}} [{{[0-3]}},0,0], {{.*}} [0,0,0]
17+
// CHECK-ACC-NOT: {{.*}}assert_in_one_kernel.hpp:12: 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/test-e2e/Assert/assert_in_one_kernel.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#include <cassert>
22
#include <iostream>
3-
#include <sycl/sycl.hpp>
3+
#include <sycl/detail/core.hpp>
4+
5+
#include <sycl/builtins.hpp>
46

57
using namespace sycl;
68
using namespace sycl::access;

sycl/test-e2e/Assert/assert_in_one_kernel_win.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
//
88
// FIXME Windows version prints '(null)' instead of '<unknown func>' once in a
99
// while for some insane reason.
10-
// CHECK: {{.*}}assert_in_one_kernel.hpp:10: {{<unknown func>|(null)}}: {{.*}} [{{[0-3]}},0,0], {{.*}} [0,0,0]
10+
// CHECK: {{.*}}assert_in_one_kernel.hpp:12: {{<unknown func>|(null)}}: {{.*}} [{{[0-3]}},0,0], {{.*}} [0,0,0]
1111
// CHECK-SAME: Assertion `Buf[wiID] != 0 && "from assert statement"` failed.
1212
// CHECK-NOT: The test ended.
1313
//
14-
// CHECK-ACC-NOT: {{.*}}assert_in_one_kernel.hpp:10: {{<unknown func>|(null)}}: {{.*}} [{{[0-3]}},0,0], {{.*}} [0,0,0]
14+
// CHECK-ACC-NOT: {{.*}}assert_in_one_kernel.hpp:12: {{<unknown func>|(null)}}: {{.*}} [{{[0-3]}},0,0], {{.*}} [0,0,0]
1515
// CHECK-ACC: The test ended.
1616

1717
#include "assert_in_one_kernel.hpp"

sycl/test-e2e/Assert/assert_in_simultaneous_kernels.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
// Shouldn't fail on ACC as fallback assert isn't enqueued there
2020
// RUN: %if gpu %{ %{gpu_env} %} %{run} %t.out &> %t.txt ; FileCheck %s --input-file %t.txt %if fpga %{ --check-prefix=CHECK-ACC %}
2121
//
22-
// CHECK: {{.*}}assert_in_simultaneous_kernels.hpp:13: void assertFunc(): {{.*}}[9,7,0], {{.*}}[0,0,0]
22+
// CHECK: {{.*}}assert_in_simultaneous_kernels.hpp:16: void assertFunc(): {{.*}}[9,7,0], {{.*}}[0,0,0]
2323
// CHECK-SAME: Assertion `false && "from assert statement"` failed
2424
// CHECK-NOT: The test ended.
2525
//
26-
// CHECK-ACC-NOT: {{.*}}assert_in_simultaneous_kernels.hpp:13: void assertFunc(): {{.*}} [9,7,0], {{.*}} [0,0,0]
26+
// CHECK-ACC-NOT: {{.*}}assert_in_simultaneous_kernels.hpp:16: void assertFunc(): {{.*}} [9,7,0], {{.*}} [0,0,0]
2727
// CHECK-ACC: The test ended.
2828

2929
#include "assert_in_simultaneous_kernels.hpp"

sycl/test-e2e/Assert/assert_in_simultaneous_kernels.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#include <cassert>
22
#include <cstdio>
33
#include <iostream>
4-
#include <sycl/sycl.hpp>
54
#include <thread>
65

6+
#include <sycl/detail/core.hpp>
7+
8+
#include <sycl/builtins.hpp>
9+
710
using namespace sycl;
811
using namespace sycl::access;
912

sycl/test-e2e/Assert/assert_in_simultaneous_kernels_win.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
//
1717
// FIXME Windows version prints '(null)' instead of '<unknown func>' once in a
1818
// while for some insane reason.
19-
// CHECK: {{.*}}assert_in_simultaneous_kernels.hpp:13: {{<unknown func>|(null)}}: global id: [9,7,0], local id: [0,0,0]
19+
// CHECK: {{.*}}assert_in_simultaneous_kernels.hpp:16: {{<unknown func>|(null)}}: global id: [9,7,0], local id: [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: {{<unknown func>|(null)}}: global id: [9,7,0], local id: [0,0,0]
23+
// CHECK-ACC-NOT: {{.*}}assert_in_simultaneous_kernels.hpp:16: {{<unknown func>|(null)}}: global id: [9,7,0], local id: [0,0,0]
2424
// CHECK-ACC: The test ended.
2525

2626
#include "assert_in_simultaneous_kernels.hpp"

sycl/test-e2e/Assert/check_resource_leak.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
// UNSUPPORTED: hip
99
#define SYCL_FALLBACK_ASSERT 1
1010

11-
#include <sycl/sycl.hpp>
11+
#include <sycl/detail/core.hpp>
12+
13+
#include <sycl/builtins.hpp>
14+
#include <sycl/ext/oneapi/sub_group_mask.hpp>
1215

1316
// DeviceGlobalUSMMem::~DeviceGlobalUSMMem() has asserts to ensure some
1417
// resources have been cleaned up when it's executed. Those asserts used to fail

0 commit comments

Comments
 (0)