imate
C++/CUDA Reference
cublas_types.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright 2021, Siavash Ameli <sameli@berkeley.edu>
3  * SPDX-License-Identifier: BSD-3-Clause
4  * SPDX-FileType: SOURCE
5  *
6  * This program is free software: you can redistribute it and/or modify it
7  * under the terms of the license found in the LICENSE.txt file in the root
8  * directory of this source tree.
9  */
10 
11 
12 #ifndef _CUDA_DYNAMIC_LOADING_CUBLAS_TYPES_H_
13 #define _CUDA_DYNAMIC_LOADING_CUBLAS_TYPES_H_
14 
15 // =======
16 // Headers
17 // =======
18 
19 #include <cublas_v2.h> // cublasSgemv, cublasDgemv, cublasScopy, cublasDcopy,
20  // cublasSaxpy, cublasDaxpy, cublasSdot, cublasDdot,
21  // cublasSnrm2, cublasDnrm2, cublasSscal, cublasDscal
22  // cublasHandle_t, cublasStatus_t
23 
24 // =====
25 // Types
26 // =====
27 
28 // cublasCreate
29 typedef cublasStatus_t (*cublasCreate_type)(cublasHandle_t* handle);
30 
31 // cublasDestroy
32 typedef cublasStatus_t (*cublasDestroy_type)(cublasHandle_t handle);
33 
34 // cublasSgemv
35 typedef cublasStatus_t (*cublasSgemv_type)(
36  cublasHandle_t handle,
37  cublasOperation_t trans,
38  int m,
39  int n,
40  const float* alpha,
41  const float* A,
42  int lda,
43  const float* x,
44  int incx,
45  const float* beta,
46  float* y,
47  int incy);
48 
49 // cublasDgemv
50 typedef cublasStatus_t (*cublasDgemv_type)(
51  cublasHandle_t handle,
52  cublasOperation_t trans,
53  int m,
54  int n,
55  const double* alpha,
56  const double* A,
57  int lda,
58  const double* x,
59  int incx,
60  const double* beta,
61  double* y,
62  int incy);
63 
64 // cublasScopy
65 typedef cublasStatus_t (*cublasScopy_type)(
66  cublasHandle_t handle, int n,
67  const float* x,
68  int incx,
69  float* y,
70  int incy);
71 
72 // cublasDcopy
73 typedef cublasStatus_t (*cublasDcopy_type)(
74  cublasHandle_t handle, int n,
75  const double* x,
76  int incx,
77  double* y,
78  int incy);
79 
80 // cublasSaxpy
81 typedef cublasStatus_t (*cublasSaxpy_type)(
82  cublasHandle_t handle,
83  int n,
84  const float *alpha,
85  const float *x,
86  int incx,
87  float *y,
88  int incy);
89 
90 // cublasDaxpy
91 typedef cublasStatus_t (*cublasDaxpy_type)(
92  cublasHandle_t handle,
93  int n,
94  const double *alpha,
95  const double *x,
96  int incx,
97  double *y,
98  int incy);
99 
100 // cublasSdot
101 typedef cublasStatus_t (*cublasSdot_type)(
102  cublasHandle_t handle,
103  int n,
104  const float *x,
105  int incx,
106  const float *y,
107  int incy,
108  float *result);
109 
110 // cublasDdot
111 typedef cublasStatus_t (*cublasDdot_type)(
112  cublasHandle_t handle,
113  int n,
114  const double *x,
115  int incx,
116  const double *y,
117  int incy,
118  double *result);
119 
120 // cublasSnrm2
121 typedef cublasStatus_t (*cublasSnrm2_type)(
122  cublasHandle_t handle,
123  int n,
124  const float *x,
125  int incx,
126  float *result);
127 
128 // cublasDnrm2
129 typedef cublasStatus_t (*cublasDnrm2_type)(
130  cublasHandle_t handle,
131  int n,
132  const double *x,
133  int incx,
134  double *result);
135 
136 // cublasSscal
137 typedef cublasStatus_t (*cublasSscal_type)(
138  cublasHandle_t handle,
139  int n,
140  const float *alpha,
141  float *x,
142  int incx);
143 
144 // cublasDscal
145 typedef cublasStatus_t (*cublasDscal_type)(
146  cublasHandle_t handle,
147  int n,
148  const double *alpha,
149  double *x,
150  int incx);
151 
152 #endif // _CUDA_DYNAMIC_LOADING_CUBLAS_TYPES_H_
cublasStatus_t(* cublasDestroy_type)(cublasHandle_t handle)
Definition: cublas_types.h:32
cublasStatus_t(* cublasDgemv_type)(cublasHandle_t handle, cublasOperation_t trans, int m, int n, const double *alpha, const double *A, int lda, const double *x, int incx, const double *beta, double *y, int incy)
Definition: cublas_types.h:50
cublasStatus_t(* cublasDcopy_type)(cublasHandle_t handle, int n, const double *x, int incx, double *y, int incy)
Definition: cublas_types.h:73
cublasStatus_t(* cublasDaxpy_type)(cublasHandle_t handle, int n, const double *alpha, const double *x, int incx, double *y, int incy)
Definition: cublas_types.h:91
cublasStatus_t(* cublasDscal_type)(cublasHandle_t handle, int n, const double *alpha, double *x, int incx)
Definition: cublas_types.h:145
cublasStatus_t(* cublasSaxpy_type)(cublasHandle_t handle, int n, const float *alpha, const float *x, int incx, float *y, int incy)
Definition: cublas_types.h:81
cublasStatus_t(* cublasCreate_type)(cublasHandle_t *handle)
Definition: cublas_types.h:29
cublasStatus_t(* cublasSscal_type)(cublasHandle_t handle, int n, const float *alpha, float *x, int incx)
Definition: cublas_types.h:137
cublasStatus_t(* cublasSgemv_type)(cublasHandle_t handle, cublasOperation_t trans, int m, int n, const float *alpha, const float *A, int lda, const float *x, int incx, const float *beta, float *y, int incy)
Definition: cublas_types.h:35
cublasStatus_t(* cublasSdot_type)(cublasHandle_t handle, int n, const float *x, int incx, const float *y, int incy, float *result)
Definition: cublas_types.h:101
cublasStatus_t(* cublasScopy_type)(cublasHandle_t handle, int n, const float *x, int incx, float *y, int incy)
Definition: cublas_types.h:65
cublasStatus_t(* cublasSnrm2_type)(cublasHandle_t handle, int n, const float *x, int incx, float *result)
Definition: cublas_types.h:121
cublasStatus_t(* cublasDdot_type)(cublasHandle_t handle, int n, const double *x, int incx, const double *y, int incy, double *result)
Definition: cublas_types.h:111
cublasStatus_t(* cublasDnrm2_type)(cublasHandle_t handle, int n, const double *x, int incx, double *result)
Definition: cublas_types.h:129