Explorar el Código

xgemm: fix checking accurracy

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.
Samuel Thibault hace 5 años
padre
commit
a98265dd12
Se han modificado 3 ficheros con 3 adiciones y 1 borrados
  1. 1 0
      examples/mult/double.h
  2. 1 0
      examples/mult/simple.h
  3. 1 1
      examples/mult/xgemm.c

+ 1 - 0
examples/mult/double.h

@@ -15,6 +15,7 @@
  */
 
 #define TYPE	double
+#define EPSILON	0.000000000001
 
 #define CUBLAS_GEMM cublasDgemm
 #define CPU_GEMM	STARPU_DGEMM

+ 1 - 0
examples/mult/simple.h

@@ -15,6 +15,7 @@
  */
 
 #define TYPE	float
+#define EPSILON	0.000001
 
 #define CUBLAS_GEMM cublasSgemm
 #define CPU_GEMM	STARPU_SGEMM

+ 1 - 1
examples/mult/xgemm.c

@@ -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;