Browse Source

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

Nathalie Furmento 14 years ago
parent
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.
 only be executed by the CPUs, but also by a CUDA device.
 
 
 @menu
 @menu
-* Definition of the CUDA Codelet::  
+* Definition of the CUDA Kernel::  
-* Definition of the OpenCL Codelet::  
+* Definition of the OpenCL Kernel::  
 * Definition of the Main Code::  
 * Definition of the Main Code::  
 * Execution of Hybrid Vector Scaling::  
 * Execution of Hybrid Vector Scaling::  
 @end menu
 @end menu
 
 
-@node Definition of the CUDA Codelet
+@node Definition of the CUDA Kernel
-@subsection Definition of the CUDA Codelet
+@subsection Definition of the CUDA Kernel
 
 
 The CUDA implementation can be written as follows. It needs to be
 The CUDA implementation can be written as follows. It needs to be
 compiled with a CUDA compiler such as nvcc, the NVIDIA CUDA compiler
 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 smallexample
 @end cartouche
 @end cartouche
 
 
-@node Definition of the OpenCL Codelet
+@node Definition of the OpenCL Kernel
-@subsection Definition of the OpenCL Codelet
+@subsection Definition of the OpenCL Kernel
 
 
 The OpenCL implementation can be written as follows. StarPU provides
 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
 @cartouche
 @smallexample
 @smallexample
@@ -927,7 +927,7 @@ int main(int argc, char **argv)
 
 
 The Makefile given at the beginning of the section must be extended to
 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
 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
 be compiled at run-time when calling the function
 @code{starpu_opencl_load_opencl_from_file()} (@pxref{starpu_opencl_load_opencl_from_file}).
 @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
 @menu
 * Enabling OpenCL::             Enabling OpenCL
 * Enabling OpenCL::             Enabling OpenCL
-* Compiling OpenCL codelets::   Compiling OpenCL codelets
+* Compiling OpenCL kernels::   Compiling OpenCL kernels
-* Loading OpenCL codelets::     Loading OpenCL codelets
+* Loading OpenCL kernels::     Loading OpenCL kernels
 @end menu
 @end menu
 
 
 @node Enabling OpenCL
 @node Enabling OpenCL
@@ -3555,10 +3555,10 @@ so:
 % STARPU_NCUDA=2 ./application
 % STARPU_NCUDA=2 ./application
 @end example
 @end example
 
 
-@node Compiling OpenCL codelets
+@node Compiling OpenCL kernels
-@subsection Compiling OpenCL codelets
+@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
 string. StarPU provides functions to build the program executable for
 each available OpenCL device as a @code{cl_program} object. This
 each available OpenCL device as a @code{cl_program} object. This
 program executable can then be loaded within a specific queue as
 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);}
 @code{int starpu_opencl_unload_opencl(struct starpu_opencl_program *opencl_programs);}
 @end table
 @end table
 
 
-@node Loading OpenCL codelets
+@node Loading OpenCL kernels
-@subsection Loading OpenCL codelets
+@subsection Loading OpenCL kernels
 
 
 @menu
 @menu
 * starpu_opencl_load_kernel::   Loading a kernel
 * starpu_opencl_load_kernel::   Loading a kernel
@@ -3853,9 +3853,9 @@ static struct starpu_sched_policy_s dummy_sched_policy = @{
 
 
 @menu
 @menu
 * Main application::            
 * Main application::            
-* CPU Codelet::                 
+* CPU Kernel::                 
-* CUDA Codelet::                
+* CUDA Kernel::                
-* OpenCL Codelet::              
+* OpenCL Kernel::              
 @end menu
 @end menu
 
 
 @node Main application
 @node Main application
@@ -3872,15 +3872,15 @@ static struct starpu_sched_policy_s dummy_sched_policy = @{
 @include vector_scal_cpu.texi
 @include vector_scal_cpu.texi
 @end smallexample
 @end smallexample
 
 
-@node CUDA Codelet
+@node CUDA Kernel
-@section CUDA Codelet
+@section CUDA Kernel
 
 
 @smallexample
 @smallexample
 @include vector_scal_cuda.texi
 @include vector_scal_cuda.texi
 @end smallexample
 @end smallexample
 
 
-@node OpenCL Codelet
+@node OpenCL Kernel
-@section OpenCL Codelet
+@section OpenCL Kernel
 
 
 @menu
 @menu
 * Invoking the kernel::         
 * Invoking the kernel::         

+ 2 - 2
doc/vector_scal_c.texi

@@ -48,7 +48,7 @@ int main(int argc, char **argv)
     starpu_init(NULL);
     starpu_init(NULL);
 
 
 #ifdef STARPU_USE_OPENCL
 #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);
                                             &programs);
 #endif
 #endif
 
 
@@ -95,7 +95,7 @@ int main(int argc, char **argv)
     starpu_data_unregister(vector_handle);
     starpu_data_unregister(vector_handle);
 
 
 #ifdef STARPU_USE_OPENCL
 #ifdef STARPU_USE_OPENCL
-        starpu_opencl_unload_opencl(&codelet);
+    starpu_opencl_unload_opencl(&programs);
 #endif
 #endif
 
 
     /* terminate StarPU, no task can be submitted after */
     /* terminate StarPU, no task can be submitted after */

+ 7 - 7
examples/Makefile.am

@@ -37,7 +37,7 @@ nobase_STARPU_OPENCL_DATA_DATA =
 endif
 endif
 
 
 EXTRA_DIST = 					\
 EXTRA_DIST = 					\
-	basic_examples/vector_scal_opencl_codelet.cl \
+	basic_examples/vector_scal_opencl_kernel.cl \
 	spmv/spmv_cuda.cu			\
 	spmv/spmv_cuda.cu			\
 	gordon/null_kernel_gordon.c		\
 	gordon/null_kernel_gordon.c		\
 	mult/xgemm.c				\
 	mult/xgemm.c				\
@@ -49,11 +49,11 @@ EXTRA_DIST = 					\
 	lu/xlu_implicit_pivot.c			\
 	lu/xlu_implicit_pivot.c			\
 	lu/xlu_kernels.c			\
 	lu/xlu_kernels.c			\
 	lu/lu_example.c				\
 	lu/lu_example.c				\
-	incrementer/incrementer_kernels_opencl_codelet.cl 	\
+	incrementer/incrementer_kernels_opencl_kernel.cl 	\
-	basic_examples/variable_kernels_opencl_codelet.cl	\
+	basic_examples/variable_kernels_opencl_kernel.cl	\
 	matvecmult/matvecmult_kernel.cl				\
 	matvecmult/matvecmult_kernel.cl				\
 	basic_examples/block_opencl_kernel.cl			\
 	basic_examples/block_opencl_kernel.cl			\
-	filters/fblock_opencl_codelet.cl
+	filters/fblock_opencl_kernel.cl
 
 
 CLEANFILES = 					\
 CLEANFILES = 					\
 	gordon/null_kernel_gordon.spuelf	\
 	gordon/null_kernel_gordon.spuelf	\
@@ -156,7 +156,7 @@ if STARPU_USE_OPENCL
 basic_examples_vector_scal_SOURCES +=		\
 basic_examples_vector_scal_SOURCES +=		\
 	basic_examples/vector_scal_opencl.c
 	basic_examples/vector_scal_opencl.c
 nobase_STARPU_OPENCL_DATA_DATA += \
 nobase_STARPU_OPENCL_DATA_DATA += \
-	basic_examples/vector_scal_opencl_codelet.cl
+	basic_examples/vector_scal_opencl_kernel.cl
 endif
 endif
 
 
 if STARPU_HAVE_F77_H
 if STARPU_HAVE_F77_H
@@ -228,7 +228,7 @@ if STARPU_USE_OPENCL
 basic_examples_variable_SOURCES +=		\
 basic_examples_variable_SOURCES +=		\
 	basic_examples/variable_kernels_opencl.c
 	basic_examples/variable_kernels_opencl.c
 nobase_STARPU_OPENCL_DATA_DATA += 		\
 nobase_STARPU_OPENCL_DATA_DATA += 		\
-	basic_examples/variable_kernels_opencl_codelet.cl
+	basic_examples/variable_kernels_opencl_kernel.cl
 endif
 endif
 
 
 
 
@@ -256,7 +256,7 @@ if STARPU_USE_OPENCL
 filters_fblock_SOURCES +=			\
 filters_fblock_SOURCES +=			\
 	filters/fblock_opencl.c
 	filters/fblock_opencl.c
 nobase_STARPU_OPENCL_DATA_DATA += \
 nobase_STARPU_OPENCL_DATA_DATA += \
-	filters/fblock_opencl_codelet.cl
+	filters/fblock_opencl_kernel.cl
 endif
 endif
 
 
 filters_fmatrix_SOURCES =			\
 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
 #ifdef STARPU_USE_OPENCL
 #include <starpu_opencl.h>
 #include <starpu_opencl.h>
 extern void opencl_codelet(void *descr[], __attribute__ ((unused)) void *_args);
 extern void opencl_codelet(void *descr[], __attribute__ ((unused)) void *_args);
-struct starpu_opencl_program opencl_code;
+struct starpu_opencl_program opencl_program;
 #endif
 #endif
 
 
 int main(int argc, char **argv)
 int main(int argc, char **argv)
@@ -46,7 +46,7 @@ int main(int argc, char **argv)
                                       (uintptr_t)&foo, sizeof(float));
                                       (uintptr_t)&foo, sizeof(float));
 
 
 #ifdef STARPU_USE_OPENCL
 #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
 #endif
 
 
 	cl.where = STARPU_CPU|STARPU_CUDA|STARPU_OPENCL;
 	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.h>
 #include <starpu_opencl.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)
 void opencl_codelet(void *descr[], void *_args)
 {
 {
 	float *val = (float *)STARPU_VARIABLE_GET_PTR(descr[0]);
 	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();
         id = starpu_worker_get_id();
         devid = starpu_worker_get_devid(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);
 	if (err != CL_SUCCESS) STARPU_OPENCL_REPORT_ERROR(err);
 
 
 	err = 0;
 	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
 #ifdef STARPU_USE_OPENCL
-struct starpu_opencl_program codelet;
+struct starpu_opencl_program opencl_program;
 #endif
 #endif
 
 
 int main(int argc, char **argv)
 int main(int argc, char **argv)
@@ -65,8 +65,8 @@ int main(int argc, char **argv)
 	starpu_init(NULL);
 	starpu_init(NULL);
 
 
 #ifdef STARPU_USE_OPENCL
 #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",
-					    &codelet);
+					    &opencl_program);
 #endif
 #endif
 
 
 	/* Tell StaPU to associate the "vector" vector with the "vector_handle"
 	/* 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);
 	starpu_data_unregister(vector_handle);
 
 
 #ifdef STARPU_USE_OPENCL
 #ifdef STARPU_USE_OPENCL
-        starpu_opencl_unload_opencl(&codelet);
+        starpu_opencl_unload_opencl(&opencl_program);
 #endif
 #endif
 
 
 	/* terminate StarPU, no task can be submitted after */
 	/* 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.h>
 #include <starpu_opencl.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)
 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();
 	id = starpu_worker_get_id();
 	devid = starpu_worker_get_devid(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);
 	if (err != CL_SUCCESS) STARPU_OPENCL_REPORT_ERROR(err);
 
 
 	err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &val);
 	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
 #ifdef STARPU_USE_OPENCL
-struct starpu_opencl_program codelet;
+struct starpu_opencl_program opencl_program;
 #endif
 #endif
 
 
 int main(int argc, char **argv)
 int main(int argc, char **argv)
@@ -95,7 +95,7 @@ int main(int argc, char **argv)
         starpu_init(NULL);
         starpu_init(NULL);
 
 
 #ifdef STARPU_USE_OPENCL
 #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
 #endif
 
 
         /* Declare data to StarPU */
         /* Declare data to StarPU */

+ 2 - 2
examples/filters/fblock_opencl.c

@@ -17,7 +17,7 @@
 #include <starpu.h>
 #include <starpu.h>
 #include <starpu_opencl.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)
 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();
 	id = starpu_worker_get_id();
 	devid = starpu_worker_get_devid(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);
 	if (err != CL_SUCCESS) STARPU_OPENCL_REPORT_ERROR(err);
 
 
 	err = 0;
 	err = 0;

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