-
Notifications
You must be signed in to change notification settings - Fork 80
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
constexpr everything #487
Comments
First paragraph sounds good.
2nd paragraph I don't understand. The main planning overhead is FFT plan
(if FFTW) plus binsort (type 1,2).
Neither of those can be "executed at compile time" :)
…On Wed, Jul 17, 2024 at 11:27 AM Marco Barbone ***@***.***> wrote:
We should constexpr everything available in c++17 as this allows to do
part of the computation at compile time when the data is needed.
We should also add macros CPP_20_CONSTEXPR CPP_23_CONSTEXPR and have
cmake use the latest available standard in compiling so that even
malloc/free can be constexpr in that case. A lot of the planning phase
might be executed at compile time when the users bake finufft in their code
as a source, this can make a meaningful difference.
This can be done in #482
<#482> #483
<#483> as it requires
some code rewrite anyway.
—
Reply to this email directly, view it on GitHub
<#487>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACNZRSQIKA6TLNKSUCP6UTDZM2EO7AVCNFSM6AAAAABLA4BQ56VHI2DSMVQWIX3LMV43ASLTON2WKOZSGQYTGOJSGI4DAOA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
*-------------------------------------------------------------------~^`^~._.~'
|\ Alex Barnett Center for Computational Mathematics, Flatiron Institute
| \ http://users.flatironinstitute.org/~ahb 646-876-5942
|
This is the most common argument that comes up when talking about constexpr everything. The goal to have the compiler do as much as possible at compile time. Not using constexpr might defer at runtime things that can be precomputed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We should constexpr everything available in c++17 as this allows to do part of the computation at compile time when the data is needed.
We should also add macros
CPP_20_CONSTEXPR
CPP_23_CONSTEXPR
and have cmake use the latest available standard in compiling so that even malloc/free can be constexpr in that case. A lot of the planning phase might be executed at compile time when the users bake finufft in their code as a source, this can make a meaningful difference.This can be done in #482 #483 as it requires some code rewrite anyway.
The text was updated successfully, but these errors were encountered: