misc_helpers.doxy 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * This file is part of the StarPU Handbook.
  3. * Copyright (C) 2009--2011 Universit@'e de Bordeaux
  4. * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2017 CNRS
  5. * Copyright (C) 2011, 2012 INRIA
  6. * See the file version.doxy for copying conditions.
  7. */
  8. /*! \defgroup API_Miscellaneous_Helpers Miscellaneous Helpers
  9. \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)
  10. \ingroup API_Miscellaneous_Helpers
  11. Copy the content of \p src_handle into \p dst_handle. The parameter \p
  12. asynchronous indicates whether the function should block or not. In
  13. the case of an asynchronous call, it is possible to synchronize with
  14. the termination of this operation either by the means of implicit
  15. dependencies (if enabled) or by calling starpu_task_wait_for_all(). If
  16. \p callback_func is not <c>NULL</c>, this callback function is executed after
  17. the handle has been copied, and it is given the pointer \p callback_arg as argument.
  18. \fn void starpu_execute_on_each_worker(void (*func)(void *), void *arg, uint32_t where)
  19. \ingroup API_Miscellaneous_Helpers
  20. Execute the given function \p func on a subset of workers. When
  21. calling this method, the offloaded function \p func is executed by
  22. every StarPU worker that are eligible to execute the function.
  23. The argument \p arg
  24. is passed to the offloaded function. The argument \p where specifies
  25. on which types of processing units the function should be executed.
  26. Similarly to the field starpu_codelet::where, it is possible to
  27. specify that the function should be executed on every CUDA device and
  28. every CPU by passing ::STARPU_CPU|::STARPU_CUDA. This function blocks
  29. until \p func has been executed on every appropriate processing
  30. units, and thus may not be called from a callback function for
  31. instance.
  32. \fn void starpu_execute_on_each_worker_ex(void (*func)(void *), void *arg, uint32_t where, const char *name)
  33. \ingroup API_Miscellaneous_Helpers
  34. Same as starpu_execute_on_each_worker(), except that the task name is
  35. specified in the argument \p name.
  36. \fn void starpu_execute_on_specific_workers(void (*func)(void*), void *arg, unsigned num_workers, unsigned *workers, const char *name);
  37. \ingroup API_Miscellaneous_Helpers
  38. Call \p func(\p arg) on every worker in the \p workers array. \p
  39. num_workers indicates the number of workers in this array. This
  40. function is synchronous, but the different workers may execute the
  41. function in parallel.
  42. \fn double starpu_timing_now(void)
  43. \ingroup API_Miscellaneous_Helpers
  44. Return the current date in micro-seconds.
  45. */