Просмотр исходного кода

Update doc concerning multiimpl

Samuel Thibault лет назад: 13
Родитель
Сommit
63fbac4cbf

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

@@ -86,14 +86,14 @@ starpu_data_handle_t handle;
 void cpu_to_opencl_opencl_func(void *buffers[], void *args);
 struct starpu_codelet cpu_to_opencl_cl = @{
     .where = STARPU_OPENCL,
-    .opencl_func = cpu_to_opencl_opencl_func,
+    .opencl_funcs = @{ cpu_to_opencl_opencl_func, NULL @},
     .nbuffers = 1
 @};
 
 void opencl_to_cpu_func(void *buffers[], void *args);
 struct starpu_codelet opencl_to_cpu_cl = @{
     .where = STARPU_CPU,
-    .cpu_func = opencl_to_cpu_func,
+    .cpu_funcs = @{ opencl_to_cpu_func, NULL @},
     .nbuffers = 1
 @};
 #endif

+ 7 - 14
doc/chapters/advanced-examples.texi

@@ -50,17 +50,11 @@ void scal_sse_func(void *buffers[], void *cl_arg)
 @end smallexample
 @end cartouche
 
-The @code{cpu_func} field of the @code{struct starpu_codelet} structure has to be set
-to the special value @code{STARPU_MULTIPLE_CPU_IMPLEMENTATIONS}. Note that
-@code{STARPU_MULTIPLE_CUDA_IMPLEMENTATIONS} and
-@code{STARPU_MULTIPLE_OPENCL_IMPLEMENTATIONS} are also available.
-
 @cartouche
 @smallexample
 struct starpu_codelet cl = @{
     .where = STARPU_CPU,
-    .cpu_func = STARPU_MULTIPLE_CPU_IMPLEMENTATIONS,
-    .cpu_funcs = @{ scal_cpu_func, scal_sse_func @},
+    .cpu_funcs = @{ scal_cpu_func, scal_sse_func, NULL @},
     .nbuffers = 1
 @};
 @end smallexample
@@ -98,8 +92,8 @@ static int can_execute(unsigned workerid, struct starpu_task *task, unsigned nim
 struct starpu_codelet cl = @{
     .where = STARPU_CPU|STARPU_GPU,
     .can_execute = can_execute,
-    .cpu_func = cpu_func,
-    .gpu_func = gpu_func
+    .cpu_funcs = @{ cpu_func, NULL @},
+    .gpu_funcs = @{ gpu_func, NULL @}
     .nbuffers = 1
 @};
 @end smallexample
@@ -143,9 +137,8 @@ static int can_execute(unsigned workerid, struct starpu_task *task, unsigned nim
 struct starpu_codelet cl = @{
     .where = STARPU_CPU|STARPU_GPU,
     .can_execute = can_execute,
-    .cpu_func = cpu_func,
-    .gpu_func = STARPU_MULTIPLE_GPU_IMPLEMENTATIONS,
-    .gpu_funcs = @{ scal_gpu_13, scal_gpu_20 @},
+    .cpu_funcs = @{ cpu_func, NULL @},
+    .gpu_funcs = @{ scal_gpu_13, scal_gpu_20, NULL @},
     .nbuffers = 1
 @};
 @end smallexample
@@ -306,7 +299,7 @@ static struct starpu_perfmodel mult_perf_model = @{
 
 struct starpu_codelet cl = @{
     .where = STARPU_CPU,
-    .cpu_func = cpu_mult,
+    .cpu_funcs = @{ cpu_mult, NULL @},
     .nbuffers = 3,
     /* for the scheduling policy to be able to use performance models */
     .model = &mult_perf_model
@@ -459,7 +452,7 @@ void func_cpu(void *descr[], void *_args)
 
 struct starpu_codelet mycodelet = @{
         .where = STARPU_CPU,
-        .cpu_func = func_cpu,
+        .cpu_funcs = @{ func_cpu, NULL @},
         .nbuffers = 2
 @};
 @end smallexample

+ 15 - 21
doc/chapters/basic-api.texi

@@ -1016,50 +1016,44 @@ argument being the array of data managed by the data management library, and
 the second argument is a pointer to the argument passed from the @code{cl_arg}
 field of the @code{starpu_task} structure.
 The @code{cpu_func} field is ignored if @code{STARPU_CPU} does not appear in
-the @code{where} field, it must be non-null otherwise. When multiple CPU
-implementations are used, this field must be set to
-@code{STARPU_MULTIPLE_CPU_IMPLEMENTATIONS}.
+the @code{where} field, it must be non-null otherwise.
 
-@item @code{cpu_funcs} (optional)
-Is an array of function pointers to the CPU implementations of the codelet. This
-field is ignored if the @code{cpu_func} field is set to anything else than
-@code{STARPU_MULTIPLE_CPU_IMPLEMENTATIONS}. Otherwise, it should contain at
-least one function pointer, and at most @code{STARPU_MAXIMPLEMENTATIONS}.
+@item @code{cpu_funcs}
+Is an array of function pointers to the CPU implementations of the codelet.
+It must be terminated by a NULL value.
 
 @item @code{cuda_func} (optional)
 Is a function pointer to the CUDA implementation of the codelet. @emph{This
 must be a host-function written in the CUDA runtime API}. Its prototype must
 be: @code{void cuda_func(void *buffers[], void *cl_arg);}. The @code{cuda_func}
 field is ignored if @code{STARPU_CUDA} does not appear in the @code{where}
-field, it must be non-null otherwise. When multiple CUDA implementations are
-used, this field must be set to @code{STARPU_MULTIPLE_CUDA_IMPLEMENTATIONS}.
+field, it must be non-null otherwise.
 
-@item @code{cuda_funcs} (optional)
+@item @code{cuda_funcs}
 Is an array of function pointers to the CUDA implementations of the codelet.
-This field is ignored if the @code{cuda_func} field is set to anything else than
-@code{STARPU_MULTIPLE_CUDA_IMPLEMENTATIONS}. Otherwise, it should contain at
-least one function pointer, and at most @code{STARPU_MAXIMPLEMENTATIONS}.
+It must be terminated by a NULL value.
 
 @item @code{opencl_func} (optional)
 Is a function pointer to the OpenCL implementation of the codelet. Its
 prototype must be:
 @code{void opencl_func(void *buffers[], void *cl_arg);}.
 This pointer is ignored if @code{STARPU_OPENCL} does not appear in the
-@code{where} field, it must be non-null otherwise. When multiple OpenCL
-implementations are used, this field must be set to
-@code{STARPU_MULTIPLE_OPENCL_IMPLEMENTATIONS}.
+@code{where} field, it must be non-null otherwise.
 
-@item @code{opencl_funcs} (optional)
+@item @code{opencl_funcs}
 Is an array of function pointers to the OpenCL implementations of the codelet.
-This field is ignored if the @code{opencl_func} field is set to anything else
-than @code{STARPU_MULTIPLE_OPENCL_IMPLEMENTATIONS}. Otherwise, it should contain
-at least one function pointer, and at most @code{STARPU_MAXIMPLEMENTATIONS}.
+It must be terminated by a NULL value.
 
 @item @code{gordon_func} (optional)
 This is the index of the Cell SPU implementation within the Gordon library.
 See Gordon documentation for more details on how to register a kernel and
 retrieve its index.
 
+@item @code{gordon_funcs}
+Is an array of index of the Cell SPU implementations of the codelet within the
+Gordon library.
+It must be terminated by a NULL value.
+
 @item @code{nbuffers}
 Specifies the number of arguments taken by the codelet. These arguments are
 managed by the DSM and are accessed from the @code{void *buffers[]}

+ 5 - 5
doc/chapters/basic-examples.texi

@@ -83,7 +83,7 @@ void cpu_func(void *buffers[], void *cl_arg)
 struct starpu_codelet cl =
 @{
     .where = STARPU_CPU,
-    .cpu_func = cpu_func,
+    .cpu_funcs = @{ cpu_func, NULL @},
     .nbuffers = 0
 @};
 @end smallexample
@@ -318,7 +318,7 @@ void scal_cpu_func(void *buffers[], void *cl_arg)
 
 struct starpu_codelet cl = @{
     .where = STARPU_CPU,
-    .cpu_func = scal_cpu_func,
+    .cpu_funcs = @{ scal_cpu_func, NULL @},
     .nbuffers = 1
 @};
 @end smallexample
@@ -495,9 +495,9 @@ extern void scal_opencl_func(void *buffers[], void *_args);
 static struct starpu_codelet cl = @{
     .where = STARPU_CPU|STARPU_CUDA|STARPU_OPENCL; /* @b{It can be executed on a CPU,} */
                                      /* @b{on a CUDA device, or on an OpenCL device} */
-    .cuda_func = scal_cuda_func,
-    .cpu_func = scal_cpu_func,
-    .opencl_func = scal_opencl_func,
+    .cuda_funcs = @{ scal_cuda_func, NULL @},
+    .cpu_funcs = @{ scal_cpu_func, NULL @},
+    .opencl_funcs = @{ scal_opencl_func, NULL @},
     .nbuffers = 1
 @}
 

+ 3 - 4
doc/chapters/vector_scal_c.texi

@@ -26,15 +26,14 @@ extern void scal_opencl_func(void *buffers[], void *_args);
 static struct starpu_codelet cl = @{
     .where = STARPU_CPU | STARPU_CUDA | STARPU_OPENCL,
     /* CPU implementation of the codelet */
-    .cpu_func = STARPU_MULTIPLE_CPU_IMPLEMENTATIONS,
-    .cpu_funcs = @{ scal_cpu_func, scal_sse_func @},
+    .cpu_funcs = @{ scal_cpu_func, scal_sse_func, NULL @},
 #ifdef STARPU_USE_CUDA
     /* CUDA implementation of the codelet */
-    .cuda_func = scal_cuda_func,
+    .cuda_funcs = @{ scal_cuda_func, NULL @},
 #endif
 #ifdef STARPU_USE_OPENCL
     /* OpenCL implementation of the codelet */
-    .opencl_func = scal_opencl_func,
+    .opencl_funcs = @{ scal_opencl_func, NULL @},
 #endif
     .nbuffers = 1
 @};