Opencl_api.Memorytype 'a buffer = {handle : Opencl_types.cl_mem;size : int;elem_size : int;context : Context.t;host_alias : nativeint option;}Whether USE_HOST_PTR over addr is aliased by the runtime rather than privately copied: the address must meet the device's alignment.
val host_ptr_refusal :
accept_device:bool ->
align_bytes:int ->
max_alloc_bytes:Stdlib.Int64.t ->
address:nativeint ->
byte_size:int ->
Spoc_framework.Framework_sig.host_ptr_refusal optionWhy a USE_HOST_PTR buffer of byte_size bytes at address is refused, cheapest check first; None when it is accepted. accept_device: the device takes host-pointer buffers (a CPU device). Pure: no device is touched.
val alloc_with_host_ptr :
Context.t ->
int ->
('a, 'b) Stdlib.Bigarray.kind ->
unit Ctypes_static.ptr ->
'c bufferAllocate buffer over the host pointer (CL_MEM_USE_HOST_PTR). Host access must go through sync_host.
Allocate buffer for custom types with explicit element size in bytes
val aliases_host : 'a buffer -> nativeint -> boolaliases_host buf addr: buf is a USE_HOST_PTR buffer over addr, so host copies at addr become map/unmap synchronisation.
val sync_host :
CommandQueue.t ->
'a buffer ->
flags:Opencl_types.cl_bitfield ->
byte_size:int ->
unitval free : 'a buffer -> unitval host_to_device :
CommandQueue.t ->
src:('a, 'b, Stdlib.Bigarray.c_layout) Stdlib.Bigarray.Array1.t ->
dst:'c buffer ->
unitval device_to_host :
CommandQueue.t ->
src:'a buffer ->
dst:('b, 'c, Stdlib.Bigarray.c_layout) Stdlib.Bigarray.Array1.t ->
unitval host_ptr_to_device :
CommandQueue.t ->
src_ptr:unit Ctypes.ptr ->
byte_size:int ->
dst:'a buffer ->
unitTransfer from raw pointer to device buffer (for custom types)
val device_to_host_ptr :
CommandQueue.t ->
src:'a buffer ->
dst_ptr:unit Ctypes.ptr ->
byte_size:int ->
unitTransfer from device buffer to raw pointer (for custom types)