소스 검색

Update doc concerning multiimpl

Samuel Thibault 13 년 전
부모
커밋
63fbac4cbf
5개의 변경된 파일32개의 추가작업 그리고 46개의 파일을 삭제
  1. 2 2
      doc/chapters/advanced-api.texi
  2. 7 14
      doc/chapters/advanced-examples.texi
  3. 15 21
      doc/chapters/basic-api.texi
  4. 5 5
      doc/chapters/basic-examples.texi
  5. 3 4
      doc/chapters/vector_scal_c.texi

+ 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);
 void cpu_to_opencl_opencl_func(void *buffers[], void *args);
 struct starpu_codelet cpu_to_opencl_cl = @{
 struct starpu_codelet cpu_to_opencl_cl = @{
     .where = STARPU_OPENCL,
     .where = STARPU_OPENCL,
-    .opencl_func = cpu_to_opencl_opencl_func,
+    .opencl_funcs = @{ cpu_to_opencl_opencl_func, NULL @},
     .nbuffers = 1
     .nbuffers = 1
 @};
 @};
 
 
 void opencl_to_cpu_func(void *buffers[], void *args);
 void opencl_to_cpu_func(void *buffers[], void *args);
 struct starpu_codelet opencl_to_cpu_cl = @{
 struct starpu_codelet opencl_to_cpu_cl = @{
     .where = STARPU_CPU,
     .where = STARPU_CPU,
-    .cpu_func = opencl_to_cpu_func,
+    .cpu_funcs = @{ opencl_to_cpu_func, NULL @},
     .nbuffers = 1
     .nbuffers = 1
 @};
 @};
 #endif
 #endif

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

@@ -50,17 +50,11 @@ void scal_sse_func(void *buffers[], void *cl_arg)
 @end smallexample
 @end smallexample
 @end cartouche
 @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
 @cartouche
 @smallexample
 @smallexample
 struct starpu_codelet cl = @{
 struct starpu_codelet cl = @{
     .where = STARPU_CPU,
     .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
     .nbuffers = 1
 @};
 @};
 @end smallexample
 @end smallexample
@@ -98,8 +92,8 @@ static int can_execute(unsigned workerid, struct starpu_task *task, unsigned nim
 struct starpu_codelet cl = @{
 struct starpu_codelet cl = @{
     .where = STARPU_CPU|STARPU_GPU,
     .where = STARPU_CPU|STARPU_GPU,
     .can_execute = can_execute,
     .can_execute = can_execute,
-    .cpu_func = cpu_func,
-    .gpu_func = gpu_func
+    .cpu_funcs = @{ cpu_func, NULL @},
+    .gpu_funcs = @{ gpu_func, NULL @}
     .nbuffers = 1
     .nbuffers = 1
 @};
 @};
 @end smallexample
 @end smallexample
@@ -143,9 +137,8 @@ static int can_execute(unsigned workerid, struct starpu_task *task, unsigned nim
 struct starpu_codelet cl = @{
 struct starpu_codelet cl = @{
     .where = STARPU_CPU|STARPU_GPU,
     .where = STARPU_CPU|STARPU_GPU,
     .can_execute = can_execute,
     .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
     .nbuffers = 1
 @};
 @};
 @end smallexample
 @end smallexample
@@ -306,7 +299,7 @@ static struct starpu_perfmodel mult_perf_model = @{
 
 
 struct starpu_codelet cl = @{
 struct starpu_codelet cl = @{
     .where = STARPU_CPU,
     .where = STARPU_CPU,
-    .cpu_func = cpu_mult,
+    .cpu_funcs = @{ cpu_mult, NULL @},
     .nbuffers = 3,
     .nbuffers = 3,
     /* for the scheduling policy to be able to use performance models */
     /* for the scheduling policy to be able to use performance models */
     .model = &mult_perf_model
     .model = &mult_perf_model
@@ -459,7 +452,7 @@ void func_cpu(void *descr[], void *_args)
 
 
 struct starpu_codelet mycodelet = @{
 struct starpu_codelet mycodelet = @{
         .where = STARPU_CPU,
         .where = STARPU_CPU,
-        .cpu_func = func_cpu,
+        .cpu_funcs = @{ func_cpu, NULL @},
         .nbuffers = 2
         .nbuffers = 2
 @};
 @};
 @end smallexample
 @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}
 the second argument is a pointer to the argument passed from the @code{cl_arg}
 field of the @code{starpu_task} structure.
 field of the @code{starpu_task} structure.
 The @code{cpu_func} field is ignored if @code{STARPU_CPU} does not appear in
 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)
 @item @code{cuda_func} (optional)
 Is a function pointer to the CUDA implementation of the codelet. @emph{This
 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
 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}
 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 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.
 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)
 @item @code{opencl_func} (optional)
 Is a function pointer to the OpenCL implementation of the codelet. Its
 Is a function pointer to the OpenCL implementation of the codelet. Its
 prototype must be:
 prototype must be:
 @code{void opencl_func(void *buffers[], void *cl_arg);}.
 @code{void opencl_func(void *buffers[], void *cl_arg);}.
 This pointer is ignored if @code{STARPU_OPENCL} does not appear in the
 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.
 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)
 @item @code{gordon_func} (optional)
 This is the index of the Cell SPU implementation within the Gordon library.
 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
 See Gordon documentation for more details on how to register a kernel and
 retrieve its index.
 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}
 @item @code{nbuffers}
 Specifies the number of arguments taken by the codelet. These arguments are
 Specifies the number of arguments taken by the codelet. These arguments are
 managed by the DSM and are accessed from the @code{void *buffers[]}
 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 =
 struct starpu_codelet cl =
 @{
 @{
     .where = STARPU_CPU,
     .where = STARPU_CPU,
-    .cpu_func = cpu_func,
+    .cpu_funcs = @{ cpu_func, NULL @},
     .nbuffers = 0
     .nbuffers = 0
 @};
 @};
 @end smallexample
 @end smallexample
@@ -318,7 +318,7 @@ void scal_cpu_func(void *buffers[], void *cl_arg)
 
 
 struct starpu_codelet cl = @{
 struct starpu_codelet cl = @{
     .where = STARPU_CPU,
     .where = STARPU_CPU,
-    .cpu_func = scal_cpu_func,
+    .cpu_funcs = @{ scal_cpu_func, NULL @},
     .nbuffers = 1
     .nbuffers = 1
 @};
 @};
 @end smallexample
 @end smallexample
@@ -495,9 +495,9 @@ extern void scal_opencl_func(void *buffers[], void *_args);
 static struct starpu_codelet cl = @{
 static struct starpu_codelet cl = @{
     .where = STARPU_CPU|STARPU_CUDA|STARPU_OPENCL; /* @b{It can be executed on a CPU,} */
     .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} */
                                      /* @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
     .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 = @{
 static struct starpu_codelet cl = @{
     .where = STARPU_CPU | STARPU_CUDA | STARPU_OPENCL,
     .where = STARPU_CPU | STARPU_CUDA | STARPU_OPENCL,
     /* CPU implementation of the codelet */
     /* 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
 #ifdef STARPU_USE_CUDA
     /* CUDA implementation of the codelet */
     /* CUDA implementation of the codelet */
-    .cuda_func = scal_cuda_func,
+    .cuda_funcs = @{ scal_cuda_func, NULL @},
 #endif
 #endif
 #ifdef STARPU_USE_OPENCL
 #ifdef STARPU_USE_OPENCL
     /* OpenCL implementation of the codelet */
     /* OpenCL implementation of the codelet */
-    .opencl_func = scal_opencl_func,
+    .opencl_funcs = @{ scal_opencl_func, NULL @},
 #endif
 #endif
     .nbuffers = 1
     .nbuffers = 1
 @};
 @};