Skip to content

Commit afef1ae

Browse files
committed
gpu: generic: sycl: lnorm: Intel GPU precision issues
1 parent 4392e04 commit afef1ae

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/benchdnn/lnorm/lnorm.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,15 @@ void setup_cmp(compare::compare_t &cmp, const prb_t *prb, data_kind_t kind,
450450
// exceeds `digits_f32`.
451451
const int safe_digits = MAX2(0, digits_dt(dnnl_f32) - digits_dt(dt));
452452
const float trh_coeff = (1 << safe_digits);
453+
#ifdef DNNL_WITH_SYCL
454+
float trh = trh_coeff
455+
* ((kind == SRC || kind == DST
456+
|| (kind == VAR && prb->dir & FLAG_FWD))
457+
? 5e-7
458+
: 0);
459+
#else
453460
float trh = trh_coeff * ((kind == SRC || kind == DST) ? 5e-7 : 0);
461+
#endif
454462
if ((kind == SC || kind == SH) && prb->dir & FLAG_BWD)
455463
trh = trh_coeff * 5e-6;
456464
cmp.set_threshold(trh);

0 commit comments

Comments
 (0)