driver_cuda.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2009, 2010, 2012-2014 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. #if defined(STARPU_USE_CUDA) || defined(STARPU_SIMGRID)
  33. void _starpu_cuda_discover_devices (struct _starpu_machine_config *);
  34. void _starpu_init_cuda(void);
  35. void *_starpu_cuda_worker(void *);
  36. #else
  37. # define _starpu_cuda_discover_devices(config) ((void) config)
  38. #endif
  39. #ifdef STARPU_USE_CUDA
  40. cudaStream_t starpu_cuda_get_local_in_transfer_stream(void);
  41. cudaStream_t starpu_cuda_get_local_out_transfer_stream(void);
  42. cudaStream_t starpu_cuda_get_peer_transfer_stream(unsigned src_node, unsigned dst_node);
  43. struct _starpu_worker_set;
  44. int _starpu_run_cuda(struct _starpu_worker_set *);
  45. int _starpu_cuda_driver_init(struct _starpu_worker_set *);
  46. int _starpu_cuda_driver_run_once(struct _starpu_worker_set *);
  47. int _starpu_cuda_driver_deinit(struct _starpu_worker_set *);
  48. #endif
  49. #endif // __DRIVER_CUDA_H__