Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for the ABCL implementation #109

Open
easye opened this issue Jun 11, 2020 · 0 comments
Open

Adding support for the ABCL implementation #109

easye opened this issue Jun 11, 2020 · 0 comments

Comments

@easye
Copy link

easye commented Jun 11, 2020

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:

  1. Macroize cl:make-array. CONS: seems hairy; need to check all implementations

  2. 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…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant