com.jogamp.opencl
Class CLEvent

java.lang.Object
  extended by com.jogamp.opencl.CLEvent
All Implemented Interfaces:
AutoCloseable, CLResource
Direct Known Subclasses:
CLUserEvent

public class CLEvent
extends Object
implements CLResource

Event objects can be used for synchronizing command queues, e.g you can wait until a event occurs or they can also be used to capture profiling information that measure execution time of a command. Profiling of OpenCL commands can be enabled by using a CLCommandQueue created with CLCommandQueue.Mode.PROFILING_MODE.

Author:
Michael Bien

Nested Class Summary
static class CLEvent.CommandType
           
static class CLEvent.ExecutionStatus
           
static class CLEvent.ProfilingCommand
           
 
Field Summary
protected  CL cl
           
protected  CLContext context
           
 long ID
          The OpenCL object handle.
 
Method Summary
 void close()
          Deprecated. This method is not intended to be called from client code.
 boolean equals(Object obj)
           
 CLContext getContext()
          Returns the context for this OpenCL object.
 long getID()
          Returns the OpenCL object handle
 CLPlatform getPlatform()
          Returns the platform for this OpenCL object.
 long getProfilingInfo(CLEvent.ProfilingCommand command)
           
 CLEvent.ExecutionStatus getStatus()
          Returns the execution status of the command which triggers this event.
 int getStatusCode()
           
 CLEvent.CommandType getType()
           
 int hashCode()
           
 boolean isComplete()
          Returns true only if getStatus() returns CLEvent.ExecutionStatus.COMPLETE.
 void registerCallback(CLEventListener callback)
          Registers a callback which will be called when the event terminates (COMPLETE or ERROR).
 void release()
          Releases the OpenCL resource.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ID

public final long ID
The OpenCL object handle.


context

protected CLContext context

cl

protected final CL cl
Method Detail

registerCallback

public void registerCallback(CLEventListener callback)
Registers a callback which will be called when the event terminates (COMPLETE or ERROR).


release

public void release()
Description copied from interface: CLResource
Releases the OpenCL resource.

Specified by:
release in interface CLResource

getStatus

public CLEvent.ExecutionStatus getStatus()
Returns the execution status of the command which triggers this event.


isComplete

public boolean isComplete()
Returns true only if getStatus() returns CLEvent.ExecutionStatus.COMPLETE.


getStatusCode

public int getStatusCode()

getType

public CLEvent.CommandType getType()

getProfilingInfo

public long getProfilingInfo(CLEvent.ProfilingCommand command)

toString

public String toString()

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

close

@Deprecated
public final void close()
Deprecated. This method is not intended to be called from client code.

Implementation detail. TODO remove as soon we have extension methods.

Specified by:
close in interface AutoCloseable
See Also:
AutoCloseable

getContext

public CLContext getContext()
Returns the context for this OpenCL object.


getPlatform

public CLPlatform getPlatform()
Returns the platform for this OpenCL object.


getID

public long getID()
Returns the OpenCL object handle