Skip to content

Commit

Permalink
gpu: generic: sycl: lnorm: Intel GPU precision issues
Browse files Browse the repository at this point in the history
  • Loading branch information
kala855 committed Sep 30, 2024
1 parent 4392e04 commit afef1ae
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/benchdnn/lnorm/lnorm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,15 @@ void setup_cmp(compare::compare_t &cmp, const prb_t *prb, data_kind_t kind,
// exceeds `digits_f32`.
const int safe_digits = MAX2(0, digits_dt(dnnl_f32) - digits_dt(dt));
const float trh_coeff = (1 << safe_digits);
#ifdef DNNL_WITH_SYCL
float trh = trh_coeff
* ((kind == SRC || kind == DST
|| (kind == VAR && prb->dir & FLAG_FWD))
? 5e-7
: 0);
#else
float trh = trh_coeff * ((kind == SRC || kind == DST) ? 5e-7 : 0);
#endif
if ((kind == SC || kind == SH) && prb->dir & FLAG_BWD)
trh = trh_coeff * 5e-6;
cmp.set_threshold(trh);
Expand Down

0 comments on commit afef1ae

Please sign in to comment.