GPam memory management in OCaml

I am wondering if it is possible to create a finalize method for OCaml records? I am creating a GPU database and I am using OCaml to create DSLs for querying and processing GPU data, and I need a way to free up GPU memory when they are eligible for GC (no longer mentioned).

I am creating a binding to my C-based GPU to allow malloc to be free and manipulate GPU data, but I am considering solutions for free GPU memory when variables are no longer referenced at this level.

let bids = (**a 1-dim GPU array*) and asks = (**another 1-dim GPU array*) in
let spread = asks - bids 

In this example, I will need to free up GPU memory for bets and request a vector in the GPU memory. Think I need to write my own language?

+3
source share
2 answers

, , , , . Caml:

http://caml.inria.fr/pub/docs/manual-ocaml-4.00/manual033.html

19.9 :

Custom_tag , C, struct custom_operations, , , , .

C . , GCed OCaml.

+3

Gc.finalise . GC- ( ) ( ). , . : -)

0

All Articles