added double precision tests
This commit is contained in:
29
tests/transcendentals-6-3.ispc
Normal file
29
tests/transcendentals-6-3.ispc
Normal file
@@ -0,0 +1,29 @@
|
||||
static double double4(uniform double a, uniform double b, uniform double c,
|
||||
uniform double d) {
|
||||
double ret = 0;
|
||||
for (uniform int i = 0; i < programCount; i += 4) {
|
||||
ret = insert(ret, i + 0, a);
|
||||
ret = insert(ret, i + 1, b);
|
||||
ret = insert(ret, i + 2, c);
|
||||
ret = insert(ret, i + 3, d);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
|
||||
bool ok(double x, double ref) {
|
||||
bool r = (abs(x - ref) < 1d-15) || abs((x-ref)/ref) < 1d-15;
|
||||
if (any(r == false))
|
||||
print("mismatch got %, expected %\n", x, ref);
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
export void f_v(uniform float RET[]) {
|
||||
double v = double4((14.300000190734863d0),(-6.699999809265137d0),(-21.200000762939453d0),(9.000000000000000d0));
|
||||
double ref = double4((-0.1621146247115303d0),(0.9143832254542971d0),(-0.7030295000381365d0),(-0.9111302618846769d0));
|
||||
RET[programIndex] = ok(cos(v), ref) ? 1. : 0.;
|
||||
}
|
||||
export void result(uniform float RET[]) { RET[programIndex] = 1.; }
|
||||
Reference in New Issue
Block a user