Command group handler class. More...
#include <CL/sycl/handler.hpp>
Classes | |
struct | ShouldEnableSetArg |
Public Types | |
template<typename T > | |
using | remove_cv_ref_t = typename detail::remove_cv_t< detail::remove_reference_t< T > > |
template<typename U , typename T > | |
using | is_same_type = std::is_same< remove_cv_ref_t< U >, remove_cv_ref_t< T > > |
Public Member Functions | |
handler (const handler &)=delete | |
handler (handler &&)=delete | |
handler & | operator= (const handler &)=delete |
handler & | operator= (handler &&)=delete |
void | use_kernel_bundle (const kernel_bundle< bundle_state::executable > &ExecBundle) |
template<typename DataT , int Dims, access::mode AccMode, access::target AccTarget> | |
void | require (accessor< DataT, Dims, AccMode, AccTarget, access::placeholder::true_t > Acc) |
Requires access to the memory object associated with the placeholder accessor. More... | |
void | depends_on (event Event) |
Registers event dependencies on this command group. More... | |
void | depends_on (const std::vector< event > &Events) |
Registers event dependencies on this command group. More... | |
template<typename T > | |
detail::enable_if_t< ShouldEnableSetArg< T >::value, void > | set_arg (int ArgIndex, T &&Arg) |
Sets argument for OpenCL interoperability kernels. More... | |
template<typename DataT , int Dims, access::mode AccessMode, access::target AccessTarget, access::placeholder IsPlaceholder> | |
void | set_arg (int ArgIndex, accessor< DataT, Dims, AccessMode, AccessTarget, IsPlaceholder > Arg) |
template<typename... Ts> | |
void | set_args (Ts &&... Args) |
Sets arguments for OpenCL interoperability kernels. More... | |
template<typename KernelName = detail::auto_name, typename KernelType > | |
void | single_task (KernelType KernelFunc) |
Defines and invokes a SYCL kernel function as a function object type. More... | |
template<typename KernelName = detail::auto_name, typename KernelType > | |
void | parallel_for (range< 1 > NumWorkItems, KernelType KernelFunc) |
template<typename KernelName = detail::auto_name, typename KernelType > | |
void | parallel_for (range< 2 > NumWorkItems, KernelType KernelFunc) |
template<typename KernelName = detail::auto_name, typename KernelType > | |
void | parallel_for (range< 3 > NumWorkItems, KernelType KernelFunc) |
template<typename FuncT > | |
__SYCL_DEPRECATED ("run_on_host_intel() is deprecated, use host_task() instead") void run_on_host_intel(FuncT Func) | |
Defines and invokes a SYCL kernel on host device. More... | |
template<typename FuncT > | |
detail::enable_if_t< detail::check_fn_signature< detail::remove_reference_t< FuncT >, void()>::value||detail::check_fn_signature< detail::remove_reference_t< FuncT >, void(interop_handle)>::value > | host_task (FuncT &&Func) |
Enqueues a command to the SYCL runtime to invoke Func once. More... | |
template<typename KernelName = detail::auto_name, typename KernelType , int Dims> | |
void | parallel_for (range< Dims > NumWorkItems, id< Dims > WorkItemOffset, _KERNELFUNCPARAM(KernelFunc)) |
Defines and invokes a SYCL kernel function for the specified range and offset. More... | |
template<typename KernelName = detail::auto_name, typename KernelType , int Dims> | |
void | parallel_for (nd_range< Dims > ExecutionRange, _KERNELFUNCPARAM(KernelFunc)) |
Defines and invokes a SYCL kernel function for the specified nd_range. More... | |
template<typename KernelName = detail::auto_name, typename KernelType , int Dims, typename Reduction > | |
void | parallel_for (range< Dims > Range, Reduction Redu, _KERNELFUNCPARAM(KernelFunc)) |
Defines and invokes a SYCL kernel function for the specified nd_range. More... | |
template<typename KernelName = detail::auto_name, typename KernelType , int Dims, typename Reduction > | |
detail::enable_if_t< Reduction::has_fast_atomics > | parallel_for (nd_range< Dims > Range, Reduction Redu, _KERNELFUNCPARAM(KernelFunc)) |
Implements parallel_for() accepting nd_range Range and one reduction object. More... | |
template<typename KernelName = detail::auto_name, typename KernelType , int Dims, typename Reduction > | |
detail::enable_if_t< Reduction::has_atomic_add_float64 > | parallel_for (nd_range< Dims > Range, Reduction Redu, _KERNELFUNCPARAM(KernelFunc)) |
Implements parallel_for() accepting nd_range Range and one reduction object. More... | |
template<typename KernelName = detail::auto_name, typename KernelType , int Dims, typename Reduction > | |
detail::enable_if_t<!Reduction::has_fast_atomics &&!Reduction::has_atomic_add_float64 > | parallel_for (nd_range< Dims > Range, Reduction Redu, _KERNELFUNCPARAM(KernelFunc)) |
Defines and invokes a SYCL kernel function for the specified nd_range. More... | |
template<typename KernelName , typename KernelType , int Dims, typename Reduction > | |
detail::enable_if_t<!Reduction::has_fast_atomics > | parallel_for_Impl (nd_range< Dims > Range, Reduction Redu, KernelType KernelFunc) |
template<typename KernelName = detail::auto_name, int Dims, typename... RestT> | |
std::enable_if_t<(sizeof...(RestT) >=3 &&ext::oneapi::detail::AreAllButLastReductions< RestT... >::value)> | parallel_for (nd_range< Dims > Range, RestT... Rest) |
template<typename KernelName = detail::auto_name, typename KernelType , int Dims> | |
void | parallel_for_work_group (range< Dims > NumWorkGroups, _KERNELFUNCPARAM(KernelFunc)) |
Hierarchical kernel invocation method of a kernel defined as a lambda encoding the body of each work-group to launch. More... | |
template<typename KernelName = detail::auto_name, typename KernelType , int Dims> | |
void | parallel_for_work_group (range< Dims > NumWorkGroups, range< Dims > WorkGroupSize, _KERNELFUNCPARAM(KernelFunc)) |
Hierarchical kernel invocation method of a kernel defined as a lambda encoding the body of each work-group to launch. More... | |
void | single_task (kernel Kernel) |
Invokes a SYCL kernel. More... | |
void | parallel_for (range< 1 > NumWorkItems, kernel Kernel) |
void | parallel_for (range< 2 > NumWorkItems, kernel Kernel) |
void | parallel_for (range< 3 > NumWorkItems, kernel Kernel) |
template<int Dims> | |
void | parallel_for (range< Dims > NumWorkItems, id< Dims > WorkItemOffset, kernel Kernel) |
Defines and invokes a SYCL kernel function for the specified range and offsets. More... | |
template<int Dims> | |
void | parallel_for (nd_range< Dims > NDRange, kernel Kernel) |
Defines and invokes a SYCL kernel function for the specified range and offsets. More... | |
template<typename KernelName = detail::auto_name, typename KernelType > | |
void | single_task (kernel Kernel, _KERNELFUNCPARAM(KernelFunc)) |
Defines and invokes a SYCL kernel function. More... | |
template<typename FuncT > | |
__SYCL_DEPRECATED ("interop_task() is deprecated, use host_task() instead") void interop_task(FuncT Func) | |
Invokes a lambda on the host. More... | |
template<typename KernelName = detail::auto_name, typename KernelType , int Dims> | |
void | parallel_for (kernel Kernel, range< Dims > NumWorkItems, _KERNELFUNCPARAM(KernelFunc)) |
Defines and invokes a SYCL kernel function for the specified range. More... | |
template<typename KernelName = detail::auto_name, typename KernelType , int Dims> | |
void | parallel_for (kernel Kernel, range< Dims > NumWorkItems, id< Dims > WorkItemOffset, _KERNELFUNCPARAM(KernelFunc)) |
Defines and invokes a SYCL kernel function for the specified range and offsets. More... | |
template<typename KernelName = detail::auto_name, typename KernelType , int Dims> | |
void | parallel_for (kernel Kernel, nd_range< Dims > NDRange, _KERNELFUNCPARAM(KernelFunc)) |
Defines and invokes a SYCL kernel function for the specified range and offsets. More... | |
template<typename KernelName = detail::auto_name, typename KernelType , int Dims> | |
void | parallel_for_work_group (kernel Kernel, range< Dims > NumWorkGroups, _KERNELFUNCPARAM(KernelFunc)) |
Hierarchical kernel invocation method of a kernel. More... | |
template<typename KernelName = detail::auto_name, typename KernelType , int Dims> | |
void | parallel_for_work_group (kernel Kernel, range< Dims > NumWorkGroups, range< Dims > WorkGroupSize, _KERNELFUNCPARAM(KernelFunc)) |
Hierarchical kernel invocation method of a kernel. More... | |
template<typename T_Src , typename T_Dst , int Dims, access::mode AccessMode, access::target AccessTarget, access::placeholder IsPlaceholder = access::placeholder::false_t> | |
void | copy (accessor< T_Src, Dims, AccessMode, AccessTarget, IsPlaceholder > Src, std::shared_ptr< T_Dst > Dst) |
Copies the content of memory object accessed by Src into the memory pointed by Dst. More... | |
template<typename T_Src , typename T_Dst , int Dims, access::mode AccessMode, access::target AccessTarget, access::placeholder IsPlaceholder = access::placeholder::false_t> | |
void | copy (std::shared_ptr< T_Src > Src, accessor< T_Dst, Dims, AccessMode, AccessTarget, IsPlaceholder > Dst) |
Copies the content of memory pointed by Src into the memory object accessed by Dst. More... | |
template<typename T_Src , typename T_Dst , int Dims, access::mode AccessMode, access::target AccessTarget, access::placeholder IsPlaceholder = access::placeholder::false_t> | |
void | copy (accessor< T_Src, Dims, AccessMode, AccessTarget, IsPlaceholder > Src, T_Dst *Dst) |
Copies the content of memory object accessed by Src into the memory pointed by Dst. More... | |
template<typename T_Src , typename T_Dst , int Dims, access::mode AccessMode, access::target AccessTarget, access::placeholder IsPlaceholder = access::placeholder::false_t> | |
void | copy (const T_Src *Src, accessor< T_Dst, Dims, AccessMode, AccessTarget, IsPlaceholder > Dst) |
Copies the content of memory pointed by Src into the memory object accessed by Dst. More... | |
template<typename T_Src , int Dims_Src, access::mode AccessMode_Src, access::target AccessTarget_Src, typename T_Dst , int Dims_Dst, access::mode AccessMode_Dst, access::target AccessTarget_Dst, access::placeholder IsPlaceholder_Src = access::placeholder::false_t, access::placeholder IsPlaceholder_Dst = access::placeholder::false_t> | |
void | copy (accessor< T_Src, Dims_Src, AccessMode_Src, AccessTarget_Src, IsPlaceholder_Src > Src, accessor< T_Dst, Dims_Dst, AccessMode_Dst, AccessTarget_Dst, IsPlaceholder_Dst > Dst) |
Copies the content of memory object accessed by Src to the memory object accessed by Dst. More... | |
template<typename T , int Dims, access::mode AccessMode, access::target AccessTarget, access::placeholder IsPlaceholder = access::placeholder::false_t> | |
void | update_host (accessor< T, Dims, AccessMode, AccessTarget, IsPlaceholder > Acc) |
Provides guarantees that the memory object accessed via Acc is updated on the host after command group object execution is complete. More... | |
template<typename T , int Dims, access::mode AccessMode, access::target AccessTarget, access::placeholder IsPlaceholder = access::placeholder::false_t, typename PropertyListT = property_list> | |
void | fill (accessor< T, Dims, AccessMode, AccessTarget, IsPlaceholder, PropertyListT > Dst, const T &Pattern) |
Fills memory pointed by accessor with the pattern given. More... | |
template<typename T > | |
void | fill (void *Ptr, const T &Pattern, size_t Count) |
Fills the specified memory with the specified pattern. More... | |
void | ext_oneapi_barrier () |
Prevents any commands submitted afterward to this queue from executing until all commands previously submitted to this queue have entered the complete state. More... | |
void | barrier () |
Prevents any commands submitted afterward to this queue from executing until all commands previously submitted to this queue have entered the complete state. More... | |
void | ext_oneapi_barrier (const std::vector< event > &WaitList) |
Prevents any commands submitted afterward to this queue from executing until all events in WaitList have entered the complete state. More... | |
void | barrier (const std::vector< event > &WaitList) |
Prevents any commands submitted afterward to this queue from executing until all events in WaitList have entered the complete state. More... | |
void | memcpy (void *Dest, const void *Src, size_t Count) |
Copies data from one memory region to another, both pointed by USM pointers. More... | |
template<typename T > | |
void | copy (const T *Src, T *Dest, size_t Count) |
Copies data from one memory region to another, both pointed by USM pointers. More... | |
void | memset (void *Dest, int Value, size_t Count) |
Fills the memory pointed by a USM pointer with the value specified. More... | |
void | prefetch (const void *Ptr, size_t Count) |
Provides hints to the runtime library that data should be made available on a device earlier than Unified Shared Memory would normally require it to be available. More... | |
void | mem_advise (const void *Ptr, size_t Length, int Advice) |
Provides additional information to the underlying runtime about how different allocations are used. More... | |
Friends | |
class | detail::queue_impl |
template<typename DataT , int Dims, access::mode AccMode, access::target AccTarget, access::placeholder isPlaceholder, typename PropertyListT > | |
class | accessor |
template<typename DataT , int Dimensions, access::mode AccessMode, access::target AccessTarget, access::placeholder IsPlaceholder> | |
class | detail::image_accessor |
class | stream |
class | detail::stream_impl |
template<typename T , class BinaryOperation , int Dims, size_t Extent, class Algorithm > | |
class | ext::oneapi::detail::reduction_impl_algo |
class | ::MockHandler |
device | detail::getDeviceFromHandler (handler &) |
void | detail::associateWithHandler (handler &, detail::AccessorBaseHost *, access::target) |
Command group handler class.
Objects of the handler class collect information about command group, such as kernel, requirements to the memory, arguments for the kernel.
The command group can represent absolutely different operations. Depending on the operation we need to store different data. But, in most cases, it's impossible to say what kind of operation we need to perform until the very end. So, handler class contains all fields simultaneously, then during "finalization" it constructs CG object, that represents specific operation, passing fields that are required only.
Definition at line 362 of file handler.hpp.
using cl::sycl::handler::is_same_type = std::is_same<remove_cv_ref_t<U>, remove_cv_ref_t<T> > |
Definition at line 1384 of file handler.hpp.
using cl::sycl::handler::remove_cv_ref_t = typename detail::remove_cv_t<detail::remove_reference_t<T> > |
Definition at line 1381 of file handler.hpp.
|
delete |
|
delete |
|
inline |
Invokes a lambda on the host.
Dependencies are satisfied on the host.
Func | is a lambda that is executed on the host |
Definition at line 2068 of file handler.hpp.
|
inline |
Defines and invokes a SYCL kernel on host device.
Func | is a SYCL kernel function defined by lambda function or a named function object type. |
Definition at line 1487 of file handler.hpp.
|
inline |
Prevents any commands submitted afterward to this queue from executing until all commands previously submitted to this queue have entered the complete state.
Definition at line 2547 of file handler.hpp.
void cl::sycl::handler::barrier | ( | const std::vector< event > & | WaitList | ) |
Prevents any commands submitted afterward to this queue from executing until all events in WaitList have entered the complete state.
If WaitList is empty, then the barrier has no effect.
WaitList | is a vector of valid SYCL events that need to complete before barrier command can be executed. |
Definition at line 713 of file handler.cpp.
References ext_oneapi_barrier().
|
inline |
Copies the content of memory object accessed by Src into the memory pointed by Dst.
Source must have at least as many bytes as the range accessed by Dst.
Src | is a source SYCL accessor. |
Dst | is a smart pointer to destination memory. |
Definition at line 2282 of file handler.hpp.
Referenced by cl::sycl::ext::oneapi::detail::reduSaveFinalResultToUserMem(), and cl::sycl::ext::oneapi::detail::reduSaveFinalResultToUserMemHelper().
|
inline |
Copies the content of memory object accessed by Src into the memory pointed by Dst.
Source must have at least as many bytes as the range accessed by Dst.
Src | is a source SYCL accessor. |
Dst | is a pointer to destination memory. |
Definition at line 2331 of file handler.hpp.
References cl::sycl::detail::getSyclObjImpl().
|
inline |
Copies the content of memory object accessed by Src to the memory object accessed by Dst.
Dst must have at least as many bytes as the range accessed by Src.
Src | is a source SYCL accessor. |
Dst | is a destination SYCL accessor. |
Definition at line 2411 of file handler.hpp.
References cl::sycl::accessor< DataT, Dimensions, AccessMode, AccessTarget, IsPlaceholder, PropertyListT >::get_size(), and cl::sycl::detail::getSyclObjImpl().
Copies data from one memory region to another, both pointed by USM pointers.
No operations is done if
Count | is zero. An exception is thrown if either |
Dest | or |
Src | is nullptr. The behavior is undefined if any of the pointer parameters is invalid. |
Src | is a USM pointer to the source memory. |
Dest | is a USM pointer to the destination memory. |
Count | is a number of elements of type T to copy. |
Definition at line 2586 of file handler.hpp.
References cl::sycl::detail::memcpy().
|
inline |
Copies the content of memory pointed by Src into the memory object accessed by Dst.
Source must have at least as many bytes as the range accessed by Dst.
Src | is a pointer to source memory. |
Dst | is a destination SYCL accessor. |
Definition at line 2370 of file handler.hpp.
References cl::sycl::detail::getSyclObjImpl().
|
inline |
Copies the content of memory pointed by Src into the memory object accessed by Dst.
Source must have at least as many bytes as the range accessed by Dst.
Src | is a smart pointer to source memory. |
Dst | is a destination SYCL accessor. |
Definition at line 2307 of file handler.hpp.
void cl::sycl::handler::depends_on | ( | const std::vector< event > & | Events | ) |
Registers event dependencies on this command group.
Events | is a vector of valid SYCL events to wait on. |
Definition at line 809 of file handler.cpp.
References cl::sycl::detail::getSyclObjImpl(), cl::sycl::invalid, and cl::sycl::make_error_code().
void cl::sycl::handler::depends_on | ( | event | Event | ) |
Registers event dependencies on this command group.
Event | is a valid SYCL event to wait on. |
Definition at line 800 of file handler.cpp.
References cl::sycl::detail::getSyclObjImpl(), cl::sycl::invalid, and cl::sycl::make_error_code().
Referenced by cl::sycl::queue::fill(), cl::sycl::queue::parallel_for(), cl::sycl::queue::parallel_for_impl(), cl::sycl::queue::prefetch(), cl::sycl::ext::oneapi::detail::reduSaveFinalResultToUserMemHelper(), and cl::sycl::queue::single_task().
|
inline |
Prevents any commands submitted afterward to this queue from executing until all commands previously submitted to this queue have entered the complete state.
Definition at line 2538 of file handler.hpp.
Referenced by barrier(), and cl::sycl::queue::ext_oneapi_submit_barrier().
void cl::sycl::handler::ext_oneapi_barrier | ( | const std::vector< event > & | WaitList | ) |
Prevents any commands submitted afterward to this queue from executing until all events in WaitList have entered the complete state.
If WaitList is empty, then the barrier has no effect.
WaitList | is a vector of valid SYCL events that need to complete before barrier command can be executed. |
Definition at line 703 of file handler.cpp.
References cl::sycl::detail::CG::BarrierWaitlist.
|
inline |
Fills memory pointed by accessor with the pattern given.
If the operation is submitted to queue associated with OpenCL device and accessor points to one dimensional memory object then use special type for filling. Otherwise fill using regular kernel.
Dst | is a destination SYCL accessor. |
Pattern | is a value to be used to fill the memory. |
Definition at line 2486 of file handler.hpp.
References cl::sycl::accessor< DataT, Dimensions, AccessMode, AccessTarget, IsPlaceholder, PropertyListT >::get_range(), and cl::sycl::detail::getSyclObjImpl().
Referenced by cl::sycl::queue::fill().
|
inline |
Fills the specified memory with the specified pattern.
Ptr | is the pointer to the memory to fill |
Pattern | is the pattern to fill into the memory. T should be trivially copyable. |
Count | is the number of times to fill Pattern into Ptr. |
Definition at line 2525 of file handler.hpp.
|
inline |
Enqueues a command to the SYCL runtime to invoke Func
once.
Definition at line 1507 of file handler.hpp.
void cl::sycl::handler::mem_advise | ( | const void * | Ptr, |
size_t | Length, | ||
int | Advice | ||
) |
Provides additional information to the underlying runtime about how different allocations are used.
Ptr | is a USM pointer to the allocation. |
Length | is a number of bytes in the allocation. |
Advice | is a device-defined advice for the specified allocation. |
Definition at line 755 of file handler.cpp.
References cl::sycl::detail::CG::AdviseUSM, cl::sycl::detail::convertToExtendedMembers(), cl::sycl::detail::HANDLER_MEM_ADVICE, and cl::sycl::detail::GlobalHandler::instance().
void cl::sycl::handler::memcpy | ( | void * | Dest, |
const void * | Src, | ||
size_t | Count | ||
) |
Copies data from one memory region to another, both pointed by USM pointers.
No operations is done if
Count | is zero. An exception is thrown if either |
Dest | or |
Src | is nullptr. The behavior is undefined if any of the pointer parameters is invalid. |
Dest | is a USM pointer to the destination memory. |
Src | is a USM pointer to the source memory. |
Count | is a number of bytes to copy. |
Definition at line 732 of file handler.cpp.
References cl::sycl::detail::CG::CopyUSM.
void cl::sycl::handler::memset | ( | void * | Dest, |
int | Value, | ||
size_t | Count | ||
) |
Fills the memory pointed by a USM pointer with the value specified.
No operations is done if
Count | is zero. An exception is thrown if |
Dest | is nullptr. The behavior is undefined if |
Dest | is invalid. |
Dest | is a USM pointer to the memory to fill. |
Value | is a value to be set. Value is cast as an unsigned char. |
Count | is a number of bytes to fill. |
Definition at line 740 of file handler.cpp.
References cl::sycl::detail::CG::FillUSM.
|
inline |
Defines and invokes a SYCL kernel function for the specified range and offsets.
Kernel | is a SYCL kernel that is executed on a SYCL device (except for the host device). |
NDRange | is a ND-range defining global and local sizes as well as offset. |
KernelFunc | is a lambda that is used if device, queue is bound to, is a host device. |
Definition at line 2160 of file handler.hpp.
References cl::sycl::kernel::get_kernel_bundle(), and cl::sycl::detail::getSyclObjImpl().
|
inline |
Defines and invokes a SYCL kernel function for the specified range.
Kernel | is a SYCL kernel that is executed on a SYCL device (except for the host device). |
NumWorkItems | is a range defining indexing space. |
KernelFunc | is a lambda that is used if device, queue is bound to, is a host device. |
Definition at line 2084 of file handler.hpp.
References cl::sycl::kernel::get_kernel_bundle(), and cl::sycl::detail::getSyclObjImpl().
|
inline |
Defines and invokes a SYCL kernel function for the specified range and offsets.
Kernel | is a SYCL kernel that is executed on a SYCL device (except for the host device). |
NumWorkItems | is a range defining indexing space. |
WorkItemOffset | is an offset to be applied to each work item index. |
KernelFunc | is a lambda that is used if device, queue is bound to, is a host device. |
Definition at line 2122 of file handler.hpp.
References cl::sycl::detail::getSyclObjImpl().
|
inline |
Defines and invokes a SYCL kernel function for the specified nd_range.
The SYCL kernel function is defined as a lambda function or a named function object type and given an id or item for indexing in the indexing space defined by range. If it is a named function object and the function object type is globally visible, there is no need for the developer to provide a kernel name for it.
ExecutionRange | is a ND-range defining global and local sizes as well as offset. |
KernelFunc | is a SYCL kernel function. |
Definition at line 1567 of file handler.hpp.
|
inline |
Defines and invokes a SYCL kernel function for the specified range and offsets.
The SYCL kernel function is defined as SYCL kernel object.
NDRange | is a ND-range defining global and local sizes as well as offset. |
Kernel | is a SYCL kernel function. |
Definition at line 2021 of file handler.hpp.
References cl::sycl::detail::getSyclObjImpl().
|
inline |
Implements parallel_for() accepting nd_range Range
and one reduction object.
This version uses fast sycl::atomic operations to update reduction variable at the end of each work-group work.
Definition at line 1651 of file handler.hpp.
|
inline |
Implements parallel_for() accepting nd_range Range
and one reduction object.
This version is a specialization for the add operator. It performs runtime checks for device aspect "atomic64"; if found, fast sycl::atomic_ref operations are used to update the reduction at the end of each work-group work. Otherwise the default implementation is used.
Definition at line 1685 of file handler.hpp.
References cl::sycl::detail::getDeviceFromHandler(), and cl::sycl::device::has().
|
inline |
Defines and invokes a SYCL kernel function for the specified nd_range.
Performs reduction operation specified in Redu
.
The SYCL kernel function is defined as a lambda function or a named function object type and given an id or item for indexing in the indexing space defined by Range
. If it is a named function object and the function object type is globally visible, there is no need for the developer to provide a kernel name for it.
TODO: Support HOST. The kernels called by this parallel_for() may use some functionality that is not yet supported on HOST such as: barrier(), and ext::oneapi::reduce() that also may be used in more optimized implementations waiting for their turn of code-review.
Definition at line 1727 of file handler.hpp.
|
inline |
Definition at line 1849 of file handler.hpp.
References std::get(), cl::sycl::nd_range< dimensions >::get_group_range(), cl::sycl::nd_range< dimensions >::get_local_range(), cl::sycl::ext::oneapi::detail::reduGetMaxWGSize(), cl::sycl::ext::oneapi::detail::reduGetMemPerWorkItem(), cl::sycl::ext::oneapi::detail::reduSaveFinalResultToUserMem(), and cl::sycl::ext::oneapi::detail::tuple_select_elements().
Definition at line 1979 of file handler.hpp.
|
inline |
Definition at line 1457 of file handler.hpp.
Referenced by cl::sycl::ext::oneapi::detail::reduAuxCGFuncImpl(), cl::sycl::ext::oneapi::detail::reduCGFuncImpl(), and cl::sycl::ext::oneapi::detail::reduCGFuncImplAtomic64().
Definition at line 1983 of file handler.hpp.
|
inline |
Definition at line 1466 of file handler.hpp.
Definition at line 1987 of file handler.hpp.
|
inline |
Definition at line 1475 of file handler.hpp.
|
inline |
Defines and invokes a SYCL kernel function for the specified range and offset.
The SYCL kernel function is defined as a lambda function or a named function object type and given an id or item for indexing in the indexing space defined by range. If it is a named function object and the function object type is globally visible, there is no need for the developer to provide a kernel name for it.
NumWorkItems | is a range defining indexing space. |
WorkItemOffset | is an offset to be applied to each work item index. |
KernelFunc | is a SYCL kernel function. |
Definition at line 1535 of file handler.hpp.
|
inline |
Defines and invokes a SYCL kernel function for the specified range and offsets.
The SYCL kernel function is defined as SYCL kernel object.
NumWorkItems | is a range defining indexing space. |
WorkItemOffset | is an offset to be applied to each work item index. |
Kernel | is a SYCL kernel function. |
Definition at line 2001 of file handler.hpp.
References cl::sycl::detail::getSyclObjImpl().
|
inline |
Defines and invokes a SYCL kernel function for the specified nd_range.
The SYCL kernel function is defined as a lambda function or a named function object type and given an id for indexing in the indexing space defined by range Range
. The parameter Redu
contains the object creted by the reduction() function and defines the type and operation used in the corresponding argument of 'reducer' type passed to lambda/functor function.
Definition at line 1600 of file handler.hpp.
References cl::sycl::ext::oneapi::detail::reduGetMaxNumConcurrentWorkGroups(), and cl::sycl::ext::oneapi::detail::reduGetMaxWGSize().
|
inline |
Definition at line 1736 of file handler.hpp.
References cl::sycl::nd_range< dimensions >::get_group_range(), cl::sycl::nd_range< dimensions >::get_local_range(), and cl::sycl::ext::oneapi::detail::reduGetMaxWGSize().
|
inline |
Hierarchical kernel invocation method of a kernel.
This version of parallel_for_work_group
takes two parameters representing the same kernel. The first one - Kernel
- is a compiled form of the second one - kernelFunc
, which is the source form of the kernel. The same source kernel can be compiled multiple times yielding multiple kernel class objects accessible via the program
class interface.
Kernel | is a compiled SYCL kernel. |
NumWorkGroups | is a range describing the number of work-groups in each dimension. |
KernelFunc | is a lambda representing kernel. |
Definition at line 2202 of file handler.hpp.
References cl::sycl::kernel::get_kernel_bundle(), and cl::sycl::detail::getSyclObjImpl().
|
inline |
Hierarchical kernel invocation method of a kernel.
This version of parallel_for_work_group
takes two parameters representing the same kernel. The first one - Kernel
- is a compiled form of the second one - kernelFunc
, which is the source form of the kernel. The same source kernel can be compiled multiple times yielding multiple kernel class objects accessible via the program
class interface.
Kernel | is a compiled SYCL kernel. |
NumWorkGroups | is a range describing the number of work-groups in each dimension. |
WorkGroupSize | is a range describing the size of work-groups in each dimension. |
KernelFunc | is a lambda representing kernel. |
Definition at line 2241 of file handler.hpp.
References cl::sycl::kernel::get_kernel_bundle(), and cl::sycl::detail::getSyclObjImpl().
|
inline |
Hierarchical kernel invocation method of a kernel defined as a lambda encoding the body of each work-group to launch.
Lambda may contain multiple calls to parallel_for_work_item(...) methods representing the execution on each work-item. Launches NumWorkGroups work-groups of runtime-defined size.
NumWorkGroups | is a range describing the number of work-groups in each dimension. |
KernelFunc | is a lambda representing kernel. |
Definition at line 1905 of file handler.hpp.
|
inline |
Hierarchical kernel invocation method of a kernel defined as a lambda encoding the body of each work-group to launch.
Lambda may contain multiple calls to parallel_for_work_item(...) methods representing the execution on each work-item. Launches NumWorkGroups work-groups of WorkGroupSize size.
NumWorkGroups | is a range describing the number of work-groups in each dimension. |
WorkGroupSize | is a range describing the size of work-groups in each dimension. |
KernelFunc | is a lambda representing kernel. |
Definition at line 1937 of file handler.hpp.
void cl::sycl::handler::prefetch | ( | const void * | Ptr, |
size_t | Count | ||
) |
Provides hints to the runtime library that data should be made available on a device earlier than Unified Shared Memory would normally require it to be available.
Ptr | is a USM pointer to the memory to be prefetched to the device. |
Count | is a number of bytes to be prefetched. |
Definition at line 748 of file handler.cpp.
References cl::sycl::detail::CG::PrefetchUSM.
Referenced by cl::sycl::queue::prefetch().
|
inline |
Requires access to the memory object associated with the placeholder accessor.
The command group has a requirement to gain access to the given memory object before executing.
Acc | is a SYCL accessor describing required memory region. |
Definition at line 1360 of file handler.hpp.
References cl::sycl::detail::associateWithHandler().
|
inline |
Definition at line 1413 of file handler.hpp.
|
inline |
Sets argument for OpenCL interoperability kernels.
Registers Arg passed as argument # ArgIndex.
ArgIndex | is a positional number of argument to be set. |
Arg | is an argument value to be set. |
Definition at line 1406 of file handler.hpp.
|
inline |
Sets arguments for OpenCL interoperability kernels.
Registers pack of arguments(Args) with indexes starting from 0.
Args | are argument values to be set. |
Definition at line 1423 of file handler.hpp.
|
inline |
Invokes a SYCL kernel.
Executes exactly once. The kernel invocation method has no functors and cannot be called on host.
Kernel | is a SYCL kernel object. |
Definition at line 1965 of file handler.hpp.
References cl::sycl::kernel::get_kernel_bundle(), and cl::sycl::detail::getSyclObjImpl().
|
inline |
Defines and invokes a SYCL kernel function.
Kernel | is a SYCL kernel that is executed on a SYCL device (except for the host device). |
KernelFunc | is a lambda that is used if device, queue is bound to, is a host device. |
Definition at line 2039 of file handler.hpp.
References cl::sycl::kernel::get_kernel_bundle(), and cl::sycl::detail::getSyclObjImpl().
|
inline |
Defines and invokes a SYCL kernel function as a function object type.
If it is a named function object and the function object type is globally visible, there is no need for the developer to provide a kernel name for it.
KernelFunc | is a SYCL kernel function. |
Definition at line 1436 of file handler.hpp.
Referenced by cl::sycl::ext::oneapi::detail::reduSaveFinalResultToUserMem().
|
inline |
Provides guarantees that the memory object accessed via Acc is updated on the host after command group object execution is complete.
Acc | is a SYCL accessor that needs to be updated on host. |
Definition at line 2459 of file handler.hpp.
References cl::sycl::detail::getSyclObjImpl().
void cl::sycl::handler::use_kernel_bundle | ( | const kernel_bundle< bundle_state::executable > & | ExecBundle | ) |
Definition at line 776 of file handler.cpp.
References cl::sycl::kernel_bundle< State >::get_context(), cl::sycl::detail::getSyclObjImpl(), cl::sycl::invalid, and cl::sycl::make_error_code().
|
friend |
Definition at line 2704 of file handler.hpp.
|
friend |
Definition at line 2677 of file handler.hpp.
|
friend |
|
friend |
|
friend |
Definition at line 2682 of file handler.hpp.
|
friend |
Definition at line 2672 of file handler.hpp.
|
friend |
Definition at line 2685 of file handler.hpp.
|
friend |
Definition at line 2690 of file handler.hpp.
|
friend |
Definition at line 2684 of file handler.hpp.