Browse Source

Fix complex_compare

Samuel Thibault 4 years ago
parent
commit
8607ba7b3c
2 changed files with 2 additions and 15 deletions
  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_a = (struct starpu_complex_interface *) data_interface_a;
 	struct starpu_complex_interface *complex_b = (struct starpu_complex_interface *) data_interface_b;
 	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,
 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,
 	   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
 	   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.
 	   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);
 	int 		 (*compare)			(void *data_interface_a, void *data_interface_b);