This repository has been archived by the owner on May 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
cblas.nim
504 lines (493 loc) · 31.9 KB
/
cblas.nim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
#_____________________________________________________________________________
#
# Manually patched after conversion from cblas.h by c2nim 0.94
#
# Emre Safak (c) 2014
#
# To do: Check that all the arrays are actually supposed to use the
# same range I. I bet they aren't, but this is just an initial commit.
#
# Note that the arrays are untraced; the procedures may modify their contents.
#_____________________________________________________________________________
when not(defined(CBLAS_H)):
const
CBLAS_H* = true
#
# Enumerated and derived types
#
type
CBLAS_INDEX* = csize # was size_t
type
CBLAS_ORDER* = enum
CblasRowMajor = 101, CblasColMajor = 102
type
CBLAS_TRANSPOSE* = enum
CblasNoTrans = 111, CblasTrans = 112, CblasConjTrans = 113
type
CBLAS_UPLO* = enum
CblasUpper = 121, CblasLower = 122
type
CBLAS_DIAG* = enum
CblasNonUnit = 131, CblasUnit = 132
type
CBLAS_SIDE* = enum
CblasLeft = 141, CblasRight = 142
#
# ===========================================================================
# Prototypes for level 1 BLAS functions (complex are recast as routines)
# ===========================================================================
#
{.push header: "<cblas.h>", nodecl.}
proc sdsdot*[I](N: cint; alpha: cfloat; X: array[I, cfloat]; incX: cint;
Y: array[I, cfloat]; incY: cint): cfloat {.importc: "cblas_sdsdot".}
proc dsdot*[I](N: cint; X: array[I, cfloat]; incX: cint; Y: array[I, cfloat];
incY: cint): cdouble {.importc: "cblas_dsdot".}
proc sdot*[I](N: cint; X: array[I, cfloat]; incX: cint; Y: array[I, cfloat];
incY: cint): cfloat {.importc: "cblas_sdot".}
proc ddot*[I](N: cint; X: array[I, cdouble]; incX: cint; Y: array[I, cdouble];
incY: cint): cdouble {.importc: "cblas_ddot".}
#
# Functions having prefixes Z and C only
#
proc cdotu_sub*(N: cint; X: pointer; incX: cint; Y: pointer; incY: cint;
dotu: pointer) {.importc: "cblas_cdotu_sub".}
proc cdotc_sub*(N: cint; X: pointer; incX: cint; Y: pointer; incY: cint;
dotc: pointer) {.importc: "cblas_cdotc_sub".}
proc zdotu_sub*(N: cint; X: pointer; incX: cint; Y: pointer; incY: cint;
dotu: pointer) {.importc: "cblas_zdotu_sub".}
proc zdotc_sub*(N: cint; X: pointer; incX: cint; Y: pointer; incY: cint;
dotc: pointer) {.importc: "cblas_zdotc_sub".}
#
# Functions having prefixes S D SC DZ
# {.importc: "".}
proc snrm2*[I](N: cint; X: array[I, cfloat]; incX: cint): cfloat {.importc: "cblas_snrm2".}
proc sasum*[I](N: cint; X: array[I, cfloat]; incX: cint): cfloat {.importc: "cblas_sasum".}
proc dnrm2*[I](N: cint; X: array[I, cdouble]; incX: cint): cdouble {.importc: "cblas_dnrm2".}
proc dasum*[I](N: cint; X: array[I, cdouble]; incX: cint): cdouble {.importc: "cblas_dasum".}
proc scnrm2*(N: cint; X: pointer; incX: cint): cfloat {.importc: "cblas_scnrm2".}
proc scasum*(N: cint; X: pointer; incX: cint): cfloat {.importc: "cblas_scasum".}
proc dznrm2*(N: cint; X: pointer; incX: cint): cdouble {.importc: "cblas_dznrm2".}
proc dzasum*(N: cint; X: pointer; incX: cint): cdouble {.importc: "cblas_dzasum".}
#
# Functions having standard 4 prefixes (S D C Z)
#
proc isamax*[I](N: cint; X: array[I, cfloat]; incX: cint): CBLAS_INDEX {.importc: "cblas_isamax".}
proc idamax*[I](N: cint; X: array[I, cdouble]; incX: cint): CBLAS_INDEX {.importc: "cblas_idamax".}
proc icamax*(N: cint; X: pointer; incX: cint): CBLAS_INDEX {.importc: "cblas_icamax".}
proc izamax*(N: cint; X: pointer; incX: cint): CBLAS_INDEX {.importc: "cblas_izamax".}
#
# ===========================================================================
# Prototypes for level 1 BLAS routines
# ===========================================================================
#
#
# Routines with standard 4 prefixes (s, d, c, z)
#
proc sswap*[I](N: cint; X: array[I, cfloat]; incX: cint; Y: array[I, cfloat];
incY: cint) {.importc: "cblas_sswap".}
proc scopy*[I](N: cint; X: array[I, cfloat]; incX: cint; Y: array[I, cfloat];
incY: cint) {.importc: "cblas_scopy".}
proc saxpy*[I](N: cint; alpha: cfloat; X: array[I, cfloat]; incX: cint;
Y: array[I, cfloat]; incY: cint) {.importc: "cblas_saxpy".}
proc dswap*[I](N: cint; X: array[I, cdouble]; incX: cint; Y: array[I, cdouble];
incY: cint) {.importc: "cblas_dswap".}
proc dcopy*[I](N: cint; X: array[I, cdouble]; incX: cint; Y: array[I, cdouble];
incY: cint) {.importc: "cblas_dcopy".}
proc daxpy*[I](N: cint; alpha: cdouble; X: array[I, cdouble]; incX: cint;
Y: array[I, cdouble]; incY: cint) {.importc: "cblas_daxpy".}
proc cswap*(N: cint; X: pointer; incX: cint; Y: pointer;
incY: cint) {.importc: "cblas_cswap".}
proc ccopy*(N: cint; X: pointer; incX: cint; Y: pointer;
incY: cint) {.importc: "cblas_ccopy".}
proc caxpy*(N: cint; alpha: pointer; X: pointer; incX: cint; Y: pointer;
incY: cint) {.importc: "cblas_caxpy".}
proc zswap*(N: cint; X: pointer; incX: cint; Y: pointer;
incY: cint) {.importc: "cblas_zswap".}
proc zcopy*(N: cint; X: pointer; incX: cint; Y: pointer;
incY: cint) {.importc: "cblas_zcopy".}
proc zaxpy*(N: cint; alpha: pointer; X: pointer; incX: cint; Y: pointer;
incY: cint) {.importc: "cblas_zaxpy".}
#
# Routines with S and D prefix only
#
proc srotg*[I](a: array[I, cfloat]; b: array[I, cfloat]; c: array[I, cfloat];
s: array[I, cfloat]) {.importc: "cblas_srotg".}
proc srotmg*[I](d1: array[I, cfloat]; d2: array[I, cfloat]; b1: array[I, cfloat];
b2: cfloat; P: array[I, cfloat]) {.importc: "cblas_srotmg".}
proc srot*[I](N: cint; X: array[I, cfloat]; incX: cint; Y: array[I, cfloat];
incY: cint; c: cfloat; s: cfloat) {.importc: "cblas_srot".}
proc srotm*[I](N: cint; X: array[I, cfloat]; incX: cint; Y: array[I, cfloat];
incY: cint; P: array[I, cfloat]) {.importc: "cblas_srotm".}
proc drotg*[I](a: array[I, cdouble]; b: array[I, cdouble]; c: array[I, cdouble];
s: array[I, cdouble]) {.importc: "cblas_drotg".}
proc drotmg*[I](d1: array[I, cdouble]; d2: array[I, cdouble]; b1: array[I, cdouble];
b2: cdouble; P: array[I, cdouble]) {.importc: "cblas_drotmg".}
proc drot*[I](N: cint; X: array[I, cdouble]; incX: cint; Y: array[I, cdouble];
incY: cint; c: cdouble; s: cdouble) {.importc: "cblas_drot".}
proc drotm*[I](N: cint; X: array[I, cdouble]; incX: cint; Y: array[I, cdouble];
incY: cint; P: array[I, cdouble]) {.importc: "cblas_drotm".}
#
# Routines with S D C Z CS and ZD prefixes
#
proc sscal*[I](N: cint; alpha: cfloat; X: array[I, cfloat]; incX: cint) {.importc: "cblas_sscal".}
proc dscal*[I](N: cint; alpha: cdouble; X: array[I, cdouble]; incX: cint) {.importc: "cblas_dscal".}
proc cscal*(N: cint; alpha: pointer; X: pointer; incX: cint) {.importc: "cblas_cscal".}
proc zscal*(N: cint; alpha: pointer; X: pointer; incX: cint) {.importc: "cblas_zscal".}
proc csscal*(N: cint; alpha: cfloat; X: pointer; incX: cint) {.importc: "cblas_csscal".}
proc zdscal*(N: cint; alpha: cdouble; X: pointer; incX: cint) {.importc: "cblas_zdscal".}
#
# ===========================================================================
# Prototypes for level 2 BLAS
# ===========================================================================
#
#
# Routines with standard 4 prefixes (S, D, C, Z)
#
proc sgemv*[I](order: CBLAS_ORDER; TransA: CBLAS_TRANSPOSE; M: cint;
N: cint; alpha: cfloat; A: array[I, cfloat]; lda: cint;
X: array[I, cfloat]; incX: cint; beta: cfloat;
Y: array[I, cfloat]; incY: cint) {.importc: "cblas_sgemv".}
proc sgbmv*[I](order: CBLAS_ORDER; TransA: CBLAS_TRANSPOSE; M: cint; N: cint;
KL: cint; KU: cint; alpha: cfloat; A: array[I, cfloat];
lda: cint; X: array[I, cfloat]; incX: cint; beta: cfloat;
Y: array[I, cfloat]; incY: cint) {.importc: "cblas_sgbmv".}
proc strmv*[I](order: CBLAS_ORDER; Uplo: CBLAS_UPLO; TransA: CBLAS_TRANSPOSE;
Diag: CBLAS_DIAG; N: cint; A: array[I, cfloat]; lda: cint;
X: array[I, cfloat]; incX: cint) {.importc: "cblas_strmv".}
proc stbmv*[I](order: CBLAS_ORDER; Uplo: CBLAS_UPLO; TransA: CBLAS_TRANSPOSE;
Diag: CBLAS_DIAG; N: cint; K: cint; A: array[I, cfloat]; lda: cint;
X: array[I, cfloat]; incX: cint) {.importc: "cblas_stbmv".}
proc stpmv*[I](order: CBLAS_ORDER; Uplo: CBLAS_UPLO; TransA: CBLAS_TRANSPOSE;
Diag: CBLAS_DIAG; N: cint; Ap: array[I, cfloat];
X: array[I, cfloat]; incX: cint) {.importc: "cblas_stpmv".}
proc strsv*[I](order: CBLAS_ORDER; Uplo: CBLAS_UPLO; TransA: CBLAS_TRANSPOSE;
Diag: CBLAS_DIAG; N: cint; A: array[I, cfloat]; lda: cint;
X: array[I, cfloat]; incX: cint) {.importc: "cblas_strsv".}
proc stbsv*[I](order: CBLAS_ORDER; Uplo: CBLAS_UPLO; TransA: CBLAS_TRANSPOSE;
Diag: CBLAS_DIAG; N: cint; K: cint; A: array[I, cfloat]; lda: cint;
X: array[I, cfloat]; incX: cint) {.importc: "cblas_stbsv".}
proc stpsv*[I](order: CBLAS_ORDER; Uplo: CBLAS_UPLO; TransA: CBLAS_TRANSPOSE;
Diag: CBLAS_DIAG; N: cint; Ap: array[I, cfloat];
X: array[I, cfloat]; incX: cint) {.importc: "cblas_stpsv".}
proc dgemv*[I](order: CBLAS_ORDER; TransA: CBLAS_TRANSPOSE; M: cint;
N: cint; alpha: cdouble; A: array[I, cdouble]; lda: cint;
X: array[I, cdouble]; incX: cint; beta: cdouble;
Y: array[I, cdouble]; incY: cint) {.importc: "cblas_dgemv".}
proc dgbmv*[I](order: CBLAS_ORDER; TransA: CBLAS_TRANSPOSE; M: cint; N: cint;
KL: cint; KU: cint; alpha: cdouble; A: array[I, cdouble];
lda: cint; X: array[I, cdouble]; incX: cint; beta: cdouble;
Y: array[I, cdouble]; incY: cint) {.importc: "cblas_dgbmv".}
proc dtrmv*[I](order: CBLAS_ORDER; Uplo: CBLAS_UPLO; TransA: CBLAS_TRANSPOSE;
Diag: CBLAS_DIAG; N: cint; A: array[I, cdouble]; lda: cint;
X: array[I, cdouble]; incX: cint) {.importc: "cblas_dtrmv".}
proc dtbmv*[I](order: CBLAS_ORDER; Uplo: CBLAS_UPLO; TransA: CBLAS_TRANSPOSE;
Diag: CBLAS_DIAG; N: cint; K: cint; A: array[I, cdouble]; lda: cint;
X: array[I, cdouble]; incX: cint) {.importc: "cblas_dtbmv".}
proc dtpmv*[I](order: CBLAS_ORDER; Uplo: CBLAS_UPLO; TransA: CBLAS_TRANSPOSE;
Diag: CBLAS_DIAG; N: cint; Ap: array[I, cdouble];
X: array[I, cdouble]; incX: cint) {.importc: "cblas_dtpmv".}
proc dtrsv*[I](order: CBLAS_ORDER; Uplo: CBLAS_UPLO; TransA: CBLAS_TRANSPOSE;
Diag: CBLAS_DIAG; N: cint; A: array[I, cdouble]; lda: cint;
X: array[I, cdouble]; incX: cint) {.importc: "cblas_dtrsv".}
proc dtbsv*[I](order: CBLAS_ORDER; Uplo: CBLAS_UPLO;
TransA: CBLAS_TRANSPOSE; Diag: CBLAS_DIAG; N: cint; K: cint;
A: array[I, cdouble]; lda: cint; X: array[I, cdouble];
incX: cint) {.importc: "cblas_dtbsv".}
proc dtpsv*[I](order: CBLAS_ORDER; Uplo: CBLAS_UPLO; TransA: CBLAS_TRANSPOSE;
Diag: CBLAS_DIAG; N: cint; Ap: array[I, cdouble];
X: array[I, cdouble]; incX: cint) {.importc: "cblas_dtpsv".}
proc cgemv*(order: CBLAS_ORDER; TransA: CBLAS_TRANSPOSE; M: cint;
N: cint; alpha: pointer; A: pointer; lda: cint; X: pointer;
incX: cint; beta: pointer; Y: pointer;
incY: cint) {.importc: "cblas_cgemv".}
proc cgbmv*(order: CBLAS_ORDER; TransA: CBLAS_TRANSPOSE; M: cint;
N: cint; KL: cint; KU: cint; alpha: pointer; A: pointer;
lda: cint; X: pointer; incX: cint; beta: pointer;
Y: pointer; incY: cint) {.importc: "cblas_cgbmv".}
proc ctrmv*(order: CBLAS_ORDER; Uplo: CBLAS_UPLO; TransA: CBLAS_TRANSPOSE;
Diag: CBLAS_DIAG; N: cint; A: pointer; lda: cint; X: pointer;
incX: cint) {.importc: "cblas_ctrmv".}
proc ctbmv*(order: CBLAS_ORDER; Uplo: CBLAS_UPLO; TransA: CBLAS_TRANSPOSE;
Diag: CBLAS_DIAG; N: cint; K: cint; A: pointer; lda: cint;
X: pointer; incX: cint) {.importc: "cblas_ctbmv".}
proc ctpmv*(order: CBLAS_ORDER; Uplo: CBLAS_UPLO; TransA: CBLAS_TRANSPOSE;
Diag: CBLAS_DIAG; N: cint; Ap: pointer; X: pointer;
incX: cint) {.importc: "cblas_ctpmv".}
proc ctrsv*(order: CBLAS_ORDER; Uplo: CBLAS_UPLO; TransA: CBLAS_TRANSPOSE;
Diag: CBLAS_DIAG; N: cint; A: pointer; lda: cint; X: pointer;
incX: cint) {.importc: "cblas_ctrsv".}
proc ctbsv*(order: CBLAS_ORDER; Uplo: CBLAS_UPLO; TransA: CBLAS_TRANSPOSE;
Diag: CBLAS_DIAG; N: cint; K: cint; A: pointer; lda: cint;
X: pointer; incX: cint) {.importc: "cblas_ctbsv".}
proc ctpsv*(order: CBLAS_ORDER; Uplo: CBLAS_UPLO; TransA: CBLAS_TRANSPOSE;
Diag: CBLAS_DIAG; N: cint; Ap: pointer; X: pointer;
incX: cint) {.importc: "cblas_ctpsv".}
proc zgemv*(order: CBLAS_ORDER; TransA: CBLAS_TRANSPOSE; M: cint; N: cint;
alpha: pointer; A: pointer; lda: cint; X: pointer; incX: cint;
beta: pointer; Y: pointer; incY: cint) {.importc: "cblas_zgemv".}
proc zgbmv*(order: CBLAS_ORDER; TransA: CBLAS_TRANSPOSE; M: cint;
N: cint; KL: cint; KU: cint; alpha: pointer; A: pointer;
lda: cint; X: pointer; incX: cint; beta: pointer;
Y: pointer; incY: cint) {.importc: "cblas_zgbmv".}
proc ztrmv*(order: CBLAS_ORDER; Uplo: CBLAS_UPLO; TransA: CBLAS_TRANSPOSE;
Diag: CBLAS_DIAG; N: cint; A: pointer; lda: cint; X: pointer;
incX: cint) {.importc: "cblas_ztrmv".}
proc ztbmv*(order: CBLAS_ORDER; Uplo: CBLAS_UPLO; TransA: CBLAS_TRANSPOSE;
Diag: CBLAS_DIAG; N: cint; K: cint; A: pointer; lda: cint;
X: pointer; incX: cint) {.importc: "cblas_ztbmv".}
proc ztpmv*(order: CBLAS_ORDER; Uplo: CBLAS_UPLO; TransA: CBLAS_TRANSPOSE;
Diag: CBLAS_DIAG; N: cint; Ap: pointer; X: pointer;
incX: cint) {.importc: "cblas_ztpmv".}
proc ztrsv*(order: CBLAS_ORDER; Uplo: CBLAS_UPLO; TransA: CBLAS_TRANSPOSE;
Diag: CBLAS_DIAG; N: cint; A: pointer; lda: cint; X: pointer;
incX: cint) {.importc: "cblas_ztrsv".}
proc ztbsv*(order: CBLAS_ORDER; Uplo: CBLAS_UPLO; TransA: CBLAS_TRANSPOSE;
Diag: CBLAS_DIAG; N: cint; K: cint; A: pointer; lda: cint;
X: pointer; incX: cint) {.importc: "cblas_ztbsv".}
proc ztpsv*(order: CBLAS_ORDER; Uplo: CBLAS_UPLO; TransA: CBLAS_TRANSPOSE;
Diag: CBLAS_DIAG; N: cint;Ap: pointer; X: pointer;
incX: cint) {.importc: "cblas_ztpsv".}
#
# Routines with S and D prefixes only
#
proc ssymv*[I](order: CBLAS_ORDER; Uplo: CBLAS_UPLO; N: cint;
alpha: cfloat; A: array[I, cfloat]; lda: cint;
X: array[I, cfloat]; incX: cint; beta: cfloat;
Y: array[I, cfloat]; incY: cint) {.importc: "cblas_ssymv".}
proc ssbmv*[I](order: CBLAS_ORDER; Uplo: CBLAS_UPLO; N: cint; K: cint;
alpha: cfloat; A: array[I, cfloat]; lda: cint;
X: array[I, cfloat]; incX: cint; beta: cfloat;
Y: array[I, cfloat]; incY: cint) {.importc: "cblas_ssbmv".}
proc sspmv*[I](order: CBLAS_ORDER; Uplo: CBLAS_UPLO; N: cint; alpha: cfloat;
Ap: array[I, cfloat]; X: array[I, cfloat]; incX: cint;
beta: cfloat; Y: array[I, cfloat];
incY: cint) {.importc: "cblas_sspmv".}
proc sger*[I](order: CBLAS_ORDER; M: cint; N: cint; alpha: cfloat;
X: array[I, cfloat]; incX: cint; Y: array[I, cfloat]; incY: cint;
A: array[I, cfloat]; lda: cint) {.importc: "cblas_sger".}
proc ssyr*[I](order: CBLAS_ORDER; Uplo: CBLAS_UPLO; N: cint; alpha: cfloat;
X: array[I, cfloat]; incX: cint; A: array[I, cfloat];
lda: cint) {.importc: "cblas_ssyr".}
proc sspr*[I](order: CBLAS_ORDER; Uplo: CBLAS_UPLO; N: cint;
alpha: cfloat; X: array[I, cfloat]; incX: cint;
Ap: array[I, cfloat]) {.importc: "cblas_sspr".}
proc ssyr2*[I](order: CBLAS_ORDER; Uplo: CBLAS_UPLO; N: cint;
alpha: cfloat; X: array[I, cfloat]; incX: cint;
Y: array[I, cfloat]; incY: cint; A: array[I, cfloat];
lda: cint) {.importc: "cblas_ssyr2".}
proc sspr2*[I](order: CBLAS_ORDER; Uplo: CBLAS_UPLO; N: cint; alpha: cfloat;
X: array[I, cfloat]; incX: cint; Y: array[I, cfloat];
incY: cint; A: array[I, cfloat]) {.importc: "cblas_sspr2".}
proc dsymv*[I](order: CBLAS_ORDER; Uplo: CBLAS_UPLO; N: cint;
alpha: cdouble; A: array[I, cdouble]; lda: cint;
X: array[I, cdouble]; incX: cint; beta: cdouble;
Y: array[I, cdouble]; incY: cint) {.importc: "cblas_dsymv".}
proc dsbmv*[I](order: CBLAS_ORDER; Uplo: CBLAS_UPLO; N: cint; K: cint;
alpha: cdouble; A: array[I, cdouble]; lda: cint;
X: array[I, cdouble]; incX: cint; beta: cdouble;
Y: array[I, cdouble]; incY: cint) {.importc: "cblas_dsbmv".}
proc dspmv*[I](order: CBLAS_ORDER; Uplo: CBLAS_UPLO; N: cint; alpha: cdouble;
Ap: array[I, cdouble]; X: array[I, cdouble]; incX: cint;
beta: cdouble; Y: array[I, cdouble];
incY: cint) {.importc: "cblas_dspmv".}
proc dger*[I](order: CBLAS_ORDER; M: cint; N: cint; alpha: cdouble;
X: array[I, cdouble]; incX: cint; Y: array[I, cdouble]; incY: cint;
A: array[I, cdouble]; lda: cint) {.importc: "cblas_dger".}
proc dsyr*[I](order: CBLAS_ORDER; Uplo: CBLAS_UPLO; N: cint;
alpha: cdouble; X: array[I, cdouble]; incX: cint;
A: array[I, cdouble]; lda: cint) {.importc: "cblas_dsyr".}
proc dspr*[I](order: CBLAS_ORDER; Uplo: CBLAS_UPLO; N: cint;
alpha: cdouble; X: array[I, cdouble]; incX: cint;
Ap: array[I, cdouble]) {.importc: "cblas_dspr".}
proc dsyr2*[I](order: CBLAS_ORDER; Uplo: CBLAS_UPLO; N: cint;
alpha: cdouble; X: array[I, cdouble]; incX: cint;
Y: array[I, cdouble]; incY: cint; A: array[I, cdouble];
lda: cint) {.importc: "cblas_dsyr2".}
proc dspr2*[I](order: CBLAS_ORDER; Uplo: CBLAS_UPLO; N: cint; alpha: cdouble;
X: array[I, cdouble]; incX: cint; Y: array[I, cdouble];
incY: cint; A: array[I, cdouble]) {.importc: "cblas_dspr2".}
#
# Routines with C and Z prefixes only
#
proc chemv*(order: CBLAS_ORDER; Uplo: CBLAS_UPLO; N: cint; alpha: pointer;
A: pointer; lda: cint; X: pointer; incX: cint; beta: pointer;
Y: pointer; incY: cint) {.importc: "cblas_chemv".}
proc chbmv*(order: CBLAS_ORDER; Uplo: CBLAS_UPLO; N: cint; K: cint;
alpha: pointer; A: pointer; lda: cint; X: pointer;
incX: cint; beta: pointer; Y: pointer;
incY: cint) {.importc: "cblas_chbmv".}
proc chpmv*(order: CBLAS_ORDER; Uplo: CBLAS_UPLO; N: cint; alpha: pointer;
Ap: pointer; X: pointer; incX: cint; beta: pointer;
Y: pointer; incY: cint) {.importc: "cblas_chpmv".}
proc cgeru*(order: CBLAS_ORDER; M: cint; N: cint; alpha: pointer;
X: pointer; incX: cint; Y: pointer; incY: cint; A: pointer;
lda: cint) {.importc: "cblas_cgeru".}
proc cgerc*(order: CBLAS_ORDER; M: cint; N: cint; alpha: pointer;
X: pointer; incX: cint; Y: pointer; incY: cint;
A: pointer; lda: cint) {.importc: "cblas_cgerc".}
proc cher*(order: CBLAS_ORDER; Uplo: CBLAS_UPLO; N: cint; alpha: cfloat;
X: pointer; incX: cint; A: pointer;
lda: cint) {.importc: "cblas_cher".}
proc chpr*(order: CBLAS_ORDER; Uplo: CBLAS_UPLO; N: cint; alpha: cfloat;
X: pointer; incX: cint; A: pointer) {.importc: "cblas_chpr".}
proc cher2*(order: CBLAS_ORDER; Uplo: CBLAS_UPLO; N: cint; alpha: pointer;
X: pointer; incX: cint; Y: pointer; incY: cint; A: pointer;
lda: cint) {.importc: "cblas_cher2".}
proc chpr2*(order: CBLAS_ORDER; Uplo: CBLAS_UPLO; N: cint; alpha: pointer;
X: pointer; incX: cint; Y: pointer; incY: cint;
Ap: pointer) {.importc: "cblas_chpr2".}
proc zhemv*(order: CBLAS_ORDER; Uplo: CBLAS_UPLO; N: cint; alpha: pointer;
A: pointer; lda: cint; X: pointer; incX: cint; beta: pointer;
Y: pointer; incY: cint) {.importc: "cblas_zhemv".}
proc zhbmv*(order: CBLAS_ORDER; Uplo: CBLAS_UPLO; N: cint; K: cint;
alpha: pointer; A: pointer; lda: cint; X: pointer;
incX: cint; beta: pointer; Y: pointer;
incY: cint) {.importc: "cblas_zhbmv".}
proc zhpmv*(order: CBLAS_ORDER; Uplo: CBLAS_UPLO; N: cint; alpha: pointer;
Ap: pointer; X: pointer; incX: cint; beta: pointer;
Y: pointer; incY: cint) {.importc: "cblas_zhpmv".}
proc zgeru*(order: CBLAS_ORDER; M: cint; N: cint; alpha: pointer;
X: pointer; incX: cint; Y: pointer; incY: cint; A: pointer;
lda: cint) {.importc: "cblas_zgeru".}
proc zgerc*(order: CBLAS_ORDER; M: cint; N: cint; alpha: pointer;
X: pointer; incX: cint; Y: pointer; incY: cint; A: pointer;
lda: cint) {.importc: "cblas_zgerc".}
proc zher*(order: CBLAS_ORDER; Uplo: CBLAS_UPLO; N: cint; alpha: cdouble;
X: pointer; incX: cint; A: pointer; lda: cint) {.importc: "cblas_zher".}
proc zhpr*(order: CBLAS_ORDER; Uplo: CBLAS_UPLO; N: cint; alpha: cdouble;
X: pointer; incX: cint; A: pointer) {.importc: "cblas_zhpr".}
proc zher2*(order: CBLAS_ORDER; Uplo: CBLAS_UPLO; N: cint; alpha: pointer;
X: pointer; incX: cint; Y: pointer; incY: cint; A: pointer;
lda: cint) {.importc: "cblas_zher2".}
proc zhpr2*(order: CBLAS_ORDER; Uplo: CBLAS_UPLO; N: cint; alpha: pointer;
X: pointer; incX: cint; Y: pointer; incY: cint;
Ap: pointer) {.importc: "cblas_zhpr2".}
#
# ===========================================================================
# Prototypes for level 3 BLAS
# ===========================================================================
#
#
# Routines with standard 4 prefixes (S, D, C, Z)
#
proc sgemm*[I](Order: CBLAS_ORDER; TransA: CBLAS_TRANSPOSE; TransB: CBLAS_TRANSPOSE;
M: cint; N: cint; K: cint; alpha: cfloat; A: array[I, cfloat];
lda: cint; B: array[I, cfloat]; ldb: cint; beta: cfloat;
C: array[I, cfloat]; ldc: cint) {.importc: "cblas_sgemm".}
proc ssymm*[I](Order: CBLAS_ORDER; Side: CBLAS_SIDE; Uplo: CBLAS_UPLO; M: cint;
N: cint; alpha: cfloat; A: array[I, cfloat]; lda: cint;
B: array[I, cfloat]; ldb: cint; beta: cfloat; C: array[I, cfloat];
ldc: cint) {.importc: "cblas_ssymm".}
proc ssyrk*[I](Order: CBLAS_ORDER; Uplo: CBLAS_UPLO; Trans: CBLAS_TRANSPOSE;
N: cint; K: cint; alpha: cfloat; A: array[I, cfloat];
lda: cint; beta: cfloat; C: array[I, cfloat];
ldc: cint) {.importc: "cblas_ssyrk".}
proc ssyr2k*[I](Order: CBLAS_ORDER; Uplo: CBLAS_UPLO; Trans: CBLAS_TRANSPOSE;
N: cint; K: cint; alpha: cfloat; A: array[I, cfloat]; lda: cint;
B: array[I, cfloat]; ldb: cint; beta: cfloat; C: array[I, cfloat];
ldc: cint) {.importc: "cblas_ssyr2k".}
proc strmm*[I](Order: CBLAS_ORDER; Side: CBLAS_SIDE; Uplo: CBLAS_UPLO;
TransA: CBLAS_TRANSPOSE; Diag: CBLAS_DIAG; M: cint; N: cint;
alpha: cfloat; A: array[I, cfloat]; lda: cint; B: array[I, cfloat];
ldb: cint) {.importc: "cblas_strmm".}
proc strsm*[I](Order: CBLAS_ORDER; Side: CBLAS_SIDE; Uplo: CBLAS_UPLO;
TransA: CBLAS_TRANSPOSE; Diag: CBLAS_DIAG; M: cint; N: cint;
alpha: cfloat; A: array[I, cfloat]; lda: cint; B: array[I, cfloat];
ldb: cint) {.importc: "cblas_strsm".}
proc dgemm*[I](Order: CBLAS_ORDER; TransA: CBLAS_TRANSPOSE; TransB: CBLAS_TRANSPOSE;
M: cint; N: cint; K: cint; alpha: cdouble; A: array[I, cdouble];
lda: cint; B: array[I, cdouble]; ldb: cint; beta: cdouble;
C: array[I, cdouble]; ldc: cint) {.importc: "cblas_dgemm".}
proc dsymm*[I](Order: CBLAS_ORDER; Side: CBLAS_SIDE; Uplo: CBLAS_UPLO; M: cint;
N: cint; alpha: cdouble; A: array[I, cdouble]; lda: cint;
B: array[I, cdouble]; ldb: cint; beta: cdouble;
C: array[I, cdouble]; ldc: cint) {.importc: "cblas_dsymm".}
proc dsyrk*[I](Order: CBLAS_ORDER; Uplo: CBLAS_UPLO; Trans: CBLAS_TRANSPOSE;
N: cint; K: cint; alpha: cdouble; A: array[I, cdouble];
lda: cint; beta: cdouble; C: array[I, cdouble];
ldc: cint) {.importc: "cblas_dsyrk".}
proc dsyr2k*[I](Order: CBLAS_ORDER; Uplo: CBLAS_UPLO; Trans: CBLAS_TRANSPOSE;
N: cint; K: cint; alpha: cdouble; A: array[I, cdouble];
lda: cint; B: array[I, cdouble]; ldb: cint; beta: cdouble;
C: array[I, cdouble]; ldc: cint) {.importc: "cblas_dsyr2k".}
proc dtrmm*[I](Order: CBLAS_ORDER; Side: CBLAS_SIDE; Uplo: CBLAS_UPLO;
TransA: CBLAS_TRANSPOSE; Diag: CBLAS_DIAG; M: cint; N: cint;
alpha: cdouble; A: array[I, cdouble]; lda: cint;
B: array[I, cdouble]; ldb: cint) {.importc: "cblas_dtrmm".}
proc dtrsm*[I](Order: CBLAS_ORDER; Side: CBLAS_SIDE; Uplo: CBLAS_UPLO;
TransA: CBLAS_TRANSPOSE; Diag: CBLAS_DIAG; M: cint; N: cint;
alpha: cdouble; A: array[I, cdouble]; lda: cint;
B: array[I, cdouble]; ldb: cint) {.importc: "cblas_dtrsm".}
proc cgemm*(Order: CBLAS_ORDER; TransA: CBLAS_TRANSPOSE; TransB: CBLAS_TRANSPOSE;
M: cint; N: cint; K: cint; alpha: pointer; A: pointer;
lda: cint; B: pointer; ldb: cint; beta: pointer; C: pointer;
ldc: cint) {.importc: "cblas_cgemm".}
proc csymm*(Order: CBLAS_ORDER; Side: CBLAS_SIDE; Uplo: CBLAS_UPLO;
M: cint; N: cint; alpha: pointer; A: pointer; lda: cint;
B: pointer; ldb: cint; beta: pointer; C: pointer;
ldc: cint) {.importc: "cblas_csymm".}
proc csyrk*(Order: CBLAS_ORDER; Uplo: CBLAS_UPLO; Trans: CBLAS_TRANSPOSE;
N: cint; K: cint; alpha: pointer; A: pointer; lda: cint;
beta: pointer; C: pointer; ldc: cint) {.importc: "cblas_csyrk".}
proc csyr2k*(Order: CBLAS_ORDER; Uplo: CBLAS_UPLO; Trans: CBLAS_TRANSPOSE;
N: cint; K: cint; alpha: pointer; A: pointer; lda: cint;
B: pointer; ldb: cint; beta: pointer; C: pointer;
ldc: cint) {.importc: "cblas_csyr2k".}
proc ctrmm*(Order: CBLAS_ORDER; Side: CBLAS_SIDE; Uplo: CBLAS_UPLO;
TransA: CBLAS_TRANSPOSE; Diag: CBLAS_DIAG; M: cint; N: cint;
alpha: pointer; A: pointer; lda: cint; B: pointer;
ldb: cint) {.importc: "cblas_ctrmm".}
proc ctrsm*(Order: CBLAS_ORDER; Side: CBLAS_SIDE; Uplo: CBLAS_UPLO;
TransA: CBLAS_TRANSPOSE; Diag: CBLAS_DIAG; M: cint; N: cint;
alpha: pointer; A: pointer; lda: cint; B: pointer;
ldb: cint) {.importc: "cblas_ctrsm".}
proc zgemm*(Order: CBLAS_ORDER; TransA: CBLAS_TRANSPOSE; TransB: CBLAS_TRANSPOSE;
M: cint; N: cint; K: cint; alpha: pointer; A: pointer;
lda: cint; B: pointer; ldb: cint; beta: pointer; C: pointer;
ldc: cint) {.importc: "cblas_zgemm".}
proc zsymm*(Order: CBLAS_ORDER; Side: CBLAS_SIDE; Uplo: CBLAS_UPLO;
M: cint; N: cint; alpha: pointer; A: pointer; lda: cint;
B: pointer; ldb: cint; beta: pointer; C: pointer;
ldc: cint) {.importc: "cblas_zsymm".}
proc zsyrk*(Order: CBLAS_ORDER; Uplo: CBLAS_UPLO; Trans: CBLAS_TRANSPOSE;
N: cint; K: cint; alpha: pointer; A: pointer; lda: cint;
beta: pointer; C: pointer; ldc: cint) {.importc: "cblas_zsyrk".}
proc zsyr2k*(Order: CBLAS_ORDER; Uplo: CBLAS_UPLO; Trans: CBLAS_TRANSPOSE;
N: cint; K: cint; alpha: pointer; A: pointer; lda: cint;
B: pointer; ldb: cint; beta: pointer; C: pointer;
ldc: cint) {.importc: "cblas_zsyr2k".}
proc ztrmm*(Order: CBLAS_ORDER; Side: CBLAS_SIDE; Uplo: CBLAS_UPLO;
TransA: CBLAS_TRANSPOSE; Diag: CBLAS_DIAG; M: cint; N: cint;
alpha: pointer; A: pointer; lda: cint; B: pointer;
ldb: cint) {.importc: "cblas_ztrmm".}
proc ztrsm*(Order: CBLAS_ORDER; Side: CBLAS_SIDE; Uplo: CBLAS_UPLO;
TransA: CBLAS_TRANSPOSE; Diag: CBLAS_DIAG; M: cint; N: cint;
alpha: pointer; A: pointer; lda: cint; B: pointer;
ldb: cint) {.importc: "cblas_ztrsm".}
#
# Routines with prefixes C and Z only
#
proc chemm*(Order: CBLAS_ORDER; Side: CBLAS_SIDE; Uplo: CBLAS_UPLO;
M: cint; N: cint; alpha: pointer; A: pointer; lda: cint;
B: pointer; ldb: cint; beta: pointer; C: pointer;
ldc: cint) {.importc: "cblas_chemm".}
proc cherk*(Order: CBLAS_ORDER; Uplo: CBLAS_UPLO; Trans: CBLAS_TRANSPOSE;
N: cint; K: cint; alpha: cfloat; A: pointer; lda: cint;
beta: cfloat; C: pointer; ldc: cint) {.importc: "cblas_cherk".}
proc cher2k*(Order: CBLAS_ORDER; Uplo: CBLAS_UPLO; Trans: CBLAS_TRANSPOSE;
N: cint; K: cint; alpha: pointer; A: pointer; lda: cint;
B: pointer; ldb: cint; beta: cfloat; C: pointer;
ldc: cint) {.importc: "cblas_cher2k".}
proc zhemm*(Order: CBLAS_ORDER; Side: CBLAS_SIDE; Uplo: CBLAS_UPLO;
M: cint; N: cint; alpha: pointer; A: pointer; lda: cint;
B: pointer; ldb: cint; beta: pointer; C: pointer;
ldc: cint) {.importc: "cblas_zhemm".}
proc zherk*(Order: CBLAS_ORDER; Uplo: CBLAS_UPLO; Trans: CBLAS_TRANSPOSE;
N: cint; K: cint; alpha: cdouble; A: pointer; lda: cint;
beta: cdouble; C: pointer; ldc: cint) {.importc: "cblas_zherk".}
proc zher2k*(Order: CBLAS_ORDER; Uplo: CBLAS_UPLO; Trans: CBLAS_TRANSPOSE;
N: cint; K: cint; alpha: pointer; A: pointer; lda: cint;
B: pointer; ldb: cint; beta: cdouble; C: pointer;
ldc: cint) {.importc: "cblas_zher2k".}
proc xerbla*(p: cint; rout: cstring; form: cstring) {.varargs, importc: "cblas_xerbla".}
{.pop.}