Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
52 changes: 47 additions & 5 deletions adoc/chapters/programming_interface.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3555,6 +3555,33 @@ a@ Equivalent to submitting a command-group containing
a@
[source]
----
event prefetch_host(void* ptr, size_t numBytes)
----
a@ <<sec:usm, USM>>
a@ Equivalent to submitting a command-group containing
[code]#handler::prefetch_host(ptr, numBytes)#.
a@
[source]
----
event prefetch_host(void* ptr, size_t numBytes,
event depEvent)
----
a@ <<sec:usm, USM>>
a@ Equivalent to submitting a command-group containing
[code]#handler::depends_on(depEvent)# and
[code]#handler::prefetch_host(ptr, numBytes)#.
a@
[source]
----
event prefetch_host(void* ptr, size_t numBytes,
const std::vector<event>& depEvents)
----
a@ <<sec:usm, USM>>
a@ Equivalent to submitting a command-group containing
[code]#handler::depends_on(depEvents)# and
[code]#handler::prefetch_host(ptr, numBytes)#.
a@
[source]
event mem_advise(void* ptr, size_t numBytes, int advice)
----
a@ <<sec:usm, USM>>
Expand Down Expand Up @@ -10046,13 +10073,19 @@ modification of shared allocations through the aspect
See <<table.device.aspect>> in <<sec:device-aspects>> for more details.

Performance hints for shared allocations may be specified by the user
by enqueueing [code]#prefetch# operations on a device. These operations
inform the SYCL runtime that the specified shared allocation is
likely to be accessed on the device in the future, and that it is free
by enqueueing [code]#prefetch# or [code]#prefetch_host#.

[code]#prefetch# inform the SYCL runtime that the specified shared allocation is
likely to be accessed by the device associated with the queue, and that it is free
to migrate the allocation to the device.
More about [code]#prefetch# is found in <<table.members.queue>> and

[code]#prefetch_host# inform the SYCL runtime that the specified shared allocation is
likely to be accessed on the host in the future, and that it is free
to migrate the allocation to the host.

More about [code]#prefetch# and [code]#prefetch_host# is found in <<table.members.queue>> and
<<table.members.handler.copy>>. If a device supports concurrent access to
shared allocations, then [code]#prefetch# operations may be overlapped
shared allocations, then [code]#prefetch# and [code]#prefetch_host# operations may be overlapped
with kernel execution.

Additionally, users may use the [code]#mem_advise# member function to annotate
Expand Down Expand Up @@ -13961,6 +13994,15 @@ a@ Enqueues a prefetch of [code]#num_bytes# of data pointed to by
the USM pointer [code]#ptr#.
For more detail on USM, please see <<sec:usm>>.

a@
[source]
----
void prefetch_hosts(void* ptr, size_t numBytes)
----
a@ Enqueues a prefetch host of [code]#num_bytes# of data pointed to by
the USM pointer [code]#ptr#.
For more detail on USM, please see <<sec:usm>>.

a@
[source]
----
Expand Down
1 change: 1 addition & 0 deletions adoc/config/rouge/lib/rouge/lexers/sycl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ class Sycl < Cpp
param_traits
permute_group_by_xor
prefetch
prefetch_host
reduce
reduce_over_group
reinterpret
Expand Down
2 changes: 2 additions & 0 deletions adoc/headers/commandGroupHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ class handler {

void prefetch(void* ptr, size_t numBytes);

void prefetch_host(void* ptr, size_t numBytes);

void mem_advise(void* ptr, size_t numBytes, int advice);

//------ Explicit memory operation APIs
Expand Down
5 changes: 5 additions & 0 deletions adoc/headers/queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ class queue {
event prefetch(void* ptr, size_t numBytes,
const std::vector<event>& depEvents);

event prefetch_host(void* ptr, size_t numBytes);
event prefetch_host(void* ptr, size_t numBytes, event depEvent);
event prefetch_host(void* ptr, size_t numBytes,
const std::vector<event>& depEvents);

event mem_advise(void* ptr, size_t numBytes, int advice);
event mem_advise(void* ptr, size_t numBytes, int advice, event depEvent);
event mem_advise(void* ptr, size_t numBytes, int advice,
Expand Down