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?
source
share