Class VoxelBuffer<T extends javax.vecmath.Tuple3d>
java.lang.Object
cz.fidentis.analyst.opencl.memory.BufferGPU<FloatBuffer>
cz.fidentis.analyst.opencl.memory.WriteBufferGPU<T>
cz.fidentis.analyst.opencl.memory.impl.VoxelBuffer<T>
- Type Parameters:
T
- extendingTuple3d
- All Implemented Interfaces:
CLResources
Buffer to hold 3D coordinates compatible with
Tuple3d
and it's descendants
Even though 3 float values are stored, we need to allocate more space
since OpenCL assumes the vector types (float3) to be aligned to match 4 * sizeof(component) boundary.-
Constructor Summary
ConstructorsConstructorDescriptionVoxelBuffer
(com.jogamp.opencl.CLContext context) Initializes buffer of Voxels -
Method Summary
Modifier and TypeMethodDescriptionprotected void
allocateBuffer
(int desiredSize) Allocate the buffer to fit the elementscom.jogamp.opencl.CLBuffer
<FloatBuffer> get()
Get underlying CLBufferGets data, that are currently copied to GPUvoid
Puts 3D coordinates into buffervoid
Puts 3D coordinates into buffer + zero value to align the datavoid
Populates buffer with 3D coordinates + adds zero values to align the data Overwrites previous data and resizes itself, if neededvoid
release()
Explicitly releases GPU resources held by this objectprotected void
resizeSubBuffer
(int desiredSize) Creating new SubBuffer of the main buffer to operate with smaller amount of memoryvoid
rewind()
Rewinds the buffervoid
Copies contents to GPUMethods inherited from class cz.fidentis.analyst.opencl.memory.BufferGPU
getClContext, getCount, getElementSize, getQueue, getSize, resize
-
Constructor Details
-
Method Details
-
getOriginalData
Description copied from class:WriteBufferGPU
Gets data, that are currently copied to GPU- Specified by:
getOriginalData
in classWriteBufferGPU<T extends javax.vecmath.Tuple3d>
- Returns:
- data
-
writeToGPU
public void writeToGPU()Description copied from class:WriteBufferGPU
Copies contents to GPU- Specified by:
writeToGPU
in classWriteBufferGPU<T extends javax.vecmath.Tuple3d>
-
release
public void release()Description copied from interface:CLResources
Explicitly releases GPU resources held by this object -
get
Description copied from class:BufferGPU
Get underlying CLBuffer- Specified by:
get
in classBufferGPU<FloatBuffer>
- Returns:
- CLBuffer
-
rewind
public void rewind()Description copied from class:BufferGPU
Rewinds the buffer- Specified by:
rewind
in classBufferGPU<FloatBuffer>
-
put
Puts 3D coordinates into buffer- Parameters:
index
- index according to the original datapoint
- 3D coordinates
-
put
Puts 3D coordinates into buffer + zero value to align the data- Parameters:
point
- 3D coordinates extendsTuple3d
. Can not be null
-
putAll
Populates buffer with 3D coordinates + adds zero values to align the data Overwrites previous data and resizes itself, if needed- Specified by:
putAll
in classWriteBufferGPU<T extends javax.vecmath.Tuple3d>
-
allocateBuffer
protected void allocateBuffer(int desiredSize) Description copied from class:BufferGPU
Allocate the buffer to fit the elements- Specified by:
allocateBuffer
in classBufferGPU<FloatBuffer>
- Parameters:
desiredSize
- desired size of the buffer
-
resizeSubBuffer
protected void resizeSubBuffer(int desiredSize) Description copied from class:BufferGPU
Creating new SubBuffer of the main buffer to operate with smaller amount of memory- Specified by:
resizeSubBuffer
in classBufferGPU<FloatBuffer>
- Parameters:
desiredSize
- desired size of the buffer
-