Browse Source

Multiformat : Fixed a bug that caused the data conversion to be skipped when copying data from RAM to an OpenCL device.

Cyril Roelandt 13 years ago
parent
commit
52c6fbcbf1
1 changed files with 7 additions and 9 deletions
  1. 7 9
      src/datawizard/interfaces/multiformat_interface.c

+ 7 - 9
src/datawizard/interfaces/multiformat_interface.c

@@ -607,17 +607,15 @@ static int copy_ram_to_opencl_async(void *src_interface, unsigned src_node,
 		if (src_multiformat->opencl_ptr == NULL) {
 			return -ENOMEM;
 		}
+	}
 
-		double tmp = starpu_timing_now();
-		void *buffers[1];
-		struct starpu_codelet *cl = src_multiformat->ops->cpu_to_opencl_cl;
-		buffers[0] = src_interface;
-		cl->cpu_func(buffers, NULL);
-		dst_multiformat->conversion_time = starpu_timing_now() - tmp;
+	double tmp = starpu_timing_now();
+	void *buffers[1];
+	struct starpu_codelet *cl = src_multiformat->ops->cpu_to_opencl_cl;
+	buffers[0] = src_interface;
+	cl->cpu_func(buffers, NULL);
+	dst_multiformat->conversion_time = starpu_timing_now() - tmp;
 
-		if (src_multiformat->opencl_ptr == NULL)
-			return -ENOMEM; // XXX
-	}
 
 	err = _starpu_opencl_copy_ram_to_opencl_async_sync(src_multiformat->opencl_ptr,
 							   src_node,