Source file owl_cblas_basic.ml
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
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
# 1 "src/owl/cblas/owl_cblas_basic.ml"
(** Please refer to: Intel Math Kernel Library implements the BLAS
url: https://software.intel.com/en-us/mkl-developer-reference-c
*)
open Ctypes
type ('a, 'b) t = ('a, 'b, Bigarray.c_layout) Bigarray.Array1.t
type cblas_layout = CblasRowMajor | CblasColMajor
let cblas_layout = function CblasRowMajor -> 101 | CblasColMajor -> 102
type cblas_transpose = CblasNoTrans | CblasTrans | CblasConjTrans
let cblas_transpose = function CblasNoTrans -> 111 | CblasTrans -> 112 | CblasConjTrans -> 113
type cblas_uplo = CblasUpper | CblasLower
let cblas_uplo = function CblasUpper -> 121 | CblasLower -> 122
type cblas_diag = CblasNonUnit | CblasUnit
let cblas_diag = function CblasNonUnit -> 131 | CblasUnit -> 132
type cblas_side = CblasLeft | CblasRight
let cblas_side = function CblasLeft -> 141 | CblasRight -> 142
module C = Owl_cblas_generated
let rotg a b =
let a = allocate double a in
let b = allocate double b in
let c = allocate double 0. in
let s = allocate double 0. in
C.drotg ~a ~b ~c ~s;
!@a, !@b, !@c, !@s
let rotmg
: type a b. (a, b) Bigarray.kind -> float -> float -> float -> float -> float * float * float * (a, b) t
= fun k d1 d2 b1 b2 ->
match k with
| Bigarray.Float32 -> (
let d1 = allocate float d1 in
let d2 = allocate float d2 in
let b1 = allocate float b1 in
let p = Bigarray.(Array1.create Float32 C_layout 5) in
let _p = bigarray_start Ctypes_static.Array1 p in
C.srotmg ~d1 ~d2 ~b1 ~b2 ~p:_p;
!@d1, !@d2, !@b1, p
)
| Bigarray.Float64 -> (
let d1 = allocate double d1 in
let d2 = allocate double d2 in
let b1 = allocate double b1 in
let p = Bigarray.(Array1.create Float64 C_layout 5) in
let _p = bigarray_start Ctypes_static.Array1 p in
C.drotmg ~d1 ~d2 ~b1 ~b2 ~p:_p;
!@d1, !@d2, !@b1, p
)
| _ -> failwith "owl_cblas:rotmg"
let rotm
: type a b. int -> (a, b) t -> int -> (a, b) t -> int -> (a, b) t -> unit
= fun n x incx y incy p ->
let _x = bigarray_start Ctypes_static.Array1 x in
let _y = bigarray_start Ctypes_static.Array1 y in
let _p = bigarray_start Ctypes_static.Array1 p in
let _ = match Bigarray.Array1.kind x with
| Bigarray.Float32 -> C.srotm ~n ~x:_x ~incx ~y:_y ~incy ~p:_p
| Bigarray.Float64 -> C.drotm ~n ~x:_x ~incx ~y:_y ~incy ~p:_p
| _ -> failwith "owl_cblas:rotm"
in ()
let rot
: type a b. int -> (a, b) t -> int -> (a, b) t -> int -> float -> float -> unit
= fun n x incx y incy c s ->
let _x = bigarray_start Ctypes_static.Array1 x in
let _y = bigarray_start Ctypes_static.Array1 y in
let _ = match Bigarray.Array1.kind x with
| Bigarray.Float32 -> C.srot ~n ~x:_x ~incx ~y:_y ~incy ~c ~s
| Bigarray.Float64 -> C.drot ~n ~x:_x ~incx ~y:_y ~incy ~c ~s
| _ -> failwith "owl_cblas:rot"
in ()
let swap
: type a b. int -> (a, b) t -> int -> (a, b) t -> int -> unit
= fun n x incx y incy ->
let _x = bigarray_start Ctypes_static.Array1 x in
let _y = bigarray_start Ctypes_static.Array1 y in
let _ = match Bigarray.Array1.kind x with
| Bigarray.Float32 -> C.sswap ~n ~x:_x ~incx ~y:_y ~incy
| Bigarray.Float64 -> C.dswap ~n ~x:_x ~incx ~y:_y ~incy
| Bigarray.Complex32 -> C.cswap ~n ~x:_x ~incx ~y:_y ~incy
| Bigarray.Complex64 -> C.zswap ~n ~x:_x ~incx ~y:_y ~incy
| _ -> failwith "owl_cblas:swap"
in ()
let scal
: type a b. int -> a -> (a, b) t -> int -> unit
= fun n a x incx ->
let _x = bigarray_start Ctypes_static.Array1 x in
let _ = match Bigarray.Array1.kind x with
| Bigarray.Float32 -> C.sscal ~n ~alpha:a ~x:_x ~incx
| Bigarray.Float64 -> C.dscal ~n ~alpha:a ~x:_x ~incx
| Bigarray.Complex32 -> C.cscal ~n ~alpha:(allocate complex32 a) ~x:_x ~incx
| Bigarray.Complex64 -> C.zscal ~n ~alpha:(allocate complex64 a) ~x:_x ~incx
| _ -> failwith "owl_cblas:scal"
in ()
let cszd_scal
: type a. int -> float -> (Complex.t, a) t -> int -> unit
= fun n a x incx ->
let _x = bigarray_start Ctypes_static.Array1 x in
let _ = match Bigarray.Array1.kind x with
| Bigarray.Complex32 -> C.csscal ~n ~alpha:a ~x:_x ~incx
| Bigarray.Complex64 -> C.zdscal ~n ~alpha:a ~x:_x ~incx
in ()
let copy
: type a b. int -> (a, b) t -> int -> (a, b) t -> int -> unit
= fun n x incx y incy ->
let _x = bigarray_start Ctypes_static.Array1 x in
let _y = bigarray_start Ctypes_static.Array1 y in
let _ = match Bigarray.Array1.kind x with
| Bigarray.Float32 -> C.scopy ~n ~x:_x ~incx ~y:_y ~incy
| Bigarray.Float64 -> C.dcopy ~n ~x:_x ~incx ~y:_y ~incy
| Bigarray.Complex32 -> C.ccopy ~n ~x:_x ~incx ~y:_y ~incy
| Bigarray.Complex64 -> C.zcopy ~n ~x:_x ~incx ~y:_y ~incy
| _ -> failwith "owl_cblas:copy"
in ()
let axpy
: type a b. int -> a -> (a, b) t -> int -> (a, b) t -> int -> unit
= fun n a x incx y incy ->
let _x = bigarray_start Ctypes_static.Array1 x in
let _y = bigarray_start Ctypes_static.Array1 y in
let _ = match Bigarray.Array1.kind x with
| Bigarray.Float32 -> C.saxpy ~n ~alpha:a ~x:_x ~incx ~y:_y ~incy
| Bigarray.Float64 -> C.daxpy ~n ~alpha:a ~x:_x ~incx ~y:_y ~incy
| Bigarray.Complex32 -> C.caxpy ~n ~alpha:(allocate complex32 a) ~x:_x ~incx ~y:_y ~incy
| Bigarray.Complex64 -> C.zaxpy ~n ~alpha:(allocate complex64 a) ~x:_x ~incx ~y:_y ~incy
| _ -> failwith "owl_cblas:axpy"
in ()
let dot
: type a b. ?conj:bool -> int -> (a, b) t -> int -> (a, b) t -> int -> a
= fun ?(conj=false) n x incx y incy ->
let _x = bigarray_start Ctypes_static.Array1 x in
let _y = bigarray_start Ctypes_static.Array1 y in
match Bigarray.Array1.kind x with
| Bigarray.Float32 -> C.sdot ~n ~x:_x ~incx ~y:_y ~incy
| Bigarray.Float64 -> C.ddot ~n ~x:_x ~incx ~y:_y ~incy
| Bigarray.Complex32 -> (
let _z = allocate complex32 Complex.zero in
if conj = true then C.cdotc ~n ~x:_x ~incx ~y:_y ~incy ~dotc:_z
else C.cdotu ~n ~x:_x ~incx ~y:_y ~incy ~dotu:_z;
!@_z
)
| Bigarray.Complex64 -> (
let _z = allocate complex32 Complex.zero in
if conj = true then C.zdotc ~n ~x:_x ~incx ~y:_y ~incy ~dotc:_z
else C.zdotu ~n ~x:_x ~incx ~y:_y ~incy ~dotu:_z;
!@_z
)
| _ -> failwith "owl_cblas:dot"
let sdsdot n a x incx y incy =
let _x = bigarray_start Ctypes_static.Array1 x in
let _y = bigarray_start Ctypes_static.Array1 y in
C.sdsdot ~n ~alpha:a ~x:_x ~incx ~y:_y ~incy
let dsdot n x incx y incy =
let _x = bigarray_start Ctypes_static.Array1 x in
let _y = bigarray_start Ctypes_static.Array1 y in
C.dsdot ~n ~x:_x ~incx ~y:_y ~incy
let nrm2
: type a b. int -> (a, b) t -> int -> float
= fun n x incx ->
let _x = bigarray_start Ctypes_static.Array1 x in
match Bigarray.Array1.kind x with
| Bigarray.Float32 -> C.snrm2 ~n ~x:_x ~incx
| Bigarray.Float64 -> C.dnrm2 ~n ~x:_x ~incx
| Bigarray.Complex32 -> C.scnrm2 ~n ~x:_x ~incx
| Bigarray.Complex64 -> C.dznrm2 ~n ~x:_x ~incx
| _ -> failwith "owl_cblas:nrm2"
let asum
: type a b. int -> (a, b) t -> int -> float
= fun n x incx ->
let _x = bigarray_start Ctypes_static.Array1 x in
match Bigarray.Array1.kind x with
| Bigarray.Float32 -> C.sasum ~n ~x:_x ~incx
| Bigarray.Float64 -> C.sasum ~n ~x:_x ~incx
| Bigarray.Complex32 -> C.scasum ~n ~x:_x ~incx
| Bigarray.Complex64 -> C.dzasum ~n ~x:_x ~incx
| _ -> failwith "owl_cblas:asum"
let amax
: type a b. int -> (a, b) t -> int -> int
= fun n x incx ->
let _x = bigarray_start Ctypes_static.Array1 x in
let i = match Bigarray.Array1.kind x with
| Bigarray.Float32 -> C.isamax ~n ~x:_x ~incx
| Bigarray.Float64 -> C.idamax ~n ~x:_x ~incx
| Bigarray.Complex32 -> C.icamax ~n ~x:_x ~incx
| Bigarray.Complex64 -> C.izamax ~n ~x:_x ~incx
| _ -> failwith "owl_cblas:amax"
in
Unsigned.Size_t.to_int i
let gemv
: type a b. cblas_layout -> cblas_transpose -> int -> int -> a -> (a, b) t -> int -> (a, b) t -> int -> a -> (a, b) t -> int -> unit
= fun layout trans m n alpha a lda x incx beta y incy ->
let _layout = cblas_layout layout in
let _trans = cblas_transpose trans in
let _x = bigarray_start Ctypes_static.Array1 x in
let _y = bigarray_start Ctypes_static.Array1 y in
let _a = bigarray_start Ctypes_static.Array1 a in
match Bigarray.Array1.kind x with
| Bigarray.Float32 ->
C.sgemv ~order:_layout ~transa:_trans ~m ~n ~alpha ~a:_a ~lda ~x:_x ~incx ~beta ~y:_y ~incy
| Bigarray.Float64 -> C.dgemv ~order:_layout ~transa:_trans ~m ~n ~alpha ~a:_a ~lda ~x:_x ~incx ~beta ~y:_y ~incy
| Bigarray.Complex32 -> C.cgemv ~order:_layout ~transa:_trans ~m ~n ~alpha:(allocate complex32 alpha) ~a:_a ~lda ~x:_x ~incx ~beta:(allocate complex32 beta) ~y:_y ~incy
| Bigarray.Complex64 -> C.zgemv ~order:_layout ~transa:_trans ~m ~n ~alpha:(allocate complex64 alpha) ~a:_a ~lda ~x:_x ~incx ~beta:(allocate complex64 beta) ~y:_y ~incy
| _ -> failwith "owl_cblas:gemv"
let gbmv
: type a b. cblas_layout -> cblas_transpose -> int -> int -> int -> int
-> a -> (a, b) t -> int -> (a, b) t -> int -> a -> (a, b) t -> int -> unit
= fun layout trans m n kl ku alpha a lda x incx beta y incy ->
let _layout = cblas_layout layout in
let _trans = cblas_transpose trans in
let _x = bigarray_start Ctypes_static.Array1 x in
let _y = bigarray_start Ctypes_static.Array1 y in
let _a = bigarray_start Ctypes_static.Array1 a in
match Bigarray.Array1.kind x with
| Bigarray.Float32 -> C.sgbmv ~order:_layout ~transa:_trans ~m ~n ~kl ~ku ~alpha ~a:_a ~lda ~x:_x ~incx ~beta ~y:_y ~incy
| Bigarray.Float64 -> C.dgbmv ~order:_layout ~transa:_trans ~m ~n ~kl ~ku ~alpha ~a:_a ~lda ~x:_x ~incx ~beta ~y:_y ~incy
| Bigarray.Complex32 -> C.cgbmv ~order:_layout ~transa:_trans ~m ~n ~kl ~ku ~alpha:(allocate complex32 alpha) ~a:_a ~lda ~x:_x ~incx ~beta:(allocate complex32 beta) ~y:_y ~incy
| Bigarray.Complex64 -> C.cgbmv ~order:_layout ~transa:_trans ~m ~n ~kl ~ku ~alpha:(allocate complex64 alpha) ~a:_a ~lda ~x:_x ~incx ~beta:(allocate complex64 beta) ~y:_y ~incy
| _ -> failwith "owl_cblas:gbmv"
let trmv
: type a b. cblas_layout -> cblas_uplo -> cblas_transpose -> cblas_diag -> int -> (a, b) t -> int -> (a, b) t -> int -> unit
= fun layout uplo trans diag n a lda x incx ->
let _layout = cblas_layout layout in
let _trans = cblas_transpose trans in
let _uplo = cblas_uplo uplo in
let _diag = cblas_diag diag in
let _x = bigarray_start Ctypes_static.Array1 x in
let _a = bigarray_start Ctypes_static.Array1 a in
match Bigarray.Array1.kind x with
| Bigarray.Float32 -> C.strmv ~order:_layout ~uplo:_uplo ~transa:_trans ~diag:_diag ~n ~a:_a ~lda ~x:_x ~incx
| Bigarray.Float64 -> C.dtrmv ~order:_layout ~uplo:_uplo ~transa:_trans ~diag:_diag ~n ~a:_a ~lda ~x:_x ~incx
| Bigarray.Complex32 -> C.ctrmv ~order:_layout ~uplo:_uplo ~transa:_trans ~diag:_diag ~n ~a:_a ~lda ~x:_x ~incx
| Bigarray.Complex64 -> C.ztrmv ~order:_layout ~uplo:_uplo ~transa:_trans ~diag:_diag ~n ~a:_a ~lda ~x:_x ~incx
| _ -> failwith "owl_cblas:trmv"
let tbmv
: type a b. cblas_layout -> cblas_uplo -> cblas_transpose -> cblas_diag -> int -> int -> (a, b) t -> int -> (a, b) t -> int -> unit
= fun layout uplo trans diag n k a lda x incx ->
let _layout = cblas_layout layout in
let _trans = cblas_transpose trans in
let _uplo = cblas_uplo uplo in
let _diag = cblas_diag diag in
let _x = bigarray_start Ctypes_static.Array1 x in
let _a = bigarray_start Ctypes_static.Array1 a in
match Bigarray.Array1.kind x with
| Bigarray.Float32 -> C.stbmv ~order:_layout ~uplo:_uplo ~transa:_trans ~diag:_diag ~n ~k ~a:_a ~lda ~x:_x ~incx
| Bigarray.Float64 -> C.dtbmv ~order:_layout ~uplo:_uplo ~transa:_trans ~diag:_diag ~n ~k ~a:_a ~lda ~x:_x ~incx
| Bigarray.Complex32 -> C.ctbmv ~order:_layout ~uplo:_uplo ~transa:_trans ~diag:_diag ~n ~k ~a:_a ~lda ~x:_x ~incx
| Bigarray.Complex64 -> C.ztbmv ~order:_layout ~uplo:_uplo ~transa:_trans ~diag:_diag ~n ~k ~a:_a ~lda ~x:_x ~incx
| _ -> failwith "owl_cblas:tbmv"
let tpmv
: type a b. cblas_layout -> cblas_uplo -> cblas_transpose -> cblas_diag -> int -> (a, b) t -> (a, b) t -> int -> unit
= fun layout uplo trans diag n ap x incx ->
let _layout = cblas_layout layout in
let _trans = cblas_transpose trans in
let _uplo = cblas_uplo uplo in
let _diag = cblas_diag diag in
let _x = bigarray_start Ctypes_static.Array1 x in
let _ap = bigarray_start Ctypes_static.Array1 ap in
match Bigarray.Array1.kind x with
| Bigarray.Float32 -> C.stpmv ~order:_layout ~uplo:_uplo ~transa:_trans ~diag:_diag ~n ~ap:_ap ~x:_x ~incx
| Bigarray.Float64 -> C.dtpmv ~order:_layout ~uplo:_uplo ~transa:_trans ~diag:_diag ~n ~ap:_ap ~x:_x ~incx
| Bigarray.Complex32 -> C.ctpmv ~order:_layout ~uplo:_uplo ~transa:_trans ~diag:_diag ~n ~ap:_ap ~x:_x ~incx
| Bigarray.Complex64 -> C.ztpmv ~order:_layout ~uplo:_uplo ~transa:_trans ~diag:_diag ~n ~ap:_ap ~x:_x ~incx
| _ -> failwith "owl_cblas:tpmv"
let trsv
: type a b. cblas_layout -> cblas_uplo -> cblas_transpose -> cblas_diag -> int -> (a, b) t -> int -> (a, b) t -> int -> unit
= fun layout uplo trans diag n a lda x incx ->
let _layout = cblas_layout layout in
let _trans = cblas_transpose trans in
let _uplo = cblas_uplo uplo in
let _diag = cblas_diag diag in
let _x = bigarray_start Ctypes_static.Array1 x in
let _a = bigarray_start Ctypes_static.Array1 a in
match Bigarray.Array1.kind x with
| Bigarray.Float32 -> C.strsv ~order:_layout ~uplo:_uplo ~transa:_trans ~diag:_diag ~n ~a:_a ~lda ~x:_x ~incx
| Bigarray.Float64 -> C.dtrsv ~order:_layout ~uplo:_uplo ~transa:_trans ~diag:_diag ~n ~a:_a ~lda ~x:_x ~incx
| Bigarray.Complex32 -> C.ctrsv ~order:_layout ~uplo:_uplo ~transa:_trans ~diag:_diag ~n ~a:_a ~lda ~x:_x ~incx
| Bigarray.Complex64 -> C.ztrsv ~order:_layout ~uplo:_uplo ~transa:_trans ~diag:_diag ~n ~a:_a ~lda ~x:_x ~incx
| _ -> failwith "owl_cblas:trsv"
let tbsv
: type a b. cblas_layout -> cblas_uplo -> cblas_transpose -> cblas_diag -> int -> int -> (a, b) t -> int -> (a, b) t -> int -> unit
= fun layout uplo trans diag n k a lda x incx ->
let _layout = cblas_layout layout in
let _trans = cblas_transpose trans in
let _uplo = cblas_uplo uplo in
let _diag = cblas_diag diag in
let _x = bigarray_start Ctypes_static.Array1 x in
let _a = bigarray_start Ctypes_static.Array1 a in
match Bigarray.Array1.kind x with
| Bigarray.Float32 -> C.stbsv ~order:_layout ~uplo:_uplo ~transa:_trans ~diag:_diag ~n ~k ~a:_a ~lda ~x:_x ~incx
| Bigarray.Float64 -> C.dtbsv ~order:_layout ~uplo:_uplo ~transa:_trans ~diag:_diag ~n ~k ~a:_a ~lda ~x:_x ~incx
| Bigarray.Complex32 -> C.ctbsv ~order:_layout ~uplo:_uplo ~transa:_trans ~diag:_diag ~n ~k ~a:_a ~lda ~x:_x ~incx
| Bigarray.Complex64 -> C.ztbsv ~order:_layout ~uplo:_uplo ~transa:_trans ~diag:_diag ~n ~k ~a:_a ~lda ~x:_x ~incx
| _ -> failwith "owl_cblas:tbsv"
let tpsv
: type a b. cblas_layout -> cblas_uplo -> cblas_transpose -> cblas_diag -> int -> (a, b) t -> (a, b) t -> int -> unit
= fun layout uplo trans diag n ap x incx ->
let _layout = cblas_layout layout in
let _trans = cblas_transpose trans in
let _uplo = cblas_uplo uplo in
let _diag = cblas_diag diag in
let _x = bigarray_start Ctypes_static.Array1 x in
let _ap = bigarray_start Ctypes_static.Array1 ap in
match Bigarray.Array1.kind x with
| Bigarray.Float32 -> C.stpsv ~order:_layout ~uplo:_uplo ~transa:_trans ~diag:_diag ~n ~ap:_ap ~x:_x ~incx
| Bigarray.Float64 -> C.dtpsv ~order:_layout ~uplo:_uplo ~transa:_trans ~diag:_diag ~n ~ap:_ap ~x:_x ~incx
| Bigarray.Complex32 -> C.ctpsv ~order:_layout ~uplo:_uplo ~transa:_trans ~diag:_diag ~n ~ap:_ap ~x:_x ~incx
| Bigarray.Complex64 -> C.ztpsv ~order:_layout ~uplo:_uplo ~transa:_trans ~diag:_diag ~n ~ap:_ap ~x:_x ~incx
| _ -> failwith "owl_cblas:tpsv"
let symv
: type a. cblas_layout -> cblas_uplo -> int -> float -> (float, a) t -> int -> (float, a) t -> int -> float -> (float, a) t -> int -> unit
= fun layout uplo n alpha a lda x incx beta y incy ->
let _layout = cblas_layout layout in
let _uplo = cblas_uplo uplo in
let _x = bigarray_start Ctypes_static.Array1 x in
let _y = bigarray_start Ctypes_static.Array1 y in
let _a = bigarray_start Ctypes_static.Array1 a in
match Bigarray.Array1.kind x with
| Bigarray.Float32 -> C.ssymv ~order:_layout ~uplo:_uplo ~n ~alpha ~a:_a ~lda ~x:_x ~incx ~beta ~y:_y ~incy
| Bigarray.Float64 -> C.dsymv ~order:_layout ~uplo:_uplo ~n ~alpha ~a:_a ~lda ~x:_x ~incx ~beta ~y:_y ~incy
let sbmv
: type a. cblas_layout -> cblas_uplo -> int -> int -> float -> (float, a) t -> int -> (float, a) t -> int -> float -> (float, a) t -> int -> unit
= fun layout uplo n k alpha a lda x incx beta y incy ->
let _layout = cblas_layout layout in
let _uplo = cblas_uplo uplo in
let _x = bigarray_start Ctypes_static.Array1 x in
let _y = bigarray_start Ctypes_static.Array1 y in
let _a = bigarray_start Ctypes_static.Array1 a in
match Bigarray.Array1.kind x with
| Bigarray.Float32 -> C.ssbmv ~order:_layout ~uplo:_uplo ~n ~k ~alpha ~a:_a ~lda ~x:_x ~incx ~beta ~y:_y ~incy
| Bigarray.Float64 -> C.dsbmv ~order:_layout ~uplo:_uplo ~n ~k ~alpha ~a:_a ~lda ~x:_x ~incx ~beta ~y:_y ~incy
let spmv
: type a. cblas_layout -> cblas_uplo -> int -> int -> float -> (float, a) t -> (float, a) t -> int -> float -> (float, a) t -> int -> unit
= fun layout uplo n _k alpha ap x incx beta y incy ->
let _layout = cblas_layout layout in
let _uplo = cblas_uplo uplo in
let _x = bigarray_start Ctypes_static.Array1 x in
let _y = bigarray_start Ctypes_static.Array1 y in
let _ap = bigarray_start Ctypes_static.Array1 ap in
match Bigarray.Array1.kind x with
| Bigarray.Float32 -> C.sspmv ~order:_layout ~uplo:_uplo ~n ~alpha ~ap:_ap ~x:_x ~incx ~beta ~y:_y ~incy
| Bigarray.Float64 -> C.dspmv ~order:_layout ~uplo:_uplo ~n ~alpha ~ap:_ap ~x:_x ~incx ~beta ~y:_y ~incy
let ger
: type a b. ?conj:bool -> cblas_layout -> int -> int -> a -> (a, b) t -> int -> (a, b) t -> int -> (a, b) t -> int -> unit
= fun ?(conj=false) layout m n alpha x incx y incy a lda ->
let _layout = cblas_layout layout in
let _x = bigarray_start Ctypes_static.Array1 x in
let _y = bigarray_start Ctypes_static.Array1 y in
let _a = bigarray_start Ctypes_static.Array1 a in
match Bigarray.Array1.kind x with
| Bigarray.Float32 -> C.sger ~order:_layout ~m ~n ~alpha ~x:_x ~incx ~y:_y ~incy ~a:_a ~lda
| Bigarray.Float64 -> C.dger ~order:_layout ~m ~n ~alpha ~x:_x ~incx ~y:_y ~incy ~a:_a ~lda
| Bigarray.Complex32 ->
if conj = true then C.cgerc ~order:_layout ~m ~n ~alpha:(allocate complex32 alpha) ~x:_x ~incx ~y:_y ~incy ~a:_a ~lda
else C.cgeru ~order:_layout ~m ~n ~alpha:(allocate complex32 alpha) ~x:_x ~incx ~y:_y ~incy ~a:_a ~lda
| Bigarray.Complex64 ->
if conj = true then C.zgerc ~order:_layout ~m ~n ~alpha:(allocate complex64 alpha) ~x:_x ~incx ~y:_y ~incy ~a:_a ~lda
else C.zgeru ~order:_layout ~m ~n ~alpha:(allocate complex64 alpha) ~x:_x ~incx ~y:_y ~incy ~a:_a ~lda
| _ -> failwith "owl_cblas:ger"
let syr
: type a. cblas_layout -> cblas_uplo -> int -> float -> (float, a) t -> int -> (float, a) t -> int -> unit
= fun layout uplo n alpha x incx a lda ->
let _layout = cblas_layout layout in
let _uplo = cblas_uplo uplo in
let _x = bigarray_start Ctypes_static.Array1 x in
let _a = bigarray_start Ctypes_static.Array1 a in
match Bigarray.Array1.kind x with
| Bigarray.Float32 -> C.ssyr ~order:_layout ~uplo:_uplo ~n ~alpha ~x:_x ~incx ~a:_a ~lda
| Bigarray.Float64 -> C.dsyr ~order:_layout ~uplo:_uplo ~n ~alpha ~x:_x ~incx ~a:_a ~lda
let spr
: type a. cblas_layout -> cblas_uplo -> int -> float -> (float, a) t -> int -> (float, a) t -> unit
= fun layout uplo n alpha x incx ap ->
let _layout = cblas_layout layout in
let _uplo = cblas_uplo uplo in
let _x = bigarray_start Ctypes_static.Array1 x in
let _ap = bigarray_start Ctypes_static.Array1 ap in
match Bigarray.Array1.kind x with
| Bigarray.Float32 -> C.sspr ~order:_layout ~uplo:_uplo ~n ~alpha ~x:_x ~incx ~ap:_ap
| Bigarray.Float64 -> C.dspr ~order:_layout ~uplo:_uplo ~n ~alpha ~x:_x ~incx ~ap:_ap
let syr2
: type a. cblas_layout -> cblas_uplo -> int -> float -> (float, a) t -> int -> (float, a) t -> int -> (float, a) t -> int -> unit
= fun layout uplo n alpha x incx y incy a lda ->
let _layout = cblas_layout layout in
let _uplo = cblas_uplo uplo in
let _x = bigarray_start Ctypes_static.Array1 x in
let _y = bigarray_start Ctypes_static.Array1 y in
let _a = bigarray_start Ctypes_static.Array1 a in
match Bigarray.Array1.kind x with
| Bigarray.Float32 -> C.ssyr2 ~order:_layout ~uplo:_uplo ~n ~alpha ~x:_x ~incx ~y:_y ~incy ~a:_a ~lda
| Bigarray.Float64 -> C.dsyr2 ~order:_layout ~uplo:_uplo ~n ~alpha ~x:_x ~incx ~y:_y ~incy ~a:_a ~lda
let spr2
: type a. cblas_layout -> cblas_uplo -> int -> float -> (float, a) t -> int -> (float, a) t -> int -> (float, a) t -> unit
= fun layout uplo n alpha x incx y incy a ->
let _layout = cblas_layout layout in
let _uplo = cblas_uplo uplo in
let _x = bigarray_start Ctypes_static.Array1 x in
let _y = bigarray_start Ctypes_static.Array1 y in
let _a = bigarray_start Ctypes_static.Array1 a in
match Bigarray.Array1.kind x with
| Bigarray.Float32 -> C.sspr2 ~order:_layout ~uplo:_uplo ~n ~alpha ~x:_x ~incx ~y:_y ~incy ~a:_a
| Bigarray.Float64 -> C.dspr2 ~order:_layout ~uplo:_uplo ~n ~alpha ~x:_x ~incx ~y:_y ~incy ~a:_a
let hemv
: type a. cblas_layout -> cblas_uplo -> int -> Complex.t -> (Complex.t, a) t -> int -> (Complex.t, a) t -> int -> Complex.t -> (Complex.t, a) t -> int -> unit
= fun layout uplo n alpha a lda x incx beta y incy ->
let _layout = cblas_layout layout in
let _uplo = cblas_uplo uplo in
let _alpha = allocate complex64 alpha in
let _beta = allocate complex64 beta in
let _x = bigarray_start Ctypes_static.Array1 x in
let _y = bigarray_start Ctypes_static.Array1 y in
let _a = bigarray_start Ctypes_static.Array1 a in
match Bigarray.Array1.kind x with
| Bigarray.Complex32 -> C.chemv ~order:_layout ~uplo:_uplo ~n ~alpha:_alpha ~a:_a ~lda ~x:_x ~incx ~beta:_beta ~y:_y ~incy
| Bigarray.Complex64 -> C.zhemv ~order:_layout ~uplo:_uplo ~n ~alpha:_alpha ~a:_a ~lda ~x:_x ~incx ~beta:_beta ~y:_y ~incy
let hbmv
: type a. cblas_layout -> cblas_uplo -> int -> int -> Complex.t -> (Complex.t, a) t -> int -> (Complex.t, a) t -> int -> Complex.t -> (Complex.t, a) t -> int -> unit
= fun layout uplo n k alpha a lda x incx beta y incy ->
let _layout = cblas_layout layout in
let _uplo = cblas_uplo uplo in
let _alpha = allocate complex64 alpha in
let _beta = allocate complex64 beta in
let _x = bigarray_start Ctypes_static.Array1 x in
let _y = bigarray_start Ctypes_static.Array1 y in
let _a = bigarray_start Ctypes_static.Array1 a in
match Bigarray.Array1.kind x with
| Bigarray.Complex32 -> C.chbmv ~order:_layout ~uplo:_uplo ~n ~k ~alpha:_alpha ~a:_a ~lda ~x:_x ~incx ~beta:_beta ~y:_y ~incy
| Bigarray.Complex64 -> C.zhbmv ~order:_layout ~uplo:_uplo ~n ~k ~alpha:_alpha ~a:_a ~lda ~x:_x ~incx ~beta:_beta ~y:_y ~incy
let hpmv
: type a. cblas_layout -> cblas_uplo -> int -> Complex.t -> (Complex.t, a) t -> (Complex.t, a) t -> int -> Complex.t -> (Complex.t, a) t -> int -> unit
= fun layout uplo n alpha ap x incx beta y incy ->
let _layout = cblas_layout layout in
let _uplo = cblas_uplo uplo in
let _alpha = allocate complex64 alpha in
let _beta = allocate complex64 beta in
let _x = bigarray_start Ctypes_static.Array1 x in
let _y = bigarray_start Ctypes_static.Array1 y in
let _ap = bigarray_start Ctypes_static.Array1 ap in
match Bigarray.Array1.kind x with
| Bigarray.Complex32 -> C.chpmv ~order:_layout ~uplo:_uplo ~n ~alpha:_alpha ~ap:_ap ~x:_x ~incx ~beta:_beta ~y:_y ~incy
| Bigarray.Complex64 -> C.zhpmv ~order:_layout ~uplo:_uplo ~n ~alpha:_alpha ~ap:_ap ~x:_x ~incx ~beta:_beta ~y:_y ~incy
let her
: type a. cblas_layout -> cblas_uplo -> int -> float -> (Complex.t, a) t -> int -> (Complex.t, a) t -> int -> unit
= fun layout uplo n alpha x incx a lda ->
let _layout = cblas_layout layout in
let _uplo = cblas_uplo uplo in
let _x = bigarray_start Ctypes_static.Array1 x in
let _a = bigarray_start Ctypes_static.Array1 a in
match Bigarray.Array1.kind x with
| Bigarray.Complex32 -> C.cher ~order:_layout ~uplo:_uplo ~n ~alpha ~x:_x ~incx ~a:_a ~lda
| Bigarray.Complex64 -> C.zher ~order:_layout ~uplo:_uplo ~n ~alpha ~x:_x ~incx ~a:_a ~lda
let hpr
: type a. cblas_layout -> cblas_uplo -> int -> float -> (Complex.t, a) t -> int -> (Complex.t, a) t -> unit
= fun layout uplo n alpha x incx a ->
let _layout = cblas_layout layout in
let _uplo = cblas_uplo uplo in
let _x = bigarray_start Ctypes_static.Array1 x in
let _a = bigarray_start Ctypes_static.Array1 a in
match Bigarray.Array1.kind x with
| Bigarray.Complex32 -> C.chpr ~order:_layout ~uplo:_uplo ~n ~alpha ~x:_x ~incx ~a:_a
| Bigarray.Complex64 -> C.zhpr ~order:_layout ~uplo:_uplo ~n ~alpha ~x:_x ~incx ~a:_a
let her2
: type a. cblas_layout -> cblas_uplo -> int -> Complex.t -> (Complex.t, a) t -> int -> (Complex.t, a) t -> int -> (Complex.t, a) t -> int -> unit
= fun layout uplo n alpha x incx y incy a lda ->
let _layout = cblas_layout layout in
let _uplo = cblas_uplo uplo in
let _alpha = allocate complex64 alpha in
let _x = bigarray_start Ctypes_static.Array1 x in
let _y = bigarray_start Ctypes_static.Array1 y in
let _a = bigarray_start Ctypes_static.Array1 a in
match Bigarray.Array1.kind x with
| Bigarray.Complex32 -> C.cher2 ~order:_layout ~uplo:_uplo ~n ~alpha:_alpha ~x:_x ~incx ~y:_y ~incy ~a:_a ~lda
| Bigarray.Complex64 -> C.zher2 ~order:_layout ~uplo:_uplo ~n ~alpha:_alpha ~x:_x ~incx ~y:_y ~incy ~a:_a ~lda
let hpr2
: type a. cblas_layout -> cblas_uplo -> int -> Complex.t -> (Complex.t, a) t -> int -> (Complex.t, a) t -> int -> (Complex.t, a) t -> unit
= fun layout uplo n alpha x incx y incy ap ->
let _layout = cblas_layout layout in
let _uplo = cblas_uplo uplo in
let _alpha = allocate complex64 alpha in
let _x = bigarray_start Ctypes_static.Array1 x in
let _y = bigarray_start Ctypes_static.Array1 y in
let _ap = bigarray_start Ctypes_static.Array1 ap in
match Bigarray.Array1.kind x with
| Bigarray.Complex32 -> C.chpr2 ~order:_layout ~uplo:_uplo ~n ~alpha:_alpha ~x:_x ~incx ~y:_y ~incy ~ap:_ap
| Bigarray.Complex64 -> C.zhpr2 ~order:_layout ~uplo:_uplo ~n ~alpha:_alpha ~x:_x ~incx ~y:_y ~incy ~ap:_ap
let gemm
: type a b. cblas_layout -> cblas_transpose -> cblas_transpose -> int -> int -> int -> a -> (a, b) t -> int -> (a, b) t -> int -> a -> (a, b) t -> int -> unit
= fun layout transa transb m n k alpha a lda b ldb beta c ldc ->
let _layout = cblas_layout layout in
let _transa = cblas_transpose transa in
let _transb = cblas_transpose transb in
let _a = bigarray_start Ctypes_static.Array1 a in
let _b = bigarray_start Ctypes_static.Array1 b in
let _c = bigarray_start Ctypes_static.Array1 c in
match Bigarray.Array1.kind a with
| Bigarray.Float32 -> C.sgemm ~order:_layout ~transa:_transa ~transb:_transb ~m ~n ~k ~alpha ~a:_a ~lda ~b:_b ~ldb ~beta ~c:_c ~ldc
| Bigarray.Float64 -> C.dgemm ~order:_layout ~transa:_transa ~transb:_transb ~m ~n ~k ~alpha ~a:_a ~lda ~b:_b ~ldb ~beta ~c:_c ~ldc
| Bigarray.Complex32 -> C.cgemm ~order:_layout ~transa:_transa ~transb:_transb ~m ~n ~k ~alpha:(allocate complex32 alpha) ~a:_a ~lda ~b:_b ~ldb ~beta:(allocate complex32 beta) ~c:_c ~ldc
| Bigarray.Complex64 -> C.zgemm ~order:_layout ~transa:_transa ~transb:_transb ~m ~n ~k ~alpha:(allocate complex64 alpha) ~a:_a ~lda ~b:_b ~ldb ~beta:(allocate complex64 beta) ~c:_c ~ldc
| _ -> failwith "owl_cblas:gemm"
let symm
: type a b. cblas_layout -> cblas_side -> cblas_uplo -> int -> int -> a -> (a, b) t -> int -> (a, b) t -> int -> a -> (a, b) t -> int -> unit
= fun layout side uplo m n alpha a lda b ldb beta c ldc ->
let _layout = cblas_layout layout in
let _side = cblas_side side in
let _uplo = cblas_uplo uplo in
let _a = bigarray_start Ctypes_static.Array1 a in
let _b = bigarray_start Ctypes_static.Array1 b in
let _c = bigarray_start Ctypes_static.Array1 c in
match Bigarray.Array1.kind a with
| Bigarray.Float32 -> C.ssymm ~order:_layout ~side:_side ~uplo:_uplo ~m ~n ~alpha ~a:_a ~lda ~b:_b ~ldb ~beta ~c:_c ~ldc
| Bigarray.Float64 -> C.dsymm ~order:_layout ~side:_side ~uplo:_uplo ~m ~n ~alpha ~a:_a ~lda ~b:_b ~ldb ~beta ~c:_c ~ldc
| Bigarray.Complex32 -> C.csymm ~order:_layout ~side:_side ~uplo:_uplo ~m ~n ~alpha:(allocate complex32 alpha) ~a:_a ~lda ~b:_b ~ldb ~beta:(allocate complex32 beta) ~c:_c ~ldc
| Bigarray.Complex64 -> C.zsymm ~order:_layout ~side:_side ~uplo:_uplo ~m ~n ~alpha:(allocate complex64 alpha) ~a:_a ~lda ~b:_b ~ldb ~beta:(allocate complex64 beta) ~c:_c ~ldc
| _ -> failwith "owl_cblas:symm"
let syrk
: type a b. cblas_layout -> cblas_uplo -> cblas_transpose -> int -> int -> a -> (a, b) t -> int -> a -> (a, b) t -> int -> unit
= fun layout uplo trans n k alpha a lda beta c ldc ->
let _layout = cblas_layout layout in
let _uplo = cblas_uplo uplo in
let _trans = cblas_transpose trans in
let _a = bigarray_start Ctypes_static.Array1 a in
let _c = bigarray_start Ctypes_static.Array1 c in
match Bigarray.Array1.kind a with
| Bigarray.Float32 -> C.ssyrk ~order:_layout ~uplo:_uplo ~trans:_trans ~n ~k ~alpha ~a:_a ~lda ~beta ~c:_c ~ldc
| Bigarray.Float64 -> C.dsyrk ~order:_layout ~uplo:_uplo ~trans:_trans ~n ~k ~alpha ~a:_a ~lda ~beta ~c:_c ~ldc
| Bigarray.Complex32 -> C.csyrk ~order:_layout ~uplo:_uplo ~trans:_trans ~n ~k ~alpha:(allocate complex32 alpha) ~a:_a ~lda ~beta:(allocate complex32 beta) ~c:_c ~ldc
| Bigarray.Complex64 -> C.zsyrk ~order:_layout ~uplo:_uplo ~trans:_trans ~n ~k ~alpha:(allocate complex64 alpha) ~a:_a ~lda ~beta:(allocate complex64 beta) ~c:_c ~ldc
| _ -> failwith "owl_cblas:syrk"
let syr2k
: type a b. cblas_layout -> cblas_uplo -> cblas_transpose -> int -> int -> a -> (a, b) t -> int -> (a, b) t -> int -> a -> (a, b) t -> int -> unit
= fun layout uplo trans n k alpha a lda b ldb beta c ldc ->
let _layout = cblas_layout layout in
let _uplo = cblas_uplo uplo in
let _trans = cblas_transpose trans in
let _a = bigarray_start Ctypes_static.Array1 a in
let _b = bigarray_start Ctypes_static.Array1 b in
let _c = bigarray_start Ctypes_static.Array1 c in
match Bigarray.Array1.kind a with
| Bigarray.Float32 -> C.ssyr2k ~order:_layout ~uplo:_uplo ~trans:_trans ~n ~k ~alpha ~a:_a ~lda ~b:_b ~ldb ~beta ~c:_c ~ldc
| Bigarray.Float64 -> C.dsyr2k ~order:_layout ~uplo:_uplo ~trans:_trans ~n ~k ~alpha ~a:_a ~lda ~b:_b ~ldb ~beta ~c:_c ~ldc
| Bigarray.Complex32 -> C.csyr2k ~order:_layout ~uplo:_uplo ~trans:_trans ~n ~k ~alpha:(allocate complex32 alpha) ~a:_a ~lda ~b:_b ~ldb ~beta:(allocate complex32 beta) ~c:_c ~ldc
| Bigarray.Complex64 -> C.zsyr2k ~order:_layout ~uplo:_uplo ~trans:_trans ~n ~k ~alpha:(allocate complex64 alpha) ~a:_a ~lda ~b:_b ~ldb ~beta:(allocate complex64 beta) ~c:_c ~ldc
| _ -> failwith "owl_cblas:syr2k"
let trmm
: type a b. cblas_layout -> cblas_side -> cblas_uplo -> cblas_transpose -> cblas_diag -> int -> int -> a -> (a, b) t -> int -> (a, b) t -> int -> unit
= fun layout side uplo transa diag m n alpha a lda b ldb ->
let _layout = cblas_layout layout in
let _side = cblas_side side in
let _uplo = cblas_uplo uplo in
let _transa = cblas_transpose transa in
let _diag = cblas_diag diag in
let _a = bigarray_start Ctypes_static.Array1 a in
let _b = bigarray_start Ctypes_static.Array1 b in
match Bigarray.Array1.kind a with
| Bigarray.Float32 -> C.strmm ~order:_layout ~side:_side ~uplo:_uplo ~transa:_transa ~diag:_diag ~m ~n ~alpha ~a:_a ~lda ~b:_b ~ldb
| Bigarray.Float64 -> C.dtrmm ~order:_layout ~side:_side ~uplo:_uplo ~transa:_transa ~diag:_diag ~m ~n ~alpha ~a:_a ~lda ~b:_b ~ldb
| Bigarray.Complex32 -> C.ctrmm ~order:_layout ~side:_side ~uplo:_uplo ~transa:_transa ~diag:_diag ~m ~n ~alpha:(allocate complex32 alpha) ~a:_a ~lda ~b:_b ~ldb
| Bigarray.Complex64 -> C.ztrmm ~order:_layout ~side:_side ~uplo:_uplo ~transa:_transa ~diag:_diag ~m ~n ~alpha:(allocate complex64 alpha) ~a:_a ~lda ~b:_b ~ldb
| _ -> failwith "owl_cblas:trmm"
let trsm
: type a b. cblas_layout -> cblas_side -> cblas_uplo -> cblas_transpose -> cblas_diag -> int -> int -> a -> (a, b) t -> int -> (a, b) t -> int -> unit
= fun layout side uplo transa diag m n alpha a lda b ldb ->
let _layout = cblas_layout layout in
let _side = cblas_side side in
let _uplo = cblas_uplo uplo in
let _transa = cblas_transpose transa in
let _diag = cblas_diag diag in
let _a = bigarray_start Ctypes_static.Array1 a in
let _b = bigarray_start Ctypes_static.Array1 b in
match Bigarray.Array1.kind a with
| Bigarray.Float32 -> C.strsm ~order:_layout ~side:_side ~uplo:_uplo ~transa:_transa ~diag:_diag ~m ~n ~alpha ~a:_a ~lda ~b:_b ~ldb
| Bigarray.Float64 -> C.dtrsm ~order:_layout ~side:_side ~uplo:_uplo ~transa:_transa ~diag:_diag ~m ~n ~alpha ~a:_a ~lda ~b:_b ~ldb
| Bigarray.Complex32 -> C.ctrsm ~order:_layout ~side:_side ~uplo:_uplo ~transa:_transa ~diag:_diag ~m ~n ~alpha:(allocate complex32 alpha) ~a:_a ~lda ~b:_b ~ldb
| Bigarray.Complex64 -> C.ztrsm ~order:_layout ~side:_side ~uplo:_uplo ~transa:_transa ~diag:_diag ~m ~n ~alpha:(allocate complex64 alpha) ~a:_a ~lda ~b:_b ~ldb
| _ -> failwith "owl_cblas:trsm"
let hemm
: type a. cblas_layout -> cblas_side -> cblas_uplo -> int -> int -> Complex.t -> (Complex.t, a) t -> int -> (Complex.t, a) t -> int -> Complex.t -> (Complex.t, a) t -> int -> unit
= fun layout side uplo m n alpha a lda b ldb beta c ldc ->
let _layout = cblas_layout layout in
let _side = cblas_side side in
let _uplo = cblas_uplo uplo in
let _a = bigarray_start Ctypes_static.Array1 a in
let _b = bigarray_start Ctypes_static.Array1 b in
let _c = bigarray_start Ctypes_static.Array1 c in
match Bigarray.Array1.kind a with
| Bigarray.Complex32 -> C.chemm ~order:_layout ~side:_side ~uplo:_uplo ~m ~n ~alpha:(allocate complex32 alpha) ~a:_a ~lda ~b:_b ~ldb ~beta:(allocate complex32 beta) ~c:_c ~ldc
| Bigarray.Complex64 -> C.zhemm ~order:_layout ~side:_side ~uplo:_uplo ~m ~n ~alpha:(allocate complex64 alpha) ~a:_a ~lda ~b:_b ~ldb ~beta:(allocate complex64 beta) ~c:_c ~ldc
let herk
: type a. cblas_layout -> cblas_uplo -> cblas_transpose -> int -> int -> float -> (Complex.t, a) t -> int -> float -> (Complex.t, a) t -> int -> unit
= fun layout uplo trans n k alpha a lda beta c ldc ->
let _layout = cblas_layout layout in
let _uplo = cblas_uplo uplo in
let _trans = cblas_transpose trans in
let _a = bigarray_start Ctypes_static.Array1 a in
let _c = bigarray_start Ctypes_static.Array1 c in
match Bigarray.Array1.kind a with
| Bigarray.Complex32 -> C.cherk ~order:_layout ~uplo:_uplo ~trans:_trans ~n ~k ~alpha ~a:_a ~lda ~beta ~c:_c ~ldc
| Bigarray.Complex64 -> C.zherk ~order:_layout ~uplo:_uplo ~trans:_trans ~n ~k ~alpha ~a:_a ~lda ~beta ~c:_c ~ldc
let her2k
: type a. cblas_layout -> cblas_uplo -> cblas_transpose -> int -> int -> Complex.t -> (Complex.t, a) t -> int -> (Complex.t, a) t -> int -> float -> (Complex.t, a) t -> int -> unit
= fun layout uplo trans n k alpha a lda b ldb beta c ldc ->
let _layout = cblas_layout layout in
let _uplo = cblas_uplo uplo in
let _trans = cblas_transpose trans in
let _alpha = allocate complex32 alpha in
let _a = bigarray_start Ctypes_static.Array1 a in
let _b = bigarray_start Ctypes_static.Array1 b in
let _c = bigarray_start Ctypes_static.Array1 c in
match Bigarray.Array1.kind a with
| Bigarray.Complex32 -> C.cher2k ~order:_layout ~uplo:_uplo ~trans:_trans ~n ~k ~alpha:(allocate complex32 alpha) ~a:_a ~lda ~b:_b ~ldb ~beta ~c:_c ~ldc
| Bigarray.Complex64 -> C.zher2k ~order:_layout ~uplo:_uplo ~trans:_trans ~n ~k ~alpha:(allocate complex64 alpha) ~a:_a ~lda ~b:_b ~ldb ~beta ~c:_c ~ldc