forked from KhronosGroup/OpenCL-CTS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix testing of half-precision fma. (KhronosGroup#1882)
Half-precision functions are generally tested against the single-precision reference. This causes double rounding: first to single precision, then from there to half precision. For the most part, it is good enough, but specifically in the case of fma, a correctly rounded result is required and is not obtained, for instance for arguments 0x1.eacp+7, 0x1.3f4p+4, 0x1.c04p+14, which produce an exact result of 0x1.065fffp+15 which should be rounded to half-prefcision 0x1.064p+15, but was previously first rounded to single-precision 0x1.066p+15, and from there to half-precision 0x1.068p+15. Testing against reference_fmal gives us sufficient precision that double rounding does not cause issues. The f_fma(..., FLUSHED) calls for FTZ testing cannot be updated the same way but do not need to be: these calls all have at least one constant operand of zero. If one operand is zero, double rounding cannot be an issue.
- Loading branch information
Showing
4 changed files
with
10 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters