DPC++ Runtime
Runtime libraries for oneAPI DPC++
sycl::_V1::handler Class Reference

Command group handler class. More...

#include <sycl/handler.hpp>

Classes

struct  ShouldEnableSetArg
 

Public Types

template<typename T >
using remove_cv_ref_t = typename std::remove_cv_t< std::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
 
handleroperator= (const handler &)=delete
 
handleroperator= (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 >
std::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 DataT , int Dims>
void set_arg (int ArgIndex, local_accessor< DataT, Dims > 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 (_KERNELFUNCPARAM(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, _KERNELFUNCPARAM(KernelFunc))
 
template<typename KernelName = detail::auto_name, typename KernelType >
void parallel_for (range< 2 > NumWorkItems, _KERNELFUNCPARAM(KernelFunc))
 
template<typename KernelName = detail::auto_name, typename KernelType >
void parallel_for (range< 3 > NumWorkItems, _KERNELFUNCPARAM(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 >
std::enable_if_t< detail::check_fn_signature< std::remove_reference_t< FuncT >, void()>::value||detail::check_fn_signature< std::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_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 KernelName = detail::auto_name, typename KernelType , typename PropertiesT >
std::enable_if_t< ext::oneapi::experimental::is_property_list< PropertiesT >::value > single_task (PropertiesT, _KERNELFUNCPARAM(KernelFunc))
 
template<typename KernelName = detail::auto_name, typename KernelType , typename PropertiesT >
std::enable_if_t< ext::oneapi::experimental::is_property_list< PropertiesT >::value > parallel_for (range< 1 > NumWorkItems, PropertiesT, _KERNELFUNCPARAM(KernelFunc))
 
template<typename KernelName = detail::auto_name, typename KernelType , typename PropertiesT >
std::enable_if_t< ext::oneapi::experimental::is_property_list< PropertiesT >::value > parallel_for (range< 2 > NumWorkItems, PropertiesT, _KERNELFUNCPARAM(KernelFunc))
 
template<typename KernelName = detail::auto_name, typename KernelType , typename PropertiesT >
std::enable_if_t< ext::oneapi::experimental::is_property_list< PropertiesT >::value > parallel_for (range< 3 > NumWorkItems, PropertiesT, _KERNELFUNCPARAM(KernelFunc))
 
template<typename KernelName = detail::auto_name, typename KernelType , typename PropertiesT , int Dims>
std::enable_if_t< ext::oneapi::experimental::is_property_list< PropertiesT >::value > parallel_for (nd_range< Dims > Range, PropertiesT Properties, _KERNELFUNCPARAM(KernelFunc))
 
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, typename RedOutVar >
class detail::reduction_impl_algo
 
class ::MockHandler
 
device detail::getDeviceFromHandler (handler &)
 
void detail::reduction::finalizeHandler (handler &CGH)
 
template<class FunctorTy >
void detail::reduction::withAuxHandler (handler &CGH, FunctorTy Func)
 
template<typename KernelName , detail::reduction::strategy Strategy, int Dims, typename PropertiesT , typename... RestT>
void detail::reduction_parallel_for (handler &CGH, range< Dims > NDRange, PropertiesT Properties, RestT... Rest)
 
template<typename KernelName , detail::reduction::strategy Strategy, int Dims, typename PropertiesT , typename... RestT>
void detail::reduction_parallel_for (handler &CGH, nd_range< Dims > NDRange, PropertiesT Properties, RestT... Rest)
 
void detail::associateWithHandler (handler &, detail::AccessorBaseHost *, access::target)
 
template<typename KernelName = detail::auto_name, int Dims, typename PropertiesT , typename... RestT>
std::enable_if_t<(sizeof...(RestT) > 1) &&detail::AreAllButLastReductions< RestT... >::value &&ext::oneapi::experimental::is_property_list< PropertiesT >::value > parallel_for (range< Dims > Range, PropertiesT Properties, RestT &&...Rest)
 Reductions. More...
 
template<typename KernelName = detail::auto_name, int Dims, typename... RestT>
std::enable_if_t< detail::AreAllButLastReductions< RestT... >::value > parallel_for (range< Dims > Range, RestT &&...Rest)
 
template<typename KernelName = detail::auto_name, int Dims, typename PropertiesT , typename... RestT>
std::enable_if_t<(sizeof...(RestT) > 1) &&detail::AreAllButLastReductions< RestT... >::value &&ext::oneapi::experimental::is_property_list< PropertiesT >::value > parallel_for (nd_range< Dims > Range, PropertiesT Properties, RestT &&...Rest)
 
template<typename KernelName = detail::auto_name, int Dims, typename... RestT>
std::enable_if_t< detail::AreAllButLastReductions< RestT... >::value > parallel_for (nd_range< Dims > Range, RestT &&...Rest)
 
template<typename KernelName = detail::auto_name, typename KernelType , int Dims, typename PropertiesT >
void parallel_for_work_group (range< Dims > NumWorkGroups, PropertiesT, _KERNELFUNCPARAM(KernelFunc))
 }@ More...
 
template<typename KernelName = detail::auto_name, typename KernelType , int Dims, typename PropertiesT >
void parallel_for_work_group (range< Dims > NumWorkGroups, range< Dims > WorkGroupSize, PropertiesT, _KERNELFUNCPARAM(KernelFunc))
 
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...
 

Detailed Description

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.

sycl::queue::submit([](handler &CGH){
CGH.require(Accessor1); // Adds a requirement to the memory object.
CGH.setArg(0, Accessor2); // Registers accessor given as an argument to
// the kernel + adds a requirement to the memory
// object.
CGH.setArg(1, N); // Registers value given as an argument to the
// kernel.
// The following registers KernelFunctor to be a kernel that will be
// executed in case of queue is bound to the host device, Kernel - for
// an OpenCL device. This function clearly indicates that command group
// represents kernel execution.
CGH.parallel_for(KernelFunctor, 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.

See also
queue
program
kernel

Definition at line 310 of file handler.hpp.

Member Typedef Documentation

◆ is_same_type

template<typename U , typename T >
using sycl::_V1::handler::is_same_type = std::is_same<remove_cv_ref_t<U>, remove_cv_ref_t<T> >

Definition at line 1500 of file handler.hpp.

◆ remove_cv_ref_t

template<typename T >
using sycl::_V1::handler::remove_cv_ref_t = typename std::remove_cv_t<std::remove_reference_t<T> >

Definition at line 1497 of file handler.hpp.

Constructor & Destructor Documentation

◆ handler() [1/2]

sycl::_V1::handler::handler ( const handler )
delete

◆ handler() [2/2]

sycl::_V1::handler::handler ( handler &&  )
delete

Member Function Documentation

◆ __SYCL_DEPRECATED() [1/2]

template<typename FuncT >
sycl::_V1::handler::__SYCL_DEPRECATED ( "interop_task() is  deprecated,
use host_task() instead  
)
inline

Invokes a lambda on the host.

Dependencies are satisfied on the host.

Parameters
Funcis a lambda that is executed on the host

Definition at line 1781 of file handler.hpp.

◆ __SYCL_DEPRECATED() [2/2]

template<typename FuncT >
sycl::_V1::handler::__SYCL_DEPRECATED ( "run_on_host_intel() is  deprecated,
use host_task() instead  
)
inline

Defines and invokes a SYCL kernel on host device.

Parameters
Funcis a SYCL kernel function defined by lambda function or a named function object type.

Definition at line 1580 of file handler.hpp.

◆ barrier() [1/2]

void sycl::_V1::handler::barrier ( )
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 2368 of file handler.hpp.

◆ barrier() [2/2]

void sycl::_V1::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.

Parameters
WaitListis a vector of valid SYCL events that need to complete before barrier command can be executed.

Definition at line 610 of file handler.cpp.

◆ copy() [1/6]

template<typename T_Src , typename T_Dst , int Dims, access::mode AccessMode, access::target AccessTarget, access::placeholder IsPlaceholder = access::placeholder::false_t>
void sycl::_V1::handler::copy ( accessor< T_Src, Dims, AccessMode, AccessTarget, IsPlaceholder Src,
std::shared_ptr< T_Dst >  Dst 
)
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.

Parameters
Srcis a source SYCL accessor.
Dstis a smart pointer to destination memory.

Definition at line 2104 of file handler.hpp.

References sycl::_V1::AccessMode.

Referenced by sycl::_V1::queue::copy(), and sycl::_V1::detail::reduction_impl_algo< T, BinaryOperation, Dims, Extent, RedOutVar >::withInitializedMem().

◆ copy() [2/6]

template<typename T_Src , typename T_Dst , int Dims, access::mode AccessMode, access::target AccessTarget, access::placeholder IsPlaceholder = access::placeholder::false_t>
void sycl::_V1::handler::copy ( accessor< T_Src, Dims, AccessMode, AccessTarget, IsPlaceholder Src,
T_Dst *  Dst 
)
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.

Parameters
Srcis a source SYCL accessor.
Dstis a pointer to destination memory.

Definition at line 2153 of file handler.hpp.

References sycl::_V1::AccessMode, and sycl::_V1::detail::getSyclObjImpl().

◆ copy() [3/6]

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 sycl::_V1::handler::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 
)
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.

Parameters
Srcis a source SYCL accessor.
Dstis a destination SYCL accessor.

Definition at line 2233 of file handler.hpp.

References sycl::_V1::detail::getSyclObjImpl().

◆ copy() [4/6]

template<typename T >
void sycl::_V1::handler::copy ( const T *  Src,
T *  Dest,
size_t  Count 
)
inline

Copies data from one memory region to another, both pointed by USM pointers.

No operations is done if

Parameters
Countis zero. An exception is thrown if either
Destor
Srcis nullptr. The behavior is undefined if any of the pointer parameters is invalid.
Srcis a USM pointer to the source memory.
Destis a USM pointer to the destination memory.
Countis a number of elements of type T to copy.

Definition at line 2407 of file handler.hpp.

References sycl::_V1::detail::memcpy().

◆ copy() [5/6]

template<typename T_Src , typename T_Dst , int Dims, access::mode AccessMode, access::target AccessTarget, access::placeholder IsPlaceholder = access::placeholder::false_t>
void sycl::_V1::handler::copy ( const T_Src *  Src,
accessor< T_Dst, Dims, AccessMode, AccessTarget, IsPlaceholder Dst 
)
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.

Parameters
Srcis a pointer to source memory.
Dstis a destination SYCL accessor.

Definition at line 2192 of file handler.hpp.

References sycl::_V1::AccessMode, and sycl::_V1::detail::getSyclObjImpl().

◆ copy() [6/6]

template<typename T_Src , typename T_Dst , int Dims, access::mode AccessMode, access::target AccessTarget, access::placeholder IsPlaceholder = access::placeholder::false_t>
void sycl::_V1::handler::copy ( std::shared_ptr< T_Src >  Src,
accessor< T_Dst, Dims, AccessMode, AccessTarget, IsPlaceholder Dst 
)
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.

Parameters
Srcis a smart pointer to source memory.
Dstis a destination SYCL accessor.

Definition at line 2129 of file handler.hpp.

References sycl::_V1::AccessMode.

◆ depends_on() [1/2]

void sycl::_V1::handler::depends_on ( const std::vector< event > &  Events)

Registers event dependencies on this command group.

Parameters
Eventsis a vector of valid SYCL events to wait on.

Definition at line 693 of file handler.cpp.

References sycl::_V1::detail::getSyclObjImpl(), and sycl::_V1::make_error_code().

◆ depends_on() [2/2]

◆ ext_oneapi_barrier() [1/2]

void sycl::_V1::handler::ext_oneapi_barrier ( )
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 2359 of file handler.hpp.

Referenced by sycl::_V1::queue::ext_oneapi_submit_barrier().

◆ ext_oneapi_barrier() [2/2]

void sycl::_V1::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.

Parameters
WaitListis a vector of valid SYCL events that need to complete before barrier command can be executed.

Definition at line 600 of file handler.cpp.

◆ fill() [1/2]

template<typename T , int Dims, access::mode AccessMode, access::target AccessTarget, access::placeholder IsPlaceholder = access::placeholder::false_t, typename PropertyListT = property_list>
void sycl::_V1::handler::fill ( accessor< T, Dims, AccessMode, AccessTarget, IsPlaceholder, PropertyListT >  Dst,
const T &  Pattern 
)
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.

Parameters
Dstis a destination SYCL accessor.
Patternis a value to be used to fill the memory.

Definition at line 2308 of file handler.hpp.

References sycl::_V1::AccessMode, sycl::_V1::detail::getSyclObjImpl(), and sycl::_V1::IsPlaceholder.

Referenced by sycl::_V1::queue::fill().

◆ fill() [2/2]

template<typename T >
void sycl::_V1::handler::fill ( void *  Ptr,
const T &  Pattern,
size_t  Count 
)
inline

Fills the specified memory with the specified pattern.

Parameters
Ptris the pointer to the memory to fill
Patternis the pattern to fill into the memory. T should be trivially copyable.
Countis the number of times to fill Pattern into Ptr.

Definition at line 2346 of file handler.hpp.

◆ host_task()

template<typename FuncT >
std::enable_if_t<detail::check_fn_signature<std::remove_reference_t<FuncT>, void()>::value || detail::check_fn_signature<std::remove_reference_t<FuncT>, void(interop_handle)>::value> sycl::_V1::handler::host_task ( FuncT &&  Func)
inline

Enqueues a command to the SYCL runtime to invoke Func once.

Definition at line 1599 of file handler.hpp.

◆ mem_advise()

void sycl::_V1::handler::mem_advise ( const void *  Ptr,
size_t  Length,
int  Advice 
)

Provides additional information to the underlying runtime about how different allocations are used.

Parameters
Ptris a USM pointer to the allocation.
Lengthis a number of bytes in the allocation.
Adviceis a device-defined advice for the specified allocation.

Definition at line 652 of file handler.cpp.

◆ memcpy()

void sycl::_V1::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

Parameters
Countis zero. An exception is thrown if either
Destor
Srcis nullptr. The behavior is undefined if any of the pointer parameters is invalid.
Destis a USM pointer to the destination memory.
Srcis a USM pointer to the source memory.
Countis a number of bytes to copy.

Definition at line 629 of file handler.cpp.

◆ memset()

void sycl::_V1::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

Parameters
Countis zero. An exception is thrown if
Destis nullptr. The behavior is undefined if
Destis invalid.
Destis a USM pointer to the memory to fill.
Valueis a value to be set. Value is cast as an unsigned char.
Countis a number of bytes to fill.

Definition at line 637 of file handler.cpp.

◆ operator=() [1/2]

handler& sycl::_V1::handler::operator= ( const handler )
delete

◆ operator=() [2/2]

handler& sycl::_V1::handler::operator= ( handler &&  )
delete

◆ parallel_for() [1/20]

template<typename KernelName = detail::auto_name, typename KernelType , int Dims>
void sycl::_V1::handler::parallel_for ( kernel  Kernel,
nd_range< Dims >  NDRange,
_KERNELFUNCPARAM(KernelFunc  
)
inline

Defines and invokes a SYCL kernel function for the specified range and offsets.

Parameters
Kernelis a SYCL kernel that is executed on a SYCL device (except for the host device).
NDRangeis a ND-range defining global and local sizes as well as offset.
KernelFuncis a lambda that is used if device, queue is bound to, is a host device.

Definition at line 1873 of file handler.hpp.

References sycl::_V1::detail::getSyclObjImpl().

◆ parallel_for() [2/20]

template<typename KernelName = detail::auto_name, typename KernelType , int Dims>
void sycl::_V1::handler::parallel_for ( kernel  Kernel,
range< Dims >  NumWorkItems,
_KERNELFUNCPARAM(KernelFunc  
)
inline

Defines and invokes a SYCL kernel function for the specified range.

Parameters
Kernelis a SYCL kernel that is executed on a SYCL device (except for the host device).
NumWorkItemsis a range defining indexing space.
KernelFuncis a lambda that is used if device, queue is bound to, is a host device.

Definition at line 1797 of file handler.hpp.

References sycl::_V1::detail::getSyclObjImpl().

◆ parallel_for() [3/20]

template<typename KernelName = detail::auto_name, typename KernelType , int Dims>
void sycl::_V1::handler::parallel_for ( kernel  Kernel,
range< Dims >  NumWorkItems,
id< Dims >  WorkItemOffset,
_KERNELFUNCPARAM(KernelFunc  
)
inline

Defines and invokes a SYCL kernel function for the specified range and offsets.

Parameters
Kernelis a SYCL kernel that is executed on a SYCL device (except for the host device).
NumWorkItemsis a range defining indexing space.
WorkItemOffsetis an offset to be applied to each work item index.
KernelFuncis a lambda that is used if device, queue is bound to, is a host device.

Definition at line 1835 of file handler.hpp.

References sycl::_V1::detail::getSyclObjImpl().

◆ parallel_for() [4/20]

template<int Dims>
void sycl::_V1::handler::parallel_for ( nd_range< Dims >  NDRange,
kernel  Kernel 
)
inline

Defines and invokes a SYCL kernel function for the specified range and offsets.

The SYCL kernel function is defined as SYCL kernel object.

Parameters
NDRangeis a ND-range defining global and local sizes as well as offset.
Kernelis a SYCL kernel function.

Definition at line 1735 of file handler.hpp.

References sycl::_V1::detail::getSyclObjImpl().

◆ parallel_for() [5/20]

template<typename KernelName = detail::auto_name, typename KernelType , typename PropertiesT , int Dims>
std::enable_if_t< ext::oneapi::experimental::is_property_list<PropertiesT>::value> sycl::_V1::handler::parallel_for ( nd_range< Dims >  Range,
PropertiesT  Properties,
_KERNELFUNCPARAM(KernelFunc  
)
inline

Definition at line 2022 of file handler.hpp.

◆ parallel_for() [6/20]

template<typename KernelName = detail::auto_name, int Dims, typename PropertiesT , typename... RestT>
std::enable_if_t< (sizeof...(RestT) > 1) && detail::AreAllButLastReductions<RestT...>::value && ext::oneapi::experimental::is_property_list<PropertiesT>::value> sycl::_V1::handler::parallel_for ( nd_range< Dims >  Range,
PropertiesT  Properties,
RestT &&...  Rest 
)
inline

Definition at line 2055 of file handler.hpp.

◆ parallel_for() [7/20]

template<typename KernelName = detail::auto_name, int Dims, typename... RestT>
std::enable_if_t<detail::AreAllButLastReductions<RestT...>::value> sycl::_V1::handler::parallel_for ( nd_range< Dims >  Range,
RestT &&...  Rest 
)
inline

Definition at line 2063 of file handler.hpp.

◆ parallel_for() [8/20]

◆ parallel_for() [9/20]

void sycl::_V1::handler::parallel_for ( range< 1 >  NumWorkItems,
kernel  Kernel 
)
inline

Definition at line 1694 of file handler.hpp.

◆ parallel_for() [10/20]

template<typename KernelName = detail::auto_name, typename KernelType , typename PropertiesT >
std::enable_if_t< ext::oneapi::experimental::is_property_list<PropertiesT>::value> sycl::_V1::handler::parallel_for ( range< 1 >  NumWorkItems,
PropertiesT  ,
_KERNELFUNCPARAM(KernelFunc  
)
inline

Definition at line 1992 of file handler.hpp.

◆ parallel_for() [11/20]

template<typename KernelName = detail::auto_name, typename KernelType >
void sycl::_V1::handler::parallel_for ( range< 2 >  NumWorkItems,
_KERNELFUNCPARAM(KernelFunc  
)
inline

Definition at line 1566 of file handler.hpp.

◆ parallel_for() [12/20]

void sycl::_V1::handler::parallel_for ( range< 2 >  NumWorkItems,
kernel  Kernel 
)
inline

Definition at line 1698 of file handler.hpp.

◆ parallel_for() [13/20]

template<typename KernelName = detail::auto_name, typename KernelType , typename PropertiesT >
std::enable_if_t< ext::oneapi::experimental::is_property_list<PropertiesT>::value> sycl::_V1::handler::parallel_for ( range< 2 >  NumWorkItems,
PropertiesT  ,
_KERNELFUNCPARAM(KernelFunc  
)
inline

Definition at line 2002 of file handler.hpp.

◆ parallel_for() [14/20]

template<typename KernelName = detail::auto_name, typename KernelType >
void sycl::_V1::handler::parallel_for ( range< 3 >  NumWorkItems,
_KERNELFUNCPARAM(KernelFunc  
)
inline

Definition at line 1571 of file handler.hpp.

◆ parallel_for() [15/20]

void sycl::_V1::handler::parallel_for ( range< 3 >  NumWorkItems,
kernel  Kernel 
)
inline

Definition at line 1702 of file handler.hpp.

◆ parallel_for() [16/20]

template<typename KernelName = detail::auto_name, typename KernelType , typename PropertiesT >
std::enable_if_t< ext::oneapi::experimental::is_property_list<PropertiesT>::value> sycl::_V1::handler::parallel_for ( range< 3 >  NumWorkItems,
PropertiesT  ,
_KERNELFUNCPARAM(KernelFunc  
)
inline

Definition at line 2012 of file handler.hpp.

◆ parallel_for() [17/20]

template<typename KernelName = detail::auto_name, typename KernelType , int Dims>
void sycl::_V1::handler::parallel_for ( range< Dims >  NumWorkItems,
id< Dims >  WorkItemOffset,
_KERNELFUNCPARAM(KernelFunc  
)
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.

Parameters
NumWorkItemsis a range defining indexing space.
WorkItemOffsetis an offset to be applied to each work item index.
KernelFuncis a SYCL kernel function.

Definition at line 1619 of file handler.hpp.

◆ parallel_for() [18/20]

template<int Dims>
void sycl::_V1::handler::parallel_for ( range< Dims >  NumWorkItems,
id< Dims >  WorkItemOffset,
kernel  Kernel 
)
inline

Defines and invokes a SYCL kernel function for the specified range and offsets.

The SYCL kernel function is defined as SYCL kernel object.

Parameters
NumWorkItemsis a range defining indexing space.
WorkItemOffsetis an offset to be applied to each work item index.
Kernelis a SYCL kernel function.

Definition at line 1716 of file handler.hpp.

References sycl::_V1::detail::getSyclObjImpl().

◆ parallel_for() [19/20]

template<typename KernelName = detail::auto_name, int Dims, typename PropertiesT , typename... RestT>
std::enable_if_t< (sizeof...(RestT) > 1) && detail::AreAllButLastReductions<RestT...>::value && ext::oneapi::experimental::is_property_list<PropertiesT>::value> sycl::_V1::handler::parallel_for ( range< Dims >  Range,
PropertiesT  Properties,
RestT &&...  Rest 
)
inline

Reductions.

Definition at line 2035 of file handler.hpp.

◆ parallel_for() [20/20]

template<typename KernelName = detail::auto_name, int Dims, typename... RestT>
std::enable_if_t<detail::AreAllButLastReductions<RestT...>::value> sycl::_V1::handler::parallel_for ( range< Dims >  Range,
RestT &&...  Rest 
)
inline

Definition at line 2043 of file handler.hpp.

◆ parallel_for_work_group() [1/6]

template<typename KernelName = detail::auto_name, typename KernelType , int Dims>
void sycl::_V1::handler::parallel_for_work_group ( kernel  Kernel,
range< Dims >  NumWorkGroups,
_KERNELFUNCPARAM(KernelFunc  
)
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.

Parameters
Kernelis a compiled SYCL kernel.
NumWorkGroupsis a range describing the number of work-groups in each dimension.
KernelFuncis a lambda representing kernel.

Definition at line 1915 of file handler.hpp.

References sycl::_V1::detail::getSyclObjImpl().

◆ parallel_for_work_group() [2/6]

template<typename KernelName = detail::auto_name, typename KernelType , int Dims>
void sycl::_V1::handler::parallel_for_work_group ( kernel  Kernel,
range< Dims >  NumWorkGroups,
range< Dims >  WorkGroupSize,
_KERNELFUNCPARAM(KernelFunc  
)
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.

Parameters
Kernelis a compiled SYCL kernel.
NumWorkGroupsis a range describing the number of work-groups in each dimension.
WorkGroupSizeis a range describing the size of work-groups in each dimension.
KernelFuncis a lambda representing kernel.

Definition at line 1954 of file handler.hpp.

References sycl::_V1::detail::getSyclObjImpl(), and sycl::_V1::ext::oneapi::experimental::detail::WorkGroupSize.

◆ parallel_for_work_group() [3/6]

template<typename KernelName = detail::auto_name, typename KernelType , int Dims>
void sycl::_V1::handler::parallel_for_work_group ( range< Dims >  NumWorkGroups,
_KERNELFUNCPARAM(KernelFunc  
)
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.

Parameters
NumWorkGroupsis a range describing the number of work-groups in each dimension.
KernelFuncis a lambda representing kernel.

Definition at line 1649 of file handler.hpp.

◆ parallel_for_work_group() [4/6]

template<typename KernelName = detail::auto_name, typename KernelType , int Dims, typename PropertiesT >
void sycl::_V1::handler::parallel_for_work_group ( range< Dims >  NumWorkGroups,
PropertiesT  ,
_KERNELFUNCPARAM(KernelFunc  
)
inline

}@

Definition at line 2073 of file handler.hpp.

◆ parallel_for_work_group() [5/6]

template<typename KernelName = detail::auto_name, typename KernelType , int Dims>
void sycl::_V1::handler::parallel_for_work_group ( range< Dims >  NumWorkGroups,
range< Dims >  WorkGroupSize,
_KERNELFUNCPARAM(KernelFunc  
)
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.

Parameters
NumWorkGroupsis a range describing the number of work-groups in each dimension.
WorkGroupSizeis a range describing the size of work-groups in each dimension.
KernelFuncis a lambda representing kernel.

Definition at line 1668 of file handler.hpp.

References sycl::_V1::ext::oneapi::experimental::detail::WorkGroupSize.

◆ parallel_for_work_group() [6/6]

template<typename KernelName = detail::auto_name, typename KernelType , int Dims, typename PropertiesT >
void sycl::_V1::handler::parallel_for_work_group ( range< Dims >  NumWorkGroups,
range< Dims >  WorkGroupSize,
PropertiesT  ,
_KERNELFUNCPARAM(KernelFunc  
)
inline

◆ prefetch()

void sycl::_V1::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.

Parameters
Ptris a USM pointer to the memory to be prefetched to the device.
Countis a number of bytes to be prefetched.

Definition at line 645 of file handler.cpp.

Referenced by sycl::_V1::queue::prefetch().

◆ require()

template<typename DataT , int Dims, access::mode AccMode, access::target AccTarget>
void sycl::_V1::handler::require ( accessor< DataT, Dims, AccMode, AccTarget, access::placeholder::true_t Acc)
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.

Parameters
Accis a SYCL accessor describing required memory region.

Definition at line 1481 of file handler.hpp.

References sycl::_V1::detail::associateWithHandler().

Referenced by sycl::_V1::queue::copy(), sycl::_V1::queue::fill(), and sycl::_V1::queue::update_host().

◆ set_arg() [1/3]

template<typename DataT , int Dims, access::mode AccessMode, access::target AccessTarget, access::placeholder IsPlaceholder>
void sycl::_V1::handler::set_arg ( int  ArgIndex,
accessor< DataT, Dims, AccessMode, AccessTarget, IsPlaceholder Arg 
)
inline

Definition at line 1529 of file handler.hpp.

◆ set_arg() [2/3]

template<typename DataT , int Dims>
void sycl::_V1::handler::set_arg ( int  ArgIndex,
local_accessor< DataT, Dims >  Arg 
)
inline

Definition at line 1535 of file handler.hpp.

◆ set_arg() [3/3]

template<typename T >
std::enable_if_t<ShouldEnableSetArg<T>::value, void> sycl::_V1::handler::set_arg ( int  ArgIndex,
T &&  Arg 
)
inline

Sets argument for OpenCL interoperability kernels.

Registers Arg passed as argument # ArgIndex.

Parameters
ArgIndexis a positional number of argument to be set.
Argis an argument value to be set.

Definition at line 1522 of file handler.hpp.

◆ set_args()

template<typename... Ts>
void sycl::_V1::handler::set_args ( Ts &&...  Args)
inline

Sets arguments for OpenCL interoperability kernels.

Registers pack of arguments(Args) with indexes starting from 0.

Parameters
Argsare argument values to be set.

Definition at line 1544 of file handler.hpp.

◆ single_task() [1/4]

template<typename KernelName = detail::auto_name, typename KernelType >
void sycl::_V1::handler::single_task ( _KERNELFUNCPARAM(KernelFunc )
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.

Parameters
KernelFuncis a SYCL kernel function.

Definition at line 1556 of file handler.hpp.

Referenced by sycl::_V1::detail::reduSaveFinalResultToUserMem(), and sycl::_V1::detail::reduction_impl_algo< T, BinaryOperation, Dims, Extent, RedOutVar >::withInitializedMem().

◆ single_task() [2/4]

void sycl::_V1::handler::single_task ( kernel  Kernel)
inline

Invokes a SYCL kernel.

Executes exactly once. The kernel invocation method has no functors and cannot be called on host.

Parameters
Kernelis a SYCL kernel object.

Definition at line 1681 of file handler.hpp.

References sycl::_V1::detail::getSyclObjImpl().

◆ single_task() [3/4]

template<typename KernelName = detail::auto_name, typename KernelType >
void sycl::_V1::handler::single_task ( kernel  Kernel,
_KERNELFUNCPARAM(KernelFunc  
)
inline

Defines and invokes a SYCL kernel function.

Parameters
Kernelis a SYCL kernel that is executed on a SYCL device (except for the host device).
KernelFuncis a lambda that is used if device, queue is bound to, is a host device.

Definition at line 1752 of file handler.hpp.

References sycl::_V1::detail::getSyclObjImpl().

◆ single_task() [4/4]

template<typename KernelName = detail::auto_name, typename KernelType , typename PropertiesT >
std::enable_if_t< ext::oneapi::experimental::is_property_list<PropertiesT>::value> sycl::_V1::handler::single_task ( PropertiesT  ,
_KERNELFUNCPARAM(KernelFunc  
)
inline

Definition at line 1984 of file handler.hpp.

◆ update_host()

template<typename T , int Dims, access::mode AccessMode, access::target AccessTarget, access::placeholder IsPlaceholder = access::placeholder::false_t>
void sycl::_V1::handler::update_host ( accessor< T, Dims, AccessMode, AccessTarget, IsPlaceholder Acc)
inline

Provides guarantees that the memory object accessed via Acc is updated on the host after command group object execution is complete.

Parameters
Accis a SYCL accessor that needs to be updated on host.

Definition at line 2281 of file handler.hpp.

References sycl::_V1::detail::getSyclObjImpl().

Referenced by sycl::_V1::queue::update_host().

◆ use_kernel_bundle()

void sycl::_V1::handler::use_kernel_bundle ( const kernel_bundle< bundle_state::executable > &  ExecBundle)

Friends And Related Function Documentation

◆ ::MockHandler

friend class ::MockHandler
friend

Definition at line 2536 of file handler.hpp.

◆ accessor

template<typename DataT , int Dims, access::mode AccMode, access::target AccTarget, access::placeholder isPlaceholder, typename PropertyListT >
friend class accessor
friend

Definition at line 2499 of file handler.hpp.

◆ detail::associateWithHandler

◆ detail::getDeviceFromHandler

◆ detail::image_accessor

template<typename DataT , int Dimensions, access::mode AccessMode, access::target AccessTarget, access::placeholder IsPlaceholder>
friend class detail::image_accessor
friend

Definition at line 2504 of file handler.hpp.

◆ detail::queue_impl

Definition at line 2494 of file handler.hpp.

◆ detail::reduction::finalizeHandler

◆ detail::reduction::withAuxHandler

template<class FunctorTy >
void detail::reduction::withAuxHandler ( handler CGH,
FunctorTy  Func 
)
friend

◆ detail::reduction_impl_algo

template<typename T , class BinaryOperation , int Dims, size_t Extent, typename RedOutVar >
friend class detail::reduction_impl_algo
friend

Definition at line 2512 of file handler.hpp.

◆ detail::reduction_parallel_for [1/2]

template<typename KernelName , detail::reduction::strategy Strategy, int Dims, typename PropertiesT , typename... RestT>
void detail::reduction_parallel_for ( handler CGH,
nd_range< Dims >  NDRange,
PropertiesT  Properties,
RestT...  Rest 
)
friend

◆ detail::reduction_parallel_for [2/2]

template<typename KernelName , detail::reduction::strategy Strategy, int Dims, typename PropertiesT , typename... RestT>
void detail::reduction_parallel_for ( handler CGH,
range< Dims >  NDRange,
PropertiesT  Properties,
RestT...  Rest 
)
friend

◆ detail::stream_impl

friend class detail::stream_impl
friend

Definition at line 2507 of file handler.hpp.

◆ stream

friend class stream
friend

Definition at line 2506 of file handler.hpp.


The documentation for this class was generated from the following files: