We also need to take into account z, to account for the error accumulation along computation. Also, precision is different in single and double precision.
@@ -15,6 +15,7 @@
*/
#define TYPE double
+#define EPSILON 0.000000000001
#define CUBLAS_GEMM cublasDgemm
#define CPU_GEMM STARPU_DGEMM
#define TYPE float
+#define EPSILON 0.000001
#define CUBLAS_GEMM cublasSgemm
#define CPU_GEMM STARPU_SGEMM
@@ -75,7 +75,7 @@ static int check_output(void)
TYPE err;
err = CPU_ASUM(xdim*ydim, C, 1);
- if (err < xdim*ydim*0.001)
+ if (err < xdim*ydim*zdim*EPSILON)
{
FPRINTF(stderr, "Results are OK\n");
return 0;