Compute Library
 22.05
Queue Class Reference

Queue classData type enumeration. More...

#include <Acl.hpp>

Collaboration diagram for Queue:
[legend]

Data Structures

struct  Options
 < Queue options More...
 

Public Member Functions

 Queue (Context &ctx, StatusCode *status=nullptr)
 Constructor. More...
 
 Queue (Context &ctx, const Options &options=Options(), StatusCode *status=nullptr)
 Constructor. More...
 
StatusCode finish ()
 Block until all the tasks of the queue have been marked as finished. More...
 
- Public Member Functions inherited from ObjectBase< AclQueue_ >
 ~ObjectBase ()=default
 Destructor. More...
 
 ObjectBase (const ObjectBase< AclQueue_ > &)=default
 Copy constructor. More...
 
 ObjectBase (ObjectBase< AclQueue_ > &&)=default
 Move Constructor. More...
 
ObjectBase< AclQueue_ > & operator= (const ObjectBase< AclQueue_ > &)=default
 Copy assignment operator. More...
 
ObjectBase< AclQueue_ > & operator= (ObjectBase< AclQueue_ > &&)=default
 Move assignment operator. More...
 
void reset (AclQueue_ *val)
 Reset object value. More...
 
const AclQueue_get () const
 Access uderlying object. More...
 
AclQueue_get ()
 Access uderlying object. More...
 

Detailed Description

Queue classData type enumeration.

Queue is responsible for the execution related aspects, with main responsibilities those of scheduling and tuning operators.

Multiple queues can be created from the same context, and the same operator can be scheduled on each concurrently.

Note
An operator might depend on the maximum possible compute units that are provided in the context, thus in cases where the number of the scheduling units of the queue are greater might lead to errors.

Definition at line 416 of file Acl.hpp.

Constructor & Destructor Documentation

◆ Queue() [1/2]

Queue ( Context ctx,
StatusCode status = nullptr 
)
inlineexplicit

Constructor.

Note
Serves as a simpler delegate constructor
As queue options, default conservative options will be used
Parameters
[in]ctxContext to create queue for
[out]statusStatus information if requested

Definition at line 451 of file Acl.hpp.

452  : Queue(ctx, Options(), status)
453  {
454  }
Queue(Context &ctx, StatusCode *status=nullptr)
Constructor.
Definition: Acl.hpp:451

◆ Queue() [2/2]

Queue ( Context ctx,
const Options options = Options(),
StatusCode status = nullptr 
)
inlineexplicit

Constructor.

Note
As queue options, default conservative options will be used
Parameters
[in]ctxContext from where the queue will be created from
[in]optionsQueue options to be used
[out]statusStatus information if requested

Definition at line 463 of file Acl.hpp.

References AclCreateQueue(), and ObjectBase< T >::get().

464  {
465  AclQueue queue;
466  const auto st = detail::as_enum<StatusCode>(AclCreateQueue(&queue, ctx.get(), &options.opts));
467  reset(queue);
468  report_status(st, "[Compute Library] Failed to create queue!");
469  if(status)
470  {
471  *status = st;
472  }
473  }
AclStatus AclCreateQueue(AclQueue *queue, AclContext ctx, const AclQueueOptions *options)
Create an operator queue.
Definition: AclQueue.cpp:45
void reset(AclQueue_ *val)
Reset object value.
Definition: Acl.hpp:148

Member Function Documentation

◆ finish()

StatusCode finish ( )
inline

Block until all the tasks of the queue have been marked as finished.

Returns
Status code

Definition at line 478 of file Acl.hpp.

References AclQueueFinish().

479  {
480  return detail::as_enum<StatusCode>(AclQueueFinish(_object.get()));
481  }
AclStatus AclQueueFinish(AclQueue queue)
Wait until all elements on the queue have been completed.
Definition: AclQueue.cpp:72

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