Skip to content

Commit

Permalink
[SYCL] Fix deferred buf destruction regression caused by host device …
Browse files Browse the repository at this point in the history
…removal (intel#14396)

Signed-off-by: Tikhomirova, Kseniya <[email protected]>
  • Loading branch information
KseniyaTikhomirova committed Jul 3, 2024
1 parent 2a85258 commit 2303e07
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 13 deletions.
9 changes: 6 additions & 3 deletions sycl/source/detail/sycl_mem_obj_t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,16 @@ void SYCLMemObjT::detachMemoryObject(
// For L0 context could be created with two ownership strategies - keep and
// transfer. If user keeps ownership - we could not enable deferred buffer
// release due to resource release conflict.
// MRecord->MCurContext == nullptr means that last submission to buffer is on
// host (host task), this execution doesn't depend on device context and fully
// controlled by RT. In this case deferred buffer destruction is allowed.
bool InteropObjectsUsed =
!MOwnNativeHandle ||
(MInteropContext && !MInteropContext->isOwnedByRuntime());

if (MRecord && MRecord->MCurContext &&
MRecord->MCurContext->isOwnedByRuntime() && !InteropObjectsUsed &&
(!MHostPtrProvided || MIsInternal)) {
if (MRecord &&
(!MRecord->MCurContext || MRecord->MCurContext->isOwnedByRuntime()) &&
!InteropObjectsUsed && (!MHostPtrProvided || MIsInternal)) {
bool okToDefer = GlobalHandler::instance().isOkToDefer();
if (okToDefer)
Scheduler::getInstance().deferMemObjRelease(Self);
Expand Down
3 changes: 0 additions & 3 deletions sycl/test-e2e/BFloat16/bfloat16_vec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
// TODO enable opaque pointers support on CPU.
// UNSUPPORTED: cpu || accelerator

// https://github.com/intel/llvm/issues/14397
// UNSUPPORTED: windows && gpu-intel-gen12

// RUN: %{build} -o %t.out
// RUN: %{run} %t.out
// RUN: %if preview-breaking-changes-supported %{ %{build} -fpreview-breaking-changes -o %t2.out %}
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/stream/blocking_pipes_and_stream.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// REQUIRES: accelerator, TEMPORARY_DISABLED
// REQUIRES: accelerator

// RUN: %{build} -o %t.out
// RUN: %{run} %t.out | FileCheck %s
Expand Down
3 changes: 0 additions & 3 deletions sycl/test-e2e/Basic/stream/stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
//
//===----------------------------------------------------------------------===//

// https://github.com/intel/llvm/issues/14397
// UNSUPPORTED: windows && gpu-intel-gen12

#include <sycl/detail/core.hpp>

#include <sycl/properties/all_properties.hpp>
Expand Down
3 changes: 0 additions & 3 deletions sycl/test-e2e/Complex/sycl_complex_stream_test.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-finite-math-only%} %else %{-fno-finite-math-only%}

// https://github.com/intel/llvm/issues/14397
// UNSUPPORTED: windows && gpu-intel-gen12

// RUN: %{build} -fsycl-device-code-split=per_kernel %{mathflags} -o %t.out
// RUN: %{run} %t.out

Expand Down

0 comments on commit 2303e07

Please sign in to comment.