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

intrinsics module with alternative implementations #915

Draft
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

jalvesz
Copy link
Contributor

@jalvesz jalvesz commented Jan 3, 2025

Add intrinsics module containing replacements for intrinsic function where some feature is found interesting: faster implementation, better accuracy, both simultaneously.

This PR follows the discussion in discourse https://fortran-lang.discourse.group/t/lfortran-now-supports-all-intrinsic-functions/8844/41 and it's based on https://github.com/jalvesz/fast_math

  • sum: 2 options (fsum and fsum_kahan)
  • dot_product: 2 options (fprod and fprod_kahan)

cc: @fortran-lang/stdlib @perazz @certik @jvdp1

@jalvesz jalvesz changed the title feate: intrinsics module with alternative implementations intrinsics module with alternative implementations Jan 4, 2025
@jalvesz
Copy link
Contributor Author

jalvesz commented Jan 7, 2025

One philosophical question: should the fsum interface be renamed to sum to enable direct replacement of the intrinsic? Keep this name? Or yet something like stdlib_sum? (Same for fprod->dot_product)

Regarding the kahan versions, given that the accuracy gains are close between the pure chunked version and the kahan one, I'm wondering which level of support should be enabled to switch between them?

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