Explorar o código

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

Cyril Roelandt %!s(int64=13) %!d(string=hai) anos
pai
achega
9a97aa40de
Modificáronse 1 ficheiros con 5 adicións e 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 <starpu.h>
 #include <assert.h>
 #include <assert.h>
+#include <math.h>
 
 
 #include <reductions/dot_product.h>
 #include <reductions/dot_product.h>
 
 
@@ -420,7 +421,10 @@ int main(int argc, char **argv)
 	free(x_handles);
 	free(x_handles);
 	free(y_handles);
 	free(y_handles);
 
 
-	return 0;
+	if (fabs(reference_dot - dot) < 1e-4)
+		return EXIT_SUCCESS;
+	else
+		return EXIT_FAILURE;
 
 
 enodev:
 enodev:
 	fprintf(stderr, "WARNING: No one can execute this task\n");
 	fprintf(stderr, "WARNING: No one can execute this task\n");