Top Description Inners Fields Constructors Methods
org.lwjgl.opencl

public final Class CLContext

extends CLObjectChild<CLPlatform>
Class Inheritance
Imports
org.lwjgl.LWJGLException, org.lwjgl.opencl.api.CLImageFormat, .Filter, org.lwjgl.opengl.Drawable, java.nio.IntBuffer, java.util.List

This class is a wrapper around a cl_context pointer.
Author
Spasi

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static interface
CLContext.CLContextUtil

CLContext utility methods interface.

Field Summary

Modifier and TypeField and Description
private final CLObjectRegistry<CLCommandQueue>
private final CLObjectRegistry<CLEvent>
private final CLObjectRegistry<CLMem>
private final CLObjectRegistry<CLProgram>
private final CLObjectRegistry<CLSampler>
private long
private long
private static final CLContext.CLContextUtil

Constructor Summary

AccessConstructor and Description
pack-priv
CLContext(final long pointer, final CLPlatform platform)

Method Summary

Modifier and TypeMethod and Description
private boolean
checkCallback(final long callback, final int result)

public static CLContext

Returns:

the new CLContext
create
(final CLPlatform
the platform to use
platform
,
final List<CLDevice>
the devices to use
devices
,
final IntBuffer
the error code result
errcode_ret
)

Creates a new CLContext.

public static CLContext

Returns:

the new CLContext
create
(final CLPlatform
the platform to use
platform
,
final List<CLDevice>
the devices to use
devices
,
final CLContextCallback
the context callback function
pfn_notify
,
final IntBuffer
the error code result
errcode_ret
)

Creates a new CLContext.

public static CLContext

Returns:

the new CLContext
create
(final CLPlatform
the platform to use
platform
,
final List<CLDevice>
the devices to use
devices
,
final CLContextCallback pfn_notify, final Drawable
the OpenGL drawable to share objects with
share_drawable
,
final IntBuffer
the error code result
errcode_ret
)

Creates a new CLContext.

public static CLContext

Returns:

the new CLContext
createFromType
(final CLPlatform
the platform to use
platform
,
final long
the device type to use
device_type
,
final IntBuffer
the error code result
errcode_ret
)

Creates a new CLContext.

public static CLContext

Returns:

the new CLContext
createFromType
(final CLPlatform
the platform to use
platform
,
final long
the device type to use
device_type
,
final CLContextCallback
the context callback function
pfn_notify
,
final IntBuffer
the error code result
errcode_ret
)

Creates a new CLContext.

public static CLContext

Returns:

the new CLContext
createFromType
(final CLPlatform
the platform to use
platform
,
final long
the device type to use
device_type
,
final CLContextCallback pfn_notify, final Drawable
the OpenGL drawable to share objects with
share_drawable
,
final IntBuffer
the error code result
errcode_ret
)

Creates a new CLContext.

public CLCommandQueue

Returns:

the CLCommandQueue object
getCLCommandQueue
(final long
the command queue object id
id
)

Returns a CLCommandQueue associated with this context.

pack-priv CLObjectRegistry<CLCommandQueue>
public CLEvent

Returns:

the CLEvent object
getCLEvent
(final long
the event object id
id
)

Returns a user CLEvent associated with this context.

pack-priv CLObjectRegistry<CLEvent>
public CLMem

Returns:

the CLMem object
getCLMem
(final long
the memory object id
id
)

Returns a CLMem associated with this context.

pack-priv CLObjectRegistry<CLMem>
public CLProgram

Returns:

the CLProgram object
getCLProgram
(final long
the program object id
id
)

Returns a CLProgram associated with this context.

pack-priv CLObjectRegistry<CLProgram>
public CLSampler

Returns:

the CLSampler object
getCLSampler
(final long
the sampler object id
id
)

Returns a CLSampler associated with this context.

pack-priv CLObjectRegistry<CLSampler>
public List<CLDevice>

Returns:

the list of devices
getInfoDevices
()

Returns the list of devices in context.

public int

Returns:

the parameter value
getInfoInt
(int
the parameter
param_name
)

Returns the integer value of the specified parameter.

public List<CLImageFormat>
getSupportedImageFormats(final long flags, final int image_type)

public List<CLImageFormat>
getSupportedImageFormats(final long flags, final int image_type, final Filter<CLImageFormat> filter)

pack-priv void
releaseImpl()

Decrements the context's reference count.

pack-priv void
setContextCallback(final long
the context callback pointer
callback
)

Associates this context with the specified context callback reference.

pack-priv void
setPrintfCallback(final long
the printf callback pointer
callback
,
final int result)

Associates this context with the specified printf callback reference.

Inherited from org.lwjgl.opencl.CLObjectChild:
getParent

Field Detail

clCommandQueuesback to summary
private final CLObjectRegistry<CLCommandQueue> clCommandQueues
clEventsback to summary
private final CLObjectRegistry<CLEvent> clEvents
clMemsback to summary
private final CLObjectRegistry<CLMem> clMems
clProgramsback to summary
private final CLObjectRegistry<CLProgram> clPrograms
clSamplersback to summary
private final CLObjectRegistry<CLSampler> clSamplers
contextCallbackback to summary
private long contextCallback
printfCallbackback to summary
private long printfCallback
utilback to summary
private static final CLContext.CLContextUtil util

Constructor Detail

CLContextback to summary
pack-priv CLContext(final long pointer, final CLPlatform platform)

Method Detail

checkCallbackback to summary
private boolean checkCallback(final long callback, final int result)
createback to summary
public static CLContext create(final CLPlatform platform, final List<CLDevice> devices, final IntBuffer errcode_ret) throws LWJGLException

Creates a new CLContext.

Parameters
platform:CLPlatform

the platform to use

devices:List<CLDevice>

the devices to use

errcode_ret:IntBuffer

the error code result

Returns:CLContext

the new CLContext

Exceptions
LWJGLException:
if an exception occurs while creating the context
createback to summary
public static CLContext create(final CLPlatform platform, final List<CLDevice> devices, final CLContextCallback pfn_notify, final IntBuffer errcode_ret) throws LWJGLException

Creates a new CLContext.

Parameters
platform:CLPlatform

the platform to use

devices:List<CLDevice>

the devices to use

pfn_notify:CLContextCallback

the context callback function

errcode_ret:IntBuffer

the error code result

Returns:CLContext

the new CLContext

Exceptions
LWJGLException:
if an exception occurs while creating the context
createback to summary
public static CLContext create(final CLPlatform platform, final List<CLDevice> devices, final CLContextCallback pfn_notify, final Drawable share_drawable, final IntBuffer errcode_ret) throws LWJGLException

Creates a new CLContext.

Parameters
platform:CLPlatform

the platform to use

devices:List<CLDevice>

the devices to use

share_drawable:Drawable

the OpenGL drawable to share objects with

errcode_ret:IntBuffer

the error code result

Returns:CLContext

the new CLContext

Exceptions
LWJGLException:
if an exception occurs while creating the context
createFromTypeback to summary
public static CLContext createFromType(final CLPlatform platform, final long device_type, final IntBuffer errcode_ret) throws LWJGLException

Creates a new CLContext.

Parameters
platform:CLPlatform

the platform to use

device_type:long

the device type to use

errcode_ret:IntBuffer

the error code result

Returns:CLContext

the new CLContext

Exceptions
LWJGLException:
if an exception occurs while creating the context
createFromTypeback to summary
public static CLContext createFromType(final CLPlatform platform, final long device_type, final CLContextCallback pfn_notify, final IntBuffer errcode_ret) throws LWJGLException

Creates a new CLContext.

Parameters
platform:CLPlatform

the platform to use

device_type:long

the device type to use

pfn_notify:CLContextCallback

the context callback function

errcode_ret:IntBuffer

the error code result

Returns:CLContext

the new CLContext

Exceptions
LWJGLException:
if an exception occurs while creating the context
createFromTypeback to summary
public static CLContext createFromType(final CLPlatform platform, final long device_type, final CLContextCallback pfn_notify, final Drawable share_drawable, final IntBuffer errcode_ret) throws LWJGLException

Creates a new CLContext.

Parameters
platform:CLPlatform

the platform to use

device_type:long

the device type to use

share_drawable:Drawable

the OpenGL drawable to share objects with

errcode_ret:IntBuffer

the error code result

Returns:CLContext

the new CLContext

Exceptions
LWJGLException:
if an exception occurs while creating the context
getCLCommandQueueback to summary
public CLCommandQueue getCLCommandQueue(final long id)

Returns a CLCommandQueue associated with this context.

Parameters
id:long

the command queue object id

Returns:CLCommandQueue

the CLCommandQueue object

getCLCommandQueueRegistryback to summary
pack-priv CLObjectRegistry<CLCommandQueue> getCLCommandQueueRegistry()
getCLEventback to summary
public CLEvent getCLEvent(final long id)

Returns a user CLEvent associated with this context.

Parameters
id:long

the event object id

Returns:CLEvent

the CLEvent object

getCLEventRegistryback to summary
pack-priv CLObjectRegistry<CLEvent> getCLEventRegistry()
getCLMemback to summary
public CLMem getCLMem(final long id)

Returns a CLMem associated with this context.

Parameters
id:long

the memory object id

Returns:CLMem

the CLMem object

getCLMemRegistryback to summary
pack-priv CLObjectRegistry<CLMem> getCLMemRegistry()
getCLProgramback to summary
public CLProgram getCLProgram(final long id)

Returns a CLProgram associated with this context.

Parameters
id:long

the program object id

Returns:CLProgram

the CLProgram object

getCLProgramRegistryback to summary
pack-priv CLObjectRegistry<CLProgram> getCLProgramRegistry()
getCLSamplerback to summary
public CLSampler getCLSampler(final long id)

Returns a CLSampler associated with this context.

Parameters
id:long

the sampler object id

Returns:CLSampler

the CLSampler object

getCLSamplerRegistryback to summary
pack-priv CLObjectRegistry<CLSampler> getCLSamplerRegistry()
getInfoDevicesback to summary
public List<CLDevice> getInfoDevices()

Returns the list of devices in context.

Returns:List<CLDevice>

the list of devices

getInfoIntback to summary
public int getInfoInt(int param_name)

Returns the integer value of the specified parameter.

Parameters
param_name:int

the parameter

Returns:int

the parameter value

getSupportedImageFormatsback to summary
public List<CLImageFormat> getSupportedImageFormats(final long flags, final int image_type)
getSupportedImageFormatsback to summary
public List<CLImageFormat> getSupportedImageFormats(final long flags, final int image_type, final Filter<CLImageFormat> filter)
releaseImplback to summary
pack-priv void releaseImpl()

Decrements the context's reference count. If the reference count hits zero, it also deletes any callback objects associated with it.

setContextCallbackback to summary
pack-priv void setContextCallback(final long callback)

Associates this context with the specified context callback reference. If the context is invalid, the callback reference is deleted. NO-OP if user_data is 0.

Parameters
callback:long

the context callback pointer

setPrintfCallbackback to summary
pack-priv void setPrintfCallback(final long callback, final int result)

Associates this context with the specified printf callback reference. If the context is invalid, the callback reference is deleted. NO-OP if user_data is 0.

Parameters
callback:long

the printf callback pointer

org.lwjgl.opencl back to summary

pack-priv Interface CLContext.CLContextUtil

extends InfoUtil<CLContext>
Known Direct Implementers
org.lwjgl.opencl.InfoUtilFactory.CLContextUtil

CLContext utility methods interface.

Method Summary

Modifier and TypeMethod and Description
public CLContext
create(CLPlatform platform, List<CLDevice> devices, CLContextCallback pfn_notify, Drawable share_drawable, IntBuffer errcode_ret)

public CLContext
createFromType(CLPlatform platform, long device_type, CLContextCallback pfn_notify, Drawable share_drawable, IntBuffer errcode_ret)

public List<CLDevice>
public List<CLImageFormat>
getSupportedImageFormats(CLContext context, final long flags, final int image_type, Filter<CLImageFormat> filter)

Inherited from org.lwjgl.opencl.InfoUtil:
getInfoIntgetInfoLonggetInfoSizegetInfoSizeArraygetInfoString

Method Detail

createback to summary
public CLContext create(CLPlatform platform, List<CLDevice> devices, CLContextCallback pfn_notify, Drawable share_drawable, IntBuffer errcode_ret) throws LWJGLException
createFromTypeback to summary
public CLContext createFromType(CLPlatform platform, long device_type, CLContextCallback pfn_notify, Drawable share_drawable, IntBuffer errcode_ret) throws LWJGLException
getInfoDevicesback to summary
public List<CLDevice> getInfoDevices(CLContext context)
getSupportedImageFormatsback to summary
public List<CLImageFormat> getSupportedImageFormats(CLContext context, final long flags, final int image_type, Filter<CLImageFormat> filter)