driver_cuda.h 1.9 KB

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