summaryrefslogtreecommitdiff
path: root/utests/utest_helper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utests/utest_helper.cpp')
-rw-r--r--utests/utest_helper.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/utests/utest_helper.cpp b/utests/utest_helper.cpp
index d3c378e9..8f772fd4 100644
--- a/utests/utest_helper.cpp
+++ b/utests/utest_helper.cpp
@@ -53,6 +53,7 @@ cl_mem buf[MAX_BUFFER_N] = {};
void *buf_data[MAX_BUFFER_N] = {};
size_t globals[3] = {};
size_t locals[3] = {};
+float ULPSIZE_FAST_MATH = 10000.;
#ifdef HAS_EGL
Display *xDisplay;
@@ -702,3 +703,14 @@ double time_subtract(struct timeval *y, struct timeval *x, struct timeval *resul
double msec = 1000.0*(y->tv_sec - x->tv_sec) + (y->tv_usec - x->tv_usec)/1000.0;
return msec;
}
+
+float select_ulpsize(float ULPSIZE_FAST_MATH, float ULPSIZE_NO_FAST_MATH)
+{
+ const char* env_strict = getenv("OCL_STRICT_CONFORMANCE");
+
+ float ULPSIZE_FACTOR = ULPSIZE_NO_FAST_MATH;
+ if (env_strict != NULL && strcmp(env_strict, "0") == 0 )
+ ULPSIZE_FACTOR = ULPSIZE_FAST_MATH;
+
+ return ULPSIZE_FACTOR;
+}