Class GpuBuffer
java.lang.Object
io.github.kirstenali.deepj.tensor.GpuBuffer
Handle to a GPU-resident float buffer managed by a
ComputeGraph.
The buffer persists on the GPU across graph flushes until explicitly released. Not tied to any specific GPU API (Metal, CUDA, etc.).
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanTrue if the runtime has allocated native memory for this id.final intbooleanTrue if GPU has newer data than Tensor.data (CPU cache is stale).final intbooleanTrue if this buffer was just allocated and needs CPU data uploaded before use.final int -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
id
public final int id -
rows
public final int rows -
cols
public final int cols -
needsUpload
public boolean needsUploadTrue if this buffer was just allocated and needs CPU data uploaded before use. -
cpuStale
public boolean cpuStaleTrue if GPU has newer data than Tensor.data (CPU cache is stale). -
allocatedOnGpu
public boolean allocatedOnGpuTrue if the runtime has allocated native memory for this id.
-
-
Constructor Details
-
GpuBuffer
public GpuBuffer(int id, int rows, int cols, boolean needsUpload)
-
-
Method Details
-
floatCount
public int floatCount()
-