Spoc_core.RuntimeRe-export framework dims helpers to avoid duplicate types
val dims1d : int -> Spoc_framework.Framework_sig.dimsval dims2d : int -> int -> Spoc_framework.Framework_sig.dimsval dims3d : int -> int -> int -> Spoc_framework.Framework_sig.dimsval init_device : ?framework:string -> unit -> Device.tInitialize the runtime and get the best available device
val all_devices : ?framework:string -> unit -> Device.t arrayGet all available devices
val kernel_cache : (string * string * int, Kernel.t) Stdlib.Hashtbl.tKernel source cache: (device_framework, kernel_name, source_hash) -> compiled
Compile a kernel from source, with caching
val set_args : Device.t -> arg list -> Kernel.argsCreate arguments from a list
val run_kernel :
Kernel.t ->
args:Kernel.args ->
grid:dims ->
block:dims ->
?shared_mem:int ->
unit ->
unitRun a kernel with the given arguments
val run :
Device.t ->
name:string ->
source:string ->
args:arg list ->
grid:dims ->
block:dims ->
?shared_mem:int ->
unit ->
unitHigh-level run function: compile (if needed) and execute
val alloc_float32 : Device.t -> int -> float Memory.bufferMemory allocation shortcuts
val alloc_float64 : Device.t -> int -> float Memory.bufferval alloc_int32 : Device.t -> int -> int32 Memory.bufferval alloc_int64 : Device.t -> int -> int64 Memory.bufferval alloc_custom : Device.t -> size:int -> elem_size:int -> 'a Memory.bufferAllocate a buffer for custom types with explicit element size
val to_device :
src:('a, 'b, Stdlib.Bigarray.c_layout) Stdlib.Bigarray.Array1.t ->
dst:'a Memory.buffer ->
unitHost-to-device transfer
val from_device :
src:'a Memory.buffer ->
dst:('a, 'b, Stdlib.Bigarray.c_layout) Stdlib.Bigarray.Array1.t ->
unitDevice-to-host transfer
val to_device_ptr : src_ptr:unit Ctypes.ptr -> dst:'a Memory.buffer -> unitHost-to-device transfer for custom types (raw pointer)
val from_device_ptr : src:'a Memory.buffer -> dst_ptr:unit Ctypes.ptr -> unitDevice-to-host transfer for custom types (raw pointer)
val free : 'a Memory.buffer -> unitFree a buffer