Top Description Inners Fields Constructors Methods
org.lwjgl.opencl

pack-priv final Class APIUtil

extends Object
Class Inheritance
Imports
org.lwjgl.*, org.lwjgl.opencl.FastLongMap.Entry, java.nio.*, java.util.HashSet, .Set, .StringTokenizer

Utility class for OpenCL API calls.
Author
spasi

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static interface

Field Summary

Modifier and TypeField and Description
private static final ThreadLocal<char[]>
private static final ThreadLocal<ByteBuffer>
private static final ThreadLocal<PointerBuffer>
private static final int
private static final ThreadLocal<APIUtil.Buffers>
private static final APIUtil.ObjectDestructor<CLCommandQueue>
private static final APIUtil.ObjectDestructor<CLEvent>
private static final APIUtil.ObjectDestructor<CLKernel>
private static final APIUtil.ObjectDestructor<CLMem>
private static final APIUtil.ObjectDestructor<CLProgram>
private static final APIUtil.ObjectDestructor<CLSampler>
private static final APIUtil.ObjectDestructor<CLDevice>
private static final int
private static final int
private static final ThreadLocal<PointerBuffer>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static ByteBuffer
encode(final ByteBuffer
The target buffer
buffer
,
final CharSequence
The source string
string
)

Simple ASCII encoding.

private static char[]
getArray(final int size)

pack-priv static long

Returns:

the String as a ByteBuffer
getBuffer
(final CharSequence string)

Returns a buffer containing the specified string as bytes.

pack-priv static long

Returns:

the String as a ByteBuffer
getBuffer
(final CharSequence string, final int offset)

Returns a buffer containing the specified string as bytes, starting at the specified offset.

pack-priv static long

Returns:

the Strings as a ByteBuffer
getBuffer
(final CharSequence[] strings)

Returns a buffer containing the specified strings as bytes.

pack-priv static ByteBuffer
getBufferByte(final int size)

private static ByteBuffer
getBufferByteOffset(final int size)

pack-priv static DoubleBuffer
pack-priv static FloatBuffer
pack-priv static IntBuffer
pack-priv static IntBuffer
pack-priv static LongBuffer
pack-priv static long

Returns:

the String as a ByteBuffer
getBufferNT
(final CharSequence string)

Returns a buffer containing the specified string as bytes, including null-termination.

pack-priv static long

Returns:

the Strings as a ByteBuffer
getBufferNT
(final CharSequence[] strings)

Returns a buffer containing the specified strings as bytes, including null-termination.

pack-priv static PointerBuffer
getBufferPointer(final int size)

pack-priv static PointerBuffer
pack-priv static ShortBuffer
pack-priv static CLPlatform
getCLPlatform(final PointerBuffer properties)

pack-priv static Set<String>
getExtensions(final String extensionList)

pack-priv static PointerBuffer
pack-priv static PointerBuffer
getLengths(final int size)

pack-priv static long

Returns:

the String lengths in a PointerBuffer
getLengths
(final CharSequence[] strings)

Returns a buffer containing the lengths of the specified strings.

pack-priv static long

Returns:

the buffer lengths in a PointerBuffer
getLengths
(final ByteBuffer[]
the buffer array
buffers
)

Returns a buffer containing the lengths of the specified buffers.

pack-priv static ByteBuffer
getNativeKernelArgs(final long user_func_ref, final CLMem[] clMems, final long[] sizes)

pack-priv static long
getPointer(final PointerWrapper pointer)

pack-priv static long
pack-priv static int
getSize(final PointerBuffer lengths)

pack-priv static String

Returns:

the buffer as a String.
getString
(final ByteBuffer buffer)

Reads a byte string from the specified buffer.

pack-priv static int
getTotalLength(final CharSequence[] strings)

pack-priv static boolean
isDevicesParam(final int param_name)

pack-priv static void
releaseObjects(final CLDevice
the CLDevice to clear
device
)

Releases all sub-devices created from the specified CLDevice.

pack-priv static void
releaseObjects(final CLContext
the CLContext to clear
context
)

Releases all objects contained in the specified CLContext.

pack-priv static void
releaseObjects(final CLProgram
the CLProgram to clear
program
)

Releases all objects contained in the specified CLProgram.

pack-priv static void
releaseObjects(final CLCommandQueue
the CLCommandQueue to clear
queue
)

Releases all objects contained in the specified CLCommandQueue.

private static <T extends CLObjectChild> void
releaseObjects(final CLObjectRegistry<T> registry, final APIUtil.ObjectDestructor<T> destructor)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

arrayTLback to summary
private static final ThreadLocal<char[]> arrayTL
bufferByteTLback to summary
private static final ThreadLocal<ByteBuffer> bufferByteTL
bufferPointerTLback to summary
private static final ThreadLocal<PointerBuffer> bufferPointerTL
BUFFERS_SIZEback to summary
private static final int BUFFERS_SIZE
buffersTLback to summary
private static final ThreadLocal<APIUtil.Buffers> buffersTL
DESTRUCTOR_CLCommandQueueback to summary
private static final APIUtil.ObjectDestructor<CLCommandQueue> DESTRUCTOR_CLCommandQueue
DESTRUCTOR_CLEventback to summary
private static final APIUtil.ObjectDestructor<CLEvent> DESTRUCTOR_CLEvent
DESTRUCTOR_CLKernelback to summary
private static final APIUtil.ObjectDestructor<CLKernel> DESTRUCTOR_CLKernel
DESTRUCTOR_CLMemback to summary
private static final APIUtil.ObjectDestructor<CLMem> DESTRUCTOR_CLMem
DESTRUCTOR_CLProgramback to summary
private static final APIUtil.ObjectDestructor<CLProgram> DESTRUCTOR_CLProgram
DESTRUCTOR_CLSamplerback to summary
private static final APIUtil.ObjectDestructor<CLSampler> DESTRUCTOR_CLSampler
DESTRUCTOR_CLSubDeviceback to summary
private static final APIUtil.ObjectDestructor<CLDevice> DESTRUCTOR_CLSubDevice
INITIAL_BUFFER_SIZEback to summary
private static final int INITIAL_BUFFER_SIZE
INITIAL_LENGTHS_SIZEback to summary
private static final int INITIAL_LENGTHS_SIZE
lengthsTLback to summary
private static final ThreadLocal<PointerBuffer> lengthsTL

Constructor Detail

APIUtilback to summary
private APIUtil()

Method Detail

encodeback to summary
private static ByteBuffer encode(final ByteBuffer buffer, final CharSequence string)

Simple ASCII encoding.

Parameters
buffer:ByteBuffer

The target buffer

string:CharSequence

The source string

getArrayback to summary
private static char[] getArray(final int size)
getBufferback to summary
pack-priv static long getBuffer(final CharSequence string)

Returns a buffer containing the specified string as bytes.

Returns:long

the String as a ByteBuffer

getBufferback to summary
pack-priv static long getBuffer(final CharSequence string, final int offset)

Returns a buffer containing the specified string as bytes, starting at the specified offset.

Returns:long

the String as a ByteBuffer

getBufferback to summary
pack-priv static long getBuffer(final CharSequence[] strings)

Returns a buffer containing the specified strings as bytes.

Returns:long

the Strings as a ByteBuffer

getBufferByteback to summary
pack-priv static ByteBuffer getBufferByte(final int size)
getBufferByteOffsetback to summary
private static ByteBuffer getBufferByteOffset(final int size)
getBufferDoubleback to summary
pack-priv static DoubleBuffer getBufferDouble()
getBufferFloatback to summary
pack-priv static FloatBuffer getBufferFloat()
getBufferIntback to summary
pack-priv static IntBuffer getBufferInt()
getBufferIntDebugback to summary
pack-priv static IntBuffer getBufferIntDebug()
getBufferLongback to summary
pack-priv static LongBuffer getBufferLong()
getBufferNTback to summary
pack-priv static long getBufferNT(final CharSequence string)

Returns a buffer containing the specified string as bytes, including null-termination.

Returns:long

the String as a ByteBuffer

getBufferNTback to summary
pack-priv static long getBufferNT(final CharSequence[] strings)

Returns a buffer containing the specified strings as bytes, including null-termination.

Returns:long

the Strings as a ByteBuffer

getBufferPointerback to summary
pack-priv static PointerBuffer getBufferPointer(final int size)
getBufferPointerback to summary
pack-priv static PointerBuffer getBufferPointer()
getBufferShortback to summary
pack-priv static ShortBuffer getBufferShort()
getCLPlatformback to summary
pack-priv static CLPlatform getCLPlatform(final PointerBuffer properties)
getExtensionsback to summary
pack-priv static Set<String> getExtensions(final String extensionList)
getLengthsback to summary
pack-priv static PointerBuffer getLengths()
getLengthsback to summary
pack-priv static PointerBuffer getLengths(final int size)
getLengthsback to summary
pack-priv static long getLengths(final CharSequence[] strings)

Returns a buffer containing the lengths of the specified strings.

Returns:long

the String lengths in a PointerBuffer

getLengthsback to summary
pack-priv static long getLengths(final ByteBuffer[] buffers)

Returns a buffer containing the lengths of the specified buffers.

Parameters
buffers:ByteBuffer[]

the buffer array

Returns:long

the buffer lengths in a PointerBuffer

getNativeKernelArgsback to summary
pack-priv static ByteBuffer getNativeKernelArgs(final long user_func_ref, final CLMem[] clMems, final long[] sizes)
getPointerback to summary
pack-priv static long getPointer(final PointerWrapper pointer)
getPointerSafeback to summary
pack-priv static long getPointerSafe(final PointerWrapper pointer)
getSizeback to summary
pack-priv static int getSize(final PointerBuffer lengths)
getStringback to summary
pack-priv static String getString(final ByteBuffer buffer)

Reads a byte string from the specified buffer.

Returns:String

the buffer as a String.

getTotalLengthback to summary
pack-priv static int getTotalLength(final CharSequence[] strings)
isDevicesParamback to summary
pack-priv static boolean isDevicesParam(final int param_name)
releaseObjectsback to summary
pack-priv static void releaseObjects(final CLDevice device)

Releases all sub-devices created from the specified CLDevice.

Parameters
device:CLDevice

the CLDevice to clear

releaseObjectsback to summary
pack-priv static void releaseObjects(final CLContext context)

Releases all objects contained in the specified CLContext.

Parameters
context:CLContext

the CLContext to clear

releaseObjectsback to summary
pack-priv static void releaseObjects(final CLProgram program)

Releases all objects contained in the specified CLProgram.

Parameters
program:CLProgram

the CLProgram to clear

releaseObjectsback to summary
pack-priv static void releaseObjects(final CLCommandQueue queue)

Releases all objects contained in the specified CLCommandQueue.

Parameters
queue:CLCommandQueue

the CLCommandQueue to clear

releaseObjectsback to summary
private static <T extends CLObjectChild> void releaseObjects(final CLObjectRegistry<T> registry, final APIUtil.ObjectDestructor<T> destructor)
org.lwjgl.opencl back to summary

private Class APIUtil.Buffers

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final DoubleBuffer
pack-priv final FloatBuffer
pack-priv final IntBuffer
pack-priv final IntBuffer
pack-priv final LongBuffer
pack-priv final PointerBuffer
pack-priv final ShortBuffer

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

doublesback to summary
pack-priv final DoubleBuffer doubles
floatsback to summary
pack-priv final FloatBuffer floats
intsback to summary
pack-priv final IntBuffer ints
intsDebugback to summary
pack-priv final IntBuffer intsDebug
longsback to summary
pack-priv final LongBuffer longs
pointersback to summary
pack-priv final PointerBuffer pointers
shortsback to summary
pack-priv final ShortBuffer shorts

Constructor Detail

Buffersback to summary
pack-priv Buffers()
org.lwjgl.opencl back to summary

private Interface APIUtil.ObjectDestructor<T extends CLObjectChild>


Method Summary

Modifier and TypeMethod and Description
public void
release(T object)

Method Detail

releaseback to summary
public void release(T object)