Backend.MemoryGPU memory allocation and transfer
Allocate buffer for custom types with explicit element size in bytes
val alloc_zero_copy :
Device.t ->
('a, 'b, Stdlib.Bigarray.c_layout) Stdlib.Bigarray.Array1.t ->
('a, 'b) Stdlib.Bigarray.kind ->
'a buffer optionAllocate zero-copy buffer using host bigarray memory directly. For CPU OpenCL devices, this avoids memory copies entirely. Returns None if zero-copy not supported by this backend.
val free : 'a buffer -> unitval host_to_device :
src:('a, 'b, Stdlib.Bigarray.c_layout) Stdlib.Bigarray.Array1.t ->
dst:'a buffer ->
unitval device_to_host :
src:'a buffer ->
dst:('a, 'b, Stdlib.Bigarray.c_layout) Stdlib.Bigarray.Array1.t ->
unitval host_ptr_to_device :
src_ptr:unit Ctypes.ptr ->
byte_size:int ->
dst:'a buffer ->
unitTransfer from raw pointer to device (for custom types). src_ptr should be obtained via Ctypes from a customarray.
val device_to_host_ptr :
src:'a buffer ->
dst_ptr:unit Ctypes.ptr ->
byte_size:int ->
unitTransfer from device to raw pointer (for custom types)
val size : 'a buffer -> intval device_ptr : 'a buffer -> nativeintval is_zero_copy : 'a buffer -> boolCheck if buffer uses zero-copy (no transfers needed)