Top Description Inners Fields Constructors Methods
org.lwjgl.opencl

public final Class CLMem

extends CLObjectChild<CLContext>
Class Inheritance
Imports
org.lwjgl.opencl.api.CLBufferRegion, .CLImageFormat, java.nio.Buffer, .ByteBuffer, .IntBuffer

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

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static interface
CLMem.CLMemUtil

CLMem utility methods interface.

Field Summary

Modifier and TypeField and Description
private static final CLMem.CLMemUtil

Constructor Summary

AccessConstructor and Description
pack-priv
CLMem(final long pointer, final CLContext context)

Method Summary

Modifier and TypeMethod and Description
pack-priv static CLMem

Returns:

the CLMem that represents the sub-buffer
create
(final long
the sub-buffer id
pointer
,
final CLContext
the context in which the sub-buffer was created
context
)

Sub-buffer factory.

public static CLMem

Returns:

the new CLMem object
createImage2D
(final CLContext
the context on which to create the image object
context
,
final long
the memory object flags
flags
,
final CLImageFormat
the image format
image_format
,
final long
the image width
image_width
,
final long
the image height
image_height
,
final long
the image row pitch
image_row_pitch
,
final Buffer
the host buffer from which to read image data (optional)
host_ptr
,
final IntBuffer
the error code result
errcode_ret
)

Creates a new 2D image object.

public static CLMem

Returns:

the new CLMem object
createImage3D
(final CLContext
the context on which to create the image object
context
,
final long
the memory object flags
flags
,
final CLImageFormat
the image format
image_format
,
final long
the image width
image_width
,
final long
the image height
image_height
,
final long
the image depth
image_depth
,
final long
the image row pitch
image_row_pitch
,
final long
the image slice pitch
image_slice_pitch
,
final Buffer
the host buffer from which to read image data (optional)
host_ptr
,
final IntBuffer
the error code result
errcode_ret
)

Creates a new 3D image object.

public CLMem
createSubBuffer(final long flags, final int buffer_create_type, final CLBufferRegion buffer_create_info, final IntBuffer errcode_ret)

public int

Returns:

the parameter value
getGLObjectName
()

Returns the GL object name.

public int

Returns:

the parameter value
getGLObjectType
()

Returns the GL object type.

public int

Returns:

the parameter value
getGLTextureInfoInt
(int
the parameter
param_name
)

Returns the int value of the specified parameter.

public int

Returns:

the parameter value
getImageChannelOrder
()

Returns the image channel order.

public int

Returns:

the parameter value
getImageChannelType
()

Returns the image channel type.

public CLImageFormat

Returns:

the parameter value
getImageFormat
()

Returns the image format.

public long

Returns:

the parameter value
getImageInfoSize
(int
the parameter
param_name
)

Returns the size_t value of the specified parameter.

public ByteBuffer

Returns:

the host memory ByteBuffer
getInfoHostBuffer
()

Returns a direct ByteBuffer instance that points to the host memory that backs this CLMem object.

public int

Returns:

the parameter value
getInfoInt
(int
the parameter
param_name
)

Returns the integer value of the specified parameter.

public long

Returns:

the parameter value
getInfoLong
(int
the parameter
param_name
)

Returns the long value of the specified parameter.

public long

Returns:

the parameter value
getInfoSize
(int
the parameter
param_name
)

Returns the size_t value of the specified parameter.

pack-priv int
Inherited from org.lwjgl.opencl.CLObjectChild:
getParent

Field Detail

utilback to summary
private static final CLMem.CLMemUtil util

Constructor Detail

CLMemback to summary
pack-priv CLMem(final long pointer, final CLContext context)

Method Detail

createback to summary
pack-priv static CLMem create(final long pointer, final CLContext context)

Sub-buffer factory. clCreateSubBuffer may return an existing CLMem.

Parameters
pointer:long

the sub-buffer id

context:CLContext

the context in which the sub-buffer was created

Returns:CLMem

the CLMem that represents the sub-buffer

createImage2Dback to summary
public static CLMem createImage2D(final CLContext context, final long flags, final CLImageFormat image_format, final long image_width, final long image_height, final long image_row_pitch, final Buffer host_ptr, final IntBuffer errcode_ret)

Creates a new 2D image object.

Parameters
context:CLContext

the context on which to create the image object

flags:long

the memory object flags

image_format:CLImageFormat

the image format

image_width:long

the image width

image_height:long

the image height

image_row_pitch:long

the image row pitch

host_ptr:Buffer

the host buffer from which to read image data (optional)

errcode_ret:IntBuffer

the error code result

Returns:CLMem

the new CLMem object

createImage3Dback to summary
public static CLMem createImage3D(final CLContext context, final long flags, final CLImageFormat image_format, final long image_width, final long image_height, final long image_depth, final long image_row_pitch, final long image_slice_pitch, final Buffer host_ptr, final IntBuffer errcode_ret)

Creates a new 3D image object.

Parameters
context:CLContext

the context on which to create the image object

flags:long

the memory object flags

image_format:CLImageFormat

the image format

image_width:long

the image width

image_height:long

the image height

image_depth:long

the image depth

image_row_pitch:long

the image row pitch

image_slice_pitch:long

the image slice pitch

host_ptr:Buffer

the host buffer from which to read image data (optional)

errcode_ret:IntBuffer

the error code result

Returns:CLMem

the new CLMem object

createSubBufferback to summary
public CLMem createSubBuffer(final long flags, final int buffer_create_type, final CLBufferRegion buffer_create_info, final IntBuffer errcode_ret)
getGLObjectNameback to summary
public int getGLObjectName()

Returns the GL object name. Applicable to CLMem objects that have been created GL objects only.

Returns:int

the parameter value

getGLObjectTypeback to summary
public int getGLObjectType()

Returns the GL object type. Applicable to CLMem objects that have been created GL objects only.

Returns:int

the parameter value

getGLTextureInfoIntback to summary
public int getGLTextureInfoInt(int param_name)

Returns the int value of the specified parameter. Applicable to CLMem objects that have been created by GL textures only.

Parameters
param_name:int

the parameter

Returns:int

the parameter value

getImageChannelOrderback to summary
public int getImageChannelOrder()

Returns the image channel order. Applicable to image objects only.

Returns:int

the parameter value

getImageChannelTypeback to summary
public int getImageChannelType()

Returns the image channel type. Applicable to image objects only.

Returns:int

the parameter value

getImageFormatback to summary
public CLImageFormat getImageFormat()

Returns the image format. Applicable to image objects only.

Returns:CLImageFormat

the parameter value

getImageInfoSizeback to summary
public long getImageInfoSize(int param_name)

Returns the size_t value of the specified parameter. Applicable to image objects only.

Parameters
param_name:int

the parameter

Returns:long

the parameter value

getInfoHostBufferback to summary
public ByteBuffer getInfoHostBuffer()

Returns a direct ByteBuffer instance that points to the host memory that backs this CLMem object. Applicable only to CLMem objects that were created with the CL_MEM_USE_HOST_PTR flag.

Returns:ByteBuffer

the host memory ByteBuffer

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

getInfoLongback to summary
public long getInfoLong(int param_name)

Returns the long value of the specified parameter. Can be used for both cl_ulong and cl_bitfield parameters.

Parameters
param_name:int

the parameter

Returns:long

the parameter value

getInfoSizeback to summary
public long getInfoSize(int param_name)

Returns the size_t value of the specified parameter.

Parameters
param_name:int

the parameter

Returns:long

the parameter value

releaseback to summary
pack-priv int release()

Overrides org.lwjgl.opencl.CLObjectRetainable.release.

org.lwjgl.opencl back to summary

pack-priv Interface CLMem.CLMemUtil

extends InfoUtil<CLMem>
Known Direct Implementers
org.lwjgl.opencl.InfoUtilFactory.CLMemUtil

CLMem utility methods interface.

Method Summary

Modifier and TypeMethod and Description
public CLMem
createImage2D(CLContext context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_row_pitch, Buffer host_ptr, IntBuffer errcode_ret)

public CLMem
createImage3D(CLContext context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_depth, long image_row_pitch, long image_slice_pitch, Buffer host_ptr, IntBuffer errcode_ret)

public CLMem
createSubBuffer(CLMem mem, long flags, int buffer_create_type, CLBufferRegion buffer_create_info, IntBuffer errcode_ret)

public int
public int
public int
getGLTextureInfoInt(CLMem mem, int param_name)

public CLImageFormat
public int
getImageInfoFormat(CLMem mem, int index)

public long
getImageInfoSize(CLMem mem, int param_name)

public ByteBuffer
Inherited from org.lwjgl.opencl.InfoUtil:
getInfoIntgetInfoLonggetInfoSizegetInfoSizeArraygetInfoString

Method Detail

createImage2Dback to summary
public CLMem createImage2D(CLContext context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_row_pitch, Buffer host_ptr, IntBuffer errcode_ret)
createImage3Dback to summary
public CLMem createImage3D(CLContext context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_depth, long image_row_pitch, long image_slice_pitch, Buffer host_ptr, IntBuffer errcode_ret)
createSubBufferback to summary
public CLMem createSubBuffer(CLMem mem, long flags, int buffer_create_type, CLBufferRegion buffer_create_info, IntBuffer errcode_ret)
getGLObjectNameback to summary
public int getGLObjectName(CLMem mem)
getGLObjectTypeback to summary
public int getGLObjectType(CLMem mem)
getGLTextureInfoIntback to summary
public int getGLTextureInfoInt(CLMem mem, int param_name)
getImageInfoFormatback to summary
public CLImageFormat getImageInfoFormat(CLMem mem)
getImageInfoFormatback to summary
public int getImageInfoFormat(CLMem mem, int index)
getImageInfoSizeback to summary
public long getImageInfoSize(CLMem mem, int param_name)
getInfoHostBufferback to summary
public ByteBuffer getInfoHostBuffer(CLMem mem)