Interface MemoryStrategy
-
public interface MemoryStrategy
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Object
alloc(DataBuffer buffer, int stride, int offset, int length)
Allocate memory for the given bufferObject
copyToHost(DataBuffer copy, int offset)
Copy data to native or gpuvoid
free(DataBuffer buffer, int offset, int length)
Free the buffer wrt the allocation strategyvoid
setData(DataBuffer buffer, int offset)
void
setData(DataBuffer buffer, int offset, int stride, int length)
Set the data for the buffer
-
-
-
Method Detail
-
setData
void setData(DataBuffer buffer, int offset, int stride, int length)
Set the data for the buffer- Parameters:
buffer
- the buffer to setoffset
- the offset to start atstride
- the stride to suelength
- the length to go till
-
setData
void setData(DataBuffer buffer, int offset)
- Parameters:
buffer
-offset
-
-
copyToHost
Object copyToHost(DataBuffer copy, int offset)
Copy data to native or gpu- Parameters:
copy
- the buffer to copy- Returns:
- a pointer representing the copied data
-
alloc
Object alloc(DataBuffer buffer, int stride, int offset, int length)
Allocate memory for the given buffer- Parameters:
buffer
- the buffer to allocate forstride
- the strideoffset
- the offset used for the buffer on allocationlength
- length
-
free
void free(DataBuffer buffer, int offset, int length)
Free the buffer wrt the allocation strategy- Parameters:
buffer
- the buffer to freeoffset
- the offset to freelength
- the length to free
-
-