Parameter Make.Ops

type handle

Opaque handle replacing unit Ctypes.ptr in custom storage.

type device_t

Opaque device type replacing Device.t. Native: Spoc_core.Device.t. Stub: unit.

type device_buf

Opaque device-buffer type stored in the per-vector device_buffers table. Native: (module Memory.BUFFER). Stub: unit.

val alloc : elem_size:int -> length:int -> handle

Allocate storage for length elements of elem_size bytes each.

val free : handle -> unit

Release storage previously returned by alloc.

val of_raw : nativeint -> handle

Wrap a raw address as a handle (native-only; may failwith).

val to_raw : handle -> nativeint

Compute the raw address of a handle (native-only; may failwith).

val add_offset : handle -> int -> handle

Advance a handle by byte_offset bytes.

val copy_elems : src:handle -> dst:handle -> elem_count:int -> get:(handle -> int -> 'a) -> set:(handle -> int -> 'a -> unit) -> unit

Copy elem_count elements using the provided get/set pair.

val bigarray_to_handle : ('a, 'b, Stdlib.Bigarray.c_layout) Stdlib.Bigarray.Array1.t -> handle

Convert a host Bigarray to a handle for the device-transfer layer. Implementations that do not support device transfers may raise.

val device_id : device_t -> int

Extract the integer device-ID from a device (used as hashtable key).