Skip to content

[UR][SYCL] Implement USM prefetch from device to host in SYCL runtime and UR #19437

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

Open
wants to merge 40 commits into
base: sycl
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
9ae0c55
Initial non-ABI breaking impl in runtime
ianayl Jul 2, 2025
59ae777
Initial UR implementation, + opencl adapter
ianayl Jul 3, 2025
6e6fe08
Add migration flags to memorymanager
ianayl Jul 7, 2025
fb827be
Add CUDA adapter impl
ianayl Jul 7, 2025
c42c233
More preliminary adapter support
ianayl Jul 9, 2025
a5ed168
Merge branch 'sycl' of https://github.com/intel/llvm into 2way-prefet…
ianayl Jul 14, 2025
41d9a6f
Update USM testing
ianayl Jul 14, 2025
742a636
Revise UR impl to not error, add graph testing
ianayl Jul 17, 2025
c160e42
Merge branch 'sycl' into 2way-prefetch-2
ianayl Jul 17, 2025
6654b6e
Fix bug
ianayl Jul 17, 2025
7141dea
Merge branch 'sycl' of https://github.com/intel/llvm into 2way-prefet…
ianayl Jul 18, 2025
96059fc
Fix bug in enqueue function header
ianayl Jul 18, 2025
b427472
update ur testing
ianayl Jul 18, 2025
4f09c40
fix build issue in new command buffer ur test
ianayl Jul 21, 2025
e3b9e9e
Fix bug
ianayl Jul 21, 2025
ba1f9f6
Fix memory leak
ianayl Jul 21, 2025
294702c
Disable opencl adapter
ianayl Jul 22, 2025
6dbf10a
Disable opencl enqueue function grpah tests
ianayl Jul 22, 2025
a2263f6
ammend test
ianayl Jul 22, 2025
1d16e60
Add breaking changes preview hotpath
ianayl Jul 23, 2025
64bec80
formatting
ianayl Jul 23, 2025
c3cfc1f
Merge branch 'sycl' into 2way-prefetch-2
ianayl Jul 23, 2025
0a45ea3
reenable queue test
ianayl Jul 23, 2025
0f4ed1f
Add unittesting to ensure the runtime calls the UR with the right args
ianayl Jul 24, 2025
236f70b
clang-format
ianayl Jul 24, 2025
6de51cc
Remove overcomplicated prefetch alternatives
ianayl Jul 25, 2025
16d40d9
Fix testing
ianayl Jul 25, 2025
160af9d
Apply suggestions for graph tests
ianayl Jul 25, 2025
ddb53e5
use new syntax for malloc_shared
ianayl Jul 25, 2025
8de6a9a
clang-format
ianayl Jul 25, 2025
e601af9
remove import from handler
ianayl Jul 25, 2025
ebc89db
Merge branch 'sycl' of https://github.com/intel/llvm into 2way-prefet…
ianayl Jul 25, 2025
b9e9fed
Merge branch 'sycl' of https://github.com/intel/llvm into 2way-prefet…
ianayl Jul 29, 2025
514474d
add new ABI symbol
ianayl Jul 29, 2025
b074aa7
remove preview_breaking_changes
ianayl Jul 29, 2025
2451609
Add new unit testing for normal USM prefetch
ianayl Jul 29, 2025
09e9a92
clang-format
ianayl Jul 29, 2025
152c1f5
Be more precise about opencl command buffer support
ianayl Jul 30, 2025
b81a531
clang-format
ianayl Jul 30, 2025
0fe0edf
Merge branch 'sycl' of https://github.com/intel/llvm into 2way-prefet…
ianayl Aug 11, 2025
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
5 changes: 5 additions & 0 deletions sycl/include/sycl/detail/cg_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ enum class CGType : unsigned int {
EnqueueNativeCommand = 27,
AsyncAlloc = 28,
AsyncFree = 29,
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
PrefetchUSMExp = 30,
#else
PrefetchUSMExpD2H = 30,
#endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
PrefetchUSMExp = 30,
#else
PrefetchUSMExpD2H = 30,
#endif
PrefetchUSMExpD2H = 30,

Changing the name here should be fine. It's not part of the ABI by its name, nor does the user have access to it.

};

template <typename, typename T> struct check_fn_signature {
Expand Down
17 changes: 14 additions & 3 deletions sycl/include/sycl/ext/oneapi/experimental/enqueue_functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#include <sycl/detail/common.hpp>
#include <sycl/event.hpp>
#include <sycl/ext/oneapi/experimental/enqueue_types.hpp>
#include <sycl/ext/oneapi/experimental/graph.hpp>
#include <sycl/ext/oneapi/properties/properties.hpp>
#include <sycl/handler.hpp>
Expand Down Expand Up @@ -369,15 +370,25 @@ void fill(sycl::queue Q, T *Ptr, const T &Pattern, size_t Count,
CodeLoc);
}

inline void prefetch(handler &CGH, void *Ptr, size_t NumBytes) {
CGH.prefetch(Ptr, NumBytes);
inline void prefetch(handler &CGH, void *Ptr, size_t NumBytes,
prefetch_type Type = prefetch_type::device) {
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an experimental API, so is there a reason we won't change the behavior? Does this path drastically change existing behavior?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at this quickly because @steffenlarsen mentioned me. I think the #ifdef __INTEL_PREVIEW_BREAKING_CHANGES is there for the case when the user compiles old code (that does not pass the Type parameter) and then runs with an old libsycl.so. In that case, we don't want the application to call CGH.ext_oneapi_prefetch_exp because it doesn't exist in the old libsycl.so.

However, I don't see the reason for adding CGH.ext_oneapi_prefetch_d2h. Why can't we just do this instead:

#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
  CGH.ext_oneapi_prefetch_exp(Ptr, NumBytes, Type);
#else
  if (Type == prefetch_type::device) {
    CGH.prefetch(Ptr, NumBytes);
  } else {
    CGH.ext_oneapi_prefetch_exp(Ptr, NumBytes, Type);
  }
#endif

or for that matter, just create a new overload of CGH.prefetch like:

#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
  CGH.prefetch(Ptr, NumBytes, Type);
#else
  if (Type == prefetch_type::device) {
    CGH.prefetch(Ptr, NumBytes);
  } else {
    CGH.prefetch(Ptr, NumBytes, Type);
  }
#endif

There's no need to preserve ABI in the case when the application uses a new feature that didn't exist in the previous compiler release. Therefore, if the application passes Type with any type other than prefetch_type::device, they're using a new feature and they are required to run with a new libsycl.so.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a lot simpler than how I had it, I went ahead with this approach. Works fine with older versions of libsycl.so as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the #ifdef __INTEL_PREVIEW_BREAKING_CHANGES is there for the case when the user compiles old code (that does not pass the Type parameter) and then runs with an old libsycl.so. In that case, we don't want the application to call CGH.ext_oneapi_prefetch_exp because it doesn't exist in the old libsycl.so.

@gmlueck - Do you mean compile with a new compiler, then run with an old libsycl? That is not something we support. We only support old builds running with new libsycl.

Unless I misunderstood, the question then is whether CGH.ext_oneapi_prefetch_exp(Ptr, NumBytes, prefetch_type::device); has a vast behavioral change compared to CGH.prefetch(Ptr, NumBytes);. Note that it is experimental, so we just need to determine whether it's too disruptive.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean compile with a new compiler, then run with an old libsycl? That is not something we support. We only support old builds running with new libsycl.

Oh, good point. In that case, can't we simplify it further and just do this:

inline void prefetch(handler &CGH, void *Ptr, size_t NumBytes,
                     prefetch_type Type = prefetch_type::device) {
  CGH.prefetch(Ptr, NumBytes, Type);
}

(Note this calls the new CGH.prefetch overload with three parameters.)

We'd still keep the overload with 2 parameters for backward compatibility with applications compiled with the old compiler. We'd need to make sure the 2-parameter overload behaves the same as it did in the old compiler, but isn't that the case?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd need to make sure the 2-parameter overload behaves the same as it did in the old compiler, but isn't that the case?

So that's the part I'm unsure about. If it does, then I don't see any reason we can't switch to it. If it does differ, I wonder how drastically it differs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since support for older libsycl's doesn't matter, I've gone ahead with the change Greg proposed.

If it does differ, I wonder how drastically it differs.

The behavior in the normal code path for prefetch (in the runtime*) should be the "same", although it's worth noting I have also modified the UR here. Despite that, I'm hoping tests can at least show that the runtime implementation behave scorrectly:

Unit testing to make sure the correct parameters are used when invoking the UR from runtime:

  • sycl/unittests/Extensions/USMPrefetch.cpp tests that existing prefetch functions call the UR as intended
  • sycl/unittests/Extensions/EnqueueFunctionsPrefetch.cpp tests that enqueue_functions prefetch calls the UR with the correct user-specified parameters

E2E checks to make sure functions behave as expected:

  • sycl/test-e2e/USM/prefetch.cpp tests normal USM prefetch -- this is a test from prior
  • sycl/test-e2e/USM/prefetch_exp.cpp tests enqueue_functions USM prefetch in both directions

If we know that prefetch is invoking the correct UR call, and there are no errors when we make said UR call, would it be sufficient to say that at least the runtime implementation has no faults in it?

As for the correctness of the UR implementation, I assume that's up to the UR reviewers...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the UR changes, I agree that there shouldn't be any difference in behavior for the device target case, so I am on board with the newest version. 🚀

CGH.ext_oneapi_prefetch_exp(Ptr, NumBytes, Type);
#else
if (Type == prefetch_type::device) {
CGH.prefetch(Ptr, NumBytes);
} else {
CGH.ext_oneapi_prefetch_d2h(Ptr, NumBytes);
}
#endif
}

inline void prefetch(queue Q, void *Ptr, size_t NumBytes,
prefetch_type Type = prefetch_type::device,
const sycl::detail::code_location &CodeLoc =
sycl::detail::code_location::current()) {
submit(
std::move(Q), [&](handler &CGH) { prefetch(CGH, Ptr, NumBytes); },
std::move(Q), [&](handler &CGH) { prefetch(CGH, Ptr, NumBytes, Type); },
CodeLoc);
}

Expand Down
33 changes: 33 additions & 0 deletions sycl/include/sycl/ext/oneapi/experimental/enqueue_types.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//==--------------- enqueue_types.hpp ---- SYCL enqueue types --------------==//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#pragma once

#include <string>

namespace sycl {
inline namespace _V1 {
namespace ext::oneapi::experimental {

/// @brief Indicates the destination device for USM data to be prefetched to.
enum class prefetch_type { device, host };

inline std::string prefetchTypeToString(prefetch_type value) {
switch (value) {
case sycl::ext::oneapi::experimental::prefetch_type::device:
return "prefetch_type::device";
case sycl::ext::oneapi::experimental::prefetch_type::host:
return "prefetch_type::host";
default:
return "prefetch_type::unknown";
}
}

} // namespace ext::oneapi::experimental
} // namespace _V1
} // namespace sycl
28 changes: 28 additions & 0 deletions sycl/include/sycl/handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ namespace ext ::oneapi ::experimental {
template <typename, typename> class work_group_memory;
template <typename, typename> class dynamic_work_group_memory;
struct image_descriptor;
enum class prefetch_type;
void prefetch(handler &CGH, void *Ptr, size_t NumBytes, prefetch_type Type);

__SYCL_EXPORT void async_free(sycl::handler &h, void *ptr);
__SYCL_EXPORT void *async_malloc(sycl::handler &h, sycl::usm::alloc kind,
size_t size);
Expand Down Expand Up @@ -3188,6 +3191,10 @@ class __SYCL_EXPORT handler {
void *MDstPtr = nullptr;
/// Length to copy or fill (for USM operations).
size_t MLength = 0;
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
// Prefetch direction for ext_oneapi_prefetch_exp
ext::oneapi::experimental::prefetch_type MPrefetchType;
#endif
/// Pattern that is used to fill memory object in case command type is fill.
std::vector<unsigned char> MPattern;
/// Storage for a lambda or function object.
Expand Down Expand Up @@ -3454,6 +3461,27 @@ class __SYCL_EXPORT handler {
void ext_oneapi_memset2d_impl(void *Dest, size_t DestPitch, int Value,
size_t Width, size_t Height);

// Implementation of enqueue_functions extension's USM prefetch, allowing for
// prefetching memory from both host to device and vice versa.
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
// Prefetch implementation that accounts for prefetching both directions, but
// introduces a "prefetch type" field to handler/CG nodes: this results in an
// ABI break.
void ext_oneapi_prefetch_exp(const void *Ptr, size_t Count,
ext::oneapi::experimental::prefetch_type Type);
#else
// Non-ABI breaking implementation that implements prefetching from device to
// host as a separate function.
void ext_oneapi_prefetch_d2h(const void *Ptr, size_t Count);
// TODO upon next ABI-breaking cycle, decide which approach to go with.
#endif

// Enqueue_functions extension's prefetch function is friended in order to
// call private handler function ext_oneapi_prefetch_d2h.
friend void ext::oneapi::experimental::prefetch(
handler &CGH, void *Ptr, size_t NumBytes,
ext::oneapi::experimental::prefetch_type Type);

// Implementation of memcpy to device_global.
void memcpyToDeviceGlobal(const void *DeviceGlobalPtr, const void *Src,
bool IsDeviceImageScoped, size_t NumBytes,
Expand Down
35 changes: 35 additions & 0 deletions sycl/source/detail/cg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,41 @@ class CGPrefetchUSM : public CG {
size_t getLength() { return MLength; }
};

#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
/// Enqueue_functions extension USM Prefetch command group class
class CGPrefetchUSMExp : public CG {
void *MDst;
size_t MLength;
ext::oneapi::experimental::prefetch_type MPrefetchType;

public:
CGPrefetchUSMExp(void *DstPtr, size_t Length, CG::StorageInitHelper CGData,
ext::oneapi::experimental::prefetch_type PrefetchType,
detail::code_location loc = {})
: CG(CGType::PrefetchUSMExp, std::move(CGData), std::move(loc)),
MDst(DstPtr), MLength(Length), MPrefetchType(PrefetchType) {}
void *getDst() { return MDst; }
size_t getLength() { return MLength; }
ext::oneapi::experimental::prefetch_type getPrefetchType() {
return MPrefetchType;
}
};
#else
/// Enqueue_functions USM device-to-host prefetch command group class
class CGPrefetchUSMExpD2H : public CG {
void *MDst;
size_t MLength;

public:
CGPrefetchUSMExpD2H(void *DstPtr, size_t Length, CG::StorageInitHelper CGData,
detail::code_location loc = {})
: CG(CGType::PrefetchUSMExpD2H, std::move(CGData), std::move(loc)),
MDst(DstPtr), MLength(Length) {}
void *getDst() { return MDst; }
size_t getLength() { return MLength; }
};
#endif

/// "Advise USM" command group class.
class CGAdviseUSM : public CG {
void *MDst;
Expand Down
40 changes: 39 additions & 1 deletion sycl/source/detail/graph/node_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
#include <sycl/detail/cg_types.hpp> // for CGType
#include <sycl/detail/kernel_desc.hpp> // for kernel_param_kind_t

#include <sycl/ext/oneapi/experimental/graph/node.hpp> // for node
#include <sycl/ext/oneapi/experimental/enqueue_types.hpp> // for prefetchType
#include <sycl/ext/oneapi/experimental/graph/node.hpp> // for node

#include <cstring>
#include <fstream>
Expand Down Expand Up @@ -55,6 +56,11 @@ inline node_type getNodeTypeFromCG(sycl::detail::CGType CGType) {
case sycl::detail::CGType::FillUSM:
return node_type::memfill;
case sycl::detail::CGType::PrefetchUSM:
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
case sycl::detail::CGType::PrefetchUSMExp:
#else
case sycl::detail::CGType::PrefetchUSMExpD2H:
#endif
return node_type::prefetch;
case sycl::detail::CGType::AdviseUSM:
return node_type::memadvise;
Expand Down Expand Up @@ -247,6 +253,13 @@ class node_impl : public std::enable_shared_from_this<node_impl> {
return createCGCopy<sycl::detail::CGFillUSM>();
case sycl::detail::CGType::PrefetchUSM:
return createCGCopy<sycl::detail::CGPrefetchUSM>();
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
case sycl::detail::CGType::PrefetchUSMExp:
return createCGCopy<sycl::detail::CGPrefetchUSMExp>();
#else
case sycl::detail::CGType::PrefetchUSMExpD2H:
return createCGCopy<sycl::detail::CGPrefetchUSMExpD2H>();
#endif
case sycl::detail::CGType::AdviseUSM:
return createCGCopy<sycl::detail::CGAdviseUSM>();
case sycl::detail::CGType::Copy2DUSM:
Expand Down Expand Up @@ -658,6 +671,31 @@ class node_impl : public std::enable_shared_from_this<node_impl> {
<< " Length: " << Prefetch->getLength() << "\\n";
}
break;
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
case sycl::detail::CGType::PrefetchUSMExp:
Stream << "CGPrefetchUSMExp \\n";
if (Verbose) {
sycl::detail::CGPrefetchUSMExp *PrefetchExp =
static_cast<sycl::detail::CGPrefetchUSMExp *>(MCommandGroup.get());
Stream << "Dst: " << PrefetchExp->getDst()
<< " Length: " << PrefetchExp->getLength() << " PrefetchType: "
<< sycl::ext::oneapi::experimental::prefetchTypeToString(
PrefetchExp->getPrefetchType())
<< "\\n";
}
break;
#else
case sycl::detail::CGType::PrefetchUSMExpD2H:
Stream << "CGPrefetchUSMExpD2H (Experimental, Device to host) \\n";
if (Verbose) {
sycl::detail::CGPrefetchUSMExpD2H *Prefetch =
static_cast<sycl::detail::CGPrefetchUSMExpD2H *>(
MCommandGroup.get());
Stream << "Dst: " << Prefetch->getDst()
<< " Length: " << Prefetch->getLength() << "\\n";
}
break;
#endif
case sycl::detail::CGType::AdviseUSM:
Stream << "CGAdviseUSM \\n";
if (Verbose) {
Expand Down
28 changes: 19 additions & 9 deletions sycl/source/detail/memory_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -922,13 +922,18 @@ void MemoryManager::fill_usm(void *Mem, queue_impl &Queue, size_t Length,
DepEvents.size(), DepEvents.data(), OutEvent);
}

void MemoryManager::prefetch_usm(void *Mem, queue_impl &Queue, size_t Length,
std::vector<ur_event_handle_t> DepEvents,
ur_event_handle_t *OutEvent) {
void MemoryManager::prefetch_usm(
void *Mem, queue_impl &Queue, size_t Length,
std::vector<ur_event_handle_t> DepEvents, ur_event_handle_t *OutEvent,
sycl::ext::oneapi::experimental::prefetch_type Dest) {
adapter_impl &Adapter = Queue.getAdapter();
Adapter.call<UrApiKind::urEnqueueUSMPrefetch>(Queue.getHandleRef(), Mem,
Length, 0u, DepEvents.size(),
DepEvents.data(), OutEvent);
ur_usm_migration_flags_t MigrationFlag =
(Dest == sycl::ext::oneapi::experimental::prefetch_type::device)
? UR_USM_MIGRATION_FLAG_HOST_TO_DEVICE
: UR_USM_MIGRATION_FLAG_DEVICE_TO_HOST;
Adapter.call<UrApiKind::urEnqueueUSMPrefetch>(
Queue.getHandleRef(), Mem, Length, MigrationFlag, DepEvents.size(),
DepEvents.data(), OutEvent);
}

void MemoryManager::advise_usm(const void *Mem, queue_impl &Queue,
Expand Down Expand Up @@ -1539,11 +1544,16 @@ void MemoryManager::ext_oneapi_prefetch_usm_cmd_buffer(
sycl::detail::context_impl *Context,
ur_exp_command_buffer_handle_t CommandBuffer, void *Mem, size_t Length,
std::vector<ur_exp_command_buffer_sync_point_t> Deps,
ur_exp_command_buffer_sync_point_t *OutSyncPoint) {
ur_exp_command_buffer_sync_point_t *OutSyncPoint,
sycl::ext::oneapi::experimental::prefetch_type Dest) {
adapter_impl &Adapter = Context->getAdapter();
ur_usm_migration_flags_t MigrationFlag =
(Dest == sycl::ext::oneapi::experimental::prefetch_type::device)
? UR_USM_MIGRATION_FLAG_HOST_TO_DEVICE
: UR_USM_MIGRATION_FLAG_DEVICE_TO_HOST;
Adapter.call<UrApiKind::urCommandBufferAppendUSMPrefetchExp>(
CommandBuffer, Mem, Length, ur_usm_migration_flags_t(0), Deps.size(),
Deps.data(), 0u, nullptr, OutSyncPoint, nullptr, nullptr);
CommandBuffer, Mem, Length, MigrationFlag, Deps.size(), Deps.data(), 0,
nullptr, OutSyncPoint, nullptr, nullptr);
}

void MemoryManager::ext_oneapi_advise_usm_cmd_buffer(
Expand Down
14 changes: 10 additions & 4 deletions sycl/source/detail/memory_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <detail/sycl_mem_obj_i.hpp>
#include <sycl/access/access.hpp>
#include <sycl/detail/export.hpp>
#include <sycl/ext/oneapi/experimental/enqueue_types.hpp> // for prefetch_type
#include <sycl/id.hpp>
#include <sycl/property_list.hpp>
#include <sycl/range.hpp>
Expand Down Expand Up @@ -146,9 +147,12 @@ class MemoryManager {
std::vector<ur_event_handle_t> DepEvents,
ur_event_handle_t *OutEvent);

static void prefetch_usm(void *Ptr, queue_impl &Queue, size_t Len,
std::vector<ur_event_handle_t> DepEvents,
ur_event_handle_t *OutEvent);
static void
prefetch_usm(void *Ptr, queue_impl &Queue, size_t Len,
std::vector<ur_event_handle_t> DepEvents,
ur_event_handle_t *OutEvent,
sycl::ext::oneapi::experimental::prefetch_type Dest =
sycl::ext::oneapi::experimental::prefetch_type::device);

static void advise_usm(const void *Ptr, queue_impl &Queue, size_t Len,
ur_usm_advice_flags_t Advice,
Expand Down Expand Up @@ -245,7 +249,9 @@ class MemoryManager {
sycl::detail::context_impl *Context,
ur_exp_command_buffer_handle_t CommandBuffer, void *Mem, size_t Length,
std::vector<ur_exp_command_buffer_sync_point_t> Deps,
ur_exp_command_buffer_sync_point_t *OutSyncPoint);
ur_exp_command_buffer_sync_point_t *OutSyncPoint,
sycl::ext::oneapi::experimental::prefetch_type Dest =
sycl::ext::oneapi::experimental::prefetch_type::device);

static void ext_oneapi_advise_usm_cmd_buffer(
sycl::detail::context_impl *Context,
Expand Down
Loading
Loading