Explorar el Código

Fix complex_compare

Samuel Thibault hace 4 años
padre
commit
8607ba7b3c
Se han modificado 2 ficheros con 2 adiciones y 15 borrados
  1. 1 15
      examples/interface/complex_interface.c
  2. 1 0
      include/starpu_data_interfaces.h

+ 1 - 15
examples/interface/complex_interface.c

@@ -175,21 +175,7 @@ static int complex_compare(void *data_interface_a, void *data_interface_b)
 	struct starpu_complex_interface *complex_a = (struct starpu_complex_interface *) data_interface_a;
 	struct starpu_complex_interface *complex_b = (struct starpu_complex_interface *) data_interface_b;
 
-	if (complex_a->nx != complex_b->nx)
-	{
-		return 0;
-	}
-	else
-	{
-		int i;
-		for(i=0 ; i<complex_a->nx ; i++)
-		{
-			if (complex_a->real[i] != complex_b->real[i]) return 0;
-			if (complex_a->imaginary[i] != complex_b->imaginary[i]) return 0;
-		}
-		return 1;
-	}
-
+	return (complex_a->nx == complex_b->nx)
 }
 
 static int copy_any_to_any(void *src_interface, unsigned src_node,

+ 1 - 0
include/starpu_data_interfaces.h

@@ -481,6 +481,7 @@ struct starpu_data_interface_ops
 	   Compare the data size and layout of two interfaces (nx, ny, ld, elemsize,
 	   etc.), to be used for indexing performance models. It should return 1 if
 	   the two interfaces size and layout match computation-wise, and 0 otherwise.
+	   It does *not* compare the actual content of the interfaces.
 	*/
 	int 		 (*compare)			(void *data_interface_a, void *data_interface_b);