ソースを参照

Non-contiguous matrices are not properly handled by the OpenCL driver yet.

Cédric Augonnet 15 年 前
コミット
3833786736
共有1 個のファイルを変更した12 個の追加0 個の削除を含む
  1. 12 0
      src/datawizard/interfaces/matrix_interface.c

+ 12 - 0
src/datawizard/interfaces/matrix_interface.c

@@ -473,6 +473,9 @@ static int copy_ram_to_opencl_async(void *src_interface, unsigned src_node __att
 
 	cl_event *event = _event;
 
+	/* XXX non contiguous matrices are not supported with OpenCL yet ! (TODO) */
+	STARPU_ASSERT((src_matrix->ld == src_matrix->nx) && (dst_matrix->ld == dst_matrix->nx));
+
 	int err = _starpu_opencl_copy_to_opencl((void*)src_matrix->ptr, (cl_mem)dst_matrix->dev_handle, src_matrix->nx*src_matrix->ny*src_matrix->elemsize,
                                                 dst_matrix->offset, event);
 
@@ -491,6 +494,9 @@ static int copy_opencl_to_ram_async(void *src_interface, unsigned src_node __att
 
 	cl_event *event = _event;
 
+	/* XXX non contiguous matrices are not supported with OpenCL yet ! (TODO) */
+	STARPU_ASSERT((src_matrix->ld == src_matrix->nx) && (dst_matrix->ld == dst_matrix->nx));
+
 	int err = _starpu_opencl_copy_from_opencl((cl_mem)src_matrix->dev_handle, (void*)dst_matrix->ptr,
                                                   src_matrix->nx*src_matrix->ny*src_matrix->elemsize,
                                                   src_matrix->offset, event);
@@ -508,6 +514,9 @@ static int copy_ram_to_opencl(void *src_interface, unsigned src_node __attribute
 	starpu_matrix_interface_t *src_matrix = src_interface;
 	starpu_matrix_interface_t *dst_matrix = dst_interface;
 
+	/* XXX non contiguous matrices are not supported with OpenCL yet ! (TODO) */
+	STARPU_ASSERT((src_matrix->ld == src_matrix->nx) && (dst_matrix->ld == dst_matrix->nx));
+
 	int err = _starpu_opencl_copy_to_opencl((void*)src_matrix->ptr, (cl_mem)dst_matrix->dev_handle, src_matrix->nx*src_matrix->ny*src_matrix->elemsize,
                                                 dst_matrix->offset, NULL);
 
@@ -524,6 +533,9 @@ static int copy_opencl_to_ram(void *src_interface, unsigned src_node __attribute
 	starpu_matrix_interface_t *src_matrix = src_interface;
 	starpu_matrix_interface_t *dst_matrix = dst_interface;
 
+	/* XXX non contiguous matrices are not supported with OpenCL yet ! (TODO) */
+	STARPU_ASSERT((src_matrix->ld == src_matrix->nx) && (dst_matrix->ld == dst_matrix->nx));
+
 	int err = _starpu_opencl_copy_from_opencl((cl_mem)src_matrix->dev_handle, (void*)dst_matrix->ptr,
                                                   src_matrix->nx*src_matrix->ny*src_matrix->elemsize,
                                                   src_matrix->offset, NULL);