diff --git a/adoc/chapters/programming_interface.adoc b/adoc/chapters/programming_interface.adoc index 45cb97493..cc5b6673f 100644 --- a/adoc/chapters/programming_interface.adoc +++ b/adoc/chapters/programming_interface.adoc @@ -3555,6 +3555,33 @@ a@ Equivalent to submitting a command-group containing a@ [source] ---- +event prefetch_host(void* ptr, size_t numBytes) +---- +a@ <> +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@ <> +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& depEvents) +---- +a@ <> +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@ <> @@ -10046,13 +10073,19 @@ modification of shared allocations through the aspect See <> in <> 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 <> 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 <> and <>. 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 @@ -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 <>. +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 <>. + a@ [source] ---- diff --git a/adoc/config/rouge/lib/rouge/lexers/sycl.rb b/adoc/config/rouge/lib/rouge/lexers/sycl.rb index 5a798d0bf..836073a1b 100644 --- a/adoc/config/rouge/lib/rouge/lexers/sycl.rb +++ b/adoc/config/rouge/lib/rouge/lexers/sycl.rb @@ -161,6 +161,7 @@ class Sycl < Cpp param_traits permute_group_by_xor prefetch + prefetch_host reduce reduce_over_group reinterpret diff --git a/adoc/headers/commandGroupHandler.h b/adoc/headers/commandGroupHandler.h index 6d95cea9f..4792d66ac 100644 --- a/adoc/headers/commandGroupHandler.h +++ b/adoc/headers/commandGroupHandler.h @@ -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 diff --git a/adoc/headers/queue.h b/adoc/headers/queue.h index f715bcde8..99f4e2072 100644 --- a/adoc/headers/queue.h +++ b/adoc/headers/queue.h @@ -144,6 +144,11 @@ class queue { event prefetch(void* ptr, size_t numBytes, const std::vector& 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& 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,