ソースを参照

custom_interface: remove/implement some unimplemented functions.

Cyril Roelandt 12 年 前
コミット
6736bcb196
共有1 個のファイルを変更した7 個の追加38 個の削除を含む
  1. 7 38
      examples/filters/custom_mf/custom_interface.c

+ 7 - 38
examples/filters/custom_mf/custom_interface.c

@@ -17,13 +17,7 @@
 #include "custom_interface.h"
 #include "custom_types.h"
 
-static int copy_ram_to_ram(void *src_interface, unsigned src_node,
-			   void *dst_interface, unsigned dst_node);
 #ifdef STARPU_USE_CUDA
-static int copy_ram_to_cuda(void *src_interface, unsigned src_node,
-			    void *dst_interface, unsigned dst_node);
-static int copy_cuda_to_ram(void *src_interface, unsigned src_node,
-			    void *dst_interface, unsigned dst_node);
 static int copy_ram_to_cuda_async(void *src_interface, unsigned src_node,
 				  void *dst_interface, unsigned dst_node,
 				  cudaStream_t stream);
@@ -54,11 +48,11 @@ static int copy_opencl_to_ram_async(void *src_interface, unsigned src_node,
 
 static struct starpu_data_copy_methods custom_copy_data_methods_s =
 {
-	.ram_to_ram = copy_ram_to_ram,
+	.ram_to_ram = NULL,
 	.ram_to_spu = NULL,
 #ifdef STARPU_USE_CUDA
-	.ram_to_cuda        = copy_ram_to_cuda,
-	.cuda_to_ram        = copy_cuda_to_ram,
+	.ram_to_cuda        = NULL,
+	.cuda_to_ram        = NULL,
 	.ram_to_cuda_async  = copy_ram_to_cuda_async,
 	.cuda_to_ram_async  = copy_cuda_to_ram_async,
 	.cuda_to_cuda       = copy_cuda_to_cuda,
@@ -87,7 +81,6 @@ static void*    custom_handle_to_pointer(starpu_data_handle_t data_handle,
 static void     free_custom_buffer_on_node(void *data_interface, uint32_t node);
 static size_t   custom_interface_get_size(starpu_data_handle_t handle);
 static uint32_t footprint_custom_interface_crc32(starpu_data_handle_t handle);
-static int      custom_compare(void *data_interface_a, void *data_interface_b);
 static void     display_custom_interface(starpu_data_handle_t handle, FILE *f);
 static uint32_t custom_get_nx(starpu_data_handle_t handle);
 
@@ -109,7 +102,7 @@ static struct starpu_data_interface_ops interface_custom_ops =
 	.copy_methods          = &custom_copy_data_methods_s,
 	.get_size              = custom_interface_get_size,
 	.footprint             = footprint_custom_interface_crc32,
-	.compare               = custom_compare,
+	.compare               = NULL,
 #ifdef STARPU_USE_GORDON
 	.convert_to_gordon     = NULL,
 #endif
@@ -325,16 +318,11 @@ static uint32_t footprint_custom_interface_crc32(starpu_data_handle_t handle)
 	return starpu_crc32_be(custom_get_nx(handle), 0);
 }
 
-static int custom_compare(void *data_interface_a, void *data_interface_b)
-{
-	/* TODO */
-	assert(0);
-}
-
 static void display_custom_interface(starpu_data_handle_t handle, FILE *f)
 {
-	/* TODO */
-	assert(0);
+	struct custom_data_interface *ci = (struct custom_interface *)
+		starpu_data_get_interface_on_node(handle, 0);
+	fprintf(f, "Custom interface of size %d", ci->nx);
 }
 
 static uint32_t
@@ -373,26 +361,7 @@ void custom_data_register(starpu_data_handle_t *handle,
 	starpu_data_register(handle, home_node, &custom, &interface_custom_ops);
 }
 
-static int copy_ram_to_ram(void *src_interface, unsigned src_node,
-			   void *dst_interface, unsigned dst_node)
-{
-	/* TODO */
-	assert(0);
-}
 #ifdef STARPU_USE_CUDA
-static int copy_ram_to_cuda(void *src_interface, unsigned src_node,
-			    void *dst_interface, unsigned dst_node)
-{
-	/* TODO */
-	assert(0);
-}
-static int copy_cuda_to_ram(void *src_interface, unsigned src_node,
-			    void *dst_interface, unsigned dst_node)
-{
-	/* TODO */
-	assert(0);
-}
-
 static int
 copy_cuda_common_async(void *src_interface, unsigned src_node,
 		       void *dst_interface, unsigned dst_node,