You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a request for advice from the current maintainers; I plan on doing the necessary work to actually get this running on ABCL.
With abcl-1.7.0, I've been able to extend the implemention's creation of arrays specialized on commonly used byte types to use memory allocated outside of the JVM's heap via system interfaces like malloc().
To do this, ABCL has extended cl:make-array to take an additional keyword vis. :nio-buffer to use a generic contract for byte buffers for which I can use JNA to use an implementation that is backed by malloc()d memory
The version of CFFI distributed with the latest (2020-06-10) Quicklisp now contains an implementation of cffi-sys:make-shareable-byte-vector which utilizes this extension if present in the ABCL runtime.
As I understand things magicl relies on the ability of a given implementation to "pin" an already allocated array to a given memory location that is then used by the LAPACK et. al. libraries.
Unfortunately for ABCL, I can't "pin" an object that is already allocated on the JVM heap. The JVM GC needs to be able to move things around at will, unconditionally.
Therefore I conclude that I need to somehow "wrap" invocations of the cl:make-array used by magicl to get it to work on ABCL.
Possible paths:
Macroize cl:make-array. CONS: seems hairy; need to check all implementations
Require magicl consumers to only use arrays created cffi-sys:make-shareable-byte-vector. CONS: too much code would break to be practical as an initial implementation.
Please correct my misunderstandings. I've never used magicl: I just wanna run quilc programs on ABCL…
The text was updated successfully, but these errors were encountered:
This is a request for advice from the current maintainers; I plan on doing the necessary work to actually get this running on ABCL.
With abcl-1.7.0, I've been able to extend the implemention's creation of arrays specialized on commonly used byte types to use memory allocated outside of the JVM's heap via system interfaces like malloc().
To do this, ABCL has extended
cl:make-array
to take an additional keyword vis.:nio-buffer
to use a generic contract for byte buffers for which I can use JNA to use an implementation that is backed bymalloc()
d memoryThe version of
CFFI
distributed with the latest (2020-06-10) Quicklisp now contains an implementation ofcffi-sys:make-shareable-byte-vector
which utilizes this extension if present in the ABCL runtime.As I understand things
magicl
relies on the ability of a given implementation to "pin" an already allocated array to a given memory location that is then used by the LAPACK et. al. libraries.Unfortunately for ABCL, I can't "pin" an object that is already allocated on the JVM heap. The JVM GC needs to be able to move things around at will, unconditionally.
Therefore I conclude that I need to somehow "wrap" invocations of the
cl:make-array
used bymagicl
to get it to work on ABCL.Possible paths:
Macroize
cl:make-array
. CONS: seems hairy; need to check all implementationsRequire
magicl
consumers to only use arrays createdcffi-sys:make-shareable-byte-vector
. CONS: too much code would break to be practical as an initial implementation.Please correct my misunderstandings. I've never used
magicl
: I just wanna runquilc
programs on ABCL…The text was updated successfully, but these errors were encountered: