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

Portability with nalgebra #90

Open
js2xxx opened this issue Aug 10, 2022 · 1 comment
Open

Portability with nalgebra #90

js2xxx opened this issue Aug 10, 2022 · 1 comment

Comments

@js2xxx
Copy link

js2xxx commented Aug 10, 2022

I wonder if every Complex<T> in the implementation could be replaced with ComplexField<RealField = T> or SimdComplexField<SimdRealField = T> trait in nalgebra so that library implementations based on these 2 crates can be more generic and portable. That's a huge change indeed, but I'm still looking forward to the possibility.

BTW, I've seen the issue #85, which seems to be a particular case of above. I don't quite know about nalgebra's SIMD operations and whether its co-op with this crate would slow down much. But I'm interested to how it would work.

@ejmahler
Copy link
Owner

ejmahler commented Nov 8, 2022

I love the idea of making rustfft more interoperable with other crates. This would be a breaking change, so at minimum, we can't do it for another year. After that, I'm torn, because that would be a very, very large commitment.

Something we do in the AVX code to get around the lack of specialization is to have two different numeric traits (one user-facing and one interal), assert that they're the same type with std::any, then just transmute one to the other. Could we take the same approach here, where we expose an API that accepts nalgebra's types, and internally we transmute them to Complex behind the scenes? That would let us put the nalgebra integration in a different crate and avoid such a massive change, while still providing usability improvements to users.

I'll leave this open and think about it.

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