Pārlūkot izejas kodu

reorganise examples directory

Nathalie Furmento 14 gadi atpakaļ
vecāks
revīzija
15e2dafe6c

+ 2 - 3
doc/starpu.texi

@@ -2811,13 +2811,12 @@ directory. Simple examples include:
 @item @code{basic_examples/}:
         Simple documented Hello world (as shown in @ref{Hello World}), vector/scalar product (as shown
         in @ref{Vector Scaling on an Hybrid CPU/GPU Machine}), matrix
-        product examples.
+        product examples, an example using the blocked matrix data
+        interface, and an example using the variable data interface.
 @item @code{matvecmult/}:
 	OpenCL example from NVidia, adapted to StarPU.
 @item @code{axpy/}:
 	AXPY CUBLAS operation adapted to StarPU.
-@item @code{block/}:
-	Example using the blocked matrix data interface.
 @item @code{fortran/}:
 	Example of Fortran bindings.
 @end table

+ 54 - 55
examples/Makefile.am

@@ -43,9 +43,9 @@ EXTRA_DIST = 					\
 	lu/xlu_kernels.c			\
 	lu/lu_example.c				\
 	incrementer/incrementer_kernels_opencl_codelet.cl 	\
-	variable/variable_kernels_opencl_codelet.cl		\
+	basic_examples/variable_kernels_opencl_codelet.cl	\
 	matvecmult/matvecmult_kernel.cl				\
-	block/block_opencl_kernel.cl					\
+	basic_examples/block_opencl_kernel.cl			\
 	filters/fblock_opencl_codelet.cl
 
 CLEANFILES = 					\
@@ -159,6 +159,58 @@ examplebin_PROGRAMS +=				\
 basic_examples_mult_SOURCES =			\
 	basic_examples/mult.c
 
+#################
+# block example #
+#################
+
+check_PROGRAMS +=				\
+	basic_examples/block
+
+examplebin_PROGRAMS +=				\
+	basic_examples/block
+
+basic_examples_block_SOURCES =			\
+	basic_examples/block.c			\
+	basic_examples/block_cpu.c
+
+if STARPU_USE_CUDA
+basic_examples_block_SOURCES +=			\
+	basic_examples/block_cuda.cu
+endif
+
+if STARPU_USE_OPENCL
+basic_examples_block_SOURCES +=			\
+	basic_examples/block_opencl.c
+nobase_STARPU_OPENCL_DATA_DATA += 		\
+	basic_examples/block_opencl_kernel.cl
+endif
+
+####################
+# Variable example #
+####################
+
+check_PROGRAMS +=				\
+	basic_examples/variable
+
+examplebin_PROGRAMS +=				\
+	basic_examples/variable
+
+basic_examples_variable_SOURCES =		\
+	basic_examples/variable.c		\
+	basic_examples/variable_kernels_cpu.c
+
+if STARPU_USE_CUDA
+basic_examples_variable_SOURCES +=		\
+	basic_examples/variable_kernels.cu
+endif
+if STARPU_USE_OPENCL
+basic_examples_variable_SOURCES +=		\
+	basic_examples/variable_kernels_opencl.c
+endif
+
+nobase_STARPU_OPENCL_DATA_DATA += 		\
+	basic_examples/variable_kernels_opencl_codelet.cl
+
 ###########
 # Filters #
 ###########
@@ -457,33 +509,6 @@ endif
 nobase_STARPU_OPENCL_DATA_DATA += \
 	incrementer/incrementer_kernels_opencl_codelet.cl
 
-####################
-# Variable example #
-####################
-
-check_PROGRAMS +=				\
-	variable/variable
-
-examplebin_PROGRAMS +=				\
-	variable/variable
-
-variable_variable_SOURCES =			\
-	variable/variable.c			\
-	variable/variable_kernels_cpu.c
-
-if STARPU_USE_CUDA
-variable_variable_SOURCES +=			\
-	variable/variable_kernels.cu
-endif
-if STARPU_USE_OPENCL
-variable_variable_SOURCES +=			\
-	variable/variable_kernels_opencl.c
-endif
-
-nobase_STARPU_OPENCL_DATA_DATA += 		\
-	variable/variable_kernels_opencl_codelet.cl
-
-
 ######################
 # matVecMult example #
 ######################
@@ -502,32 +527,6 @@ nobase_STARPU_OPENCL_DATA_DATA += \
 	matvecmult/matvecmult_kernel.cl
 endif
 
-#################
-# block example #
-#################
-
-check_PROGRAMS +=				\
-	block/block
-
-examplebin_PROGRAMS +=				\
-	block/block
-
-block_block_SOURCES =				\
-	block/block.c				\
-	block/block_cpu.c
-
-if STARPU_USE_CUDA
-block_block_SOURCES +=				\
-	block/block_cuda.cu
-endif
-
-if STARPU_USE_OPENCL
-block_block_SOURCES +=				\
-	block/block_opencl.c
-nobase_STARPU_OPENCL_DATA_DATA += 		\
-	block/block_opencl_kernel.cl
-endif
-
 #####################
 # profiling example #
 #####################

+ 1 - 1
examples/block/block.c

@@ -92,7 +92,7 @@ int main(int argc, char **argv)
         ret = execute_on(STARPU_CPU, cpu_codelet, block, nx, ny, nz, 1.0);
         if (!ret) multiplier *= 1.0;
 #ifdef STARPU_USE_OPENCL
-        starpu_opencl_load_opencl_from_file("examples/block/block_opencl_kernel.cl", &opencl_code);
+        starpu_opencl_load_opencl_from_file("examples/basic_examples/block_opencl_kernel.cl", &opencl_code);
         ret = execute_on(STARPU_OPENCL, opencl_codelet, block, nx, ny, nz, 2.0);
         if (!ret) multiplier *= 2.0;
 #endif

examples/block/block_cpu.c → examples/basic_examples/block_cpu.c


examples/block/block_cuda.cu → examples/basic_examples/block_cuda.cu


examples/block/block_opencl.c → examples/basic_examples/block_opencl.c


examples/block/block_opencl_kernel.cl → examples/basic_examples/block_opencl_kernel.cl


+ 1 - 1
examples/variable/variable.c

@@ -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/variable/variable_kernels_opencl_codelet.cl", &opencl_code);
+        starpu_opencl_load_opencl_from_file("examples/basic_examples/variable_kernels_opencl_codelet.cl", &opencl_code);
 #endif
 
 	cl.where = STARPU_CPU|STARPU_CUDA|STARPU_OPENCL;

examples/variable/variable_kernels.cu → examples/basic_examples/variable_kernels.cu


examples/variable/variable_kernels_cpu.c → examples/basic_examples/variable_kernels_cpu.c


examples/variable/variable_kernels_opencl.c → examples/basic_examples/variable_kernels_opencl.c


examples/variable/variable_kernels_opencl_codelet.cl → examples/basic_examples/variable_kernels_opencl_codelet.cl