瀏覽代碼

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 4 年之前
父節點
當前提交
a98265dd12
共有 3 個文件被更改,包括 3 次插入1 次删除
  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;