Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit 165cee8

Browse files
authored
[ESIMD] Update tf32 test (#1474)
1 parent bd51c51 commit 165cee8

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

SYCL/ESIMD/api/bin_and_cmp_ops_heavy.cpp

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
// Tests various binary operations applied to simd objects.
1515

1616
// TODO
17-
// Arithmetic operations behaviour depends on Gen's control regiter's rounding
17+
// Arithmetic operations behaviour depends on Gen's control register's rounding
1818
// mode, which is RTNE by default:
1919
// cr0.5:4 is 00b = Round to Nearest or Even (RTNE)
20-
// For half this leads to divergence between Gen and host (emulated) results
21-
// larger than certain threshold. Might need to tune the cr0 once this feature
22-
// is available in ESIMD.
20+
// For half and tfloat32 this leads to divergence between Gen and host
21+
// (emulated) results larger than certain threshold. Might need to tune the cr0
22+
// once this feature is available in ESIMD.
2323
//
2424

2525
#include "../esimd_test_utils.hpp"
@@ -286,16 +286,15 @@ int main(void) {
286286
passed &= test<half, bfloat16, 7, BinOp, VEfa, IDf>(arith_ops, q, 0.03);
287287
#endif // USE_BF16
288288
#ifdef USE_TF32
289-
passed &= test<tfloat32, float, 32, BinOp, VEf, IDf>(arith_ops, q, 0.000001f);
289+
passed &= test<tfloat32, float, 32, BinOp, VEfa, IDf>(arith_ops, q, 0.001f);
290290
passed &=
291-
test<tfloat32, tfloat32, 32, BinOp, VEf, IDf>(arith_ops, q, 0.000001f);
292-
passed &= test<char, tfloat32, 32, BinOp, VEf, IDf>(arith_ops, q, 0.000001f);
291+
test<tfloat32, tfloat32, 32, BinOp, VEfa, IDf>(arith_ops, q, 0.001f);
292+
passed &= test<char, tfloat32, 32, BinOp, VEfa, IDf>(arith_ops, q, 0.001f);
293293
if (SupportsHalf)
294-
passed &=
295-
test<tfloat32, half, 32, BinOp, VEf, IDf>(arith_ops, q, 0.000001f);
296-
passed &= test<tfloat32, unsigned char, 32, BinOp, VEf, IDf>(arith_ops, q,
297-
0.000001f);
298-
passed &= test<tfloat32, short, 32, BinOp, VEf, IDf>(arith_ops, q, 0.000001f);
294+
passed &= test<tfloat32, half, 32, BinOp, VEfa, IDf>(arith_ops, q, 0.001f);
295+
passed &=
296+
test<tfloat32, unsigned char, 32, BinOp, VEfa, IDf>(arith_ops, q, 0.001f);
297+
passed &= test<tfloat32, short, 32, BinOp, VEfa, IDf>(arith_ops, q, 0.001f);
299298
#endif // USE_TF32
300299
// Test division separately, as error probability is higher.
301300
auto div_op = esimd_test::BinaryOpSeq<BinOp::div>{};
@@ -322,14 +321,14 @@ int main(void) {
322321
#endif // USE_BF16
323322

324323
#ifdef USE_TF32
325-
passed &= test<tfloat32, float, 32, BinOp, VEf, IDf>(div_op, q, 0.000001f);
326-
passed &= test<tfloat32, tfloat32, 32, BinOp, VEf, IDf>(div_op, q, 0.000001f);
327-
passed &= test<char, tfloat32, 32, BinOp, VEf, IDf>(div_op, q, 0.000001f);
324+
passed &= test<tfloat32, float, 32, BinOp, VEf, IDf>(div_op, q, 0.001f);
325+
passed &= test<tfloat32, tfloat32, 32, BinOp, VEf, IDf>(div_op, q, 0.001f);
326+
passed &= test<char, tfloat32, 32, BinOp, VEf, IDf>(div_op, q, 0.001f);
328327
if (SupportsHalf)
329-
passed &= test<tfloat32, half, 32, BinOp, VEf, IDf>(div_op, q, 0.000001f);
328+
passed &= test<tfloat32, half, 32, BinOp, VEf, IDf>(div_op, q, 0.001f);
330329
passed &=
331-
test<tfloat32, unsigned char, 32, BinOp, VEf, IDf>(div_op, q, 0.000001f);
332-
passed &= test<tfloat32, short, 32, BinOp, VEf, IDf>(div_op, q, 0.000001f);
330+
test<tfloat32, unsigned char, 32, BinOp, VEf, IDf>(div_op, q, 0.001f);
331+
passed &= test<tfloat32, short, 32, BinOp, VEf, IDf>(div_op, q, 0.001f);
333332
#endif // USE_TF32
334333

335334
auto int_ops = esimd_test::IntBinaryOpsNoShiftNoDivRem;

0 commit comments

Comments
 (0)