ocaml-mm icon indicating copy to clipboard operation
ocaml-mm copied to clipboard

Start using floatarray internally.

Open toots opened this issue 1 year ago • 0 comments

floatarray are defined in Float.Array since OCaml 4.08. They are guaranteed to be always be unboxed flat arrays. If the compiler supports it (see: https://github.com/ocaml/ocaml/pull/12019), floatarray can be cast to double * arrays and passed to a C function.

Currently, they share the same underlying representation as float array so switching to the shouldn't impact performances. However, this could change (or can be by disabling flat float arrays in the compiler) so this will make the implementation more robust to future changes in the compiler.

toots avatar Feb 18 '23 22:02 toots