Top Description Inners Fields Constructors Methods
com.jogamp.opencl

public Class CLEvent

extends CLObjectResource
Class Inheritance
Known Direct Subclasses
com.jogamp.opencl.CLUserEvent
Imports
com.jogamp.opencl.impl.CLTLInfoAccessor, com.jogamp.opencl.llb.CLEventBinding, com.jogamp.opencl.llb.impl.CLEventCallback, com.jogamp.common.nio.PointerBuffer, java.nio.Buffer

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 com.jogamp.opencl.CLCommandQueue created with com.jogamp.opencl.CLCommandQueue.Mode#PROFILING_MODE.
Author
Michael Bien, et al.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private class
public static enum
public static enum
public static enum

Field Summary

Modifier and TypeField and Description
private final CLEventBinding
private final CLEvent.CLEventInfoAccessor
private final CLEvent.CLEventProfilingInfoAccessor

Constructor Summary

AccessConstructor and Description
pack-priv
CLEvent(final CLContext context, final long id)

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(final Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public long
public CLEvent.ExecutionStatus
getStatus()

Returns the execution status of the command which triggers this event.

public int
public CLEvent.CommandType
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.
public boolean
isComplete()

Returns true only if getStatus returns ExecutionStatus#COMPLETE.

public void
registerCallback(final CLEventListener callback)

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

private void
public void
release()

Overrides com.jogamp.opencl.CLObjectResource.release.

Implements com.jogamp.opencl.CLResource.release.

Releases the OpenCL resource.
public String
toString()

Overrides com.jogamp.opencl.CLObject.toString.

Returns a string representation of the object.
Inherited from com.jogamp.opencl.CLObjectResource:
closeisReleased

Field Detail

bindingback to summary
private final CLEventBinding binding
eventInfoback to summary
private final CLEvent.CLEventInfoAccessor eventInfo
eventProfilingInfoback to summary
private final CLEvent.CLEventProfilingInfoAccessor eventProfilingInfo

Constructor Detail

CLEventback to summary
pack-priv CLEvent(final CLContext context, final long id)

Method Detail

equalsback to summary
public boolean equals(final Object obj)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
obj:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getProfilingInfoback to summary
public long getProfilingInfo(final CLEvent.ProfilingCommand command)
getStatusback to summary
public CLEvent.ExecutionStatus getStatus()

Returns the execution status of the command which triggers this event.

getStatusCodeback to summary
public int getStatusCode()
getTypeback to summary
public CLEvent.CommandType getType()
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
isCompleteback to summary
public boolean isComplete()

Returns true only if getStatus returns ExecutionStatus#COMPLETE.

registerCallbackback to summary
public void registerCallback(final CLEventListener callback)

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

registerCallbackback to summary
private void registerCallback(final CLEventListener callback, final CLEvent.ExecutionStatus trigger)
releaseback to summary
public void release()

Overrides com.jogamp.opencl.CLObjectResource.release.

Implements com.jogamp.opencl.CLResource.release.

Doc from com.jogamp.opencl.CLResource.release.

Releases the OpenCL resource.

Annotations
@Override
toStringback to summary
public String toString()

Overrides com.jogamp.opencl.CLObject.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override
com.jogamp.opencl back to summary

private Class CLEvent.CLEventInfoAccessor

extends CLTLInfoAccessor
Class Inheritance

Field Summary

Inherited from com.jogamp.opencl.impl.CLTLInfoAccessor:
localBBlocalNSB

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
protected int
getInfo(final int name, final long valueSize, final Buffer value, final PointerBuffer valueSizeRet)

Implements abstract com.jogamp.opencl.impl.CLTLInfoAccessor.getInfo.

Inherited from com.jogamp.opencl.impl.CLTLInfoAccessor:
getBBgetIntsgetLonggetNSBgetStringgetUInt32Long

Constructor Detail

CLEventInfoAccessorback to summary
private CLEventInfoAccessor()

Method Detail

getInfoback to summary
protected int getInfo(final int name, final long valueSize, final Buffer value, final PointerBuffer valueSizeRet)

Implements abstract com.jogamp.opencl.impl.CLTLInfoAccessor.getInfo.

Annotations
@Override
com.jogamp.opencl back to summary

private Class CLEvent.CLEventProfilingInfoAccessor

extends CLTLInfoAccessor
Class Inheritance

Field Summary

Inherited from com.jogamp.opencl.impl.CLTLInfoAccessor:
localBBlocalNSB

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
protected int
getInfo(final int name, final long valueSize, final Buffer value, final PointerBuffer valueSizeRet)

Implements abstract com.jogamp.opencl.impl.CLTLInfoAccessor.getInfo.

Inherited from com.jogamp.opencl.impl.CLTLInfoAccessor:
getBBgetIntsgetLonggetNSBgetStringgetUInt32Long

Constructor Detail

CLEventProfilingInfoAccessorback to summary
private CLEventProfilingInfoAccessor()

Method Detail

getInfoback to summary
protected int getInfo(final int name, final long valueSize, final Buffer value, final PointerBuffer valueSizeRet)

Implements abstract com.jogamp.opencl.impl.CLTLInfoAccessor.getInfo.

Annotations
@Override
com.jogamp.opencl back to summary

public final Enum CLEvent.CommandType

extends Enum<CLEvent.CommandType>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final CLEvent.CommandType
public static final CLEvent.CommandType
public static final CLEvent.CommandType
public static final CLEvent.CommandType
public static final CLEvent.CommandType
public static final CLEvent.CommandType
public static final CLEvent.CommandType
public static final CLEvent.CommandType
public static final CLEvent.CommandType
public static final CLEvent.CommandType
public static final CLEvent.CommandType
public static final CLEvent.CommandType
public static final CLEvent.CommandType
public static final CLEvent.CommandType
public static final CLEvent.CommandType
public static final CLEvent.CommandType
public static final CLEvent.CommandType
public final int
TYPE

Value of wrapped OpenCL command type.

public static final CLEvent.CommandType
public static final CLEvent.CommandType
public static final CLEvent.CommandType
public static final CLEvent.CommandType
public static final CLEvent.CommandType

Constructor Summary

AccessConstructor and Description
private
CommandType(final int type)

Method Summary

Modifier and TypeMethod and Description
public static CLEvent.CommandType
public static CLEvent.CommandType
valueOf(final int commandType)

public static CLEvent.CommandType[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ACQUIRE_GL_OBJECTSback to summary
public static final CLEvent.CommandType ACQUIRE_GL_OBJECTS
COPY_BUFFERback to summary
public static final CLEvent.CommandType COPY_BUFFER
COPY_BUFFER_RECTback to summary
public static final CLEvent.CommandType COPY_BUFFER_RECT
COPY_BUFFER_TO_IMAGEback to summary
public static final CLEvent.CommandType COPY_BUFFER_TO_IMAGE
COPY_IMAGEback to summary
public static final CLEvent.CommandType COPY_IMAGE
COPY_IMAGE_TO_BUFFERback to summary
public static final CLEvent.CommandType COPY_IMAGE_TO_BUFFER
GL_FENCE_SYNC_OBJECT_KHRback to summary
public static final CLEvent.CommandType GL_FENCE_SYNC_OBJECT_KHR
MAP_BUFFERback to summary
public static final CLEvent.CommandType MAP_BUFFER
MAP_IMAGEback to summary
public static final CLEvent.CommandType MAP_IMAGE
MARKERback to summary
public static final CLEvent.CommandType MARKER
NATIVE_KERNELback to summary
public static final CLEvent.CommandType NATIVE_KERNEL
NDRANGE_KERNELback to summary
public static final CLEvent.CommandType NDRANGE_KERNEL
READ_BUFFERback to summary
public static final CLEvent.CommandType READ_BUFFER
READ_BUFFER_RECTback to summary
public static final CLEvent.CommandType READ_BUFFER_RECT
READ_IMAGEback to summary
public static final CLEvent.CommandType READ_IMAGE
RELEASE_GL_OBJECTSback to summary
public static final CLEvent.CommandType RELEASE_GL_OBJECTS
TASKback to summary
public static final CLEvent.CommandType TASK
TYPEback to summary
public final int TYPE

Value of wrapped OpenCL command type.

UNMAP_MEM_OBJECTback to summary
public static final CLEvent.CommandType UNMAP_MEM_OBJECT
USERback to summary
public static final CLEvent.CommandType USER
WRITE_BUFFERback to summary
public static final CLEvent.CommandType WRITE_BUFFER
WRITE_BUFFER_RECTback to summary
public static final CLEvent.CommandType WRITE_BUFFER_RECT
WRITE_IMAGEback to summary
public static final CLEvent.CommandType WRITE_IMAGE

Constructor Detail

CommandTypeback to summary
private CommandType(final int type)

Method Detail

valueOfback to summary
public static CLEvent.CommandType valueOf(String name)
valueOfback to summary
public static CLEvent.CommandType valueOf(final int commandType)
valuesback to summary
public static CLEvent.CommandType[] values()
com.jogamp.opencl back to summary

public final Enum CLEvent.ExecutionStatus

extends Enum<CLEvent.ExecutionStatus>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final CLEvent.ExecutionStatus
COMPLETE

The command has completed.

public static final CLEvent.ExecutionStatus
ERROR

The command did not complete because of an error.

public static final CLEvent.ExecutionStatus
QUEUED

Command has been enqueued in the command-queue.

public static final CLEvent.ExecutionStatus
RUNNING

Device is currently executing this command.

public final int
STATUS

Value of wrapped OpenCL command execution status.

public static final CLEvent.ExecutionStatus
SUBMITTED

Enqueued command has been submitted by the host to the device associated with the command-queue.

Constructor Summary

AccessConstructor and Description
private
ExecutionStatus(final int status)

Method Summary

Modifier and TypeMethod and Description
public static CLEvent.ExecutionStatus
public static CLEvent.ExecutionStatus
valueOf(final int status)

public static CLEvent.ExecutionStatus[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

COMPLETEback to summary
public static final CLEvent.ExecutionStatus COMPLETE

The command has completed.

ERRORback to summary
public static final CLEvent.ExecutionStatus ERROR

The command did not complete because of an error.

QUEUEDback to summary
public static final CLEvent.ExecutionStatus QUEUED

Command has been enqueued in the command-queue.

RUNNINGback to summary
public static final CLEvent.ExecutionStatus RUNNING

Device is currently executing this command.

STATUSback to summary
public final int STATUS

Value of wrapped OpenCL command execution status.

SUBMITTEDback to summary
public static final CLEvent.ExecutionStatus SUBMITTED

Enqueued command has been submitted by the host to the device associated with the command-queue.

Constructor Detail

ExecutionStatusback to summary
private ExecutionStatus(final int status)

Method Detail

valueOfback to summary
public static CLEvent.ExecutionStatus valueOf(String name)
valueOfback to summary
public static CLEvent.ExecutionStatus valueOf(final int status)
valuesback to summary
public static CLEvent.ExecutionStatus[] values()
com.jogamp.opencl back to summary

public final Enum CLEvent.ProfilingCommand

extends Enum<CLEvent.ProfilingCommand>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public final int
COMMAND

Value of wrapped OpenCL profiling command.

public static final CLEvent.ProfilingCommand
END

A 64-bit value that describes the current device time counter in nanoseconds when the command identified by event has finished execution on the device.

public static final CLEvent.ProfilingCommand
QUEUED

A 64-bit value that describes the current device time counter in nanoseconds when the command identified by event is enqueued in a command-queue by the host.

public static final CLEvent.ProfilingCommand
START

A 64-bit value that describes the current device time counter in nanoseconds when the command identified by event starts execution on the device.

public static final CLEvent.ProfilingCommand
SUBMIT

A 64-bit value that describes the current device time counter in nanoseconds when the command identified by event that has been enqueued is submitted by the host to the device associated with the commandqueue.

Constructor Summary

AccessConstructor and Description
private
ProfilingCommand(final int command)

Method Summary

Modifier and TypeMethod and Description
public static CLEvent.ProfilingCommand
public static CLEvent.ProfilingCommand
valueOf(final int status)

public static CLEvent.ProfilingCommand[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

COMMANDback to summary
public final int COMMAND

Value of wrapped OpenCL profiling command.

ENDback to summary
public static final CLEvent.ProfilingCommand END

A 64-bit value that describes the current device time counter in nanoseconds when the command identified by event has finished execution on the device.

QUEUEDback to summary
public static final CLEvent.ProfilingCommand QUEUED

A 64-bit value that describes the current device time counter in nanoseconds when the command identified by event is enqueued in a command-queue by the host.

STARTback to summary
public static final CLEvent.ProfilingCommand START

A 64-bit value that describes the current device time counter in nanoseconds when the command identified by event starts execution on the device.

SUBMITback to summary
public static final CLEvent.ProfilingCommand SUBMIT

A 64-bit value that describes the current device time counter in nanoseconds when the command identified by event that has been enqueued is submitted by the host to the device associated with the commandqueue.

Constructor Detail

ProfilingCommandback to summary
private ProfilingCommand(final int command)

Method Detail

valueOfback to summary
public static CLEvent.ProfilingCommand valueOf(String name)
valueOfback to summary
public static CLEvent.ProfilingCommand valueOf(final int status)
valuesback to summary
public static CLEvent.ProfilingCommand[] values()