Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
cublas.h892 linesDownload Raw Back to include
1/*
2 * Copyright 1993-2019 NVIDIA Corporation. All rights reserved.
3 *
4 * NOTICE TO LICENSEE:
5 *
6 * This source code and/or documentation ("Licensed Deliverables") are
7 * subject to NVIDIA intellectual property rights under U.S. and
8 * international Copyright laws.
9 *
10 * These Licensed Deliverables contained herein is PROPRIETARY and
11 * CONFIDENTIAL to NVIDIA and is being provided under the terms and
12 * conditions of a form of NVIDIA software license agreement by and
13 * between NVIDIA and Licensee ("License Agreement") or electronically
14 * accepted by Licensee.  Notwithstanding any terms or conditions to
15 * the contrary in the License Agreement, reproduction or disclosure
16 * of the Licensed Deliverables to any third party without the express
17 * written consent of NVIDIA is prohibited.
18 *
19 * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
20 * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
21 * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE.  IT IS
22 * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
23 * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
24 * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
25 * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
26 * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
27 * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
28 * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
29 * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
30 * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
31 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
32 * OF THESE LICENSED DELIVERABLES.
33 *
34 * U.S. Government End Users.  These Licensed Deliverables are a
35 * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
36 * 1995), consisting of "commercial computer software" and "commercial
37 * computer software documentation" as such terms are used in 48
38 * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
39 * only as a commercial end item.  Consistent with 48 C.F.R.12.212 and
40 * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
41 * U.S. Government End Users acquire the Licensed Deliverables with
42 * only those rights set forth herein.
43 *
44 * Any use of the Licensed Deliverables in individual and commercial
45 * software must include, in the user documentation and internal
46 * comments to the code, the above Disclaimer and U.S. Government End
47 * Users Notice.
48 */
49
50/*
51 * This is the public header file for the CUBLAS library, defining the API
52 *
53 * CUBLAS is an implementation of BLAS (Basic Linear Algebra Subroutines)
54 * on top of the CUDA runtime.
55 */
56
57#if !defined(CUBLAS_H_)
58#define CUBLAS_H_
59
60#if defined(CUBLAS_V2_H_)
61#error "It is an error to include both cublas.h and cublas_v2.h"
62#endif
63
64#include <cuda_runtime.h>
65
66#ifndef CUBLASWINAPI
67#ifdef _WIN32
68#define CUBLASWINAPI __stdcall
69#else
70#define CUBLASWINAPI
71#endif
72#endif
73
74#undef CUBLASAPI
75#ifdef __CUDACC__
76#define CUBLASAPI __host__
77#else
78#define CUBLASAPI
79#endif
80
81#include "cublas_api.h"
82
83#if defined(__cplusplus)
84extern "C" {
85#endif
86
87/* CUBLAS data types */
88#define cublasStatus cublasStatus_t
89
90cublasStatus CUBLASWINAPI cublasInit(void);
91cublasStatus CUBLASWINAPI cublasShutdown(void);
92cublasStatus CUBLASWINAPI cublasGetError(void);
93
94cublasStatus CUBLASWINAPI cublasGetVersion(int* version);
95cublasStatus CUBLASWINAPI cublasAlloc(int n, int elemSize, void** devicePtr);
96
97cublasStatus CUBLASWINAPI cublasFree(void* devicePtr);
98
99cublasStatus CUBLASWINAPI cublasSetKernelStream(cudaStream_t stream);
100
101/* ---------------- CUBLAS BLAS1 functions ---------------- */
102/* NRM2 */
103float CUBLASWINAPI cublasSnrm2(int n, const float* x, int incx);
104double CUBLASWINAPI cublasDnrm2(int n, const double* x, int incx);
105float CUBLASWINAPI cublasScnrm2(int n, const cuComplex* x, int incx);
106double CUBLASWINAPI cublasDznrm2(int n, const cuDoubleComplex* x, int incx);
107/*------------------------------------------------------------------------*/
108/* DOT */
109float CUBLASWINAPI cublasSdot(int n, const float* x, int incx, const float* y, int incy);
110double CUBLASWINAPI cublasDdot(int n, const double* x, int incx, const double* y, int incy);
111cuComplex CUBLASWINAPI cublasCdotu(int n, const cuComplex* x, int incx, const cuComplex* y, int incy);
112cuComplex CUBLASWINAPI cublasCdotc(int n, const cuComplex* x, int incx, const cuComplex* y, int incy);
113cuDoubleComplex CUBLASWINAPI cublasZdotu(int n, const cuDoubleComplex* x, int incx, const cuDoubleComplex* y, int incy);
114cuDoubleComplex CUBLASWINAPI cublasZdotc(int n, const cuDoubleComplex* x, int incx, const cuDoubleComplex* y, int incy);
115/*------------------------------------------------------------------------*/
116/* SCAL */
117void CUBLASWINAPI cublasSscal(int n, float alpha, float* x, int incx);
118void CUBLASWINAPI cublasDscal(int n, double alpha, double* x, int incx);
119void CUBLASWINAPI cublasCscal(int n, cuComplex alpha, cuComplex* x, int incx);
120void CUBLASWINAPI cublasZscal(int n, cuDoubleComplex alpha, cuDoubleComplex* x, int incx);
121
122void CUBLASWINAPI cublasCsscal(int n, float alpha, cuComplex* x, int incx);
123void CUBLASWINAPI cublasZdscal(int n, double alpha, cuDoubleComplex* x, int incx);
124/*------------------------------------------------------------------------*/
125/* AXPY */
126void CUBLASWINAPI cublasSaxpy(int n, float alpha, const float* x, int incx, float* y, int incy);
127void CUBLASWINAPI cublasDaxpy(int n, double alpha, const double* x, int incx, double* y, int incy);
128void CUBLASWINAPI cublasCaxpy(int n, cuComplex alpha, const cuComplex* x, int incx, cuComplex* y, int incy);
129void CUBLASWINAPI
130cublasZaxpy(int n, cuDoubleComplex alpha, const cuDoubleComplex* x, int incx, cuDoubleComplex* y, int incy);
131/*------------------------------------------------------------------------*/
132/* COPY */
133void CUBLASWINAPI cublasScopy(int n, const float* x, int incx, float* y, int incy);
134void CUBLASWINAPI cublasDcopy(int n, const double* x, int incx, double* y, int incy);
135void CUBLASWINAPI cublasCcopy(int n, const cuComplex* x, int incx, cuComplex* y, int incy);
136void CUBLASWINAPI cublasZcopy(int n, const cuDoubleComplex* x, int incx, cuDoubleComplex* y, int incy);
137/*------------------------------------------------------------------------*/
138/* SWAP */
139void CUBLASWINAPI cublasSswap(int n, float* x, int incx, float* y, int incy);
140void CUBLASWINAPI cublasDswap(int n, double* x, int incx, double* y, int incy);
141void CUBLASWINAPI cublasCswap(int n, cuComplex* x, int incx, cuComplex* y, int incy);
142void CUBLASWINAPI cublasZswap(int n, cuDoubleComplex* x, int incx, cuDoubleComplex* y, int incy);
143/*------------------------------------------------------------------------*/
144/* AMAX */
145int CUBLASWINAPI cublasIsamax(int n, const float* x, int incx);
146int CUBLASWINAPI cublasIdamax(int n, const double* x, int incx);
147int CUBLASWINAPI cublasIcamax(int n, const cuComplex* x, int incx);
148int CUBLASWINAPI cublasIzamax(int n, const cuDoubleComplex* x, int incx);
149/*------------------------------------------------------------------------*/
150/* AMIN */
151int CUBLASWINAPI cublasIsamin(int n, const float* x, int incx);
152int CUBLASWINAPI cublasIdamin(int n, const double* x, int incx);
153
154int CUBLASWINAPI cublasIcamin(int n, const cuComplex* x, int incx);
155int CUBLASWINAPI cublasIzamin(int n, const cuDoubleComplex* x, int incx);
156/*------------------------------------------------------------------------*/
157/* ASUM */
158float CUBLASWINAPI cublasSasum(int n, const float* x, int incx);
159double CUBLASWINAPI cublasDasum(int n, const double* x, int incx);
160float CUBLASWINAPI cublasScasum(int n, const cuComplex* x, int incx);
161double CUBLASWINAPI cublasDzasum(int n, const cuDoubleComplex* x, int incx);
162/*------------------------------------------------------------------------*/
163/* ROT */
164void CUBLASWINAPI cublasSrot(int n, float* x, int incx, float* y, int incy, float sc, float ss);
165void CUBLASWINAPI cublasDrot(int n, double* x, int incx, double* y, int incy, double sc, double ss);
166void CUBLASWINAPI cublasCrot(int n, cuComplex* x, int incx, cuComplex* y, int incy, float c, cuComplex s);
167void CUBLASWINAPI
168cublasZrot(int n, cuDoubleComplex* x, int incx, cuDoubleComplex* y, int incy, double sc, cuDoubleComplex cs);
169void CUBLASWINAPI cublasCsrot(int n, cuComplex* x, int incx, cuComplex* y, int incy, float c, float s);
170void CUBLASWINAPI cublasZdrot(int n, cuDoubleComplex* x, int incx, cuDoubleComplex* y, int incy, double c, double s);
171/*------------------------------------------------------------------------*/
172/* ROTG */
173void CUBLASWINAPI cublasSrotg(float* sa, float* sb, float* sc, float* ss);
174void CUBLASWINAPI cublasDrotg(double* sa, double* sb, double* sc, double* ss);
175void CUBLASWINAPI cublasCrotg(cuComplex* ca, cuComplex cb, float* sc, cuComplex* cs);
176void CUBLASWINAPI cublasZrotg(cuDoubleComplex* ca, cuDoubleComplex cb, double* sc, cuDoubleComplex* cs);
177/*------------------------------------------------------------------------*/
178/* ROTM */
179void CUBLASWINAPI cublasSrotm(int n, float* x, int incx, float* y, int incy, const float* sparam);
180void CUBLASWINAPI cublasDrotm(int n, double* x, int incx, double* y, int incy, const double* sparam);
181/*------------------------------------------------------------------------*/
182/* ROTMG */
183void CUBLASWINAPI cublasSrotmg(float* sd1, float* sd2, float* sx1, const float* sy1, float* sparam);
184void CUBLASWINAPI cublasDrotmg(double* sd1, double* sd2, double* sx1, const double* sy1, double* sparam);
185
186/* --------------- CUBLAS BLAS2 functions  ---------------- */
187/* GEMV */
188void CUBLASWINAPI cublasSgemv(char trans,
189                              int m,
190                              int n,
191                              float alpha,
192                              const float* A,
193                              int lda,
194                              const float* x,
195                              int incx,
196                              float beta,
197                              float* y,
198                              int incy);
199void CUBLASWINAPI cublasDgemv(char trans,
200                              int m,
201                              int n,
202                              double alpha,
203                              const double* A,
204                              int lda,
205                              const double* x,
206                              int incx,
207                              double beta,
208                              double* y,
209                              int incy);
210void CUBLASWINAPI cublasCgemv(char trans,
211                              int m,
212                              int n,
213                              cuComplex alpha,
214                              const cuComplex* A,
215                              int lda,
216                              const cuComplex* x,
217                              int incx,
218                              cuComplex beta,
219                              cuComplex* y,
220                              int incy);
221void CUBLASWINAPI cublasZgemv(char trans,
222                              int m,
223                              int n,
224                              cuDoubleComplex alpha,
225                              const cuDoubleComplex* A,
226                              int lda,
227                              const cuDoubleComplex* x,
228                              int incx,
229                              cuDoubleComplex beta,
230                              cuDoubleComplex* y,
231                              int incy);
232/*------------------------------------------------------------------------*/
233/* GBMV */
234void CUBLASWINAPI cublasSgbmv(char trans,
235                              int m,
236                              int n,
237                              int kl,
238                              int ku,
239                              float alpha,
240                              const float* A,
241                              int lda,
242                              const float* x,
243                              int incx,
244                              float beta,
245                              float* y,
246                              int incy);
247void CUBLASWINAPI cublasDgbmv(char trans,
248                              int m,
249                              int n,
250                              int kl,
251                              int ku,
252                              double alpha,
253                              const double* A,
254                              int lda,
255                              const double* x,
256                              int incx,
257                              double beta,
258                              double* y,
259                              int incy);
260void CUBLASWINAPI cublasCgbmv(char trans,
261                              int m,
262                              int n,
263                              int kl,
264                              int ku,
265                              cuComplex alpha,
266                              const cuComplex* A,
267                              int lda,
268                              const cuComplex* x,
269                              int incx,
270                              cuComplex beta,
271                              cuComplex* y,
272                              int incy);
273void CUBLASWINAPI cublasZgbmv(char trans,
274                              int m,
275                              int n,
276                              int kl,
277                              int ku,
278                              cuDoubleComplex alpha,
279                              const cuDoubleComplex* A,
280                              int lda,
281                              const cuDoubleComplex* x,
282                              int incx,
283                              cuDoubleComplex beta,
284                              cuDoubleComplex* y,
285                              int incy);
286/*------------------------------------------------------------------------*/
287/* TRMV */
288void CUBLASWINAPI cublasStrmv(char uplo, char trans, char diag, int n, const float* A, int lda, float* x, int incx);
289void CUBLASWINAPI cublasDtrmv(char uplo, char trans, char diag, int n, const double* A, int lda, double* x, int incx);
290void CUBLASWINAPI
291cublasCtrmv(char uplo, char trans, char diag, int n, const cuComplex* A, int lda, cuComplex* x, int incx);
292void CUBLASWINAPI
293cublasZtrmv(char uplo, char trans, char diag, int n, const cuDoubleComplex* A, int lda, cuDoubleComplex* x, int incx);
294/*------------------------------------------------------------------------*/
295/* TBMV */
296void CUBLASWINAPI
297cublasStbmv(char uplo, char trans, char diag, int n, int k, const float* A, int lda, float* x, int incx);
298void CUBLASWINAPI
299cublasDtbmv(char uplo, char trans, char diag, int n, int k, const double* A, int lda, double* x, int incx);
300void CUBLASWINAPI
301cublasCtbmv(char uplo, char trans, char diag, int n, int k, const cuComplex* A, int lda, cuComplex* x, int incx);
302void CUBLASWINAPI cublasZtbmv(
303    char uplo, char trans, char diag, int n, int k, const cuDoubleComplex* A, int lda, cuDoubleComplex* x, int incx);
304/*------------------------------------------------------------------------*/
305/* TPMV */
306void CUBLASWINAPI cublasStpmv(char uplo, char trans, char diag, int n, const float* AP, float* x, int incx);
307
308void CUBLASWINAPI cublasDtpmv(char uplo, char trans, char diag, int n, const double* AP, double* x, int incx);
309
310void CUBLASWINAPI cublasCtpmv(char uplo, char trans, char diag, int n, const cuComplex* AP, cuComplex* x, int incx);
311
312void CUBLASWINAPI
313cublasZtpmv(char uplo, char trans, char diag, int n, const cuDoubleComplex* AP, cuDoubleComplex* x, int incx);
314/*------------------------------------------------------------------------*/
315/* TRSV */
316void CUBLASWINAPI cublasStrsv(char uplo, char trans, char diag, int n, const float* A, int lda, float* x, int incx);
317
318void CUBLASWINAPI cublasDtrsv(char uplo, char trans, char diag, int n, const double* A, int lda, double* x, int incx);
319
320void CUBLASWINAPI
321cublasCtrsv(char uplo, char trans, char diag, int n, const cuComplex* A, int lda, cuComplex* x, int incx);
322
323void CUBLASWINAPI
324cublasZtrsv(char uplo, char trans, char diag, int n, const cuDoubleComplex* A, int lda, cuDoubleComplex* x, int incx);
325/*------------------------------------------------------------------------*/
326/* TPSV */
327void CUBLASWINAPI cublasStpsv(char uplo, char trans, char diag, int n, const float* AP, float* x, int incx);
328
329void CUBLASWINAPI cublasDtpsv(char uplo, char trans, char diag, int n, const double* AP, double* x, int incx);
330
331void CUBLASWINAPI cublasCtpsv(char uplo, char trans, char diag, int n, const cuComplex* AP, cuComplex* x, int incx);
332
333void CUBLASWINAPI
334cublasZtpsv(char uplo, char trans, char diag, int n, const cuDoubleComplex* AP, cuDoubleComplex* x, int incx);
335/*------------------------------------------------------------------------*/
336/* TBSV */
337void CUBLASWINAPI
338cublasStbsv(char uplo, char trans, char diag, int n, int k, const float* A, int lda, float* x, int incx);
339
340void CUBLASWINAPI
341cublasDtbsv(char uplo, char trans, char diag, int n, int k, const double* A, int lda, double* x, int incx);
342void CUBLASWINAPI
343cublasCtbsv(char uplo, char trans, char diag, int n, int k, const cuComplex* A, int lda, cuComplex* x, int incx);
344
345void CUBLASWINAPI cublasZtbsv(
346    char uplo, char trans, char diag, int n, int k, const cuDoubleComplex* A, int lda, cuDoubleComplex* x, int incx);
347/*------------------------------------------------------------------------*/
348/* SYMV/HEMV */
349void CUBLASWINAPI cublasSsymv(
350    char uplo, int n, float alpha, const float* A, int lda, const float* x, int incx, float beta, float* y, int incy);
351void CUBLASWINAPI cublasDsymv(char uplo,
352                              int n,
353                              double alpha,
354                              const double* A,
355                              int lda,
356                              const double* x,
357                              int incx,
358                              double beta,
359                              double* y,
360                              int incy);
361void CUBLASWINAPI cublasChemv(char uplo,
362                              int n,
363                              cuComplex alpha,
364                              const cuComplex* A,
365                              int lda,
366                              const cuComplex* x,
367                              int incx,
368                              cuComplex beta,
369                              cuComplex* y,
370                              int incy);
371void CUBLASWINAPI cublasZhemv(char uplo,
372                              int n,
373                              cuDoubleComplex alpha,
374                              const cuDoubleComplex* A,
375                              int lda,
376                              const cuDoubleComplex* x,
377                              int incx,
378                              cuDoubleComplex beta,
379                              cuDoubleComplex* y,
380                              int incy);
381/*------------------------------------------------------------------------*/
382/* SBMV/HBMV */
383void CUBLASWINAPI cublasSsbmv(char uplo,
384                              int n,
385                              int k,
386                              float alpha,
387                              const float* A,
388                              int lda,
389                              const float* x,
390                              int incx,
391                              float beta,
392                              float* y,
393                              int incy);
394void CUBLASWINAPI cublasDsbmv(char uplo,
395                              int n,
396                              int k,
397                              double alpha,
398                              const double* A,
399                              int lda,
400                              const double* x,
401                              int incx,
402                              double beta,
403                              double* y,
404                              int incy);
405void CUBLASWINAPI cublasChbmv(char uplo,
406                              int n,
407                              int k,
408                              cuComplex alpha,
409                              const cuComplex* A,
410                              int lda,
411                              const cuComplex* x,
412                              int incx,
413                              cuComplex beta,
414                              cuComplex* y,
415                              int incy);
416void CUBLASWINAPI cublasZhbmv(char uplo,
417                              int n,
418                              int k,
419                              cuDoubleComplex alpha,
420                              const cuDoubleComplex* A,
421                              int lda,
422                              const cuDoubleComplex* x,
423                              int incx,
424                              cuDoubleComplex beta,
425                              cuDoubleComplex* y,
426                              int incy);
427/*------------------------------------------------------------------------*/
428/* SPMV/HPMV */
429void CUBLASWINAPI
430cublasSspmv(char uplo, int n, float alpha, const float* AP, const float* x, int incx, float beta, float* y, int incy);
431void CUBLASWINAPI cublasDspmv(
432    char uplo, int n, double alpha, const double* AP, const double* x, int incx, double beta, double* y, int incy);
433void CUBLASWINAPI cublasChpmv(char uplo,
434                              int n,
435                              cuComplex alpha,
436                              const cuComplex* AP,
437                              const cuComplex* x,
438                              int incx,
439                              cuComplex beta,
440                              cuComplex* y,
441                              int incy);
442void CUBLASWINAPI cublasZhpmv(char uplo,
443                              int n,
444                              cuDoubleComplex alpha,
445                              const cuDoubleComplex* AP,
446                              const cuDoubleComplex* x,
447                              int incx,
448                              cuDoubleComplex beta,
449                              cuDoubleComplex* y,
450                              int incy);
451
452/*------------------------------------------------------------------------*/
453/* GER */
454void CUBLASWINAPI
455cublasSger(int m, int n, float alpha, const float* x, int incx, const float* y, int incy, float* A, int lda);
456void CUBLASWINAPI
457cublasDger(int m, int n, double alpha, const double* x, int incx, const double* y, int incy, double* A, int lda);
458
459void CUBLASWINAPI cublasCgeru(
460    int m, int n, cuComplex alpha, const cuComplex* x, int incx, const cuComplex* y, int incy, cuComplex* A, int lda);
461void CUBLASWINAPI cublasCgerc(
462    int m, int n, cuComplex alpha, const cuComplex* x, int incx, const cuComplex* y, int incy, cuComplex* A, int lda);
463void CUBLASWINAPI cublasZgeru(int m,
464                              int n,
465                              cuDoubleComplex alpha,
466                              const cuDoubleComplex* x,
467                              int incx,
468                              const cuDoubleComplex* y,
469                              int incy,
470                              cuDoubleComplex* A,
471                              int lda);
472void CUBLASWINAPI cublasZgerc(int m,
473                              int n,
474                              cuDoubleComplex alpha,
475                              const cuDoubleComplex* x,
476                              int incx,
477                              const cuDoubleComplex* y,
478                              int incy,
479                              cuDoubleComplex* A,
480                              int lda);
481/*------------------------------------------------------------------------*/
482/* SYR/HER */
483void CUBLASWINAPI cublasSsyr(char uplo, int n, float alpha, const float* x, int incx, float* A, int lda);
484void CUBLASWINAPI cublasDsyr(char uplo, int n, double alpha, const double* x, int incx, double* A, int lda);
485
486void CUBLASWINAPI cublasCher(char uplo, int n, float alpha, const cuComplex* x, int incx, cuComplex* A, int lda);
487void CUBLASWINAPI
488cublasZher(char uplo, int n, double alpha, const cuDoubleComplex* x, int incx, cuDoubleComplex* A, int lda);
489
490/*------------------------------------------------------------------------*/
491/* SPR/HPR */
492void CUBLASWINAPI cublasSspr(char uplo, int n, float alpha, const float* x, int incx, float* AP);
493void CUBLASWINAPI cublasDspr(char uplo, int n, double alpha, const double* x, int incx, double* AP);
494void CUBLASWINAPI cublasChpr(char uplo, int n, float alpha, const cuComplex* x, int incx, cuComplex* AP);
495void CUBLASWINAPI cublasZhpr(char uplo, int n, double alpha, const cuDoubleComplex* x, int incx, cuDoubleComplex* AP);
496/*------------------------------------------------------------------------*/
497/* SYR2/HER2 */
498void CUBLASWINAPI
499cublasSsyr2(char uplo, int n, float alpha, const float* x, int incx, const float* y, int incy, float* A, int lda);
500void CUBLASWINAPI
501cublasDsyr2(char uplo, int n, double alpha, const double* x, int incx, const double* y, int incy, double* A, int lda);
502void CUBLASWINAPI cublasCher2(char uplo,
503                              int n,
504                              cuComplex alpha,
505                              const cuComplex* x,
506                              int incx,
507                              const cuComplex* y,
508                              int incy,
509                              cuComplex* A,
510                              int lda);
511void CUBLASWINAPI cublasZher2(char uplo,
512                              int n,
513                              cuDoubleComplex alpha,
514                              const cuDoubleComplex* x,
515                              int incx,
516                              const cuDoubleComplex* y,
517                              int incy,
518                              cuDoubleComplex* A,
519                              int lda);
520
521/*------------------------------------------------------------------------*/
522/* SPR2/HPR2 */
523void CUBLASWINAPI
524cublasSspr2(char uplo, int n, float alpha, const float* x, int incx, const float* y, int incy, float* AP);
525void CUBLASWINAPI
526cublasDspr2(char uplo, int n, double alpha, const double* x, int incx, const double* y, int incy, double* AP);
527void CUBLASWINAPI cublasChpr2(
528    char uplo, int n, cuComplex alpha, const cuComplex* x, int incx, const cuComplex* y, int incy, cuComplex* AP);
529void CUBLASWINAPI cublasZhpr2(char uplo,
530                              int n,
531                              cuDoubleComplex alpha,
532                              const cuDoubleComplex* x,
533                              int incx,
534                              const cuDoubleComplex* y,
535                              int incy,
536                              cuDoubleComplex* AP);
537/* ------------------------BLAS3 Functions ------------------------------- */
538/* GEMM */
539void CUBLASWINAPI cublasSgemm(char transa,
540                              char transb,
541                              int m,
542                              int n,
543                              int k,
544                              float alpha,
545                              const float* A,
546                              int lda,
547                              const float* B,
548                              int ldb,
549                              float beta,
550                              float* C,
551                              int ldc);
552void CUBLASWINAPI cublasDgemm(char transa,
553                              char transb,
554                              int m,
555                              int n,
556                              int k,
557                              double alpha,
558                              const double* A,
559                              int lda,
560                              const double* B,
561                              int ldb,
562                              double beta,
563                              double* C,
564                              int ldc);
565void CUBLASWINAPI cublasCgemm(char transa,
566                              char transb,
567                              int m,
568                              int n,
569                              int k,
570                              cuComplex alpha,
571                              const cuComplex* A,
572                              int lda,
573                              const cuComplex* B,
574                              int ldb,
575                              cuComplex beta,
576                              cuComplex* C,
577                              int ldc);
578void CUBLASWINAPI cublasZgemm(char transa,
579                              char transb,
580                              int m,
581                              int n,
582                              int k,
583                              cuDoubleComplex alpha,
584                              const cuDoubleComplex* A,
585                              int lda,
586                              const cuDoubleComplex* B,
587                              int ldb,
588                              cuDoubleComplex beta,
589                              cuDoubleComplex* C,
590                              int ldc);
591/* -------------------------------------------------------*/
592/* SYRK */
593void CUBLASWINAPI
594cublasSsyrk(char uplo, char trans, int n, int k, float alpha, const float* A, int lda, float beta, float* C, int ldc);
595void CUBLASWINAPI cublasDsyrk(
596    char uplo, char trans, int n, int k, double alpha, const double* A, int lda, double beta, double* C, int ldc);
597
598void CUBLASWINAPI cublasCsyrk(char uplo,
599                              char trans,
600                              int n,
601                              int k,
602                              cuComplex alpha,
603                              const cuComplex* A,
604                              int lda,
605                              cuComplex beta,
606                              cuComplex* C,
607                              int ldc);
608void CUBLASWINAPI cublasZsyrk(char uplo,
609                              char trans,
610                              int n,
611                              int k,
612                              cuDoubleComplex alpha,
613                              const cuDoubleComplex* A,
614                              int lda,
615                              cuDoubleComplex beta,
616                              cuDoubleComplex* C,
617                              int ldc);
618/* ------------------------------------------------------- */
619/* HERK */
620void CUBLASWINAPI cublasCherk(
621    char uplo, char trans, int n, int k, float alpha, const cuComplex* A, int lda, float beta, cuComplex* C, int ldc);
622void CUBLASWINAPI cublasZherk(char uplo,
623                              char trans,
624                              int n,
625                              int k,
626                              double alpha,
627                              const cuDoubleComplex* A,
628                              int lda,
629                              double beta,
630                              cuDoubleComplex* C,
631                              int ldc);
632/* ------------------------------------------------------- */
633/* SYR2K */
634void CUBLASWINAPI cublasSsyr2k(char uplo,
635                               char trans,
636                               int n,
637                               int k,
638                               float alpha,
639                               const float* A,
640                               int lda,
641                               const float* B,
642                               int ldb,
643                               float beta,
644                               float* C,
645                               int ldc);
646
647void CUBLASWINAPI cublasDsyr2k(char uplo,
648                               char trans,
649                               int n,
650                               int k,
651                               double alpha,
652                               const double* A,
653                               int lda,
654                               const double* B,
655                               int ldb,
656                               double beta,
657                               double* C,
658                               int ldc);
659void CUBLASWINAPI cublasCsyr2k(char uplo,
660                               char trans,
661                               int n,
662                               int k,
663                               cuComplex alpha,
664                               const cuComplex* A,
665                               int lda,
666                               const cuComplex* B,
667                               int ldb,
668                               cuComplex beta,
669                               cuComplex* C,
670                               int ldc);
671
672void CUBLASWINAPI cublasZsyr2k(char uplo,
673                               char trans,
674                               int n,
675                               int k,
676                               cuDoubleComplex alpha,
677                               const cuDoubleComplex* A,
678                               int lda,
679                               const cuDoubleComplex* B,
680                               int ldb,
681                               cuDoubleComplex beta,
682                               cuDoubleComplex* C,
683                               int ldc);
684/* ------------------------------------------------------- */
685/* HER2K */
686void CUBLASWINAPI cublasCher2k(char uplo,
687                               char trans,
688                               int n,
689                               int k,
690                               cuComplex alpha,
691                               const cuComplex* A,
692                               int lda,
693                               const cuComplex* B,
694                               int ldb,
695                               float beta,
696                               cuComplex* C,
697                               int ldc);
698
699void CUBLASWINAPI cublasZher2k(char uplo,
700                               char trans,
701                               int n,
702                               int k,
703                               cuDoubleComplex alpha,
704                               const cuDoubleComplex* A,
705                               int lda,
706                               const cuDoubleComplex* B,
707                               int ldb,
708                               double beta,
709                               cuDoubleComplex* C,
710                               int ldc);
711
712/*------------------------------------------------------------------------*/
713/* SYMM*/
714void CUBLASWINAPI cublasSsymm(char side,
715                              char uplo,
716                              int m,
717                              int n,
718                              float alpha,
719                              const float* A,
720                              int lda,
721                              const float* B,
722                              int ldb,
723                              float beta,
724                              float* C,
725                              int ldc);
726void CUBLASWINAPI cublasDsymm(char side,
727                              char uplo,
728                              int m,
729                              int n,
730                              double alpha,
731                              const double* A,
732                              int lda,
733                              const double* B,
734                              int ldb,
735                              double beta,
736                              double* C,
737                              int ldc);
738
739void CUBLASWINAPI cublasCsymm(char side,
740                              char uplo,
741                              int m,
742                              int n,
743                              cuComplex alpha,
744                              const cuComplex* A,
745                              int lda,
746                              const cuComplex* B,
747                              int ldb,
748                              cuComplex beta,
749                              cuComplex* C,
750                              int ldc);
751
752void CUBLASWINAPI cublasZsymm(char side,
753                              char uplo,
754                              int m,
755                              int n,
756                              cuDoubleComplex alpha,
757                              const cuDoubleComplex* A,
758                              int lda,
759                              const cuDoubleComplex* B,
760                              int ldb,
761                              cuDoubleComplex beta,
762                              cuDoubleComplex* C,
763                              int ldc);
764/*------------------------------------------------------------------------*/
765/* HEMM*/
766void CUBLASWINAPI cublasChemm(char side,
767                              char uplo,
768                              int m,
769                              int n,
770                              cuComplex alpha,
771                              const cuComplex* A,
772                              int lda,
773                              const cuComplex* B,
774                              int ldb,
775                              cuComplex beta,
776                              cuComplex* C,
777                              int ldc);
778void CUBLASWINAPI cublasZhemm(char side,
779                              char uplo,
780                              int m,
781                              int n,
782                              cuDoubleComplex alpha,
783                              const cuDoubleComplex* A,
784                              int lda,
785                              const cuDoubleComplex* B,
786                              int ldb,
787                              cuDoubleComplex beta,
788                              cuDoubleComplex* C,
789                              int ldc);
790
791/*------------------------------------------------------------------------*/
792/* TRSM*/
793void CUBLASWINAPI cublasStrsm(char side,
794                              char uplo,
795                              char transa,
796                              char diag,
797                              int m,
798                              int n,
799                              float alpha,
800                              const float* A,
801                              int lda,
802                              float* B,
803                              int ldb);
804
805void CUBLASWINAPI cublasDtrsm(char side,
806                              char uplo,
807                              char transa,
808                              char diag,
809                              int m,
810                              int n,
811                              double alpha,
812                              const double* A,
813                              int lda,
814                              double* B,
815                              int ldb);
816
817void CUBLASWINAPI cublasCtrsm(char side,
818                              char uplo,
819                              char transa,
820                              char diag,
821                              int m,
822                              int n,
823                              cuComplex alpha,
824                              const cuComplex* A,
825                              int lda,
826                              cuComplex* B,
827                              int ldb);
828
829void CUBLASWINAPI cublasZtrsm(char side,
830                              char uplo,
831                              char transa,
832                              char diag,
833                              int m,
834                              int n,
835                              cuDoubleComplex alpha,
836                              const cuDoubleComplex* A,
837                              int lda,
838                              cuDoubleComplex* B,
839                              int ldb);
840/*------------------------------------------------------------------------*/
841/* TRMM*/
842void CUBLASWINAPI cublasStrmm(char side,
843                              char uplo,
844                              char transa,
845                              char diag,
846                              int m,
847                              int n,
848                              float alpha,
849                              const float* A,
850                              int lda,
851                              float* B,
852                              int ldb);
853void CUBLASWINAPI cublasDtrmm(char side,
854                              char uplo,
855                              char transa,
856                              char diag,
857                              int m,
858                              int n,
859                              double alpha,
860                              const double* A,
861                              int lda,
862                              double* B,
863                              int ldb);
864void CUBLASWINAPI cublasCtrmm(char side,
865                              char uplo,
866                              char transa,
867                              char diag,
868                              int m,
869                              int n,
870                              cuComplex alpha,
871                              const cuComplex* A,
872                              int lda,
873                              cuComplex* B,
874                              int ldb);
875void CUBLASWINAPI cublasZtrmm(char side,
876                              char uplo,
877                              char transa,
878                              char diag,
879                              int m,
880                              int n,
881                              cuDoubleComplex alpha,
882                              const cuDoubleComplex* A,
883                              int lda,
884                              cuDoubleComplex* B,
885                              int ldb);
886
887#if defined(__cplusplus)
888}
889#endif /* __cplusplus */
890
891#endif /* !defined(CUBLAS_H_) */
892 
codekingpro/portable-devtools · Team Ai