Skip to content

[SYCL][E2E] Switch Assert/* tests to use <sycl/detail/core.hpp> #13117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion sycl/test-e2e/Assert/Inputs/kernels_in_file2.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

#include <sycl/builtins.hpp>

SYCL_EXTERNAL int calculus(int X);

Expand Down
4 changes: 2 additions & 2 deletions sycl/test-e2e/Assert/assert_in_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
// RUN: %{run} %t.out &> %t.txt ; FileCheck %s --input-file %t.txt %if fpga %{ --check-prefix=CHECK-ACC %}
//
// CHECK-NOT: One shouldn't see this message
// CHECK: {{.*}}assert_in_kernels.hpp:25: void kernelFunc2(int *, int): {{.*}} [{{[0,2]}},0,0], {{.*}} [0,0,0]
// CHECK: {{.*}}assert_in_kernels.hpp:27: void kernelFunc2(int *, int): {{.*}} [{{[0,2]}},0,0], {{.*}} [0,0,0]
// CHECK-SAME: Assertion `Buf[wiID] == 0 && "from assert statement"` failed
// CHECK-NOT: test aborts earlier, one shouldn't see this message
// CHECK-NOT: The test ended.
//
// CHECK-ACC-NOT: {{.*}}assert_in_kernels.hpp:25: void kernelFunc2(int *, int): {{.*}} [{{[0,2]}},0,0], {{.*}} [0,0,0]
// CHECK-ACC-NOT: {{.*}}assert_in_kernels.hpp:27: void kernelFunc2(int *, int): {{.*}} [{{[0,2]}},0,0], {{.*}} [0,0,0]
// CHECK-ACC: The test ended.

#include "assert_in_kernels.hpp"
4 changes: 3 additions & 1 deletion sycl/test-e2e/Assert/assert_in_kernels.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include <cassert>
#include <iostream>
#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

#include <sycl/builtins.hpp>

using namespace sycl;
using namespace sycl::access;
Expand Down
4 changes: 2 additions & 2 deletions sycl/test-e2e/Assert/assert_in_kernels_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
// CHECK-NOT: One shouldn't see this message
// FIXME Windows version prints '(null)' instead of '<unknown func>' once in a
// while for some insane reason.
// CHECK: {{.*}}assert_in_kernels.hpp:25: {{<unknown func>|(null)}}: {{.*}} [{{[0,2]}},0,0], {{.*}} [0,0,0]
// CHECK: {{.*}}assert_in_kernels.hpp:27: {{<unknown func>|(null)}}: {{.*}} [{{[0,2]}},0,0], {{.*}} [0,0,0]
// CHECK-SAME: Assertion `Buf[wiID] == 0 && "from assert statement"` failed.
// CHECK-NOT: test aborts earlier, one shouldn't see this message
// CHECK-NOT: The test ended.
//
// CHECK-ACC-NOT: {{.*}}assert_in_kernels.hpp:25: {{<unknown func>|(null)}}: {{.*}} [{{[0,2]}},0,0], {{.*}} [0,0,0]
// CHECK-ACC-NOT: {{.*}}assert_in_kernels.hpp:27: {{<unknown func>|(null)}}: {{.*}} [{{[0,2]}},0,0], {{.*}} [0,0,0]
// CHECK-ACC: The test ended.

#include "assert_in_kernels.hpp"
4 changes: 3 additions & 1 deletion sycl/test-e2e/Assert/assert_in_multiple_tus.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "Inputs/kernels_in_file2.hpp"
#include <iostream>
#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

#include <sycl/builtins.hpp>

#ifdef DEFINE_NDEBUG_INFILE1
#define NDEBUG
Expand Down
4 changes: 2 additions & 2 deletions sycl/test-e2e/Assert/assert_in_multiple_tus_one_ndebug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
// CHECK-NOT: this message from calculus
// CUDA uses block/thread vs global/local id for SYCL, also it shows the
// position of a thread within the block, not the absolute ID.
// CHECK: {{.*}}assert_in_multiple_tus.hpp:20: int checkFunction(): {{global id: \[5|block: \[1}},0,0],
// CHECK: {{.*}}assert_in_multiple_tus.hpp:22: int checkFunction(): {{global id: \[5|block: \[1}},0,0],
// CHECK-SAME: {{.*}} [1,0,0] Assertion `X && "Nil in result"` failed
// CHECK-NOT: this message from file2
// CHECK-NOT: The test ended.
//
// CHECK-ACC-NOT: {{.*}}assert_in_multiple_tus.hpp:20: int checkFunction(): {{.*}}
// CHECK-ACC-NOT: {{.*}}assert_in_multiple_tus.hpp:22: int checkFunction(): {{.*}}
// CHECK-ACC: The test ended.
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
// CHECK-NOT: this message from calculus
// FIXME Windows version prints '(null)' instead of '<unknown func>' once in a
// while for some insane reason.
// CHECK: {{.*}}assert_in_multiple_tus.hpp:20: {{<unknown func>|(null)}}: {{.*}} [5,0,0],
// CHECK: {{.*}}assert_in_multiple_tus.hpp:22: {{<unknown func>|(null)}}: {{.*}} [5,0,0],
// CHECK-SAME: {{.*}} [1,0,0] Assertion `X && "Nil in result"` failed.
// CHECK-NOT: this message from file2
// CHECK-NOT: The test ended.
//
// CHECK-ACC-NOT: {{.*}}assert_in_multiple_tus.hpp:20: {{<unknown func>|(null)}}: {{.*}} [5,0,0],
// CHECK-ACC-NOT: {{.*}}assert_in_multiple_tus.hpp:22: {{<unknown func>|(null)}}: {{.*}} [5,0,0],
// CHECK-ACC: The test ended.
4 changes: 2 additions & 2 deletions sycl/test-e2e/Assert/assert_in_one_kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
// Shouldn't fail on ACC as fallback assert isn't enqueued there
// RUN: %{run} %t.out &> %t.txt ; FileCheck %s --input-file %t.txt %if fpga %{ --check-prefix=CHECK-ACC %}
//
// CHECK: {{.*}}assert_in_one_kernel.hpp:10: void kernelFunc(int *, int): {{.*}} [{{[0-3]}},0,0], {{.*}} [0,0,0]
// CHECK: {{.*}}assert_in_one_kernel.hpp:12: void kernelFunc(int *, int): {{.*}} [{{[0-3]}},0,0], {{.*}} [0,0,0]
// CHECK-SAME: Assertion `Buf[wiID] != 0 && "from assert statement"` failed
// CHECK-NOT: The test ended.
//
// CHECK-ACC-NOT: {{.*}}assert_in_one_kernel.hpp:10: void kernelFunc(int *, int): {{.*}} [{{[0-3]}},0,0], {{.*}} [0,0,0]
// CHECK-ACC-NOT: {{.*}}assert_in_one_kernel.hpp:12: void kernelFunc(int *, int): {{.*}} [{{[0-3]}},0,0], {{.*}} [0,0,0]
// CHECK-ACC: The test ended.

#include "assert_in_one_kernel.hpp"
4 changes: 3 additions & 1 deletion sycl/test-e2e/Assert/assert_in_one_kernel.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include <cassert>
#include <iostream>
#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

#include <sycl/builtins.hpp>

using namespace sycl;
using namespace sycl::access;
Expand Down
4 changes: 2 additions & 2 deletions sycl/test-e2e/Assert/assert_in_one_kernel_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
//
// FIXME Windows version prints '(null)' instead of '<unknown func>' once in a
// while for some insane reason.
// CHECK: {{.*}}assert_in_one_kernel.hpp:10: {{<unknown func>|(null)}}: {{.*}} [{{[0-3]}},0,0], {{.*}} [0,0,0]
// CHECK: {{.*}}assert_in_one_kernel.hpp:12: {{<unknown func>|(null)}}: {{.*}} [{{[0-3]}},0,0], {{.*}} [0,0,0]
// CHECK-SAME: Assertion `Buf[wiID] != 0 && "from assert statement"` failed.
// CHECK-NOT: The test ended.
//
// CHECK-ACC-NOT: {{.*}}assert_in_one_kernel.hpp:10: {{<unknown func>|(null)}}: {{.*}} [{{[0-3]}},0,0], {{.*}} [0,0,0]
// CHECK-ACC-NOT: {{.*}}assert_in_one_kernel.hpp:12: {{<unknown func>|(null)}}: {{.*}} [{{[0-3]}},0,0], {{.*}} [0,0,0]
// CHECK-ACC: The test ended.

#include "assert_in_one_kernel.hpp"
4 changes: 2 additions & 2 deletions sycl/test-e2e/Assert/assert_in_simultaneous_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
// Shouldn't fail on ACC as fallback assert isn't enqueued there
// RUN: %if gpu %{ %{gpu_env} %} %{run} %t.out &> %t.txt ; FileCheck %s --input-file %t.txt %if fpga %{ --check-prefix=CHECK-ACC %}
//
// CHECK: {{.*}}assert_in_simultaneous_kernels.hpp:13: void assertFunc(): {{.*}}[9,7,0], {{.*}}[0,0,0]
// CHECK: {{.*}}assert_in_simultaneous_kernels.hpp:16: void assertFunc(): {{.*}}[9,7,0], {{.*}}[0,0,0]
// CHECK-SAME: Assertion `false && "from assert statement"` failed
// CHECK-NOT: The test ended.
//
// CHECK-ACC-NOT: {{.*}}assert_in_simultaneous_kernels.hpp:13: void assertFunc(): {{.*}} [9,7,0], {{.*}} [0,0,0]
// CHECK-ACC-NOT: {{.*}}assert_in_simultaneous_kernels.hpp:16: void assertFunc(): {{.*}} [9,7,0], {{.*}} [0,0,0]
// CHECK-ACC: The test ended.

#include "assert_in_simultaneous_kernels.hpp"
5 changes: 4 additions & 1 deletion sycl/test-e2e/Assert/assert_in_simultaneous_kernels.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#include <cassert>
#include <cstdio>
#include <iostream>
#include <sycl/sycl.hpp>
#include <thread>

#include <sycl/detail/core.hpp>

#include <sycl/builtins.hpp>

using namespace sycl;
using namespace sycl::access;

Expand Down
4 changes: 2 additions & 2 deletions sycl/test-e2e/Assert/assert_in_simultaneous_kernels_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
//
// FIXME Windows version prints '(null)' instead of '<unknown func>' once in a
// while for some insane reason.
// CHECK: {{.*}}assert_in_simultaneous_kernels.hpp:13: {{<unknown func>|(null)}}: global id: [9,7,0], local id: [0,0,0]
// CHECK: {{.*}}assert_in_simultaneous_kernels.hpp:16: {{<unknown func>|(null)}}: global id: [9,7,0], local id: [0,0,0]
// CHECK-SAME: Assertion `false && "from assert statement"` failed.
// CHECK-NOT: The test ended.
//
// CHECK-ACC-NOT: {{.*}}assert_in_simultaneous_kernels.hpp:13: {{<unknown func>|(null)}}: global id: [9,7,0], local id: [0,0,0]
// CHECK-ACC-NOT: {{.*}}assert_in_simultaneous_kernels.hpp:16: {{<unknown func>|(null)}}: global id: [9,7,0], local id: [0,0,0]
// CHECK-ACC: The test ended.

#include "assert_in_simultaneous_kernels.hpp"
5 changes: 4 additions & 1 deletion sycl/test-e2e/Assert/check_resource_leak.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
// UNSUPPORTED: hip
#define SYCL_FALLBACK_ASSERT 1

#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

#include <sycl/builtins.hpp>
#include <sycl/ext/oneapi/sub_group_mask.hpp>

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