瀏覽代碼

Rename STARPU_MULTIFORMAT_GET_PTR into STARPU_MULTIFORMAT_GET_CPU_PTR, for coherency with the other macros

Samuel Thibault 13 年之前
父節點
當前提交
7733a5cb3c

+ 10 - 11
doc/chapters/advanced-api.texi

@@ -120,24 +120,23 @@ on the @var{dst_node} node (on another OpenCL device), using the given
 @end deftp
 @end deftp
 
 
 @deftypefun uint32_t starpu_crc32_be_n ({void *}@var{input}, size_t @var{n}, uint32_t @var{inputcrc})
 @deftypefun uint32_t starpu_crc32_be_n ({void *}@var{input}, size_t @var{n}, uint32_t @var{inputcrc})
-todo: say what it is for
 Compute the CRC of a byte buffer seeded by the inputcrc "current
 Compute the CRC of a byte buffer seeded by the inputcrc "current
 state". The return value should be considered as the new "current
 state". The return value should be considered as the new "current
-state" for future CRC computation.
+state" for future CRC computation. This is used for computing data size
+footprint.
 @end deftypefun
 @end deftypefun
 
 
 @deftypefun uint32_t starpu_crc32_be (uint32_t @var{input}, uint32_t @var{inputcrc})
 @deftypefun uint32_t starpu_crc32_be (uint32_t @var{input}, uint32_t @var{inputcrc})
-todo: say what it is for
 Compute the CRC of a 32bit number seeded by the inputcrc "current
 Compute the CRC of a 32bit number seeded by the inputcrc "current
 state". The return value should be considered as the new "current
 state". The return value should be considered as the new "current
-state" for future CRC computation.
+state" for future CRC computation. This is used for computing data size
+footprint.
 @end deftypefun
 @end deftypefun
 
 
 @deftypefun uint32_t starpu_crc32_string ({char *}@var{str}, uint32_t @var{inputcrc})
 @deftypefun uint32_t starpu_crc32_string ({char *}@var{str}, uint32_t @var{inputcrc})
-todo: say what it is for
 Compute the CRC of a string seeded by the inputcrc "current state".
 Compute the CRC of a string seeded by the inputcrc "current state".
 The return value should be considered as the new "current state" for
 The return value should be considered as the new "current state" for
-future CRC computation.
+future CRC computation. This is used for computing data size footprint.
 @end deftypefun
 @end deftypefun
 
 
 @node An example of data interface
 @node An example of data interface
@@ -185,20 +184,20 @@ working on a GPU.
 the format.
 the format.
 @end deftypefun
 @end deftypefun
 
 
-@defmac STARPU_MULTIFORMAT_GET_PTR ({void *}@var{interface})
+@defmac STARPU_MULTIFORMAT_GET_CPU_PTR ({void *}@var{interface})
-todo
+returns the local pointer to the data with CPU format.
 @end defmac
 @end defmac
 
 
 @defmac STARPU_MULTIFORMAT_GET_CUDA_PTR ({void *}@var{interface})
 @defmac STARPU_MULTIFORMAT_GET_CUDA_PTR ({void *}@var{interface})
-todo
+returns the local pointer to the data with CUDA format.
 @end defmac
 @end defmac
 
 
 @defmac STARPU_MULTIFORMAT_GET_OPENCL_PTR ({void *}@var{interface})
 @defmac STARPU_MULTIFORMAT_GET_OPENCL_PTR ({void *}@var{interface})
-todo
+returns the local pointer to the data with OpenCL format.
 @end defmac
 @end defmac
 
 
 @defmac STARPU_MULTIFORMAT_GET_NX  ({void *}@var{interface})
 @defmac STARPU_MULTIFORMAT_GET_NX  ({void *}@var{interface})
-todo
+returns the number of elements in the data.
 @end defmac
 @end defmac
 
 
 
 

+ 2 - 2
doc/chapters/advanced-examples.texi

@@ -788,7 +788,7 @@ starpu_multiformat_data_register(handle, 0, &array_of_structs, NX, &format_ops);
 @end cartouche
 @end cartouche
 
 
 Kernels can be written almost as for any other interface. Note that
 Kernels can be written almost as for any other interface. Note that
-STARPU_MULTIFORMAT_GET_PTR shall only be used for CPU kernels. CUDA kernels
+STARPU_MULTIFORMAT_GET_CPU_PTR shall only be used for CPU kernels. CUDA kernels
 must use STARPU_MULTIFORMAT_GET_CUDA_PTR, and OpenCL kernels must use
 must use STARPU_MULTIFORMAT_GET_CUDA_PTR, and OpenCL kernels must use
 STARPU_MULTIFORMAT_GET_OPENCL_PTR. STARPU_MULTIFORMAT_GET_NX may be used in any
 STARPU_MULTIFORMAT_GET_OPENCL_PTR. STARPU_MULTIFORMAT_GET_NX may be used in any
 kind of kernel.
 kind of kernel.
@@ -800,7 +800,7 @@ multiformat_scal_cpu_func(void *buffers[], void *args)
     struct point *aos;
     struct point *aos;
     unsigned int n;
     unsigned int n;
 
 
-    aos = STARPU_MULTIFORMAT_GET_PTR(buffers[0]);
+    aos = STARPU_MULTIFORMAT_GET_CPU_PTR(buffers[0]);
     n = STARPU_MULTIFORMAT_GET_NX(buffers[0]);
     n = STARPU_MULTIFORMAT_GET_NX(buffers[0]);
     ...
     ...
 @}
 @}

+ 1 - 1
examples/basic_examples/multiformat.c

@@ -33,7 +33,7 @@ multiformat_scal_cpu_func(void *buffers[], void *args)
 	struct point *aos;
 	struct point *aos;
 	unsigned int n, i;
 	unsigned int n, i;
 
 
-	aos = (struct point *) STARPU_MULTIFORMAT_GET_PTR(buffers[0]);
+	aos = (struct point *) STARPU_MULTIFORMAT_GET_CPU_PTR(buffers[0]);
 	n = STARPU_MULTIFORMAT_GET_NX(buffers[0]);
 	n = STARPU_MULTIFORMAT_GET_NX(buffers[0]);
 
 
 	for (i = 0; i < n; i++)
 	for (i = 0; i < n; i++)

+ 2 - 2
examples/basic_examples/multiformat_conversion_codelets.c

@@ -21,7 +21,7 @@
 void cuda_to_cpu(void *buffers[], void *arg)
 void cuda_to_cpu(void *buffers[], void *arg)
 {
 {
 	struct struct_of_arrays *src = STARPU_MULTIFORMAT_GET_CUDA_PTR(buffers[0]);
 	struct struct_of_arrays *src = STARPU_MULTIFORMAT_GET_CUDA_PTR(buffers[0]);
-	struct point *dst = STARPU_MULTIFORMAT_GET_PTR(buffers[0]);
+	struct point *dst = STARPU_MULTIFORMAT_GET_CPU_PTR(buffers[0]);
 	int n = STARPU_MULTIFORMAT_GET_NX(buffers[0]);
 	int n = STARPU_MULTIFORMAT_GET_NX(buffers[0]);
 	int i;
 	int i;
 	for (i = 0; i < n; i++)
 	for (i = 0; i < n; i++)
@@ -54,7 +54,7 @@ void opencl_to_cpu(void *buffers[], void *arg)
 {
 {
 	FPRINTF(stderr, "User Entering %s\n", __func__);
 	FPRINTF(stderr, "User Entering %s\n", __func__);
 	struct struct_of_arrays *src = STARPU_MULTIFORMAT_GET_OPENCL_PTR(buffers[0]);
 	struct struct_of_arrays *src = STARPU_MULTIFORMAT_GET_OPENCL_PTR(buffers[0]);
-	struct point *dst = STARPU_MULTIFORMAT_GET_PTR(buffers[0]);
+	struct point *dst = STARPU_MULTIFORMAT_GET_CPU_PTR(buffers[0]);
 	int n = STARPU_MULTIFORMAT_GET_NX(buffers[0]);
 	int n = STARPU_MULTIFORMAT_GET_NX(buffers[0]);
 	int i;
 	int i;
 	for (i = 0; i < n; i++)
 	for (i = 0; i < n; i++)

+ 1 - 1
examples/basic_examples/multiformat_conversion_codelets_cuda.cu

@@ -36,7 +36,7 @@ extern "C" void cpu_to_cuda_cuda_func(void *buffers[], void *_args)
 	struct point *src;
 	struct point *src;
 	struct struct_of_arrays *dst;
 	struct struct_of_arrays *dst;
 
 
-	src = (struct point *) STARPU_MULTIFORMAT_GET_PTR(buffers[0]);
+	src = (struct point *) STARPU_MULTIFORMAT_GET_CPU_PTR(buffers[0]);
 	dst = (struct struct_of_arrays *) STARPU_MULTIFORMAT_GET_CUDA_PTR(buffers[0]);
 	dst = (struct struct_of_arrays *) STARPU_MULTIFORMAT_GET_CUDA_PTR(buffers[0]);
 
 
 	int n = STARPU_MULTIFORMAT_GET_NX(buffers[0]);
 	int n = STARPU_MULTIFORMAT_GET_NX(buffers[0]);

+ 1 - 1
examples/basic_examples/multiformat_conversion_codelets_opencl.c

@@ -29,7 +29,7 @@ void cpu_to_opencl_opencl_func(void *buffers[], void *args)
 	cl_event event;
 	cl_event event;
 
 
 	unsigned n = STARPU_MULTIFORMAT_GET_NX(buffers[0]);
 	unsigned n = STARPU_MULTIFORMAT_GET_NX(buffers[0]);
-	cl_mem src = (cl_mem) STARPU_MULTIFORMAT_GET_PTR(buffers[0]);
+	cl_mem src = (cl_mem) STARPU_MULTIFORMAT_GET_CPU_PTR(buffers[0]);
 	cl_mem dst = (cl_mem) STARPU_MULTIFORMAT_GET_OPENCL_PTR(buffers[0]);
 	cl_mem dst = (cl_mem) STARPU_MULTIFORMAT_GET_OPENCL_PTR(buffers[0]);
 
 
 	id = starpu_worker_get_id();
 	id = starpu_worker_get_id();

+ 2 - 2
include/starpu_data_interfaces.h

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  *
- * Copyright (C) 2010-2011  Université de Bordeaux 1
+ * Copyright (C) 2010-2012  Université de Bordeaux 1
  * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  * Copyright (C) 2011-2012  Institut National de Recherche en Informatique et Automatique
  * Copyright (C) 2011-2012  Institut National de Recherche en Informatique et Automatique
  *
  *
@@ -376,7 +376,7 @@ struct starpu_multiformat_interface
 
 
 void starpu_multiformat_data_register(starpu_data_handle_t *handle, uint32_t home_node, void *ptr, uint32_t nobjects, struct starpu_multiformat_data_interface_ops *format_ops);
 void starpu_multiformat_data_register(starpu_data_handle_t *handle, uint32_t home_node, void *ptr, uint32_t nobjects, struct starpu_multiformat_data_interface_ops *format_ops);
 
 
-#define STARPU_MULTIFORMAT_GET_PTR(interface)  (((struct starpu_multiformat_interface *)(interface))->cpu_ptr)
+#define STARPU_MULTIFORMAT_GET_CPU_PTR(interface)  (((struct starpu_multiformat_interface *)(interface))->cpu_ptr)
 
 
 #ifdef STARPU_USE_CUDA
 #ifdef STARPU_USE_CUDA
 #define STARPU_MULTIFORMAT_GET_CUDA_PTR(interface) (((struct starpu_multiformat_interface *)(interface))->cuda_ptr)
 #define STARPU_MULTIFORMAT_GET_CUDA_PTR(interface) (((struct starpu_multiformat_interface *)(interface))->cuda_ptr)

+ 2 - 2
tests/datawizard/interfaces/multiformat/multiformat_conversion_codelets.c

@@ -25,7 +25,7 @@ void cuda_to_cpu(void *buffers[], void *arg)
 
 
 	FPRINTF(stderr, "Entering %s\n", __func__);
 	FPRINTF(stderr, "Entering %s\n", __func__);
 	struct struct_of_arrays *src = STARPU_MULTIFORMAT_GET_CUDA_PTR(buffers[0]);
 	struct struct_of_arrays *src = STARPU_MULTIFORMAT_GET_CUDA_PTR(buffers[0]);
-	struct point *dst = STARPU_MULTIFORMAT_GET_PTR(buffers[0]);
+	struct point *dst = STARPU_MULTIFORMAT_GET_CPU_PTR(buffers[0]);
 	int n = STARPU_MULTIFORMAT_GET_NX(buffers[0]);
 	int n = STARPU_MULTIFORMAT_GET_NX(buffers[0]);
 	int i;
 	int i;
 	for (i = 0; i < n; i++)
 	for (i = 0; i < n; i++)
@@ -56,7 +56,7 @@ void opencl_to_cpu(void *buffers[], void *arg)
 	STARPU_SKIP_IF_VALGRIND;
 	STARPU_SKIP_IF_VALGRIND;
 
 
 	struct struct_of_arrays *src = STARPU_MULTIFORMAT_GET_OPENCL_PTR(buffers[0]);
 	struct struct_of_arrays *src = STARPU_MULTIFORMAT_GET_OPENCL_PTR(buffers[0]);
-	struct point *dst = STARPU_MULTIFORMAT_GET_PTR(buffers[0]);
+	struct point *dst = STARPU_MULTIFORMAT_GET_CPU_PTR(buffers[0]);
 	int n = STARPU_MULTIFORMAT_GET_NX(buffers[0]);
 	int n = STARPU_MULTIFORMAT_GET_NX(buffers[0]);
 	int i;
 	int i;
 	for (i = 0; i < n; i++)
 	for (i = 0; i < n; i++)

+ 1 - 1
tests/datawizard/interfaces/multiformat/multiformat_conversion_codelets_cuda.cu

@@ -37,7 +37,7 @@ extern "C" void cpu_to_cuda_cuda_func(void *buffers[], void *_args)
 	struct point *src;
 	struct point *src;
 	struct struct_of_arrays *dst;
 	struct struct_of_arrays *dst;
 
 
-	src = (struct point *) STARPU_MULTIFORMAT_GET_PTR(buffers[0]);
+	src = (struct point *) STARPU_MULTIFORMAT_GET_CPU_PTR(buffers[0]);
 	dst = (struct struct_of_arrays *) STARPU_MULTIFORMAT_GET_CUDA_PTR(buffers[0]);
 	dst = (struct struct_of_arrays *) STARPU_MULTIFORMAT_GET_CUDA_PTR(buffers[0]);
 
 
 	int n = STARPU_MULTIFORMAT_GET_NX(buffers[0]);
 	int n = STARPU_MULTIFORMAT_GET_NX(buffers[0]);

+ 1 - 1
tests/datawizard/interfaces/multiformat/multiformat_conversion_codelets_opencl.c

@@ -35,7 +35,7 @@ void cpu_to_opencl_opencl_func(void *buffers[], void *args)
 	cl_event event;
 	cl_event event;
 
 
 	unsigned n = STARPU_MULTIFORMAT_GET_NX(buffers[0]);
 	unsigned n = STARPU_MULTIFORMAT_GET_NX(buffers[0]);
-	cl_mem src = (cl_mem) STARPU_MULTIFORMAT_GET_PTR(buffers[0]);
+	cl_mem src = (cl_mem) STARPU_MULTIFORMAT_GET_CPU_PTR(buffers[0]);
 	cl_mem dst = (cl_mem) STARPU_MULTIFORMAT_GET_OPENCL_PTR(buffers[0]);
 	cl_mem dst = (cl_mem) STARPU_MULTIFORMAT_GET_OPENCL_PTR(buffers[0]);
 
 
 	id = starpu_worker_get_id();
 	id = starpu_worker_get_id();

+ 1 - 1
tests/datawizard/interfaces/multiformat/multiformat_interface.c

@@ -57,7 +57,7 @@ test_multiformat_cpu_func(void *buffers[], void *args)
 	unsigned int n, i;
 	unsigned int n, i;
 	int factor;
 	int factor;
 
 
-	aos = (struct point *) STARPU_MULTIFORMAT_GET_PTR(buffers[0]);
+	aos = (struct point *) STARPU_MULTIFORMAT_GET_CPU_PTR(buffers[0]);
 	n = STARPU_MULTIFORMAT_GET_NX(buffers[0]);
 	n = STARPU_MULTIFORMAT_GET_NX(buffers[0]);
 	factor = *(int *) args;
 	factor = *(int *) args;