driver_cuda.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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, 2017 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. #include <common/config.h>
  20. #ifdef STARPU_USE_CUDA
  21. #include <cuda.h>
  22. #include <cuda_runtime_api.h>
  23. #include <cublas.h>
  24. #endif
  25. #include <starpu.h>
  26. extern struct _starpu_driver_ops _starpu_driver_cuda_ops;
  27. void _starpu_cuda_init(void);
  28. unsigned _starpu_get_cuda_device_count(void);
  29. extern int _starpu_cuda_bus_ids[STARPU_MAXCUDADEVS+STARPU_MAXNUMANODES][STARPU_MAXCUDADEVS+STARPU_MAXNUMANODES];
  30. #if defined(STARPU_USE_CUDA) || defined(STARPU_SIMGRID)
  31. void _starpu_cuda_discover_devices (struct _starpu_machine_config *);
  32. void _starpu_init_cuda(void);
  33. void *_starpu_cuda_worker(void *);
  34. #else
  35. # define _starpu_cuda_discover_devices(config) ((void) config)
  36. #endif
  37. #ifdef STARPU_USE_CUDA
  38. cudaStream_t starpu_cuda_get_local_in_transfer_stream(void);
  39. cudaStream_t starpu_cuda_get_in_transfer_stream(unsigned dst_node);
  40. cudaStream_t starpu_cuda_get_local_out_transfer_stream(void);
  41. cudaStream_t starpu_cuda_get_out_transfer_stream(unsigned src_node);
  42. cudaStream_t starpu_cuda_get_peer_transfer_stream(unsigned src_node, unsigned dst_node);
  43. #endif
  44. #endif // __DRIVER_CUDA_H__