Add print() statements to tests to indicate failure details.

These tests all fail with generic-16/c++ output currently; however, the
output indicates that it's just small floating-point differences.
(Though the question remains, why are those differences popping up?)
This commit is contained in:
Matt Pharr
2012-04-19 10:32:55 -07:00
parent 326c45fa17
commit 49f1a5c2b3
3 changed files with 15 additions and 2 deletions

View File

@@ -10,6 +10,8 @@ export void f_v(uniform float RET[]) {
h = float_to_half(f);
int mismatches = (f == f && i != h);
if (any(mismatches != 0))
print("mismatch: orig int16 % -> float % -> half %\n", i, f, h);
errors += reduce_add(mismatches);
}

View File

@@ -13,7 +13,12 @@ static float float4(uniform float a, uniform float b, uniform float c,
export uniform int width() { return programCount; }
bool ok(float x, float ref) { return (abs(x - ref) < 1e-6) || abs((x-ref)/ref) < 1e-5; }
bool ok(float x, float ref) {
bool r = (abs(x - ref) < 1e-6) || abs((x-ref)/ref) < 1e-5;
if (any(r == false))
print("mismatch got %, expected %\n", x, ref);
return r;
}
export void f_v(uniform float RET[]) {
float v = float4((-9.424777984619141),(4.000000000000000),(10.000000000000000),(-10.000000000000000));

View File

@@ -13,7 +13,13 @@ static float float4(uniform float a, uniform float b, uniform float c,
export uniform int width() { return programCount; }
bool ok(float x, float ref) { return (abs(x - ref) < 1e-6) || abs((x-ref)/ref) < 1e-5; }
bool ok(float x, float ref) {
bool r = (abs(x - ref) < 1e-6) || abs((x-ref)/ref) < 1e-5;
if (any(r == false))
print("mismatch got %, expected %\n", x, ref);
return r;
}
export void f_v(uniform float RET[]) {
float v = float4((14.300000190734863),(-6.699999809265137),(-21.200000762939453),(9.000000000000000));