Quellcode durchsuchen

OpenCL: use 'opencl kernels' instead of 'opencl codelet' to avoid confusion with starpu codelet object

Nathalie Furmento vor 14 Jahren
Ursprung
Commit
38808dce37

+ 22 - 22
doc/starpu.texi

@@ -711,14 +711,14 @@ Contrary to the previous examples, the task submitted in this example may not
 only be executed by the CPUs, but also by a CUDA device.
 
 @menu
-* Definition of the CUDA Codelet::  
-* Definition of the OpenCL Codelet::  
+* Definition of the CUDA Kernel::  
+* Definition of the OpenCL Kernel::  
 * Definition of the Main Code::  
 * Execution of Hybrid Vector Scaling::  
 @end menu
 
-@node Definition of the CUDA Codelet
-@subsection Definition of the CUDA Codelet
+@node Definition of the CUDA Kernel
+@subsection Definition of the CUDA Kernel
 
 The CUDA implementation can be written as follows. It needs to be
 compiled with a CUDA compiler such as nvcc, the NVIDIA CUDA compiler
@@ -752,11 +752,11 @@ extern "C" void scal_cuda_func(void *buffers[], void *_args)
 @end smallexample
 @end cartouche
 
-@node Definition of the OpenCL Codelet
-@subsection Definition of the OpenCL Codelet
+@node Definition of the OpenCL Kernel
+@subsection Definition of the OpenCL Kernel
 
 The OpenCL implementation can be written as follows. StarPU provides
-tools to compile a OpenCL codelet stored in a file.
+tools to compile a OpenCL kernel stored in a file.
 
 @cartouche
 @smallexample
@@ -927,7 +927,7 @@ int main(int argc, char **argv)
 
 The Makefile given at the beginning of the section must be extended to
 give the rules to compile the CUDA source code. Note that the source
-file of the OpenCL codelet does not need to be compiled now, it will
+file of the OpenCL kernel does not need to be compiled now, it will
 be compiled at run-time when calling the function
 @code{starpu_opencl_load_opencl_from_file()} (@pxref{starpu_opencl_load_opencl_from_file}).
 
@@ -3525,8 +3525,8 @@ This function synchronously deinitializes the CUBLAS library on every CUDA devic
 
 @menu
 * Enabling OpenCL::             Enabling OpenCL
-* Compiling OpenCL codelets::   Compiling OpenCL codelets
-* Loading OpenCL codelets::     Loading OpenCL codelets
+* Compiling OpenCL kernels::   Compiling OpenCL kernels
+* Loading OpenCL kernels::     Loading OpenCL kernels
 @end menu
 
 @node Enabling OpenCL
@@ -3555,10 +3555,10 @@ so:
 % STARPU_NCUDA=2 ./application
 @end example
 
-@node Compiling OpenCL codelets
-@subsection Compiling OpenCL codelets
+@node Compiling OpenCL kernels
+@subsection Compiling OpenCL kernels
 
-Source codes for OpenCL codelets can be stored in a file or in a
+Source codes for OpenCL kernels can be stored in a file or in a
 string. StarPU provides functions to build the program executable for
 each available OpenCL device as a @code{cl_program} object. This
 program executable can then be loaded within a specific queue as
@@ -3600,8 +3600,8 @@ TODO
 @code{int starpu_opencl_unload_opencl(struct starpu_opencl_program *opencl_programs);}
 @end table
 
-@node Loading OpenCL codelets
-@subsection Loading OpenCL codelets
+@node Loading OpenCL kernels
+@subsection Loading OpenCL kernels
 
 @menu
 * starpu_opencl_load_kernel::   Loading a kernel
@@ -3853,9 +3853,9 @@ static struct starpu_sched_policy_s dummy_sched_policy = @{
 
 @menu
 * Main application::            
-* CPU Codelet::                 
-* CUDA Codelet::                
-* OpenCL Codelet::              
+* CPU Kernel::                 
+* CUDA Kernel::                
+* OpenCL Kernel::              
 @end menu
 
 @node Main application
@@ -3872,15 +3872,15 @@ static struct starpu_sched_policy_s dummy_sched_policy = @{
 @include vector_scal_cpu.texi
 @end smallexample
 
-@node CUDA Codelet
-@section CUDA Codelet
+@node CUDA Kernel
+@section CUDA Kernel
 
 @smallexample
 @include vector_scal_cuda.texi
 @end smallexample
 
-@node OpenCL Codelet
-@section OpenCL Codelet
+@node OpenCL Kernel
+@section OpenCL Kernel
 
 @menu
 * Invoking the kernel::         

+ 2 - 2
doc/vector_scal_c.texi

@@ -48,7 +48,7 @@ int main(int argc, char **argv)
     starpu_init(NULL);
 
 #ifdef STARPU_USE_OPENCL
-        starpu_opencl_load_opencl_from_file("examples/basic_examples/vector_scal_opencl_codelet.cl",
+        starpu_opencl_load_opencl_from_file("examples/basic_examples/vector_scal_opencl_kernel.cl",
                                             &programs);
 #endif
 
@@ -95,7 +95,7 @@ int main(int argc, char **argv)
     starpu_data_unregister(vector_handle);
 
 #ifdef STARPU_USE_OPENCL
-        starpu_opencl_unload_opencl(&codelet);
+    starpu_opencl_unload_opencl(&programs);
 #endif
 
     /* terminate StarPU, no task can be submitted after */

+ 7 - 7
examples/Makefile.am

@@ -37,7 +37,7 @@ nobase_STARPU_OPENCL_DATA_DATA =
 endif
 
 EXTRA_DIST = 					\
-	basic_examples/vector_scal_opencl_codelet.cl \
+	basic_examples/vector_scal_opencl_kernel.cl \
 	spmv/spmv_cuda.cu			\
 	gordon/null_kernel_gordon.c		\
 	mult/xgemm.c				\
@@ -49,11 +49,11 @@ EXTRA_DIST = 					\
 	lu/xlu_implicit_pivot.c			\
 	lu/xlu_kernels.c			\
 	lu/lu_example.c				\
-	incrementer/incrementer_kernels_opencl_codelet.cl 	\
-	basic_examples/variable_kernels_opencl_codelet.cl	\
+	incrementer/incrementer_kernels_opencl_kernel.cl 	\
+	basic_examples/variable_kernels_opencl_kernel.cl	\
 	matvecmult/matvecmult_kernel.cl				\
 	basic_examples/block_opencl_kernel.cl			\
-	filters/fblock_opencl_codelet.cl
+	filters/fblock_opencl_kernel.cl
 
 CLEANFILES = 					\
 	gordon/null_kernel_gordon.spuelf	\
@@ -156,7 +156,7 @@ if STARPU_USE_OPENCL
 basic_examples_vector_scal_SOURCES +=		\
 	basic_examples/vector_scal_opencl.c
 nobase_STARPU_OPENCL_DATA_DATA += \
-	basic_examples/vector_scal_opencl_codelet.cl
+	basic_examples/vector_scal_opencl_kernel.cl
 endif
 
 if STARPU_HAVE_F77_H
@@ -228,7 +228,7 @@ if STARPU_USE_OPENCL
 basic_examples_variable_SOURCES +=		\
 	basic_examples/variable_kernels_opencl.c
 nobase_STARPU_OPENCL_DATA_DATA += 		\
-	basic_examples/variable_kernels_opencl_codelet.cl
+	basic_examples/variable_kernels_opencl_kernel.cl
 endif
 
 
@@ -256,7 +256,7 @@ if STARPU_USE_OPENCL
 filters_fblock_SOURCES +=			\
 	filters/fblock_opencl.c
 nobase_STARPU_OPENCL_DATA_DATA += \
-	filters/fblock_opencl_codelet.cl
+	filters/fblock_opencl_kernel.cl
 endif
 
 filters_fmatrix_SOURCES =			\

+ 2 - 2
examples/basic_examples/variable.c

@@ -28,7 +28,7 @@ extern void cuda_codelet(void *descr[], __attribute__ ((unused)) void *_args);
 #ifdef STARPU_USE_OPENCL
 #include <starpu_opencl.h>
 extern void opencl_codelet(void *descr[], __attribute__ ((unused)) void *_args);
-struct starpu_opencl_program opencl_code;
+struct starpu_opencl_program opencl_program;
 #endif
 
 int main(int argc, char **argv)
@@ -46,7 +46,7 @@ int main(int argc, char **argv)
                                       (uintptr_t)&foo, sizeof(float));
 
 #ifdef STARPU_USE_OPENCL
-        starpu_opencl_load_opencl_from_file("examples/basic_examples/variable_kernels_opencl_codelet.cl", &opencl_code);
+        starpu_opencl_load_opencl_from_file("examples/basic_examples/variable_kernels_opencl_kernel.cl", &opencl_program);
 #endif
 
 	cl.where = STARPU_CPU|STARPU_CUDA|STARPU_OPENCL;

+ 2 - 2
examples/basic_examples/variable_kernels_opencl.c

@@ -17,7 +17,7 @@
 #include <starpu.h>
 #include <starpu_opencl.h>
 
-extern struct starpu_opencl_program opencl_code;
+extern struct starpu_opencl_program opencl_program;
 void opencl_codelet(void *descr[], void *_args)
 {
 	float *val = (float *)STARPU_VARIABLE_GET_PTR(descr[0]);
@@ -28,7 +28,7 @@ void opencl_codelet(void *descr[], void *_args)
         id = starpu_worker_get_id();
         devid = starpu_worker_get_devid(id);
 
-	err = starpu_opencl_load_kernel(&kernel, &queue, &opencl_code, "variable", devid);
+	err = starpu_opencl_load_kernel(&kernel, &queue, &opencl_program, "variable", devid);
 	if (err != CL_SUCCESS) STARPU_OPENCL_REPORT_ERROR(err);
 
 	err = 0;

examples/basic_examples/variable_kernels_opencl_codelet.cl → examples/basic_examples/variable_kernels_opencl_kernel.cl


+ 4 - 4
examples/basic_examples/vector_scal.c

@@ -47,7 +47,7 @@ static starpu_codelet cl = {
 };
 
 #ifdef STARPU_USE_OPENCL
-struct starpu_opencl_program codelet;
+struct starpu_opencl_program opencl_program;
 #endif
 
 int main(int argc, char **argv)
@@ -65,8 +65,8 @@ int main(int argc, char **argv)
 	starpu_init(NULL);
 
 #ifdef STARPU_USE_OPENCL
-        starpu_opencl_load_opencl_from_file("examples/basic_examples/vector_scal_opencl_codelet.cl",
-					    &codelet);
+	starpu_opencl_load_opencl_from_file("examples/basic_examples/vector_scal_opencl_kernel.cl",
+					    &opencl_program);
 #endif
 
 	/* Tell StaPU to associate the "vector" vector with the "vector_handle"
@@ -112,7 +112,7 @@ int main(int argc, char **argv)
 	starpu_data_unregister(vector_handle);
 
 #ifdef STARPU_USE_OPENCL
-        starpu_opencl_unload_opencl(&codelet);
+        starpu_opencl_unload_opencl(&opencl_program);
 #endif
 
 	/* terminate StarPU, no task can be submitted after */

+ 2 - 2
examples/basic_examples/vector_scal_opencl.c

@@ -21,7 +21,7 @@
 #include <starpu.h>
 #include <starpu_opencl.h>
 
-extern struct starpu_opencl_program codelet;
+extern struct starpu_opencl_program opencl_program;
 
 void scal_opencl_func(void *buffers[], void *_args)
 {
@@ -39,7 +39,7 @@ void scal_opencl_func(void *buffers[], void *_args)
 	id = starpu_worker_get_id();
 	devid = starpu_worker_get_devid(id);
 
-	err = starpu_opencl_load_kernel(&kernel, &queue, &codelet, "vector_mult_opencl", devid);
+	err = starpu_opencl_load_kernel(&kernel, &queue, &opencl_program, "vector_mult_opencl", devid);
 	if (err != CL_SUCCESS) STARPU_OPENCL_REPORT_ERROR(err);
 
 	err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &val);

examples/basic_examples/vector_scal_opencl_codelet.cl → examples/basic_examples/vector_scal_opencl_kernel.cl


+ 2 - 2
examples/filters/fblock.c

@@ -61,7 +61,7 @@ void print_data(starpu_data_handle block_handle)
 }
 
 #ifdef STARPU_USE_OPENCL
-struct starpu_opencl_program codelet;
+struct starpu_opencl_program opencl_program;
 #endif
 
 int main(int argc, char **argv)
@@ -95,7 +95,7 @@ int main(int argc, char **argv)
         starpu_init(NULL);
 
 #ifdef STARPU_USE_OPENCL
-        starpu_opencl_load_opencl_from_file("examples/filters/fblock_opencl_codelet.cl", &codelet);
+        starpu_opencl_load_opencl_from_file("examples/filters/fblock_opencl_kernel.cl", &opencl_program);
 #endif
 
         /* Declare data to StarPU */

+ 2 - 2
examples/filters/fblock_opencl.c

@@ -17,7 +17,7 @@
 #include <starpu.h>
 #include <starpu_opencl.h>
 
-extern struct starpu_opencl_program codelet;
+extern struct starpu_opencl_program opencl_program;
 
 void opencl_func(void *buffers[], void *cl_arg)
 {
@@ -36,7 +36,7 @@ void opencl_func(void *buffers[], void *cl_arg)
 	id = starpu_worker_get_id();
 	devid = starpu_worker_get_devid(id);
 
-	err = starpu_opencl_load_kernel(&kernel, &queue, &codelet, "fblock_opencl", devid);
+	err = starpu_opencl_load_kernel(&kernel, &queue, &opencl_program, "fblock_opencl", devid);
 	if (err != CL_SUCCESS) STARPU_OPENCL_REPORT_ERROR(err);
 
 	err = 0;

examples/filters/fblock_opencl_codelet.cl → examples/filters/fblock_opencl_kernel.cl