starpu_driver.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2009-2013 Université de Bordeaux
  4. * Copyright (C) 2010-2013 CNRS
  5. *
  6. * StarPU is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU Lesser General Public License as published by
  8. * the Free Software Foundation; either version 2.1 of the License, or (at
  9. * your option) any later version.
  10. *
  11. * StarPU is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. *
  15. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  16. */
  17. #ifndef __STARPU_DRIVER_H__
  18. #define __STARPU_DRIVER_H__
  19. #include <starpu_config.h>
  20. #if defined(STARPU_USE_OPENCL) && !defined(__CUDACC__)
  21. #include <starpu_opencl.h>
  22. #endif
  23. #ifdef __cplusplus
  24. extern "C"
  25. {
  26. #endif
  27. struct starpu_driver
  28. {
  29. enum starpu_worker_archtype type;
  30. union
  31. {
  32. unsigned cpu_id;
  33. unsigned cuda_id;
  34. #if defined(STARPU_USE_OPENCL) && !defined(__CUDACC__)
  35. cl_device_id opencl_id;
  36. #elif defined(STARPU_SIMGRID)
  37. unsigned opencl_id;
  38. #endif
  39. } id;
  40. };
  41. int starpu_driver_run(struct starpu_driver *d);
  42. void starpu_drivers_request_termination(void);
  43. int starpu_driver_init(struct starpu_driver *d);
  44. int starpu_driver_run_once(struct starpu_driver *d);
  45. int starpu_driver_deinit(struct starpu_driver *d);
  46. #ifdef __cplusplus
  47. }
  48. #endif
  49. #endif /* __STARPU_DRIVER_H__ */