running_driver.doxy 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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, 2017 CNRS
  5. * Copyright (C) 2011, 2012 INRIA
  6. * See the file version.doxy for copying conditions.
  7. */
  8. /*! \defgroup API_Running_Drivers Running Drivers
  9. \struct starpu_driver
  10. structure for a driver
  11. \ingroup API_Running_Drivers
  12. \var enum starpu_worker_archtype starpu_driver::type
  13. Type of the driver. Only ::STARPU_CPU_WORKER, ::STARPU_CUDA_WORKER
  14. and ::STARPU_OPENCL_WORKER are currently supported.
  15. \var union starpu_driver::id
  16. Identifier of the driver.
  17. \fn int starpu_driver_run(struct starpu_driver *d)
  18. \ingroup API_Running_Drivers
  19. Initialize the given driver, run it until it receives a request to
  20. terminate, deinitialize it and return 0 on success. Return
  21. <c>-EINVAL</c> if starpu_driver::type is not a valid StarPU device type
  22. (::STARPU_CPU_WORKER, ::STARPU_CUDA_WORKER or ::STARPU_OPENCL_WORKER).
  23. This is the same as using the following functions: calling
  24. starpu_driver_init(), then calling starpu_driver_run_once() in a loop,
  25. and finally starpu_driver_deinit().
  26. \fn int starpu_driver_init(struct starpu_driver *d)
  27. \ingroup API_Running_Drivers
  28. Initialize the given driver. Return 0 on success, <c>-EINVAL</c>
  29. if starpu_driver::type is not a valid ::starpu_worker_archtype.
  30. \fn int starpu_driver_run_once(struct starpu_driver *d)
  31. \ingroup API_Running_Drivers
  32. Run the driver once, then return 0 on success, <c>-EINVAL</c> if starpu_driver::type is not a valid ::starpu_worker_archtype.
  33. \fn int starpu_driver_deinit(struct starpu_driver *d)
  34. \ingroup API_Running_Drivers
  35. Deinitialize the given driver. Return 0 on success, <c>-EINVAL</c> if
  36. starpu_driver::type is not a valid ::starpu_worker_archtype.
  37. \fn void starpu_drivers_request_termination(void)
  38. \ingroup API_Running_Drivers
  39. Notify all running drivers that they should terminate.
  40. */