Skip to content

Conversation

@christophe-murphy
Copy link
Contributor

When AF_WITH_FAST_MATH is disabled, the pow function definition incorrectly casts float16 arguments to integers.

Description

This error occurs when AF_WITH_FAST_MATH is disabled however when it is enabled the arguments are cast to double precision. This has been changed to always cast to double precision.

Fixes: #3560

Checklist

…uments with the CUDA backend. Since the half precision CUDA library doesn't have a pow function, the default pow function is used, casting the arguments to double precision.
edwinsolisf
edwinsolisf previously approved these changes Jan 16, 2025
Copy link
Contributor

@edwinsolisf edwinsolisf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works, tested on windows with an RTX3070 Ti Mobile

…pow-function-with-float16-arguments-with-cuda-backend
@christophe-murphy christophe-murphy merged commit ffda1b6 into master Jan 30, 2025
2 of 4 checks passed
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.

[BUG] Incorrect results when using the pow function with float16 arguments with CUDA backend

3 participants