forked from intel/llvm
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCL] Add support for -foffload-fp32-prec-div/sqrt options. (intel#1…
…5836) Add support for options `-f[no]-offload-fp32-prec-div` and `-f[no-]-offload-fp32-prec-sqrt`. These options are added to allow users to control whether `fdiv` and `sqrt` operations in offload device code are required to return correctly rounded results. In order to communicate this to the device code, we need the front end to generate IR that reflects the choice. When the correctly rounded setting is used, we can just generate the `fdiv` instruction and `llvm.sqrt` intrinsic, because these operations are required to be correctly rounded by default in LLVM IR. When the result is not required to be correctly rounded, the front end should generate a call to the `llvm.fpbuiltin.fdiv` or `llvm.fpbuiltin.sqrt` intrinsic with the `fpbuiltin-max-error` attribute set. For single precision` fdiv`, the setting should be `2.5`. For single-precision sqrt, the setting should be `3.0`. If the -ffp-accuracy option is used, we should issue warnings if the settings conflict with an explicitly set `-foffload-fp32-prec-div` or `-foffload-fp32-prec-sqrt` option.
- Loading branch information
Showing
14 changed files
with
798 additions
and
55 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
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
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
Oops, something went wrong.