-
-
Notifications
You must be signed in to change notification settings - Fork 100
ORC support #692
Description
Hi all,
I am developing (though I am not a developer, weird new times) a tool that estimates structural equation models in the gpu using L-BFGS. My tool works great for my use and I validated against classical optimizers for SEM in R. At some point I decided to try to use ORC throughout (removing --mm:refc) and asked Claude to add the sinks and copies in the relevant parts. This is what Claude changed:
data_structure.nim — ClStorage type replaced:
- Removed Fref_tracking: CudaTensorRefTracker (GC finalizer approach)
- Added Fdeleter/Fretainer callback fields (plain proc pointers)
- Added ORC-compatible =destroy (calls Fdeleter) and =copy (calls Fretainer) hooks
opencl_backend.nim — newClStorage and layout handling replaced:
- Removed deallocCl finalizer proc
- Added clStorageRelease/clStorageRetain callbacks wired into newClStorage
- ClLayoutArray changed from ref with finalizer → ptr UncheckedArray[cint]
- Added =destroy on ClTensorLayout to release device memory; =copy marked {.error.}
p_kernels_interface_opencl.nim — kernel arg passing updated:
- All .buffer accesses on shape/strides replaced with .toClpointer (since they're now plain ptr, not
ref)
I am not a programmer, and while this works for me, I don't have a slight idea about other consequences that this may have to Arraymancer. It is a bit of slop.
- Is there any interest in reviewing these changes if I push a commit? I completely understand if this is not welcome.
I've read #616 and it seems the issues on memory management are more complex than just adjusting those files.