Explorar el Código

examples/reductions/dot_product.c: check the result of the computations.

Cyril Roelandt hace 13 años
padre
commit
9a97aa40de
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5 1
      examples/reductions/dot_product.c

+ 5 - 1
examples/reductions/dot_product.c

@@ -17,6 +17,7 @@
 
 #include <starpu.h>
 #include <assert.h>
+#include <math.h>
 
 #include <reductions/dot_product.h>
 
@@ -420,7 +421,10 @@ int main(int argc, char **argv)
 	free(x_handles);
 	free(y_handles);
 
-	return 0;
+	if (fabs(reference_dot - dot) < 1e-4)
+		return EXIT_SUCCESS;
+	else
+		return EXIT_FAILURE;
 
 enodev:
 	fprintf(stderr, "WARNING: No one can execute this task\n");