added double precision tests
This commit is contained in:
28
tests/transcendentals-5-2.ispc
Normal file
28
tests/transcendentals-5-2.ispc
Normal file
@@ -0,0 +1,28 @@
|
||||
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) < 1e-14) || abs((x-ref)/ref) < 1e-14;
|
||||
if (any(r == false))
|
||||
print("mismatch got %, expected %\n", x, ref);
|
||||
return r;
|
||||
}
|
||||
|
||||
export void f_v(uniform float RET[]) {
|
||||
double v = double4((-9.424777984619141d0),(4.000000000000000d0),(10.000000000000000d0),(-10.000000000000000d0));
|
||||
double ref = double4((2.3849760909612067d-08),(-0.7568024953079282d0),(-0.5440211108893699d0),(0.5440211108893699d0));
|
||||
RET[programIndex] = ok(sin(v), ref) ? 1. : 0.;
|
||||
}
|
||||
export void result(uniform float RET[]) { RET[programIndex] = 1.; }
|
||||
Reference in New Issue
Block a user