Skip to content

Commit 2303e07

Browse files
[SYCL] Fix deferred buf destruction regression caused by host device removal (#14396)
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
1 parent 2a85258 commit 2303e07

File tree

5 files changed

+7
-13
lines changed

5 files changed

+7
-13
lines changed

sycl/source/detail/sycl_mem_obj_t.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,16 @@ void SYCLMemObjT::detachMemoryObject(
205205
// For L0 context could be created with two ownership strategies - keep and
206206
// transfer. If user keeps ownership - we could not enable deferred buffer
207207
// release due to resource release conflict.
208+
// MRecord->MCurContext == nullptr means that last submission to buffer is on
209+
// host (host task), this execution doesn't depend on device context and fully
210+
// controlled by RT. In this case deferred buffer destruction is allowed.
208211
bool InteropObjectsUsed =
209212
!MOwnNativeHandle ||
210213
(MInteropContext && !MInteropContext->isOwnedByRuntime());
211214

212-
if (MRecord && MRecord->MCurContext &&
213-
MRecord->MCurContext->isOwnedByRuntime() && !InteropObjectsUsed &&
214-
(!MHostPtrProvided || MIsInternal)) {
215+
if (MRecord &&
216+
(!MRecord->MCurContext || MRecord->MCurContext->isOwnedByRuntime()) &&
217+
!InteropObjectsUsed && (!MHostPtrProvided || MIsInternal)) {
215218
bool okToDefer = GlobalHandler::instance().isOkToDefer();
216219
if (okToDefer)
217220
Scheduler::getInstance().deferMemObjRelease(Self);

sycl/test-e2e/BFloat16/bfloat16_vec.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
// TODO enable opaque pointers support on CPU.
1111
// UNSUPPORTED: cpu || accelerator
1212

13-
// https://github.com/intel/llvm/issues/14397
14-
// UNSUPPORTED: windows && gpu-intel-gen12
15-
1613
// RUN: %{build} -o %t.out
1714
// RUN: %{run} %t.out
1815
// RUN: %if preview-breaking-changes-supported %{ %{build} -fpreview-breaking-changes -o %t2.out %}

sycl/test-e2e/Basic/stream/blocking_pipes_and_stream.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// REQUIRES: accelerator, TEMPORARY_DISABLED
1+
// REQUIRES: accelerator
22

33
// RUN: %{build} -o %t.out
44
// RUN: %{run} %t.out | FileCheck %s

sycl/test-e2e/Basic/stream/stream.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12-
// https://github.com/intel/llvm/issues/14397
13-
// UNSUPPORTED: windows && gpu-intel-gen12
14-
1512
#include <sycl/detail/core.hpp>
1613

1714
#include <sycl/properties/all_properties.hpp>

sycl/test-e2e/Complex/sycl_complex_stream_test.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-finite-math-only%} %else %{-fno-finite-math-only%}
22

3-
// https://github.com/intel/llvm/issues/14397
4-
// UNSUPPORTED: windows && gpu-intel-gen12
5-
63
// RUN: %{build} -fsycl-device-code-split=per_kernel %{mathflags} -o %t.out
74
// RUN: %{run} %t.out
85

0 commit comments

Comments
 (0)