Module Transfer.Wrap_scalar

Packages a backend buffer of a scalar vector as a DEVICE_BUFFER. A buffer that is_zero_copy (Native, Interpreter: the device uses the host array itself) needs no transfer; any other one, OpenCL host-pointer buffers included, goes through its backend's transfers, which synchronise (map/unmap) instead of copying when the buffer aliases the host pointer.

Parameters

Signature

val wrap : dev:Device.t -> length:int -> elem_size:int -> host_link:Memory.host_link -> 'a B.Memory.buffer -> Vector.device_buffer