Arrayjit.Backends
val finalize :
'buffer_ptr 'dev 'runner 'event. (module Backend_intf.Backend
with type buffer_ptr = 'buffer_ptr
and type dev = 'dev
and type event = 'event
and type runner = 'runner) ->
('buffer_ptr, ('buffer_ptr, 'dev, 'runner, 'event) Backend_intf.stream)
Backend_intf.context ->
Base.unit
Frees the arrays that are specific to the context -- not contained in the parent context. Note: use finalize
to optimize memory, it is not obligatory because all arrays are freed when their buffer_ptr
s are garbage-collected.
Note: this type will get simpler with modular explicits.
val fresh_backend :
?backend_name:Base.string ->
Base.unit ->
(module Backend_intf.Backend)
Creates a new backend corresponding to backend_name
, or if omitted, selected via the global backend
setting. It should be safe to call Tensor.unsafe_reinitialize
before fresh_backend
.