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

Start using floatarray internally. #17

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Start using floatarray internally. #17

wants to merge 2 commits into from

Conversation

toots
Copy link
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