Skip to content

Commit

Permalink
[SYCL][E2E] Hack AddressSanitizer/.../device_global.cpp to pass CI
Browse files Browse the repository at this point in the history
  • Loading branch information
aelovikov-intel committed Jan 31, 2025
1 parent 51cfcfa commit 4933957
Showing 1 changed file with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
// REQUIRES: linux, cpu || (gpu && level_zero)

// The following is an ugly hack to make CI pass. The issue here is that when
// sycl-toolchain is built with assertions enabled, then we hit one at
// `DeviceGlobalUSMMem::~DeviceGlobalUSMMem()` and exit with abort. If not, then
// sanitizer does `exit(1)`.
//
// That doesn't matter as long as LIT does *not* use "external shell", but when
// it does, the difference between `not` and `not --crash` becomes crucial and
// we cannot have a single command that would match both behaviors. Ideally,
// we'd need to make a choice based on how the toolchain was built.
// Unfortunately, we don't have that information at the LIT level and
// propagating it all the way down to it would be ugly. Instead, rely on the
// fact that "no-assertion" mode doesn't use "run-only" lit invocations and make
// a choice based on that. This is rather fragile but workarounds the issue for
// the time being.

// DEFINE: %{not} = not %if !build-and-run-mode %{ --crash %}

// RUN: %{build} %device_asan_flags -O0 -g -o %t1.out
// RUN: %{run} not --crash %t1.out 2>&1 | FileCheck %s
// RUN: %{run} %{not} %t1.out 2>&1 | FileCheck %s
// RUN: %{build} %device_asan_flags -O1 -g -o %t2.out
// RUN: %{run} not --crash %t2.out 2>&1 | FileCheck %s
// RUN: %{run} %{not} %t2.out 2>&1 | FileCheck %s
// RUN: %{build} %device_asan_flags -O2 -g -o %t3.out
// RUN: %{run} not --crash %t3.out 2>&1 | FileCheck %s
// RUN: %{run} %{not} %t3.out 2>&1 | FileCheck %s

// Flakily timesout on PVC
// UNSUPPORTED: arch-intel_gpu_pvc
Expand Down

0 comments on commit 4933957

Please sign in to comment.