cl::sycl::queue Class Reference
The cl::sycl::queue object is the SYCL abstraction of the OpenCL object cl_command_queue. More...
#include <queue.h>
Public Member Functions | |
queue (const property_list &propList={}) | |
Constructs a queue using a default device selector. More... | |
queue (const async_handler &asyncHandler, const property_list &propList={}) | |
Constructs a queue using a default device selector. More... | |
queue (const device_selector &deviceSelector, const property_list &propList={}) | |
Constructs a queue using a user defined device selector. More... | |
queue (const device_selector &deviceSelector, const async_handler &asyncHandler, const property_list &propList={}) | |
Constructs a queue using a user defined device selector. More... | |
queue (const device &dev, const property_list &propList={}) | |
Construct a queue from a given device, creating an implicit context in the process. More... | |
queue (const device &dev, const async_handler &asyncHandler, const property_list &propList={}) | |
Construct a queue from a given device, creating an implicit context in the process. More... | |
queue (const context &syclContext, const device_selector &selector, const property_list &propList={}) | |
Constructs a queue using a user defined device selector against a specific context. More... | |
queue (const context &syclContext, const device_selector &selector, const async_handler &asyncHandler, const property_list &propList={}) | |
Constructs a queue using a user defined device selector against a specific context. More... | |
queue (const context &syclContext, const device &dev, const async_handler &asyncHandler, const property_list &propList={}) | |
Constructs a queue with properties using an existing device and context. More... | |
queue (const context &syclContext, const device &dev, const property_list &propList={}) | |
Constructs a queue using an existing device and context. More... | |
queue (cl_command_queue clqueue, const context &s_context, const async_handler &asyncHandler=nullptr) | |
Construct a queue object from a given OpenCL object. More... | |
queue (const queue &rhs)=default | |
Construct a queue object by copying the contents of a given queue object. More... | |
queue & | operator= (const queue &rhs)=default |
Completely assigns the contents of the queue to that of another queue. More... | |
queue (queue &&rhs)=default | |
Completely moves the contents of a queue to that of another queue. More... | |
queue & | operator= (queue &&rhs)=default |
Completely moves the contents of a queue to that of another queue. More... | |
template<typename propertyT > | |
bool | has_property () const noexcept |
Returns whether this SYCL queue was constructed with the property specified by propertyT. More... | |
template<typename propertyT > | |
propertyT | get_property () const |
Returns a copy of the property of type propertyT that this SYCL queue was constructed with. More... | |
COMPUTECPP_TEST_VIRTUAL bool | is_host () const |
Determine if the queue is executing kernels on the host. More... | |
template<info::queue param> | |
COMPUTECPP_EXPORT info::param_traits< info::queue, param >::return_type | get_info () const |
Gets OpenCL information for the queue. More... | |
COMPUTECPP_TEST_VIRTUAL context | get_context () const |
Returns the context associate to the queue. More... | |
cl_command_queue | get () const |
Returns the underlying OpenCL cl_command_queue object. More... | |
void | wait () |
Performs a blocking wait for the completion of all enqueued tasks in the queue. More... | |
device | get_device () const |
Returns the Device associated with the queue. More... | |
template<typename T > | |
event | fill (void *ptr, const T &pattern, size_t count) |
Enqueues an USM fill operation. More... | |
event | memcpy (void *dest, const void *src, size_t size) |
Enqueues an USM memcpy operation. More... | |
event | memcpy (void *dest, const void *src, size_t size, event dependency) |
Enqueues an USM memcpy operation. More... | |
event | memcpy (void *dest, const void *src, size_t size, const std::vector< event > &dependencies) |
Enqueues an USM memcpy operation. More... | |
event | experimental_prefetch (const void *ptr, size_t size) |
Hints to the SYCL runtime that the data is available earlier than when the USM model would require it. More... | |
event | prefetch (const void *ptr, size_t size) |
Hints to the SYCL runtime that the data is available earlier than when the USM model would require it. More... | |
event | experimental_mem_advise (const void *ptr, size_t size, int advice) |
Provides the SYCL runtime with information about how the allocation is used. More... | |
event | mem_advise (const void *ptr, size_t size, int advice) |
Provides the SYCL runtime with information about how the allocation is used. More... | |
void | wait_and_throw () |
Performs a blocking wait for the completion of all enqueued tasks in the queue. More... | |
void | throw_asynchronous () |
Report any unreported asynchronous errors via the async_handler if provided (lost otherwise) More... | |
template<typename T > | |
event | submit (T cgf) |
Submits a command group functor to execution. More... | |
template<typename T > | |
event | submit (T cgf, const cl::sycl::queue &fallbackQ) |
Submits a command group functor to execution with a fallback queue. More... | |
Friends | |
bool | operator== (const queue &lhs, const queue &rhs) |
Determines if lhs and rhs are equal. More... | |
bool | operator!= (const queue &lhs, const queue &rhs) |
Determines if lhs and rhs are not equal. More... | |
Detailed Description
The cl::sycl::queue object is the SYCL abstraction of the OpenCL object cl_command_queue.
It is responsible for constructing the OpenCL cl_command_queue object and all OpenCL API functions that involve enqueuing. As the cl::sycl::queue object can be constructed using different methods, it maintains the ownership over objects that it can potentially be responsible for constructing and destructing.
Constructor & Destructor Documentation
◆ queue() [1/13]
|
inlineexplicit |
◆ queue() [2/13]
|
explicit |
Constructs a queue using a default device selector.
- Parameters
-
asyncHandler User defined async_handler propList List of queue properties
◆ queue() [3/13]
|
inlineexplicit |
Constructs a queue using a user defined device selector.
The device selector device_selector::select_device() is called by the constructor to get the device to construct the queue.
- Parameters
-
deviceSelector User defined device_selector propList List of queue properties
◆ queue() [4/13]
|
explicit |
Constructs a queue using a user defined device selector.
The device selector device_selector::select_device() is called by the constructor to get the device to construct the queue.
- Parameters
-
deviceSelector User defined device_selector asyncHandler User defined async_handler propList List of queue properties
◆ queue() [5/13]
|
inlineexplicit |
◆ queue() [6/13]
|
explicit |
Construct a queue from a given device, creating an implicit context in the process.
- Parameters
-
dev The device to use to create the queue asyncHandler User defined async_handler propList List of queue properties
◆ queue() [7/13]
|
inlineexplicit |
Constructs a queue using a user defined device selector against a specific context.
The device selector device_selector::select_device() is called by the constructor to get the device to construct the queue.
- Parameters
-
syclContext Context in which the queue will be created. selector Used to get a device from the context propList List of queue properties
◆ queue() [8/13]
|
explicit |
Constructs a queue using a user defined device selector against a specific context.
The device selector device_selector::select_device() is called by the constructor to get the device to construct the queue.
- Parameters
-
syclContext Context in which the queue will be created. selector Used to get a device from the context propList List of queue properties
◆ queue() [9/13]
|
explicit |
Constructs a queue with properties using an existing device and context.
- Parameters
-
syclContext The context the queue will belong to. dev The device that work will be executed on. asyncHandler Handler for asynchronous exceptions propList List of properties for the queue to have.
- Exceptions
-
sycl_exception If dev is not in syclContext
◆ queue() [10/13]
|
inlineexplicit |
◆ queue() [11/13]
|
explicit |
Construct a queue object from a given OpenCL object.
- Parameters
-
clQueue a valid OpenCL object for a command queue s_context a valid OpenCL context asyncHandler User defined async_handler
◆ queue() [12/13]
|
default |
Construct a queue object by copying the contents of a given queue object.
- Parameters
-
rhs a queue to be copied over to the returned object
◆ queue() [13/13]
|
default |
Completely moves the contents of a queue to that of another queue.
Member Function Documentation
◆ experimental_mem_advise()
event cl::sycl::queue::experimental_mem_advise | ( | const void * | ptr, |
size_t | size, | ||
int | advice | ||
) |
Provides the SYCL runtime with information about how the allocation is used.
- Parameters
-
ptr Address of allocation size Number of bytes in the allocation advice Device-defined advice for the specified allocation
- Returns
- Event associated with the advise operation
◆ experimental_prefetch()
event cl::sycl::queue::experimental_prefetch | ( | const void * | ptr, |
size_t | size | ||
) |
Hints to the SYCL runtime that the data is available earlier than when the USM model would require it.
Can only be overlapped with kernel execution when Concurrent or System USM is available.
- Parameters
-
ptr Pointer to the memory to be prefetched to the device size Number of bytes requested to be prefetched
- Returns
- Event associated with the memory prefetch
◆ fill()
|
inline |
Enqueues an USM fill operation.
Fills the memory pointed by ptr
.
- Template Parameters
-
T The type of the element.
- Parameters
-
ptr Pointer object to fill. pattern The pattern to fill each element of ptr
count The number of elements of type T to fill.
- Returns
- A runtime event representing this operation
◆ get()
cl_command_queue cl::sycl::queue::get | ( | ) | const |
Returns the underlying OpenCL cl_command_queue object.
- Returns
- an OpenCL cl_command_queue object.
◆ get_context()
COMPUTECPP_TEST_VIRTUAL context cl::sycl::queue::get_context | ( | ) | const |
Returns the context associate to the queue.
- Returns
- The context object.
◆ get_device()
device cl::sycl::queue::get_device | ( | ) | const |
Returns the Device associated with the queue.
- Returns
- The device object used with the queue.
◆ get_info()
COMPUTECPP_EXPORT info::param_traits<info::queue, param>::return_type cl::sycl::queue::get_info | ( | ) | const |
Gets OpenCL information for the queue.
- Template Parameters
-
param A info::queue descriptor specifying the information to retrieve.
- Returns
- The retrieved information as the appropriate return type
◆ get_property()
|
inline |
◆ has_property()
|
inlinenoexcept |
◆ is_host()
COMPUTECPP_TEST_VIRTUAL bool cl::sycl::queue::is_host | ( | ) | const |
Determine if the queue is executing kernels on the host.
- Returns
- true if the queue is executing kernels on the host.
◆ mem_advise()
|
inline |
◆ memcpy() [1/3]
event cl::sycl::queue::memcpy | ( | void * | dest, |
const void * | src, | ||
size_t | size | ||
) |
Enqueues an USM memcpy operation.
Copies size
bytes from src
to dest
. This is a utility function that will submit an operation in this queue.
- Parameters
-
dest Pointer to the memory location to copy to. src Pointer to the memory location to copy from. size The number of bytes to copy.
- Returns
- A runtime event representing this operation.
◆ memcpy() [2/3]
Enqueues an USM memcpy operation.
Copies size
bytes from src
to dest
. This is a utility function that will submit an operation in this queue.
- Parameters
-
dest Pointer to the memory location to copy to. src Pointer to the memory location to copy from. size The number of bytes to copy. dependency The event object which must be complete before the command can be executed. dependency The event object which must be complete before the command can be executed.
- Returns
- A runtime event representing this operation.
◆ memcpy() [3/3]
event cl::sycl::queue::memcpy | ( | void * | dest, |
const void * | src, | ||
size_t | size, | ||
const std::vector< event > & | dependencies | ||
) |
Enqueues an USM memcpy operation.
Copies size
bytes from src
to dest
. This is a utility function that will submit an operation in this queue.
- Parameters
-
dest Pointer to the memory location to copy to. src Pointer to the memory location to copy from. size The number of bytes to copy. dependencies Event objects which must be complete before the command can be executed.
- Returns
- A runtime event representing this operation.
◆ operator=() [1/2]
Completely assigns the contents of the queue to that of another queue.
◆ operator=() [2/2]
Completely moves the contents of a queue to that of another queue.
◆ prefetch()
|
inline |
Hints to the SYCL runtime that the data is available earlier than when the USM model would require it.
Can only be overlapped with kernel execution when Concurrent or System USM is available.
- Parameters
-
ptr Pointer to the memory to be prefetched to the device size Number of bytes requested to be prefetched
- Returns
- Event associated with the memory prefetch
◆ submit() [1/2]
|
inline |
◆ submit() [2/2]
|
inline |
Submits a command group functor to execution with a fallback queue.
If an error occur during the execution of the kernel on the current queue, the runtime will try to run the kernel on the fallback queue.
- Template Parameters
-
T The command group type
- Parameters
-
cgf The command group functor fallbackQ The fallback queue to use in case of error.
◆ throw_asynchronous()
void cl::sycl::queue::throw_asynchronous | ( | ) |
Report any unreported asynchronous errors via the async_handler if provided (lost otherwise)
◆ wait()
void cl::sycl::queue::wait | ( | ) |
Performs a blocking wait for the completion of all enqueued tasks in the queue.
Synchronous errors are reported through C++ exceptions.
◆ wait_and_throw()
void cl::sycl::queue::wait_and_throw | ( | ) |
Performs a blocking wait for the completion of all enqueued tasks in the queue.
Synchronous errors are reported through C++ exceptions. Asynchronous errors are reported to the async_handler if provided (lost otherwise)
Friends And Related Function Documentation
◆ operator!=
◆ operator==
The documentation for this class was generated from the following file: