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

Math: User-Controlled Fast Math #297

Open
ax3l opened this issue Dec 20, 2016 · 0 comments
Open

Math: User-Controlled Fast Math #297

ax3l opened this issue Dec 20, 2016 · 0 comments

Comments

@ax3l
Copy link
Member

ax3l commented Dec 20, 2016

In PIConGPU we discussed the influence of fast math for important functions such a trigonometric functions in ComputationalRadiationPhysics/picongpu#1489. The main problem is, that some restrictions like

cosf == __cosf(x):

For x in [-π,π], the maximum absolute error is 2^-21.19, and larger otherwise.

are only know to the implementer writing that cosine (since he/she knows the definition range of the input). The cleanest way would be to expose that to the user without using the shotgun approach of compiler flags could be:

An additional template argument for math functions like sqrt and sin to explicitly enable fast-math if the range of the argument's range and expected value range is 100% satisfying the reduced precision: default PMacc::math::sin<T_FastMath=False>().

Of course, the individual, absolute hardware specific fast-math errors are hardware dependent, but usually follow at least a similar scheme (such as expected input range).

@ax3l ax3l added this to the Future milestone Dec 20, 2016
@BenjaminW3 BenjaminW3 removed this from the Future milestone May 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants