From fcce841b3e8bb270f1e895063fc89c5189d5d14a Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Tue, 5 Feb 2013 00:21:59 -0500 Subject: Don't use constexpr; Intel compiler doesn't handle it well --- test.cc | 91 ++++++++++++++++++++++++++++++++++------------------------------- 1 file changed, 47 insertions(+), 44 deletions(-) (limited to 'test.cc') diff --git a/test.cc b/test.cc index bb174c3..3c45bb6 100644 --- a/test.cc +++ b/test.cc @@ -42,7 +42,7 @@ struct vecmathlib_test { // Test each function with this many random values static int const imax = 10000; // Require (arbitrarily) that 3/4 of the digits are correct - static real_t constexpr accuracy = pow(realvec_t::epsilon(), R(0.75)); + static real_t accuracy() { return pow(realvec_t::epsilon(), R(0.75)); } @@ -379,8 +379,8 @@ struct vecmathlib_test { intvec_t const n = random(int_t(-10), int_t(+10)); check("copysign", copysign, vecmathlib::copysign, x, y, 0.0); check("fabs", fabs, vecmathlib::fabs, x, 0.0); - check("fdim", fdim, vecmathlib::fdim, x, y, accuracy); - check("fma", fma, vecmathlib::fma, x, y, z, accuracy); + check("fdim", fdim, vecmathlib::fdim, x, y, accuracy()); + check("fma", fma, vecmathlib::fma, x, y, z, accuracy()); check("fmax", fmax, vecmathlib::fmax, x, y, 0.0); check("fmin", fmin, vecmathlib::fmin, x, y, 0.0); check("ilogb", ilogb, vecmathlib::ilogb, x); @@ -403,14 +403,14 @@ struct vecmathlib_test { intvec_t const n = random(int_t(-1000000), int_t(+1000000)); realvec_t const fn = vecmathlib::convert_float(n); check("convert_float", - FP::convert_float, vecmathlib::convert_float, n, accuracy); + FP::convert_float, vecmathlib::convert_float, n, accuracy()); check("convert_int", FP::convert_int, vecmathlib::convert_int, x); - check("ceil", ceil, vecmathlib::ceil, x, accuracy); - check("ceil", ceil, vecmathlib::ceil, fn, accuracy); - check("floor", floor, vecmathlib::floor, x, accuracy); - check("floor", floor, vecmathlib::floor, fn, accuracy); - check("round", round, vecmathlib::round, x, accuracy); - check("round", round, vecmathlib::round, fn, accuracy); + check("ceil", ceil, vecmathlib::ceil, x, accuracy()); + check("ceil", ceil, vecmathlib::ceil, fn, accuracy()); + check("floor", floor, vecmathlib::floor, x, accuracy()); + check("floor", floor, vecmathlib::floor, fn, accuracy()); + check("round", round, vecmathlib::round, x, accuracy()); + check("round", round, vecmathlib::round, fn, accuracy()); } } @@ -421,12 +421,12 @@ struct vecmathlib_test { cout << " testing asin acos atan...\n" << flush; for (int i=0; i