[SYCL][Test] Guard imf_half_type_cast subnormal tests by device fp_co… - #22981
Open
vishwajithupendra wants to merge 1 commit into
Open
[SYCL][Test] Guard imf_half_type_cast subnormal tests by device fp_co…#22981vishwajithupendra wants to merge 1 commit into
vishwajithupendra wants to merge 1 commit into
Conversation
…nfig subnormal flag
The Adreno GPU does not support FP16 or FP32 subnormal values - they are
flushed to zero. This caused test failures when subnormal inputs produced
results that did not match the reference values computed assuming subnormal
preservation.
Add a check_subnormal() helper template that instantiates with a SYCL device
info descriptor and queries the device's fp_config flags at runtime to check
for the subnormal bit.
Use it to derive two boolean guards:
has_half_subnormal : gates subnormal sub-cases in all
half2int/uint/short/ushort/ll/ull blocks
has_single_subnormal: gates two sub-cases within float2half -
(a) FP32 normal inputs whose magnitude is so small
they produce a FP16 subnormal output
(gated by has_half_subnormal)
(b) FP32 subnormal inputs, where the input itself
must not be flushed before conversion
(gated by has_single_subnormal only)
In each block, subnormal inputs are removed from the main unconditional
input list and moved into a separate if (has_*_subnormal) sub-block with
its own ref values.
Test blocks that depend on subnormal behaviour are skipped when the
corresponding fp_config subnormal flag is absent, making the test portable
across devices with and without subnormal support.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…nfig subnormal flag
The Adreno GPU does not support FP16 or FP32 subnormal values - they are flushed to zero. This caused test failures when subnormal inputs produced results that did not match the reference values computed assuming subnormal preservation.
Add a check_subnormal() helper template that instantiates with a SYCL device info descriptor and queries the device's fp_config flags at runtime to check for the subnormal bit.
Use it to derive two boolean guards:
has_half_subnormal : gates subnormal sub-cases in all
half2int/uint/short/ushort/ll/ull blocks
has_single_subnormal: gates two sub-cases within float2half -
(a) FP32 normal inputs whose magnitude is so small
they produce a FP16 subnormal output
(gated by has_half_subnormal)
(b) FP32 subnormal inputs, where the input itself
must not be flushed before conversion
(gated by has_single_subnormal only)
In each block, subnormal inputs are removed from the main unconditional input list and moved into a separate if (has_*_subnormal) sub-block with its own ref values.
Test blocks that depend on subnormal behaviour are skipped when the corresponding fp_config subnormal flag is absent, making the test portable across devices with and without subnormal support.