Package com.jme3.opencl
Class CommandQueue
java.lang.Object
com.jme3.opencl.AbstractOpenCLObject
com.jme3.opencl.CommandQueue
- All Implemented Interfaces:
OpenCLObject
- Direct Known Subclasses:
LwjglCommandQueue
Wrapper for an OpenCL command queue.
The command queue serializes every GPU function call: By passing the same
queue to OpenCL function (buffer, image operations, kernel calls), it is
ensured that they are executed in the order in which they are passed.
Each command queue is associated with exactly one device: that device is specified on creation (
Each command queue is associated with exactly one device: that device is specified on creation (
Context.createQueue(com.jme3.opencl.Device)
)
and all commands are sent to this device.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.jme3.opencl.OpenCLObject
OpenCLObject.ObjectReleaser
-
Field Summary
Fields inherited from class com.jme3.opencl.AbstractOpenCLObject
releaser
-
Constructor Summary
ModifierConstructorDescriptionprotected
CommandQueue
(OpenCLObject.ObjectReleaser releaser, Device device) -
Method Summary
Modifier and TypeMethodDescriptionabstract void
finish()
Blocks until all previously queued OpenCL commands in command queue are issued to the associated device and have completed.abstract void
flush()
Issues all previously queued OpenCL commands in command_queue to the device associated with command queue.Returns the device associated with this command queue.register()
Registers this object for automatic releasing on garbage collection.Methods inherited from class com.jme3.opencl.AbstractOpenCLObject
finalize, getReleaser, release
-
Field Details
-
device
-
-
Constructor Details
-
CommandQueue
-
-
Method Details
-
register
Description copied from interface:OpenCLObject
Registers this object for automatic releasing on garbage collection. By default, OpenCLObjects are not registered in theOpenCLObjectManager
, you have to release it manually by callingOpenCLObject.release()
. Without registering or releasing, a memory leak might occur.
Returnsthis
to allow calls likeBuffer buffer = clContext.createBuffer(1024).register();
.- Specified by:
register
in interfaceOpenCLObject
- Overrides:
register
in classAbstractOpenCLObject
- Returns:
this
-
getDevice
Returns the device associated with this command queue. It can be used to query properties of the device that is used to execute the commands issued to this command queue.- Returns:
- the associated device
-
flush
public abstract void flush()Issues all previously queued OpenCL commands in command_queue to the device associated with command queue. Flush only guarantees that all queued commands to command_queue will eventually be submitted to the appropriate device. There is no guarantee that they will be complete after flush returns. -
finish
public abstract void finish()Blocks until all previously queued OpenCL commands in command queue are issued to the associated device and have completed. Finish does not return until all previously queued commands in command queue have been processed and completed. Finish is also a synchronization point.
-