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][Graph] Support for Prefetch and memory advise #11474

Merged
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
1df19a1
[SYCL][Graph] Support for Prefetch and memory advise
mfrancepillois Sep 29, 2023
358043d
Merge branch 'sycl' into command-buffer-prefetch-advise-support
mfrancepillois Oct 9, 2023
b2230d7
Fixes clang-format
mfrancepillois Oct 9, 2023
9909ee6
Corrects typos
mfrancepillois Oct 9, 2023
0d36c07
Disables tests with CUDA backend (temporarily)
mfrancepillois Oct 10, 2023
d373c74
Adds missing definitions of prefetch and mem-advise functions
mfrancepillois Oct 11, 2023
8a7d20d
Adds missing symbols
mfrancepillois Oct 11, 2023
eae7760
Adds windows symbols
mfrancepillois Oct 11, 2023
33074dd
Adds missing instructions for storing SyncPoint in events returned by…
mfrancepillois Oct 30, 2023
802c078
Merge branch 'sycl' into command-buffer-prefetch-advise-support
mfrancepillois Dec 4, 2023
267ca3e
Updates tests
mfrancepillois Dec 4, 2023
7c3f3bc
Moves OpenCL stubs to UR
mfrancepillois Dec 6, 2023
381c87f
Merge branch 'sycl' into command-buffer-prefetch-advise-support
mfrancepillois Dec 6, 2023
db45126
clang-format
mfrancepillois Dec 6, 2023
000d5cb
Merge branch 'command-buffer-prefetch-advise-support' of github.com:r…
mfrancepillois Dec 6, 2023
1130c4a
Updates design doc
mfrancepillois Dec 7, 2023
076b705
Updates OpenCL design doc
mfrancepillois Dec 7, 2023
4bd2851
Merge branch 'sycl' into command-buffer-prefetch-advise-support
mfrancepillois Jan 4, 2024
bad026b
Bump _PI_H_VERSION_MINOR number
mfrancepillois Jan 5, 2024
a4576b4
Run FileCheck in new lit tests
EwanC Jan 9, 2024
5fbb5bd
Only run FILECHECKing on Linux CUDA & L0 targets
EwanC Jan 9, 2024
befb716
Merge branch 'sycl' into command-buffer-prefetch-advise-support
EwanC Jan 10, 2024
a9d9de7
Merge branch 'sycl' into command-buffer-prefetch-advise-support
EwanC Jan 11, 2024
8eb1245
Add pi2ur for native-cpu
EwanC Jan 12, 2024
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
4 changes: 4 additions & 0 deletions sycl/doc/design/CommandGraph.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,8 @@ The types of commands which are unsupported, and lead to this exception are:
This corresponds to a memory buffer write command.
* `handler::copy(src, dest)` or `handler::memcpy(dest, src)` - Where both `src` and
`dest` are USM pointers. This corresponds to a USM copy command.
* `handler::prefetch()`.
* `handler::mem_advise()`.

Note that `handler::copy(src, dest)` where both `src` and `dest` are an accessor
is supported, as a memory buffer copy command exists in the OpenCL extension.
Expand All @@ -373,6 +375,8 @@ adapter where there is matching support for each function in the list.
| urCommandBufferAppendMemBufferWriteRectExp | | No |
| urCommandBufferAppendMemBufferReadRectExp | | No |
| urCommandBufferAppendMemBufferFillExp | clCommandFillBufferKHR | Yes |
| urCommandBufferAppendUSMPrefetchExp | | No |
EwanC marked this conversation as resolved.
Show resolved Hide resolved
EwanC marked this conversation as resolved.
Show resolved Hide resolved
| urCommandBufferAppendUSMAdviseExp | | No |
| urCommandBufferEnqueueExp | clEnqueueCommandBufferKHR | Yes |
| | clCommandBarrierWithWaitListKHR | No |
| | clCommandCopyImageKHR | No |
Expand Down
2 changes: 2 additions & 0 deletions sycl/include/sycl/detail/pi.def
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ _PI_API(piextCommandBufferMemBufferWrite)
_PI_API(piextCommandBufferMemBufferWriteRect)
_PI_API(piextCommandBufferMemBufferRead)
_PI_API(piextCommandBufferMemBufferReadRect)
_PI_API(piextCommandBufferPrefetchUSM)
_PI_API(piextCommandBufferAdviseUSM)
_PI_API(piextEnqueueCommandBuffer)

_PI_API(piextUSMPitchedAlloc)
Expand Down
35 changes: 34 additions & 1 deletion sycl/include/sycl/detail/pi.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,10 @@
// 14.37 Added piextUSMImportExternalPointer and piextUSMReleaseImportedPointer.
// 14.38 Change PI_MEM_ADVICE_* values to flags for use in bitwise operations.
// 14.39 Added PI_EXT_INTEL_DEVICE_INFO_ESIMD_SUPPORT device info query.
// 14.40 Added piextCommandBufferPrefetchUSM and piextCommandBufferAdviseUSM

#define _PI_H_VERSION_MAJOR 14
#define _PI_H_VERSION_MINOR 39
#define _PI_H_VERSION_MINOR 40

#define _PI_STRING_HELPER(a) #a
#define _PI_CONCAT(a, b) _PI_STRING_HELPER(a.b)
Expand Down Expand Up @@ -2463,6 +2464,38 @@ __SYCL_EXPORT pi_result piextCommandBufferMemBufferWriteRect(
const pi_ext_sync_point *sync_point_wait_list,
pi_ext_sync_point *sync_point);

/// API to append a USM Prefetch command to the command-buffer.
/// \param command_buffer The command-buffer to append onto.
/// \param ptr points to the memory to migrate.
/// \param size is the number of bytes to migrate.
/// \param flags is a bitfield used to specify memory migration options.
/// \param num_sync_points_in_wait_list The number of sync points in the
/// provided wait list.
/// \param sync_point_wait_list A list of sync points that this command must
/// wait on.
/// \param sync_point The sync_point associated with this memory operation.
__SYCL_EXPORT pi_result piextCommandBufferPrefetchUSM(
mfrancepillois marked this conversation as resolved.
Show resolved Hide resolved
pi_ext_command_buffer command_buffer, const void *ptr, size_t size,
pi_usm_migration_flags flags, pi_uint32 num_sync_points_in_wait_list,
const pi_ext_sync_point *sync_point_wait_list,
pi_ext_sync_point *sync_point);

/// API to append a USM Advise command to the command-buffer.
/// \param command_buffer The command-buffer to append onto.
/// \param ptr is the data to be advised.
/// \param length is the size in bytes of the memory to advise.
/// \param advice is device specific advice.
/// \param num_sync_points_in_wait_list The number of sync points in the
/// provided wait list.
/// \param sync_point_wait_list A list of sync points that this command must
/// wait on.
/// \param sync_point The sync_point associated with this memory operation.
__SYCL_EXPORT pi_result piextCommandBufferAdviseUSM(
pi_ext_command_buffer command_buffer, const void *ptr, size_t length,
pi_mem_advice advice, pi_uint32 num_sync_points_in_wait_list,
const pi_ext_sync_point *sync_point_wait_list,
pi_ext_sync_point *sync_point);

/// API to submit the command-buffer to queue for execution, returns an error if
/// the command-buffer is not finalized or another instance of the same
/// command-buffer is currently executing.
Expand Down
18 changes: 18 additions & 0 deletions sycl/plugins/cuda/pi_cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1137,6 +1137,24 @@ pi_result piextCommandBufferMemBufferWriteRect(
NumSyncPointsInWaitList, SyncPointWaitList, SyncPoint);
}

pi_result piextCommandBufferPrefetchUSM(
pi_ext_command_buffer CommandBuffer, const void *Ptr, size_t Size,
pi_usm_migration_flags Flags, pi_uint32 NumSyncPointsInWaitList,
const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint) {
return pi2ur::piextCommandBufferPrefetchUSM(CommandBuffer, Ptr, Size, Flags,
NumSyncPointsInWaitList,
SyncPointWaitList, SyncPoint);
}

pi_result piextCommandBufferAdviseUSM(
pi_ext_command_buffer CommandBuffer, const void *Ptr, size_t Length,
pi_mem_advice Advice, pi_uint32 NumSyncPointsInWaitList,
const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint) {
return pi2ur::piextCommandBufferAdviseUSM(CommandBuffer, Ptr, Length, Advice,
NumSyncPointsInWaitList,
SyncPointWaitList, SyncPoint);
}

pi_result piextEnqueueCommandBuffer(pi_ext_command_buffer CommandBuffer,
pi_queue Queue,
pi_uint32 NumEventsInWaitList,
Expand Down
18 changes: 18 additions & 0 deletions sycl/plugins/hip/pi_hip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1145,6 +1145,24 @@ pi_result piextCommandBufferMemBufferWriteRect(
NumSyncPointsInWaitList, SyncPointWaitList, SyncPoint);
}

pi_result piextCommandBufferPrefetchUSM(
pi_ext_command_buffer CommandBuffer, const void *Ptr, size_t Size,
pi_usm_migration_flags Flags, pi_uint32 NumSyncPointsInWaitList,
const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint) {
return pi2ur::piextCommandBufferPrefetchUSM(CommandBuffer, Ptr, Size, Flags,
NumSyncPointsInWaitList,
SyncPointWaitList, SyncPoint);
}

pi_result piextCommandBufferAdviseUSM(
pi_ext_command_buffer CommandBuffer, const void *Ptr, size_t Length,
pi_mem_advice Advice, pi_uint32 NumSyncPointsInWaitList,
const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint) {
return pi2ur::piextCommandBufferAdviseUSM(CommandBuffer, Ptr, Length, Advice,
NumSyncPointsInWaitList,
SyncPointWaitList, SyncPoint);
}

pi_result piextEnqueueCommandBuffer(pi_ext_command_buffer CommandBuffer,
pi_queue Queue,
pi_uint32 NumEventsInWaitList,
Expand Down
18 changes: 18 additions & 0 deletions sycl/plugins/level_zero/pi_level_zero.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1304,6 +1304,24 @@ pi_result piextCommandBufferMemBufferWriteRect(
NumSyncPointsInWaitList, SyncPointWaitList, SyncPoint);
}

pi_result piextCommandBufferPrefetchUSM(
pi_ext_command_buffer CommandBuffer, const void *Ptr, size_t Size,
pi_usm_migration_flags Flags, pi_uint32 NumSyncPointsInWaitList,
const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint) {
return pi2ur::piextCommandBufferPrefetchUSM(CommandBuffer, Ptr, Size, Flags,
NumSyncPointsInWaitList,
SyncPointWaitList, SyncPoint);
}

pi_result piextCommandBufferAdviseUSM(
pi_ext_command_buffer CommandBuffer, const void *Ptr, size_t Length,
pi_mem_advice Advice, pi_uint32 NumSyncPointsInWaitList,
const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint) {
return pi2ur::piextCommandBufferAdviseUSM(CommandBuffer, Ptr, Length, Advice,
NumSyncPointsInWaitList,
SyncPointWaitList, SyncPoint);
}

pi_result piextEnqueueCommandBuffer(pi_ext_command_buffer CommandBuffer,
pi_queue Queue,
pi_uint32 NumEventsInWaitList,
Expand Down
18 changes: 18 additions & 0 deletions sycl/plugins/opencl/pi_opencl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,24 @@ pi_result piextCommandBufferMemBufferWriteRect(
NumSyncPointsInWaitList, SyncPointWaitList, SyncPoint);
}

pi_result piextCommandBufferPrefetchUSM(
pi_ext_command_buffer CommandBuffer, const void *Ptr, size_t Size,
pi_usm_migration_flags Flags, pi_uint32 NumSyncPointsInWaitList,
const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint) {
return pi2ur::piextCommandBufferPrefetchUSM(CommandBuffer, Ptr, Size, Flags,
NumSyncPointsInWaitList,
SyncPointWaitList, SyncPoint);
}

pi_result piextCommandBufferAdviseUSM(
pi_ext_command_buffer CommandBuffer, const void *Ptr, size_t Length,
pi_mem_advice Advice, pi_uint32 NumSyncPointsInWaitList,
const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint) {
return pi2ur::piextCommandBufferAdviseUSM(CommandBuffer, Ptr, Length, Advice,
NumSyncPointsInWaitList,
SyncPointWaitList, SyncPoint);
}

pi_result piextEnqueueCommandBuffer(pi_ext_command_buffer CommandBuffer,
pi_queue Queue,
pi_uint32 NumEventsInWaitList,
Expand Down
35 changes: 35 additions & 0 deletions sycl/plugins/unified_runtime/pi2ur.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4568,6 +4568,41 @@ inline pi_result piextCommandBufferMemBufferWrite(
return PI_SUCCESS;
}

inline pi_result piextCommandBufferPrefetchUSM(
pi_ext_command_buffer CommandBuffer, const void *Ptr, size_t Size,
pi_usm_migration_flags Flags, pi_uint32 NumSyncPointsInWaitList,
const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint) {

// flags is currently unused so fail if set
PI_ASSERT(Flags == 0, PI_ERROR_INVALID_VALUE);

ur_exp_command_buffer_handle_t UrCommandBuffer =
reinterpret_cast<ur_exp_command_buffer_handle_t>(CommandBuffer);

// TODO: to map from pi_usm_migration_flags to
// ur_usm_migration_flags_t
// once we have those defined
ur_usm_migration_flags_t UrFlags{};
HANDLE_ERRORS(urCommandBufferAppendUSMPrefetchExp(
UrCommandBuffer, Ptr, Size, UrFlags, NumSyncPointsInWaitList,
SyncPointWaitList, SyncPoint));
return PI_SUCCESS;
}

inline pi_result piextCommandBufferAdviseUSM(
pi_ext_command_buffer CommandBuffer, const void *Ptr, size_t Length,
pi_mem_advice Advice, pi_uint32 NumSyncPointsInWaitList,
const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint) {
ur_exp_command_buffer_handle_t UrCommandBuffer =
reinterpret_cast<ur_exp_command_buffer_handle_t>(CommandBuffer);

ur_usm_advice_flags_t UrAdvice{};
HANDLE_ERRORS(urCommandBufferAppendUSMAdviseExp(
UrCommandBuffer, Ptr, Length, UrAdvice, NumSyncPointsInWaitList,
SyncPointWaitList, SyncPoint));
return PI_SUCCESS;
}

inline pi_result piextEnqueueCommandBuffer(pi_ext_command_buffer CommandBuffer,
pi_queue Queue,
pi_uint32 NumEventsInWaitList,
Expand Down
18 changes: 18 additions & 0 deletions sycl/plugins/unified_runtime/pi_unified_runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1102,6 +1102,24 @@ pi_result piextCommandBufferMemBufferWriteRect(
NumSyncPointsInWaitList, SyncPointWaitList, SyncPoint);
}

pi_result piextCommandBufferPrefetchUSM(
pi_ext_command_buffer CommandBuffer, const void *Ptr, size_t Size,
pi_usm_migration_flags Flags, pi_uint32 NumSyncPointsInWaitList,
const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint) {
return pi2ur::piextCommandBufferPrefetchUSM(CommandBuffer, Ptr, Size, Flags,
NumSyncPointsInWaitList,
SyncPointWaitList, SyncPoint);
}

pi_result piextCommandBufferAdviseUSM(
pi_ext_command_buffer CommandBuffer, const void *Ptr, size_t Length,
pi_mem_advice Advice, pi_uint32 NumSyncPointsInWaitList,
const pi_ext_sync_point *SyncPointWaitList, pi_ext_sync_point *SyncPoint) {
return pi2ur::piextCommandBufferAdviseUSM(CommandBuffer, Ptr, Length, Advice,
NumSyncPointsInWaitList,
SyncPointWaitList, SyncPoint);
}

pi_result piextEnqueueCommandBuffer(pi_ext_command_buffer CommandBuffer,
pi_queue Queue,
pi_uint32 NumEventsInWaitList,
Expand Down
43 changes: 35 additions & 8 deletions sycl/source/detail/memory_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,15 @@ void memBufferMapHelper(const PluginPtr &Plugin, pi_queue Queue, pi_mem Buffer,
// We only want to instrument piEnqueueMemBufferMap

#ifdef XPTI_ENABLE_INSTRUMENTATION
CorrID = emitMemAllocBeginTrace(MemObjID, Size, 0 /* guard zone */);
xpti::utils::finally _{[&] {
emitMemAllocEndTrace(MemObjID, (uintptr_t)(*RetMap), Size,
0 /* guard zone */, CorrID);
}};
CorrID = emitMemAllocBeginTrace(MemObjID, Size, 0 /* guard zone */);
xpti::utils::finally _{[&] {
emitMemAllocEndTrace(MemObjID, (uintptr_t)(*RetMap), Size,
0 /* guard zone */, CorrID);
}};
#endif
Plugin->call<PiApiKind::piEnqueueMemBufferMap>(
Queue, Buffer, Blocking, Flags, Offset, Size, NumEvents, WaitList,
Event, RetMap);
Plugin->call<PiApiKind::piEnqueueMemBufferMap>(Queue, Buffer, Blocking, Flags,
Offset, Size, NumEvents,
WaitList, Event, RetMap);
}

void memUnmapHelper(const PluginPtr &Plugin, pi_queue Queue, pi_mem Mem,
Expand Down Expand Up @@ -1666,6 +1666,33 @@ void MemoryManager::ext_oneapi_copy_usm_cmd_buffer(
}
}

void MemoryManager::ext_oneapi_prefetch_usm_cmd_buffer(
sycl::detail::ContextImplPtr Context,
sycl::detail::pi::PiExtCommandBuffer CommandBuffer, void *Mem,
size_t Length, std::vector<sycl::detail::pi::PiExtSyncPoint> Deps,
sycl::detail::pi::PiExtSyncPoint *OutSyncPoint) {
assert(!Context->is_host() && "Host queue not supported in prefetch_usm.");

const PluginPtr &Plugin = Context->getPlugin();
Plugin->call<PiApiKind::piextCommandBufferPrefetchUSM>(
CommandBuffer, Mem, Length, _pi_usm_migration_flags(0), Deps.size(),
Deps.data(), OutSyncPoint);
}

void MemoryManager::ext_oneapi_advise_usm_cmd_buffer(
sycl::detail::ContextImplPtr Context,
sycl::detail::pi::PiExtCommandBuffer CommandBuffer, const void *Mem,
size_t Length, pi_mem_advice Advice,
std::vector<sycl::detail::pi::PiExtSyncPoint> Deps,
sycl::detail::pi::PiExtSyncPoint *OutSyncPoint) {
assert(!Context->is_host() && "Host queue not supported in advise_usm.");

const PluginPtr &Plugin = Context->getPlugin();
Plugin->call<PiApiKind::piextCommandBufferAdviseUSM>(
CommandBuffer, Mem, Length, Advice, Deps.size(), Deps.data(),
OutSyncPoint);
}

void MemoryManager::copy_image_bindless(
void *Src, QueueImplPtr Queue, void *Dst,
const sycl::detail::pi::PiMemImageDesc &Desc,
Expand Down
13 changes: 13 additions & 0 deletions sycl/source/detail/memory_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,19 @@ class __SYCL_EXPORT MemoryManager {
void *DstMem, std::vector<sycl::detail::pi::PiExtSyncPoint> Deps,
sycl::detail::pi::PiExtSyncPoint *OutSyncPoint);

static void ext_oneapi_prefetch_usm_cmd_buffer(
sycl::detail::ContextImplPtr Context,
sycl::detail::pi::PiExtCommandBuffer CommandBuffer, void *Mem,
size_t Length, std::vector<sycl::detail::pi::PiExtSyncPoint> Deps,
sycl::detail::pi::PiExtSyncPoint *OutSyncPoint);

static void ext_oneapi_advise_usm_cmd_buffer(
sycl::detail::ContextImplPtr Context,
sycl::detail::pi::PiExtCommandBuffer CommandBuffer, const void *Mem,
size_t Length, pi_mem_advice Advice,
std::vector<sycl::detail::pi::PiExtSyncPoint> Deps,
sycl::detail::pi::PiExtSyncPoint *OutSyncPoint);

static void
copy_image_bindless(void *Src, QueueImplPtr Queue, void *Dst,
const sycl::detail::pi::PiMemImageDesc &Desc,
Expand Down
11 changes: 11 additions & 0 deletions sycl/source/detail/queue_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,17 @@ event queue_impl::mem_advise(const std::shared_ptr<detail::queue_impl> &Self,
const void *Ptr, size_t Length,
pi_mem_advice Advice,
const std::vector<event> &DepEvents) {
// If we have a command graph set we need to capture the advise through normal
// queue submission.
if (MGraph.lock()) {
return submit(
[&](handler &CGH) {
CGH.depends_on(DepEvents);
CGH.mem_advise(Ptr, Length, Advice);
},
Self, {});
}

if (MHasDiscardEventsSupport) {
MemoryManager::advise_usm(Ptr, Self, Length, Advice,
getOrWaitEvents(DepEvents, MContext), nullptr);
Expand Down
17 changes: 17 additions & 0 deletions sycl/source/detail/scheduler/commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2764,6 +2764,23 @@ pi_int32 ExecCGCommand::enqueueImpCommandBuffer() {
MEvent->setSyncPoint(OutSyncPoint);
return PI_SUCCESS;
}
case CG::CGTYPE::PrefetchUSM: {
CGPrefetchUSM *Prefetch = (CGPrefetchUSM *)MCommandGroup.get();
MemoryManager::ext_oneapi_prefetch_usm_cmd_buffer(
MQueue->getContextImplPtr(), MCommandBuffer, Prefetch->getDst(),
Prefetch->getLength(), std::move(MSyncPointDeps), &OutSyncPoint);
MEvent->setSyncPoint(OutSyncPoint);
return PI_SUCCESS;
}
case CG::CGTYPE::AdviseUSM: {
CGAdviseUSM *Advise = (CGAdviseUSM *)MCommandGroup.get();
MemoryManager::ext_oneapi_advise_usm_cmd_buffer(
MQueue->getContextImplPtr(), MCommandBuffer, Advise->getDst(),
Advise->getLength(), Advise->getAdvice(), std::move(MSyncPointDeps),
&OutSyncPoint);
MEvent->setSyncPoint(OutSyncPoint);
return PI_SUCCESS;
}
default:
throw runtime_error("CG type not implemented for command buffers.",
PI_ERROR_INVALID_OPERATION);
Expand Down
32 changes: 32 additions & 0 deletions sycl/test-e2e/Graph/Explicit/memadvise.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// RUN: %{build} -o %t.out
// RUN: %if linux && (level_zero || cuda) %{ env SYCL_PI_TRACE=2 %{run} %t.out 2>&1 FileCheck %s %} %else %{ %{run} %t.out %}

// Since Mem advise is only a memory hint that doesn't
// impact results but only performances, we verify
// that a node is correctly added by checking PI function calls.

// CHECK: piextCommandBufferAdviseUSM
// CHECK-NEXT: <unknown> : 0x[[#%x,COMMAND_BUFFER:]]
// CHECK-NEXT: <unknown> : 0x[[#%x,PTR:]]
// CHECK-NEXT: <unknown> : 400
// CHECK-NEXT: <unknown> : 0
// CHECK-NEXT: <unknown> : 0
// CHECK-NEXT: <unknown> : 0
// CHECK-NEXT: <unknown> : 0x[[#%x,ADVISE_SYNC_POINT:]]
// CHECK: pi_result : PI_SUCCESS

// CHECK: piextCommandBufferNDRangeKernel(
// CHECK-NEXT: <unknown> : 0x[[#COMMAND_BUFFER]]
// CHECK-NEXT: <unknown> : 0x[[#%x,KERNEL:]]
// CHECK-NEXT: <unknown> : 1
// CHECK-NEXT: <unknown> : 0x[[#%x,GLOBAL_WORK_OFFSET:]]
// CHECK-NEXT: <unknown> : 0x[[#%x,GLOBAL_WORK_SIZE:]]
// CHECK-NEXT: <unknown> : 0
// CHECK-NEXT: <unknown> : 1
// CHECK-NEXT: <unknown> : 0x[[#%x,SYNC_POINT_WAIT_LIST:]]
// CHECK-NEXT: <unknown> : 0x[[#%x,KERNEL_SYNC_POINT:]]
// CHECK: pi_result : PI_SUCCESS

#define GRAPH_E2E_EXPLICIT

#include "../Inputs/memadvise.cpp"
Loading