Package com.jme3.opencl
Class Event
java.lang.Object
com.jme3.opencl.AbstractOpenCLObject
com.jme3.opencl.Event
- All Implemented Interfaces:
OpenCLObject
- Direct Known Subclasses:
LwjglEvent
Wrapper for an OpenCL Event object.
Events are returned from kernel launches and all asynchronous operations.
They allow us to test whether an action has completed and block until the operation
is done.
-
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
-
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
Tests if the action is completed.register()
Registers this object for automatic releasing on garbage collection.abstract void
Waits until the action has finished (blocking).Methods inherited from class com.jme3.opencl.AbstractOpenCLObject
finalize, getReleaser, release
-
Constructor Details
-
Event
-
-
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
-
waitForFinished
public abstract void waitForFinished()Waits until the action has finished (blocking). This automatically releases the event. -
isCompleted
public abstract boolean isCompleted()Tests if the action is completed. If the action is completed, the event is released.- Returns:
true
if the action is completed
-