Spoc_core.Transferval alloc_scalar_buffer :
Device.t ->
int ->
('a, 'b) Vector.scalar_kind ->
Vector.device_bufferAllocate a device buffer for a scalar vector, returning a DEVICE_BUFFER module. The buffer is packaged with its backend for type-safe operations.
For CPU devices (OpenCL CPU, Native), uses zero-copy allocation when possible to avoid memory transfers entirely.
val alloc_scalar_buffer_zero_copy :
Device.t ->
('a, 'b, Stdlib.Bigarray.c_layout) Stdlib.Bigarray.Array1.t ->
('a, 'b) Vector.scalar_kind ->
Vector.device_buffer optionAllocate a device buffer using zero-copy (host memory sharing) if supported. Returns None if the backend doesn't support zero-copy for this device.
val alloc_custom_buffer : Device.t -> int -> int -> Vector.device_bufferAllocate a device buffer for a custom vector
val ensure_buffer : ('a, 'b) Vector.t -> Device.t -> Vector.device_bufferEnsure vector has a device buffer, allocating if needed. For backends that support zero-copy (typically CPU backends), automatically uses zero-copy to avoid memory transfer overhead. The backend decides via alloc_zero_copy.
val to_cpu : ?force:bool -> ('a, 'b) Vector.t -> unitTransfer vector data from device to CPU.
val sync : ('a, 'b) Vector.t -> unitEnsure vector is fully synchronized
val free_all_buffers : ('a, 'b) Vector.t -> unitFree all device buffers for a vector
val flush : Device.t -> unitSynchronize all pending operations on a device
module type STREAM = sig ... endStream handle - packages backend stream with its operations
type stream = (module STREAM)val synchronize_stream : stream -> unitval destroy_stream : stream -> unitval to_cpu_all : ('a, 'b) Vector.t list -> unitval sync_all : ('a, 'b) Vector.t list -> unit