advanced-examples.texi 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565
  1. @c -*-texinfo-*-
  2. @c This file is part of the StarPU Handbook.
  3. @c Copyright (C) 2009--2011 Universit@'e de Bordeaux 1
  4. @c Copyright (C) 2010, 2011 Centre National de la Recherche Scientifique
  5. @c Copyright (C) 2011 Institut National de Recherche en Informatique et Automatique
  6. @c See the file starpu.texi for copying conditions.
  7. @node Advanced Examples
  8. @chapter Advanced Examples
  9. @menu
  10. * Using multiple implementations of a codelet::
  11. * Enabling implementation according to capabilities::
  12. * Task and Worker Profiling::
  13. * Partitioning Data:: Partitioning Data
  14. * Performance model example::
  15. * Theoretical lower bound on execution time::
  16. * Insert Task Utility::
  17. * More examples:: More examples shipped with StarPU
  18. * Debugging:: When things go wrong.
  19. @end menu
  20. @node Using multiple implementations of a codelet
  21. @section Using multiple implementations of a codelet
  22. One may want to write multiple implementations of a codelet for a single type of
  23. device and let StarPU choose which one to run. As an example, we will show how
  24. to use SSE to scale a vector. The codelet can be written as follows :
  25. @cartouche
  26. @smallexample
  27. #include <xmmintrin.h>
  28. void scal_sse_func(void *buffers[], void *cl_arg)
  29. @{
  30. float *vector = (float *) STARPU_VECTOR_GET_PTR(buffers[0]);
  31. unsigned int n = STARPU_VECTOR_GET_NX(buffers[0]);
  32. unsigned int n_iterations = n/4;
  33. if (n % 4 != 0)
  34. n_iterations++;
  35. __m128 *VECTOR = (__m128*) vector;
  36. __m128 factor __attribute__((aligned(16)));
  37. factor = _mm_set1_ps(*(float *) cl_arg);
  38. unsigned int i;
  39. for (i = 0; i < n_iterations; i++)
  40. VECTOR[i] = _mm_mul_ps(factor, VECTOR[i]);
  41. @}
  42. @end smallexample
  43. @end cartouche
  44. The @code{cpu_func} field of the @code{struct starpu_codelet} structure has to be set
  45. to the special value @code{STARPU_MULTIPLE_CPU_IMPLEMENTATIONS}. Note that
  46. @code{STARPU_MULTIPLE_CUDA_IMPLEMENTATIONS} and
  47. @code{STARPU_MULTIPLE_OPENCL_IMPLEMENTATIONS} are also available.
  48. @cartouche
  49. @smallexample
  50. struct starpu_codelet cl = @{
  51. .where = STARPU_CPU,
  52. .cpu_func = STARPU_MULTIPLE_CPU_IMPLEMENTATIONS,
  53. .cpu_funcs = @{ scal_cpu_func, scal_sse_func @},
  54. .nbuffers = 1
  55. @};
  56. @end smallexample
  57. @end cartouche
  58. Scheduler which are multi-implementation aware (only @code{dmda}, @code{heft}
  59. and @code{pheft} for now) will use the performance models of all the
  60. implementations it was given, and pick the one that seems to be the fastest.
  61. @node Enabling implementation according to capabilities
  62. @section Enabling implementation according to capabilities
  63. Some implementations may not run on some devices. For instance, some GPU
  64. devices do not support double floating point precision, and thus the kernel
  65. execution would just fail; or the GPU may not have enough shared memory for
  66. the implementation being used. The @code{can_execute} field of the @code{struct
  67. starpu_codelet} structure permits to express this. For instance:
  68. @cartouche
  69. @smallexample
  70. static int can_execute(unsigned workerid, struct starpu_task *task, unsigned nimpl)
  71. @{
  72. const struct cudaDeviceProp *props;
  73. if (starpu_worker_get_type(workerid) == STARPU_CPU_WORKER)
  74. return 1;
  75. /* Cuda device */
  76. props = starpu_cuda_get_device_properties(workerid);
  77. if (props->major >= 2 || props->minor >= 3)
  78. /* At least compute capability 1.3, supports doubles */
  79. return 1;
  80. /* Old card, does not support doubles */
  81. return 0;
  82. @}
  83. struct starpu_codelet cl = @{
  84. .where = STARPU_CPU|STARPU_GPU,
  85. .can_execute = can_execute,
  86. .cpu_func = cpu_func,
  87. .gpu_func = gpu_func
  88. .nbuffers = 1
  89. @};
  90. @end smallexample
  91. @end cartouche
  92. This can be essential e.g. when running on a machine which mixes various models
  93. of GPUs, to take benefit from the new models without crashing on old models.
  94. Note: the @code{can_execute} function is called by the scheduler each time it
  95. tries to match a task with a worker, and should thus be very fast. The
  96. @code{starpu_cuda_get_device_properties} provides a quick access to CUDA
  97. properties of CUDA devices to achieve such efficiency.
  98. Another example is compiling CUDA code for various compute capabilities,
  99. resulting with two GPU functions, e.g. @code{scal_gpu_13} for compute capability
  100. 1.3, and @code{scal_gpu_20} for compute capability 2.0. Both functions can be
  101. provided to StarPU by using @code{gpu_funcs}, and @code{can_execute} can then be
  102. used to rule out the @code{scal_gpu_20} variant on GPU which will not be able to
  103. execute it:
  104. @cartouche
  105. @smallexample
  106. static int can_execute(unsigned workerid, struct starpu_task *task, unsigned nimpl)
  107. @{
  108. const struct cudaDeviceProp *props;
  109. if (starpu_worker_get_type(workerid) == STARPU_CPU_WORKER)
  110. return 1;
  111. /* Cuda device */
  112. if (nimpl == 0)
  113. /* Trying to execute the 1.3 capability variant, we assume it is ok in all cases. */
  114. return 1;
  115. /* Trying to execute the 2.0 capability variant, check that the card can do it. */
  116. props = starpu_cuda_get_device_properties(workerid);
  117. if (props->major >= 2 || props->minor >= 0)
  118. /* At least compute capability 2.0, can run it */
  119. return 1;
  120. /* Old card, does not support 2.0, will not be able to execute the 2.0 variant. */
  121. return 0;
  122. @}
  123. struct starpu_codelet cl = @{
  124. .where = STARPU_CPU|STARPU_GPU,
  125. .can_execute = can_execute,
  126. .cpu_func = cpu_func,
  127. .gpu_func = STARPU_MULTIPLE_GPU_IMPLEMENTATIONS,
  128. .gpu_funcs = @{ scal_gpu_13, scal_gpu_20 @},
  129. .nbuffers = 1
  130. @};
  131. @end smallexample
  132. @end cartouche
  133. Note: the most generic variant should be provided first, as some schedulers are
  134. not able to try the different variants.
  135. @node Task and Worker Profiling
  136. @section Task and Worker Profiling
  137. A full example showing how to use the profiling API is available in
  138. the StarPU sources in the directory @code{examples/profiling/}.
  139. @cartouche
  140. @smallexample
  141. struct starpu_task *task = starpu_task_create();
  142. task->cl = &cl;
  143. task->synchronous = 1;
  144. /* We will destroy the task structure by hand so that we can
  145. * query the profiling info before the task is destroyed. */
  146. task->destroy = 0;
  147. /* Submit and wait for completion (since synchronous was set to 1) */
  148. starpu_task_submit(task);
  149. /* The task is finished, get profiling information */
  150. struct starpu_task_profiling_info *info = task->profiling_info;
  151. /* How much time did it take before the task started ? */
  152. double delay += starpu_timing_timespec_delay_us(&info->submit_time, &info->start_time);
  153. /* How long was the task execution ? */
  154. double length += starpu_timing_timespec_delay_us(&info->start_time, &info->end_time);
  155. /* We don't need the task structure anymore */
  156. starpu_task_destroy(task);
  157. @end smallexample
  158. @end cartouche
  159. @cartouche
  160. @smallexample
  161. /* Display the occupancy of all workers during the test */
  162. int worker;
  163. for (worker = 0; worker < starpu_worker_get_count(); worker++)
  164. @{
  165. struct starpu_worker_profiling_info worker_info;
  166. int ret = starpu_worker_get_profiling_info(worker, &worker_info);
  167. STARPU_ASSERT(!ret);
  168. double total_time = starpu_timing_timespec_to_us(&worker_info.total_time);
  169. double executing_time = starpu_timing_timespec_to_us(&worker_info.executing_time);
  170. double sleeping_time = starpu_timing_timespec_to_us(&worker_info.sleeping_time);
  171. float executing_ratio = 100.0*executing_time/total_time;
  172. float sleeping_ratio = 100.0*sleeping_time/total_time;
  173. char workername[128];
  174. starpu_worker_get_name(worker, workername, 128);
  175. fprintf(stderr, "Worker %s:\n", workername);
  176. fprintf(stderr, "\ttotal time : %.2lf ms\n", total_time*1e-3);
  177. fprintf(stderr, "\texec time : %.2lf ms (%.2f %%)\n", executing_time*1e-3,
  178. executing_ratio);
  179. fprintf(stderr, "\tblocked time : %.2lf ms (%.2f %%)\n", sleeping_time*1e-3,
  180. sleeping_ratio);
  181. @}
  182. @end smallexample
  183. @end cartouche
  184. @node Partitioning Data
  185. @section Partitioning Data
  186. An existing piece of data can be partitioned in sub parts to be used by different tasks, for instance:
  187. @cartouche
  188. @smallexample
  189. int vector[NX];
  190. starpu_data_handle_t handle;
  191. /* Declare data to StarPU */
  192. starpu_vector_data_register(&handle, 0, (uintptr_t)vector, NX, sizeof(vector[0]));
  193. /* Partition the vector in PARTS sub-vectors */
  194. starpu_filter f =
  195. @{
  196. .filter_func = starpu_block_filter_func_vector,
  197. .nchildren = PARTS
  198. @};
  199. starpu_data_partition(handle, &f);
  200. @end smallexample
  201. @end cartouche
  202. @cartouche
  203. @smallexample
  204. /* Submit a task on each sub-vector */
  205. for (i=0; i<starpu_data_get_nb_children(handle); i++) @{
  206. /* Get subdata number i (there is only 1 dimension) */
  207. starpu_data_handle_t sub_handle = starpu_data_get_sub_data(handle, 1, i);
  208. struct starpu_task *task = starpu_task_create();
  209. task->buffers[0].handle = sub_handle;
  210. task->buffers[0].mode = STARPU_RW;
  211. task->cl = &cl;
  212. task->synchronous = 1;
  213. task->cl_arg = &factor;
  214. task->cl_arg_size = sizeof(factor);
  215. starpu_task_submit(task);
  216. @}
  217. @end smallexample
  218. @end cartouche
  219. Partitioning can be applied several times, see
  220. @code{examples/basic_examples/mult.c} and @code{examples/filters/}.
  221. @node Performance model example
  222. @section Performance model example
  223. To achieve good scheduling, StarPU scheduling policies need to be able to
  224. estimate in advance the duration of a task. This is done by giving to codelets
  225. a performance model, by defining a @code{starpu_perfmodel} structure and
  226. providing its address in the @code{model} field of the @code{struct starpu_codelet}
  227. structure. The @code{symbol} and @code{type} fields of @code{starpu_perfmodel}
  228. are mandatory, to give a name to the model, and the type of the model, since
  229. there are several kinds of performance models.
  230. @itemize
  231. @item
  232. Measured at runtime (@code{STARPU_HISTORY_BASED} model type). This assumes that for a
  233. given set of data input/output sizes, the performance will always be about the
  234. same. This is very true for regular kernels on GPUs for instance (<0.1% error),
  235. and just a bit less true on CPUs (~=1% error). This also assumes that there are
  236. few different sets of data input/output sizes. StarPU will then keep record of
  237. the average time of previous executions on the various processing units, and use
  238. it as an estimation. History is done per task size, by using a hash of the input
  239. and ouput sizes as an index.
  240. It will also save it in @code{~/.starpu/sampling/codelets}
  241. for further executions, and can be observed by using the
  242. @code{starpu_perfmodel_display} command, or drawn by using
  243. the @code{starpu_perfmodel_plot}. The models are indexed by machine name. To
  244. share the models between machines (e.g. for a homogeneous cluster), use
  245. @code{export STARPU_HOSTNAME=some_global_name}. Measurements are only done when using a task scheduler which makes use of it, such as @code{heft} or @code{dmda}.
  246. The following is a small code example.
  247. If e.g. the code is recompiled with other compilation options, or several
  248. variants of the code are used, the symbol string should be changed to reflect
  249. that, in order to recalibrate a new model from zero. The symbol string can even
  250. be constructed dynamically at execution time, as long as this is done before
  251. submitting any task using it.
  252. @cartouche
  253. @smallexample
  254. static struct starpu_perfmodel mult_perf_model = @{
  255. .type = STARPU_HISTORY_BASED,
  256. .symbol = "mult_perf_model"
  257. @};
  258. struct starpu_codelet cl = @{
  259. .where = STARPU_CPU,
  260. .cpu_func = cpu_mult,
  261. .nbuffers = 3,
  262. /* for the scheduling policy to be able to use performance models */
  263. .model = &mult_perf_model
  264. @};
  265. @end smallexample
  266. @end cartouche
  267. @item
  268. Measured at runtime and refined by regression (@code{STARPU_REGRESSION_*_BASED}
  269. model type). This still assumes performance regularity, but can work
  270. with various data input sizes, by applying regression over observed
  271. execution times. STARPU_REGRESSION_BASED uses an a*n^b regression
  272. form, STARPU_NL_REGRESSION_BASED uses an a*n^b+c (more precise than
  273. STARPU_REGRESSION_BASED, but costs a lot more to compute). For instance,
  274. @code{tests/perfmodels/regression_based.c} uses a regression-based performance
  275. model for the @code{memset} operation. Of course, the application has to issue
  276. tasks with varying size so that the regression can be computed. StarPU will not
  277. trust the regression unless there is at least 10% difference between the minimum
  278. and maximum observed input size. For non-linear regression, since computing it
  279. is quite expensive, it is only done at termination of the application. This
  280. means that the first execution uses history-based performance model to perform
  281. scheduling.
  282. @item
  283. Provided as an estimation from the application itself (@code{STARPU_COMMON} model type and @code{cost_model} field),
  284. see for instance
  285. @code{examples/common/blas_model.h} and @code{examples/common/blas_model.c}.
  286. @item
  287. Provided explicitly by the application (@code{STARPU_PER_ARCH} model type): the
  288. @code{.per_arch[i].cost_model} fields have to be filled with pointers to
  289. functions which return the expected duration of the task in micro-seconds, one
  290. per architecture.
  291. @end itemize
  292. How to use schedulers which can benefit from such performance model is explained
  293. in @ref{Task scheduling policy}.
  294. The same can be done for task power consumption estimation, by setting the
  295. @code{power_model} field the same way as the @code{model} field. Note: for
  296. now, the application has to give to the power consumption performance model
  297. a name which is different from the execution time performance model.
  298. The application can request time estimations from the StarPU performance
  299. models by filling a task structure as usual without actually submitting
  300. it. The data handles can be created by calling @code{starpu_data_register}
  301. functions with a @code{NULL} pointer (and need to be unregistered as usual)
  302. and the desired data sizes. The @code{starpu_task_expected_length} and
  303. @code{starpu_task_expected_power} functions can then be called to get an
  304. estimation of the task duration on a given arch. @code{starpu_task_destroy}
  305. needs to be called to destroy the dummy task afterwards. See
  306. @code{tests/perfmodels/regression_based.c} for an example.
  307. @node Theoretical lower bound on execution time
  308. @section Theoretical lower bound on execution time
  309. For kernels with history-based performance models, StarPU can very easily provide a theoretical lower
  310. bound for the execution time of a whole set of tasks. See for
  311. instance @code{examples/lu/lu_example.c}: before submitting tasks,
  312. call @code{starpu_bound_start}, and after complete execution, call
  313. @code{starpu_bound_stop}. @code{starpu_bound_print_lp} or
  314. @code{starpu_bound_print_mps} can then be used to output a Linear Programming
  315. problem corresponding to the schedule of your tasks. Run it through
  316. @code{lp_solve} or any other linear programming solver, and that will give you a
  317. lower bound for the total execution time of your tasks. If StarPU was compiled
  318. with the glpk library installed, @code{starpu_bound_compute} can be used to
  319. solve it immediately and get the optimized minimum, in ms. Its @code{integer}
  320. parameter allows to decide whether integer resolution should be computed
  321. and returned too.
  322. The @code{deps} parameter tells StarPU whether to take tasks and implicit data
  323. dependencies into account. It must be understood that the linear programming
  324. problem size is quadratic with the number of tasks and thus the time to solve it
  325. will be very long, it could be minutes for just a few dozen tasks. You should
  326. probably use @code{lp_solve -timeout 1 test.pl -wmps test.mps} to convert the
  327. problem to MPS format and then use a better solver, @code{glpsol} might be
  328. better than @code{lp_solve} for instance (the @code{--pcost} option may be
  329. useful), but sometimes doesn't manage to converge. @code{cbc} might look
  330. slower, but it is parallel. Be sure to try at least all the @code{-B} options
  331. of @code{lp_solve}. For instance, we often just use
  332. @code{lp_solve -cc -B1 -Bb -Bg -Bp -Bf -Br -BG -Bd -Bs -BB -Bo -Bc -Bi} , and
  333. the @code{-gr} option can also be quite useful.
  334. Setting @code{deps} to 0 will only take into account the actual computations
  335. on processing units. It however still properly takes into account the varying
  336. performances of kernels and processing units, which is quite more accurate than
  337. just comparing StarPU performances with the fastest of the kernels being used.
  338. The @code{prio} parameter tells StarPU whether to simulate taking into account
  339. the priorities as the StarPU scheduler would, i.e. schedule prioritized
  340. tasks before less prioritized tasks, to check to which extend this results
  341. to a less optimal solution. This increases even more computation time.
  342. Note that for simplicity, all this however doesn't take into account data
  343. transfers, which are assumed to be completely overlapped.
  344. @node Insert Task Utility
  345. @section Insert Task Utility
  346. StarPU provides the wrapper function @code{starpu_insert_task} to ease
  347. the creation and submission of tasks.
  348. @deftypefun int starpu_insert_task (struct starpu_codelet *@var{cl}, ...)
  349. Create and submit a task corresponding to @var{cl} with the following
  350. arguments. The argument list must be zero-terminated.
  351. The arguments following the codelets can be of the following types:
  352. @itemize
  353. @item
  354. @code{STARPU_R}, @code{STARPU_W}, @code{STARPU_RW}, @code{STARPU_SCRATCH}, @code{STARPU_REDUX} an access mode followed by a data handle;
  355. @item
  356. @code{STARPU_VALUE} followed by a pointer to a constant value and
  357. the size of the constant;
  358. @item
  359. @code{STARPU_CALLBACK} followed by a pointer to a callback function;
  360. @item
  361. @code{STARPU_CALLBACK_ARG} followed by a pointer to be given as an
  362. argument to the callback function;
  363. @item
  364. @code{STARPU_CALLBACK_WITH_ARG} followed by two pointers: one to a callback
  365. function, and the other to be given as an argument to the callback
  366. function; this is equivalent to using both @code{STARPU_CALLBACK} and
  367. @code{STARPU_CALLBACK_WITH_ARG}
  368. @item
  369. @code{STARPU_PRIORITY} followed by a integer defining a priority level.
  370. @end itemize
  371. Parameters to be passed to the codelet implementation are defined
  372. through the type @code{STARPU_VALUE}. The function
  373. @code{starpu_unpack_cl_args} must be called within the codelet
  374. implementation to retrieve them.
  375. @end deftypefun
  376. Here the implementation of the codelet:
  377. @smallexample
  378. void func_cpu(void *descr[], void *_args)
  379. @{
  380. int *x0 = (int *)STARPU_VARIABLE_GET_PTR(descr[0]);
  381. float *x1 = (float *)STARPU_VARIABLE_GET_PTR(descr[1]);
  382. int ifactor;
  383. float ffactor;
  384. starpu_unpack_cl_args(_args, &ifactor, &ffactor);
  385. *x0 = *x0 * ifactor;
  386. *x1 = *x1 * ffactor;
  387. @}
  388. struct starpu_codelet mycodelet = @{
  389. .where = STARPU_CPU,
  390. .cpu_func = func_cpu,
  391. .nbuffers = 2
  392. @};
  393. @end smallexample
  394. And the call to the @code{starpu_insert_task} wrapper:
  395. @smallexample
  396. starpu_insert_task(&mycodelet,
  397. STARPU_VALUE, &ifactor, sizeof(ifactor),
  398. STARPU_VALUE, &ffactor, sizeof(ffactor),
  399. STARPU_RW, data_handles[0], STARPU_RW, data_handles[1],
  400. 0);
  401. @end smallexample
  402. The call to @code{starpu_insert_task} is equivalent to the following
  403. code:
  404. @smallexample
  405. struct starpu_task *task = starpu_task_create();
  406. task->cl = &mycodelet;
  407. task->buffers[0].handle = data_handles[0];
  408. task->buffers[0].mode = STARPU_RW;
  409. task->buffers[1].handle = data_handles[1];
  410. task->buffers[1].mode = STARPU_RW;
  411. char *arg_buffer;
  412. size_t arg_buffer_size;
  413. starpu_pack_cl_args(&arg_buffer, &arg_buffer_size,
  414. STARPU_VALUE, &ifactor, sizeof(ifactor),
  415. STARPU_VALUE, &ffactor, sizeof(ffactor),
  416. 0);
  417. task->cl_arg = arg_buffer;
  418. task->cl_arg_size = arg_buffer_size;
  419. int ret = starpu_task_submit(task);
  420. @end smallexample
  421. If some part of the task insertion depends on the value of some computation,
  422. the @code{STARPU_DATA_ACQUIRE_CB} macro can be very convenient. For
  423. instance, assuming that the index variable @code{i} was registered as handle
  424. @code{i_handle}:
  425. @smallexample
  426. /* Compute which portion we will work on, e.g. pivot */
  427. starpu_insert_task(&which_index, STARPU_W, i_handle, 0);
  428. /* And submit the corresponding task */
  429. STARPU_DATA_ACQUIRE_CB(i_handle, STARPU_R, starpu_insert_task(&work, STARPU_RW, A_handle[i], 0));
  430. @end smallexample
  431. The @code{STARPU_DATA_ACQUIRE_CB} macro submits an asynchronous request for
  432. acquiring data @code{i} for the main application, and will execute the code
  433. given as third parameter when it is acquired. In other words, as soon as the
  434. value of @code{i} computed by the @code{which_index} codelet can be read, the
  435. portion of code passed as third parameter of @code{STARPU_DATA_ACQUIRE_CB} will
  436. be executed, and is allowed to read from @code{i} to use it e.g. as an
  437. index. Note that this macro is only avaible when compiling StarPU with
  438. the compiler @code{gcc}.
  439. @node Debugging
  440. @section Debugging
  441. StarPU provides several tools to help debugging aplications. Execution traces
  442. can be generated and displayed graphically, see @ref{Generating traces}. Some
  443. gdb helpers are also provided to show the whole StarPU state:
  444. @smallexample
  445. (gdb) source tools/gdbinit
  446. (gdb) help starpu
  447. @end smallexample
  448. @node More examples
  449. @section More examples
  450. More examples are available in the StarPU sources in the @code{examples/}
  451. directory. Simple examples include:
  452. @table @asis
  453. @item @code{incrementer/}:
  454. Trivial incrementation test.
  455. @item @code{basic_examples/}:
  456. Simple documented Hello world (as shown in @ref{Hello World}), vector/scalar product (as shown
  457. in @ref{Vector Scaling on an Hybrid CPU/GPU Machine}), matrix
  458. product examples (as shown in @ref{Performance model example}), an example using the blocked matrix data
  459. interface, an example using the variable data interface, and an example
  460. using different formats on CPUs and GPUs.
  461. @item @code{matvecmult/}:
  462. OpenCL example from NVidia, adapted to StarPU.
  463. @item @code{axpy/}:
  464. AXPY CUBLAS operation adapted to StarPU.
  465. @item @code{fortran/}:
  466. Example of Fortran bindings.
  467. @end table
  468. More advanced examples include:
  469. @table @asis
  470. @item @code{filters/}:
  471. Examples using filters, as shown in @ref{Partitioning Data}.
  472. @item @code{lu/}:
  473. LU matrix factorization, see for instance @code{xlu_implicit.c}
  474. @item @code{cholesky/}:
  475. Cholesky matrix factorization, see for instance @code{cholesky_implicit.c}.
  476. @end table