-
Notifications
You must be signed in to change notification settings - Fork 177
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
base: master
Are you sure you want to change the base?
Conversation
One philosophical question: should the fsum interface be renamed to 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? |
IMHO shorter names are better, and don't see a problem if they overlap with the intrinsics. First, because one can always pick the right version: use stdlib_intrinsics, only: dot_product vs. ! Force using intrinsic
intrinsic :: dot_product And then because they can be augmented by more/different arguments c = dot_product(a,b) ! intrinsic
c = dot_product(a,b,mode='kahan') ! stdlib
c = dot_product(a,b,mode='blocked') ! stdlib
... I find this more elegant and definitely not confusing. |
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
stdlib_sum
andstdlib_sum_kahan
)stdlib_dot_product
andstdlib_dot_product_kahan
)cc: @fortran-lang/stdlib @perazz @certik @jvdp1