Quellcode durchsuchen

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 vor 5 Jahren
Ursprung
Commit
a98265dd12
3 geänderte Dateien mit 3 neuen und 1 gelöschten Zeilen
  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;