driver_cuda.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2009, 2010, 2012-2014, 2016 Université de Bordeaux
  4. * Copyright (C) 2010, 2012 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 __DRIVER_CUDA_H__
  18. #define __DRIVER_CUDA_H__
  19. #ifdef STARPU_USE_CUDA
  20. #include <cuda.h>
  21. #include <cuda_runtime_api.h>
  22. #include <cublas.h>
  23. #endif
  24. #include <starpu.h>
  25. #include <common/config.h>
  26. #include <core/jobs.h>
  27. #include <core/task.h>
  28. #include <datawizard/datawizard.h>
  29. #include <core/perfmodel/perfmodel.h>
  30. #include <common/fxt.h>
  31. unsigned _starpu_get_cuda_device_count(void);
  32. extern int _starpu_cuda_bus_ids[STARPU_MAXCUDADEVS+1][STARPU_MAXCUDADEVS+1];
  33. #if defined(STARPU_USE_CUDA) || defined(STARPU_SIMGRID)
  34. void _starpu_cuda_discover_devices (struct _starpu_machine_config *);
  35. void _starpu_init_cuda(void);
  36. void *_starpu_cuda_worker(void *);
  37. #else
  38. # define _starpu_cuda_discover_devices(config) ((void) config)
  39. #endif
  40. #ifdef STARPU_USE_CUDA
  41. cudaStream_t starpu_cuda_get_local_in_transfer_stream(void);
  42. cudaStream_t starpu_cuda_get_local_out_transfer_stream(void);
  43. cudaStream_t starpu_cuda_get_peer_transfer_stream(unsigned src_node, unsigned dst_node);
  44. struct _starpu_worker_set;
  45. int _starpu_run_cuda(struct _starpu_worker_set *);
  46. int _starpu_cuda_driver_init(struct _starpu_worker_set *);
  47. int _starpu_cuda_driver_run_once(struct _starpu_worker_set *);
  48. int _starpu_cuda_driver_deinit(struct _starpu_worker_set *);
  49. #endif
  50. #endif // __DRIVER_CUDA_H__