driver_cuda.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2009, 2010, 2012 Université de Bordeaux 1
  4. * Copyright (C) 2010, 2012 Centre National de la Recherche Scientifique
  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 <assert.h>
  20. #include <math.h>
  21. #include <stdio.h>
  22. #ifdef STARPU_USE_CUDA
  23. #include <cuda.h>
  24. #include <cuda_runtime_api.h>
  25. #include <cublas.h>
  26. #endif
  27. #include <starpu.h>
  28. #include <common/config.h>
  29. #include <core/jobs.h>
  30. #include <core/task.h>
  31. #include <datawizard/datawizard.h>
  32. #include <core/perfmodel/perfmodel.h>
  33. #include <common/fxt.h>
  34. unsigned _starpu_get_cuda_device_count(void);
  35. #ifdef STARPU_USE_CUDA
  36. void _starpu_cuda_discover_devices (struct _starpu_machine_config *);
  37. void _starpu_init_cuda(void);
  38. void *_starpu_cuda_worker(void *);
  39. cudaStream_t starpu_cuda_get_local_in_transfer_stream(void);
  40. cudaStream_t starpu_cuda_get_local_out_transfer_stream(void);
  41. cudaStream_t starpu_cuda_get_local_peer_transfer_stream(void);
  42. int _starpu_run_cuda(struct starpu_driver *);
  43. int _starpu_cuda_driver_init(struct starpu_driver *);
  44. int _starpu_cuda_driver_run_once(struct starpu_driver *);
  45. int _starpu_cuda_driver_deinit(struct starpu_driver *);
  46. #else
  47. # define _starpu_cuda_discover_devices(config) ((void) config)
  48. #endif
  49. #endif // __DRIVER_CUDA_H__