Skip to content

Start using floatarray internally.#17

Draft
toots wants to merge 2 commits into
mainfrom
floatarray
Draft

Start using floatarray internally.#17
toots wants to merge 2 commits into
mainfrom
floatarray

Conversation

@toots
Copy link
Copy Markdown
Member

@toots toots commented Feb 18, 2023

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: ocaml/ocaml#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 toots requested a review from smimram February 18, 2023 22:10
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

Successfully merging this pull request may close these issues.

1 participant