Top Description Fields Constructors Methods
org.lwjgl.opencl

pack-priv final Class CallbackUtil

extends Object
Class Inheritance
Imports
java.util.HashMap, .Map

Utility class that handles OpenCL API callbacks.
Author
Spasi

Field Summary

Modifier and TypeField and Description
private static final Map<CLContext, Long>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv static void
checkCallback(final int
the error code
errcode
,
final long
the GlobalRef memory address
user_data
)

Deletes the global reference represented by user_data if an OpenCL error occured.

pack-priv static long

Returns:

the GlobalRef memory address or 0 if the Object is null.
createGlobalRef
(final Object
the Object
obj
)

Creates a new global reference to the specified Object.

pack-priv static native void
deleteGlobalRef(long
the GlobalRef memory address.
ref
)

Deletes a global reference.

pack-priv static native long

Returns:

the callback function address
getContextCallback
()

Returns the memory address of the native function we pass to clCreateContext(FromType).

pack-priv static native long

Returns:

the callback function address
getEventCallback
()

Returns the memory address of the native function we pass to clSetEventCallback.

pack-priv static native long

Returns:

the callback function address
getLogMessageToStderrAPPLE
()

Returns the memory address of the native function we pass to clCreateContext(FromType), when APPLEContextLoggingUtil.STD_ERR_CALLBACK is used.

pack-priv static native long

Returns:

the callback function address
getLogMessageToStdoutAPPLE
()

Returns the memory address of the native function we pass to clCreateContext(FromType), when APPLEContextLoggingUtil.STD_OUT_CALLBACK is used.

pack-priv static native long

Returns:

the callback function address
getLogMessageToSystemLogAPPLE
()

Returns the memory address of the native function we pass to clCreateContext(FromType), when APPLEContextLoggingUtil.SYSTEM_LOG_CALLBACK is used.

pack-priv static native long

Returns:

the callback function address
getMemObjectDestructorCallback
()

Returns the memory address of the native function we pass to clSetMemObjectDestructorCallback.

pack-priv static native long

Returns:

the callback function address
getNativeKernelCallback
()

Returns the memory address of the native function we pass to clEnqueueNativeKernel.

pack-priv static native long

Returns:

the callback function address
getPrintfCallback
()

Returns the memory address of the native function we pass to clSetPrintfCallback.

pack-priv static native long

Returns:

the callback function address
getProgramCallback
()

Returns the memory address of the native function we pass to clBuildProgram.

private static native long

Returns:

the GlobalRef memory address.
ncreateGlobalRef
(Object
the Object
obj
)

Creates a new global reference to the specified Object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

contextUserDataback to summary
private static final Map<CLContext, Long> contextUserData

Constructor Detail

CallbackUtilback to summary
private CallbackUtil()

Method Detail

checkCallbackback to summary
pack-priv static void checkCallback(final int errcode, final long user_data)

Deletes the global reference represented by user_data if an OpenCL error occured.

Parameters
errcode:int

the error code

user_data:long

the GlobalRef memory address

createGlobalRefback to summary
pack-priv static long createGlobalRef(final Object obj)

Creates a new global reference to the specified Object.

Parameters
obj:Object

the Object

Returns:long

the GlobalRef memory address or 0 if the Object is null.

deleteGlobalRefback to summary
pack-priv static native void deleteGlobalRef(long ref)

Deletes a global reference.

Parameters
ref:long

the GlobalRef memory address.

getContextCallbackback to summary
pack-priv static native long getContextCallback()

Returns the memory address of the native function we pass to clCreateContext(FromType).

Returns:long

the callback function address

getEventCallbackback to summary
pack-priv static native long getEventCallback()

Returns the memory address of the native function we pass to clSetEventCallback.

Returns:long

the callback function address

getLogMessageToStderrAPPLEback to summary
pack-priv static native long getLogMessageToStderrAPPLE()

Returns the memory address of the native function we pass to clCreateContext(FromType), when APPLEContextLoggingUtil.STD_ERR_CALLBACK is used.

Returns:long

the callback function address

See Also
APPLEContextLoggingUtil#STD_ERR_CALLBACK
getLogMessageToStdoutAPPLEback to summary
pack-priv static native long getLogMessageToStdoutAPPLE()

Returns the memory address of the native function we pass to clCreateContext(FromType), when APPLEContextLoggingUtil.STD_OUT_CALLBACK is used.

Returns:long

the callback function address

See Also
APPLEContextLoggingUtil#STD_OUT_CALLBACK
getLogMessageToSystemLogAPPLEback to summary
pack-priv static native long getLogMessageToSystemLogAPPLE()

Returns the memory address of the native function we pass to clCreateContext(FromType), when APPLEContextLoggingUtil.SYSTEM_LOG_CALLBACK is used.

Returns:long

the callback function address

See Also
APPLEContextLoggingUtil#SYSTEM_LOG_CALLBACK
getMemObjectDestructorCallbackback to summary
pack-priv static native long getMemObjectDestructorCallback()

Returns the memory address of the native function we pass to clSetMemObjectDestructorCallback.

Returns:long

the callback function address

getNativeKernelCallbackback to summary
pack-priv static native long getNativeKernelCallback()

Returns the memory address of the native function we pass to clEnqueueNativeKernel.

Returns:long

the callback function address

getPrintfCallbackback to summary
pack-priv static native long getPrintfCallback()

Returns the memory address of the native function we pass to clSetPrintfCallback.

Returns:long

the callback function address

getProgramCallbackback to summary
pack-priv static native long getProgramCallback()

Returns the memory address of the native function we pass to clBuildProgram.

Returns:long

the callback function address

ncreateGlobalRefback to summary
private static native long ncreateGlobalRef(Object obj)

Creates a new global reference to the specified Object.

Parameters
obj:Object

the Object

Returns:long

the GlobalRef memory address.