Commit ef38229
authored
Add a for loop that is unrolled at compile time (#3674)
## Summary
The constexpr_for function is fully unrolled at compile time. This is
useful for relatively short loops where some of the functions inside the
loop are known to possible to evaluate at compile time and may be
relatively expensive, so evaluating them at compile time rather than at
runtime may be beneficial for performance reasons.
## Additional background
This has been used in AMReX-Astro/Microphysics successfully in the
context of evaluating some nuclear reaction network quantities at
compile time.
## Checklist
The proposed changes:
- [ ] fix a bug or incorrect behavior in AMReX
- [x] add new capabilities to AMReX
- [ ] changes answers in the test suite to more than roundoff level
- [ ] are likely to significantly affect the results of downstream AMReX
users
- [ ] include documentation in the code and/or rst files, if appropriate1 parent d1e55fb commit ef38229
1 file changed
+24
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
214 | 238 | | |
215 | 239 | | |
216 | 240 | | |
| |||
0 commit comments