Skip to content
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

[SYCL] Fix deferred buf destruction regression caused by host device removal #14396

Merged
merged 6 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
10 changes: 7 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,17 @@ 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 && MRecord->MCurContext->isOwnedByRuntime())) &&
sergey-semenov marked this conversation as resolved.
Show resolved Hide resolved
!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
Loading