misc_helpers.doxy 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2010-2015,2017 CNRS
  4. * Copyright (C) 2009-2011,2014 Université de Bordeaux
  5. * Copyright (C) 2011-2012 Inria
  6. *
  7. * StarPU is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU Lesser General Public License as published by
  9. * the Free Software Foundation; either version 2.1 of the License, or (at
  10. * your option) any later version.
  11. *
  12. * StarPU is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. *
  16. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  17. */
  18. /*! \defgroup API_Miscellaneous_Helpers Miscellaneous Helpers
  19. \fn int starpu_data_cpy(starpu_data_handle_t dst_handle, starpu_data_handle_t src_handle, int asynchronous, void (*callback_func)(void*), void *callback_arg)
  20. \ingroup API_Miscellaneous_Helpers
  21. Copy the content of \p src_handle into \p dst_handle. The parameter \p
  22. asynchronous indicates whether the function should block or not. In
  23. the case of an asynchronous call, it is possible to synchronize with
  24. the termination of this operation either by the means of implicit
  25. dependencies (if enabled) or by calling starpu_task_wait_for_all(). If
  26. \p callback_func is not <c>NULL</c>, this callback function is executed after
  27. the handle has been copied, and it is given the pointer \p callback_arg as argument.
  28. \fn void starpu_execute_on_each_worker(void (*func)(void *), void *arg, uint32_t where)
  29. \ingroup API_Miscellaneous_Helpers
  30. Execute the given function \p func on a subset of workers. When
  31. calling this method, the offloaded function \p func is executed by
  32. every StarPU worker that are eligible to execute the function.
  33. The argument \p arg
  34. is passed to the offloaded function. The argument \p where specifies
  35. on which types of processing units the function should be executed.
  36. Similarly to the field starpu_codelet::where, it is possible to
  37. specify that the function should be executed on every CUDA device and
  38. every CPU by passing ::STARPU_CPU|::STARPU_CUDA. This function blocks
  39. until \p func has been executed on every appropriate processing
  40. units, and thus may not be called from a callback function for
  41. instance.
  42. \fn void starpu_execute_on_each_worker_ex(void (*func)(void *), void *arg, uint32_t where, const char *name)
  43. \ingroup API_Miscellaneous_Helpers
  44. Same as starpu_execute_on_each_worker(), except that the task name is
  45. specified in the argument \p name.
  46. \fn void starpu_execute_on_specific_workers(void (*func)(void*), void *arg, unsigned num_workers, unsigned *workers, const char *name);
  47. \ingroup API_Miscellaneous_Helpers
  48. Call \p func(\p arg) on every worker in the \p workers array. \p
  49. num_workers indicates the number of workers in this array. This
  50. function is synchronous, but the different workers may execute the
  51. function in parallel.
  52. \fn double starpu_timing_now(void)
  53. \ingroup API_Miscellaneous_Helpers
  54. Return the current date in micro-seconds.
  55. */