[erlang-questions] Vector instructions, BLAS, FFI

Alceste Scalas <>
Wed Apr 9 10:42:51 CEST 2008

Il giorno mar, 08/04/2008 alle 11.18 -0500, tsuraan ha scritto:
> Does the FFI allow everything to be stored as binaries, and then you
> can just hand the binaries from the erlang machine to atlas directly
> without any data munging or copying?

Yes, it does.  The FFI allows both to receive and return binaries and
handle refcounting.  Furthermore, several operations do not involve the
C side at all (for example: matrix/vector transposition just changes an
Erlang record field; the same goes for matrix/vector extraction from
existing matrices/vectors).

We developed the BLAS interface (and the FFI in the first place) trying
to avoid copying, unless the data is sent between different Erlang nodes
(and since matrices and vectors are just regular Erlang records, the
Erlang VM can handle them without problems).


Alceste Scalas <>
CRS4 - http://www.crs4.it/

More information about the erlang-questions mailing list