starpu_cublas.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2010-2013,2015,2017,2019 CNRS
  4. * Copyright (C) 2010-2014,2017 Université de Bordeaux
  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 __STARPU_CUBLAS_H__
  18. #define __STARPU_CUBLAS_H__
  19. #ifdef __cplusplus
  20. extern "C"
  21. {
  22. #endif
  23. /**
  24. @ingroup API_CUDA_Extensions
  25. @{
  26. */
  27. /**
  28. Initialize CUBLAS on every CUDA device. The
  29. CUBLAS library must be initialized prior to any CUBLAS call. Calling
  30. starpu_cublas_init() will initialize CUBLAS on every CUDA device
  31. controlled by StarPU. This call blocks until CUBLAS has been properly
  32. initialized on every device.
  33. */
  34. void starpu_cublas_init(void);
  35. /**
  36. Set the proper CUBLAS stream for CUBLAS v1. This must be called
  37. from the CUDA codelet before calling CUBLAS v1 kernels, so that
  38. they are queued on the proper CUDA stream. When using one thread
  39. per CUDA worker, this function does not do anything since the
  40. CUBLAS stream does not change, and is set once by
  41. starpu_cublas_init().
  42. */
  43. void starpu_cublas_set_stream(void);
  44. /**
  45. Synchronously deinitialize the CUBLAS library on
  46. every CUDA device.
  47. */
  48. void starpu_cublas_shutdown(void);
  49. /** @} */
  50. #ifdef __cplusplus
  51. }
  52. #endif
  53. #endif /* __STARPU_CUBLAS_H__ */