MCPcopy Create free account
hub / github.com/cogentcore/core / SyncValueIndexFromGPU

Method SyncValueIndexFromGPU

vgpu/memory.go:365–372  ·  view source on GitHub ↗

SyncValueIndexFromGPU syncs given value from GPU device memory to CPU host memory, specifying value by index for given named variable, in given set. Variable can only only be Storage memory -- otherwise an error is returned.

(set int, varNm string, valIndex int)

Source from the content-addressed store, hash-verified

363// specifying value by index for given named variable, in given set.
364// Variable can only only be Storage memory -- otherwise an error is returned.
365func (mm *Memory) SyncValueIndexFromGPU(set int, varNm string, valIndex int) error {
366 mr, err := mm.SyncRegionValueIndex(set, varNm, valIndex)
367 if err != nil {
368 return err
369 }
370 mm.TransferRegsFromGPU([]MemReg{mr})
371 return nil
372}
373
374// SyncStorageRegionsFromGPU syncs given regions from the Storage buffer memory
375// from GPU to CPU, in one call. Use SyncRegValueIndexFromCPU to get the regions.

Callers 5

mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80

Calls 2

SyncRegionValueIndexMethod · 0.95
TransferRegsFromGPUMethod · 0.95

Tested by

no test coverage detected