JOCL v2.6.0-rc-20250722
JOCL, OpenCL® API Binding for Java™ (public API).
com.jogamp.opencl.util.concurrent.CLCommandQueuePool< C extends CLQueueContext > Class Template Reference

A multithreaded, fixed size pool of OpenCL command queues. More...

Inheritance diagram for com.jogamp.opencl.util.concurrent.CLCommandQueuePool< C extends CLQueueContext >:
Collaboration diagram for com.jogamp.opencl.util.concurrent.CLCommandQueuePool< C extends CLQueueContext >:

Classes

enum  FinishAction
 The action executed after a task completes. More...
 

Public Member Functions

CLCommandQueuePool< C > switchContext (final CLQueueContextFactory< C > factory)
 Switches the context of all queues - this operation can be expensive. More...
 
void flushQueues ()
 Calls CLCommandQueue#flush() on all queues. More...
 
void finishQueues ()
 Calls CLCommandQueue#finish() on all queues. More...
 
void release ()
 Releases all queues. More...
 
List< CLCommandQueuegetQueues ()
 Returns the command queues used in this pool. More...
 
int getSize ()
 Returns the size of this pool (number of command queues). More...
 
FinishAction getFinishAction ()
 
boolean isReleased ()
 Returns true if release() has been called. More...
 
void setFinishAction (final FinishAction action)
 Sets the action which is run after every completed task. More...
 
String toString ()
 
void release ()
 Releases the OpenCL resource. More...
 
boolean isReleased ()
 Returns true if release() has been called. More...
 

Static Public Member Functions

static< C extends CLQueueContext > CLCommandQueuePool< C > create (final CLQueueContextFactory< C > factory, final CLMultiContext mc, final CLCommandQueue.Mode... modes)
 
static< C extends CLQueueContext > CLCommandQueuePool< C > create (final CLQueueContextFactory< C > factory, final Collection< CLDevice > devices, final CLCommandQueue.Mode... modes)
 
static< C extends CLQueueContext > CLCommandQueuePool< C > create (final CLQueueContextFactory< C > factory, final Collection< CLCommandQueue > queues)
 

Detailed Description

A multithreaded, fixed size pool of OpenCL command queues.

It serves as a multiplexer distributing tasks over N queues usually run on N devices. The usage of this pool is similar to ExecutorService but it uses CLTasks instead of Callables and provides a per-queue context for resource sharing across all tasks of one queue.

Author
Michael Bien

Definition at line 28 of file CLCommandQueuePool.java.

Member Function Documentation

◆ create() [1/3]

static< C extends CLQueueContext > CLCommandQueuePool< C > com.jogamp.opencl.util.concurrent.CLCommandQueuePool< C extends CLQueueContext >.create ( final CLQueueContextFactory< C >  factory,
final CLMultiContext  mc,
final CLCommandQueue.Mode...  modes 
)
static

Definition at line 61 of file CLCommandQueuePool.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create() [2/3]

static< C extends CLQueueContext > CLCommandQueuePool< C > com.jogamp.opencl.util.concurrent.CLCommandQueuePool< C extends CLQueueContext >.create ( final CLQueueContextFactory< C >  factory,
final Collection< CLCommandQueue queues 
)
static

Definition at line 73 of file CLCommandQueuePool.java.

◆ create() [3/3]

static< C extends CLQueueContext > CLCommandQueuePool< C > com.jogamp.opencl.util.concurrent.CLCommandQueuePool< C extends CLQueueContext >.create ( final CLQueueContextFactory< C >  factory,
final Collection< CLDevice devices,
final CLCommandQueue.Mode...  modes 
)
static

Definition at line 65 of file CLCommandQueuePool.java.

Here is the call graph for this function:

◆ finishQueues()

Calls CLCommandQueue#finish() on all queues.

Definition at line 153 of file CLCommandQueuePool.java.

Here is the caller graph for this function:

◆ flushQueues()

Calls CLCommandQueue#flush() on all queues.

Definition at line 144 of file CLCommandQueuePool.java.

◆ getFinishAction()

◆ getQueues()

Returns the command queues used in this pool.

Definition at line 178 of file CLCommandQueuePool.java.

Here is the caller graph for this function:

◆ getSize()

Returns the size of this pool (number of command queues).

Definition at line 189 of file CLCommandQueuePool.java.

Here is the caller graph for this function:

◆ isReleased()

Returns true if release() has been called.

Implements com.jogamp.opencl.CLResource.

Definition at line 198 of file CLCommandQueuePool.java.

◆ release()

Releases all queues.

Implements com.jogamp.opencl.CLResource.

Definition at line 163 of file CLCommandQueuePool.java.

Here is the caller graph for this function:

◆ setFinishAction()

void com.jogamp.opencl.util.concurrent.CLCommandQueuePool< C extends CLQueueContext >.setFinishAction ( final FinishAction  action)

Sets the action which is run after every completed task.

This is mainly intended for debugging, default value is FinishAction#DO_NOTHING.

Definition at line 206 of file CLCommandQueuePool.java.

◆ switchContext()

Switches the context of all queues - this operation can be expensive.

Blocks until all tasks finish and sets up a new context for all queues.

Returns
this

Definition at line 131 of file CLCommandQueuePool.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toString()

Definition at line 211 of file CLCommandQueuePool.java.


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