starpu_cublas.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2010-2021 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
  4. *
  5. * StarPU is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU Lesser General Public License as published by
  7. * the Free Software Foundation; either version 2.1 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * StarPU is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. *
  14. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  15. */
  16. #ifndef __STARPU_CUBLAS_H__
  17. #define __STARPU_CUBLAS_H__
  18. #ifdef __cplusplus
  19. extern "C"
  20. {
  21. #endif
  22. /**
  23. @ingroup API_CUDA_Extensions
  24. @{
  25. */
  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
  36. from the CUDA codelet before calling CUBLAS v1 kernels, so that
  37. they are queued on the proper CUDA stream. When using one thread
  38. per CUDA worker, this function does not do anything since the
  39. CUBLAS stream does not change, and is set once by
  40. starpu_cublas_init().
  41. */
  42. void starpu_cublas_set_stream(void);
  43. /**
  44. Synchronously deinitialize the CUBLAS library on
  45. every CUDA device.
  46. */
  47. void starpu_cublas_shutdown(void);
  48. /** @} */
  49. #ifdef __cplusplus
  50. }
  51. #endif
  52. #endif /* __STARPU_CUBLAS_H__ */