Skip to content

Commit 32abcd1

Browse files
[SYCL][NFC] Fix flaky assert_in_multiple_tus behavior (#16799)
The test expects that the first kernel hits an assertion and it never gets to the assertion in the second kernel. However, it was using an out-of-order queue, which meant that that behavior wasn't guaranteed.
1 parent 67a3806 commit 32abcd1

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

sycl/test-e2e/Assert/assert_in_multiple_tus.hpp

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

55
#include <sycl/builtins.hpp>
6+
#include <sycl/properties/all_properties.hpp>
67

78
#ifdef DEFINE_NDEBUG_INFILE1
89
#define NDEBUG
@@ -44,7 +45,7 @@ void enqueueKernel_1_fromFile1(queue *Q) {
4445

4546
int main(int Argc, const char *Argv[]) {
4647

47-
queue Q;
48+
queue Q({sycl::property::queue::in_order{}});
4849
enqueueKernel_1_fromFile1(&Q);
4950
enqueueKernel_2_fromFile2(&Q);
5051
Q.wait();

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:22: int checkFunction(): {{global id: \[5|block: \[1}},0,0],
19+
// CHECK: {{.*}}assert_in_multiple_tus.hpp:23: 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:22: int checkFunction(): {{.*}}
24+
// CHECK-ACC-NOT: {{.*}}assert_in_multiple_tus.hpp:23: 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
@@ -6,10 +6,10 @@
66
// CHECK-NOT: this message from calculus
77
// FIXME Windows version prints '(null)' instead of '<unknown func>' once in a
88
// while for some insane reason.
9-
// CHECK: {{.*}}assert_in_multiple_tus.hpp:22: {{<unknown func>|\(null\)}}: {{.*}} [5,0,0],
9+
// CHECK: {{.*}}assert_in_multiple_tus.hpp:23: {{<unknown func>|\(null\)}}: {{.*}} [5,0,0],
1010
// CHECK-SAME: {{.*}} [1,0,0] Assertion `X && "Nil in result"` failed.
1111
// CHECK-NOT: this message from file2
1212
// CHECK-NOT: The test ended.
1313
//
14-
// CHECK-ACC-NOT: {{.*}}assert_in_multiple_tus.hpp:22: {{<unknown func>|\(null\)}}: {{.*}} [5,0,0],
14+
// CHECK-ACC-NOT: {{.*}}assert_in_multiple_tus.hpp:23: {{<unknown func>|\(null\)}}: {{.*}} [5,0,0],
1515
// CHECK-ACC: The test ended.

0 commit comments

Comments
 (0)