Skip to content

Interface nfloat and nfloat_complex #200

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

Open
fredrik-johansson opened this issue Jan 20, 2025 · 3 comments
Open

Interface nfloat and nfloat_complex #200

fredrik-johansson opened this issue Jan 20, 2025 · 3 comments

Comments

@fredrik-johansson
Copy link

These are available in flint-3.2(-rc1) and often much faster than arf/acf. Plus, they should be possible to wrap as GC-free Julia structs (using metaprogramming to generate one for each limb size).

@Joel-Dahne
Copy link
Collaborator

Yes, wrapping these would be great! A few weeks ago I started to experiment a little bit with a potential interface, but didn't get so far.

I'm not sure if it is possible to generate them in a fully GC-free way. They have a fixed size, but they still need to be mutable. From what I recall, mutable structs in Julia are generally heap allocated and handled by the GC. In principle I think the compiler can sometimes make optimization to be able to put them on the stack, but probably not if they are passed to opaque C-functions. The GC should however be significantly faster than for afc/arb since there is no need to have a custom finalizer, which has a fairly large performance impact (though it might be possible to improve upon this).

There might be some way to get around the heap allocation. I was hoping to discuss this a bit with people in the Zulip chat during the workshop next week (since unfortunately I will not be able to attend in person).

@Joel-Dahne
Copy link
Collaborator

I started making an attempt at wrapping these functions, see flintlib/flint#2184 for some comments.

@Joel-Dahne
Copy link
Collaborator

See #202

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

2 participants