starpu_cublas.h 1.8 KB

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