Files
UnrealEngine/Engine/Source/ThirdParty/Intel/ISPC/ispc-1.24.0/tests/half.ispc
2025-05-18 13:04:45 +08:00

20 lines
473 B
Plaintext

#include "../test_static.isph"
task void f_v(uniform float RET[]) {
float sum = 0;
int errors = 0;
for (uniform int i = 0; i <= 0xffff; ++i) {
unsigned int16 h = i;
float f = half_to_float(i);
h = float_to_half(f);
// may return a different value back for NaNs..
if (!isnan(f) && i != h)
++errors;
}
RET[programIndex] = errors;
}
task void result(uniform float RET[]) {
RET[programIndex] = 0;
}