Skip to content

Commit

Permalink
Fix vcmul microkernel tester
Browse files Browse the repository at this point in the history
The tester was using `nanf("")` to initialize the output buffer, but this is not a valid `NaN` value for fp16. This CL changes the tester to use `UINT16_C(0x7E00)`, which is a valid `NaN` value for `fp16`.

PiperOrigin-RevId: 634416194
  • Loading branch information
alankelly authored and xnnpack-bot committed May 16, 2024
1 parent 9d12551 commit a26ebeb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/vcmul-microkernel-tester.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class VCMulMicrokernelTester {
} else if (inplace_b()) {
std::copy(b.cbegin(), b.cend(), y.begin());
} else {
std::fill(y.begin(), y.end(), nanf(""));
std::fill(y.begin(), y.end(), UINT16_C(0x7E00) /* NaN */);
}
const uint16_t* a_data = inplace_a() ? y.data() : a.data();
const uint16_t* b_data = inplace_b() ? y.data() : b.data();
Expand Down

0 comments on commit a26ebeb

Please sign in to comment.