You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SYCL] Add support for -foffload-fp32-prec-div/sqrt options. (#15836)
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.
0 commit comments