forked from codeplaysoftware/portBLAS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
blas2_interface.h
1172 lines (1079 loc) · 51.6 KB
/
blas2_interface.h
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
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/***************************************************************************
*
* @license
* Copyright (C) Codeplay Software Limited
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* For your convenience, a copy of the License has been included in this
* repository.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* portBLAS: BLAS implementation using SYCL
*
* @filename blas2_interface.h
*
**************************************************************************/
#ifndef PORTBLAS_BLAS2_INTERFACE_H
#define PORTBLAS_BLAS2_INTERFACE_H
#include "operations/blas2_trees.h"
namespace blas {
namespace internal {
/*!
@brief Generalised matrix vector product with a rectangular non-symmetric
matrix.
Generalised matrix vector product with a rectangular non-symmetric matrix, i.e.
computing the mathematical operation:
y = alpha*A*x + beta*y
See the netlib blas interface documentation for more details of the high level
interface: http://www.netlib.org/lapack/explore-html/db/d58/sgemv_8f.html
*/
template <typename sb_handle_t, typename index_t, typename element_t,
typename container_0_t, typename container_1_t, typename increment_t,
typename container_2_t>
typename sb_handle_t::event_t _gemv(
sb_handle_t& sb_handle, // sb_handle_t (sycl, parallel, serial, etc)
char _trans, // The transposition of the matrix ('n', 't', 'c')
index_t _M, // The size of dimension M of the matrix (rows)
index_t _N, // The size of dimension N of the matrix (columns)
element_t _alpha, // Scalar parameter Alpha
container_0_t _mA, // An array (LDA,N), with the first m*n elements
index_t _lda, // Specifies the first dimension of a, max(1, m)
container_1_t _vx, // An array of dimension at least: (1+(n-1)*abs(incx))
// when trans = 'n' and (1+(m-1)*abs(incx) otherwise,
// containing the vector "x"
increment_t _incx, // The increment for elements in x (nonzero).
element_t _beta, // Scalar parameter Beta
container_2_t _vy, // An array of dimension at least: (1+(m-1)*abs(incy))
// when trans = "n" and (1+(n-1)*abs(incy) otherwise,
// containing the vector "y" (if beta is nonzero). When
// finished, y is overwritten with the updated vector.
increment_t _incy, // The increment for elements in y (nonzero).
const typename sb_handle_t::event_t& _dependencies // Vector of events
);
/*!
* @brief Prototype for the internal implementation of the GEMV operation. See
* documentation in the blas2_interface.hpp file for details.
*/
template <uint32_t local_range, uint32_t cache_line_size,
gemv_memory_t memory_type, transpose_type trn, typename sb_handle_t,
typename index_t, typename element_t, typename container_t0,
typename container_t1, typename increment_t, typename container_t2>
typename sb_handle_t::event_t _gemv_impl(
sb_handle_t& sb_handle, index_t _M, index_t _N, element_t _alpha,
container_t0 _mA, index_t _lda, container_t1 _vx, increment_t _incx,
element_t _beta, container_t2 _vy, increment_t _incy,
const typename sb_handle_t::event_t& _dependencies);
/*!
@brief Generalised matrix vector product with a triangular symmetric matrix.
Generalised matrix vector product with a triangular symmetric matrix, i.e.
computing the mathematical operation:
x = A*x
See the netlib blas interface documentation for more details of the high level
interface: http://www.netlib.org/lapack/explore-html/de/d45/strmv_8f.html
*/
template <typename sb_handle_t, typename index_t, typename container_0_t,
typename container_1_t, typename increment_t>
typename sb_handle_t::event_t _trmv(
sb_handle_t& sb_handle, // sb_handle_t (sycl, parallel, serial, etc)
char _Uplo, // Whether the matrix is upper/lower ('u', 'l')
char _trans, // Whether the matrix is transposed ('n', 't', 'c')
char _Diag, // Whether the matrix is unit triangular ('u', 'n')
index_t _N, // >0 The order of matrix A
container_0_t _mA, // (_lda, _N) The input matrix
index_t _lda, // >max(1, _N) The first dimension of _mA
container_1_t _vx, // (1 + (_N-1)*abs(_incx)), output vector X
increment_t _incx, // !=0 The increment for the elements of X
const typename sb_handle_t::event_t& _dependencies // Vector of events
);
/**
* @brief Linear system solver for triangular matrices.
*
* Linear system solver for triangular matrices, i.e., computing x s.t.
*
* op(A)*x = x
*
* See the netlib blas interface documentation for more details of the
* interface: https://netlib.org/lapack/explore-html/d0/d2a/strsv_8f.html
*
* @param sb_handle SB_handle
* @param _Uplo Specifies if A is upper or lower triangular
* @param _trans Transposition operation applied to A ('n', 't', 'c')
* @param _Diag Specifies if A unit triangular or not
* @param _N Number of rows and columns of A
* @param _mA A buffer (_LDA,_N) containing the coefficient of A
* @param _lda Leading dimension _mA at least _N
* @param _vx Buffer containing x of at least (1+(_N-1)*abs(_incx)) elements
* @param _incx Increment for _vx (nonzero)
* @param _dependencies Vector of events
*/
template <typename sb_handle_t, typename index_t, typename container_0_t,
typename container_1_t, typename increment_t>
typename sb_handle_t::event_t _trsv(
sb_handle_t& sb_handle, char _Uplo, char _trans, char _Diag, index_t _N,
container_0_t _mA, index_t _lda, container_1_t _vx, increment_t _incx,
const typename sb_handle_t::event_t& _dependencies = {});
template <uint32_t subgroup_size, uint32_t subgroups, uplo_type uplo,
transpose_type trn, diag_type diag, typename sb_handle_t,
typename index_t, typename container_t0, typename container_t1,
typename increment_t>
typename sb_handle_t::event_t _trsv_impl(
sb_handle_t& sb_handle, index_t _N, container_t0 _mA, index_t _lda,
container_t1 _vx, increment_t _incx,
const typename sb_handle_t::event_t& _dependencies);
/*!
@brief Generalised matrix vector product with a square symmetric matrix,
followed by a vector sum.
Generalised matrix vector product with a square symmetric matrix, followed by
a vector sum, i.e. computing the mathematical operation:
x = alpha*A*x + beta*y
See the netlib blas interface documentation for more details of the high level
interface: http://www.netlib.org/lapack/explore-html/d2/d94/ssymv_8f.html
*/
template <typename sb_handle_t, typename index_t, typename element_t,
typename container_0_t, typename container_1_t, typename increment_t,
typename container_2_t>
typename sb_handle_t::event_t _symv(
sb_handle_t& sb_handle, // sb_handle_t (sycl, parallel, serial, etc)
char _Uplo, // Whether the matrix is upper/lower ('u', 'l')
index_t _N, // >0 The order of matrix A
element_t _alpha, // Scalar parameter alpha
container_0_t _mA, // (_lda, _N) The input matrix
index_t _lda, // >max(1, _N) The first dimension of _mA
container_1_t _vx, // (1 + (_N-1)*abs(_incx)), input vector X
increment_t _incx, // !=0 The increment for the elements of X
element_t _beta, // Scalar parameter beta
container_2_t _vy, // (1 + (_N-1)*abs(_incy)), output vector Y
increment_t _incy, // !=0 The increment for the elements of Y
const typename sb_handle_t::event_t& _dependencies // Vector of events
);
/*!
* @brief Generalised vector product followed by a sum with a rectangular
* non-symmetric matrix.
*
* Generalised vector product followed by a sum with a rectangular non-symmetric
* matrix, i.e. computing the mathematical operation:
*
* A = alpha*x*yT + A
*
* See the netlib blas interface documentation for more details of the high
* level interface:
* http://www.netlib.org/lapack/explore-html/db/d5c/sger_8f.html
*
* @param sb_handle SB_handle
* @param _M Number of rows in matrix A
* @param _N Number of columns in matrix A
* @param _alpha Scalar alpha
* @param _vx Input vector having (1 + (_M-1)*abs(_incx)) elements
* @param _incx Increment for vector X
* @param _vy, Input vector having having (1 + (_N-1)*abs(_incy)) elements
* @param _incy Increment for vector Y
* @param _mA Input/output matrix A(_lda, n)
* @param _lda Leading dimension of A
* @param _dependencies Vector of events
*/
template <typename sb_handle_t, typename index_t, typename element_t,
typename container_0_t, typename increment_t, typename container_1_t,
typename container_2_t>
typename sb_handle_t::event_t _ger(
sb_handle_t& sb_handle, index_t _M, index_t _N, element_t _alpha,
container_0_t _vx, increment_t _incx, container_1_t _vy, increment_t _incy,
container_2_t _mA, index_t _lda,
const typename sb_handle_t::event_t& _dependencies);
/*!
@brief Generalised vector squaring followed by a sum with a symmetric matrix.
Generalised vector squaring followed by a sum with a symmetric matrix,
i.e. computing the mathematical operation:
A = alpha*x*xT + A
See the netlib blas interface documentation for more details of the high level
interface: http://www.netlib.org/lapack/explore-html/db/d99/ssyr2_8f.html
*/
template <typename sb_handle_t, typename index_t, typename element_t,
typename container_0_t, typename increment_t, typename container_1_t>
typename sb_handle_t::event_t _syr(
sb_handle_t& sb_handle, // sb_handle_t (sycl, parallel, serial, etc)
char _Uplo, // Whether the matrix is upper/lower ('u', 'l')
index_t _N, // >0 The order of matrix A
element_t _alpha, // Scalar alpha
container_0_t _vx, // (1 + (_N-1)*abs(_incx)), input vector X
increment_t _incx, // !=0 The increment for the elements of X
container_1_t _mA, // (_lda, _N) The output matrix
index_t _lda, // >max(1, _N) The first dimension of _mA
const typename sb_handle_t::event_t& _dependencies // Vector of events
);
/**
* @brief Generalised vector squaring followed by a sum with a packed symmetric
* matrix.
*
* Generalised vector squaring followed by a sum with a packed symmetric matrix,
* i.e. computing the mathematical operation:
* A = alpha*x*xT + A
* See the netlib blas interface documentation for more details of the high
* level interface:
* https://netlib.org/lapack/explore-html/d2/d9b/sspr_8f.html
*
* @param sb_handle sb_handle_t (sycl, parallel, serial, etc)
* @param _Uplo Whether the matrix is upper/lower ('u', 'l')
* @param _N >0 The order of matrix A
* @param _alpha Scalar multiplier
* @param _vx (1 + (_N-1)*abs(_incx)), input vector X
* @param _incx !=0 The increment for the elements of X
* @param _mPA (_lda, _N) The output matrix in packed format
* @param _dependencies Vector of events
*/
template <typename sb_handle_t, typename index_t, typename element_t,
typename container_0_t, typename increment_t, typename container_1_t>
typename sb_handle_t::event_t _spr(
sb_handle_t& sb_handle, char _Uplo, index_t _N, element_t _alpha,
container_0_t _vx, increment_t _incx, container_1_t _mPA,
const typename sb_handle_t::event_t& _dependencies);
/**
* @brief Generalised two vectors squaring followed by a sum with a packed
* symmetric matrix.
*
* Generalised two vector squaring followed by a sum with a packed symmetric
* matrix, i.e. computing the mathematical operation:
* A = alpha*x*yT + alpha*y*xT + A
* See the netlib blas interface documentation for more details of the high
* level interface:
* https://netlib.org/lapack/explore-html/db/d3e/sspr2_8f.html
*
* @param sb_handle sb_handle_t (sycl, parallel, serial, etc)
* @param _Uplo Whether the matrix is upper/lower ('u', 'l')
* @param _N >0 The order of matrix A
* @param _alpha Scalar multiplier
* @param _vx (1 + (_N-1)*abs(_incx)), input vector X
* @param _incx !=0 The increment for the elements of X
* @param _vy (1 + (_N-1)*abs(_incy)), input vector Y
* @param _incy !=0 The increment for the elements of Y
* @param _mPA (_lda, _N) The output matrix in packed format
* @param _dependencies Vector of events
*/
template <typename sb_handle_t, typename index_t, typename element_t,
typename container_t0, typename increment_t, typename container_t1,
typename container_t2>
typename sb_handle_t::event_t _spr2(
sb_handle_t& sb_handle, char _Uplo, index_t _N, element_t _alpha,
container_t0 _vx, increment_t _incx, container_t1 _vy, increment_t _incy,
container_t2 _mPA, const typename sb_handle_t::event_t& _dependencies);
/*!
@brief Generalised vector products followed by a sum with a symmetric matrix.
Generalised vector products followed by a sum with a symmetric matrix,
i.e. computing the mathematical operation:
A = alpha*x*yT + alpha*y*xT + A
See the netlib blas interface documentation for more details of the high level
interface: http://www.netlib.org/lapack/explore-html/d6/dac/ssyr_8f.html
*/
template <typename sb_handle_t, typename index_t, typename element_t,
typename container_0_t, typename increment_t, typename container_1_t,
typename container_2_t>
typename sb_handle_t::event_t _syr2(
sb_handle_t& sb_handle, // sb_handle_t (sycl, parallel, serial, etc)
char _Uplo, // Whether the matrix is upper/lower ('u', 'l')
index_t _N, // >0 The order of matrix A
element_t _alpha, // Scalar alpha
container_0_t _vx, // (1 + (_N-1)*abs(_incx)), input vector X
increment_t _incx, // !=0 The increment for the elements of X
container_1_t _vy, // (1 + (_N-1)*abs(_incx)), input vector Y
increment_t _incy, // !=0 The increment for the elements of Y
container_2_t _mA, // (_lda, _N) The output matrix
index_t _lda, // >max(1, _N) The first dimension of _mA
const typename sb_handle_t::event_t& _dependencies // Vector of events
);
/**
* @brief Generalised matrix vector product with band matrices.
*
* Generalised matrix vector product with a band matrix, i.e. computing the
* mathematical operation:
*
* y = alpha*op(A)*x + beta*y
*
* See the netlib blas interface documentation for more details of the
* interface: https://netlib.org/lapack/explore-html/d6/d46/sgbmv_8f.html
*
* @param sb_handle SB_handle
* @param _trans Transposition operation applied to A ('n', 't', 'c')
* @param _M Number of rows of A
* @param _N Number of columns of A
* @param _KL Number of A sub-diagonals
* @param _KU Number of A super-diagonals
* @param _alpha Scalar parameter alpha
* @param _mA Buffer (_LDA,_N) containing the coefficient of A in the Band
* Matrix format
* @param _lda Leading dimension _mA at least (_KL + _KU + 1)
* @param _vx Buffer containing x of at least (1+(_N-1)*abs(_incx)) elements
* when trans = 'n' and (1+(_M-1)*abs(_incx) otherwise
* @param _incx Increment for _vx (nonzero)
* @param _beta Scalar parameter beta
* @param _vy Buffer containing y of at least (1+(_M-1)*abs(_incy)) elements
* when trans = 'n' and (1+(_N-1)*abs(_incy) otherwise
* @param _incy Increment for _vy
* @param _dependencies Vector of events
*/
template <typename sb_handle_t, typename index_t, typename element_t,
typename container_0_t, typename container_1_t, typename increment_t,
typename container_2_t>
typename sb_handle_t::event_t _gbmv(
sb_handle_t& sb_handle, char _trans, index_t _M, index_t _N, index_t _KL,
index_t _KU, element_t _alpha, container_0_t _mA, index_t _lda,
container_1_t _vx, increment_t _incx, element_t _beta, container_2_t _vy,
increment_t _incy, const typename sb_handle_t::event_t& _dependencies);
template <uint32_t local_range, transpose_type trn, typename sb_handle_t,
typename index_t, typename element_t, typename container_t0,
typename container_t1, typename increment_t, typename container_t2>
typename sb_handle_t::event_t _gbmv_impl(
sb_handle_t& sb_handle, index_t _M, index_t _N, index_t _KL, index_t _KU,
element_t _alpha, container_t0 _mA, index_t _lda, container_t1 _vx,
increment_t _incx, element_t _beta, container_t2 _vy, increment_t _incy,
const typename sb_handle_t::event_t& _dependencies);
/**
* @brief Matrix vector product with symmetric band matrices.
*
* Matrix vector product with a symmetric band matrix, i.e. computing the
* mathematical operation:
*
* y = alpha*A*x + beta*y
*
* See the netlib blas interface documentation for more details of the
* interface: https://netlib.org/lapack/explore-html/d3/da1/ssbmv_8f.html
*
* @param sb_handle SB_handle
* @param _Uplo Specifies if A is upper or lower triangular
* @param _N Number of rows and columns of A
* @param _K Number of A super-diagonals
* @param _alpha Scalar parameter alpha
* @param _mA Buffer (_LDA,_N) containing the coefficient of A in the Band
* Matrix format
* @param _lda Leading dimension _mA at least (_K + 1)
* @param _vx Buffer containing x of at least (1+(_N-1)*abs(_incx)) elements
* @param _incx Increment for _vx (nonzero)
* @param _beta Scalar parameter beta
* @param _vy Buffer containing y of at least (1+(_N-1)*abs(_incy)) elements
* @param _incy Increment for _vy
* @param _dependencies Vector of events
*/
template <typename sb_handle_t, typename index_t, typename element_t,
typename container_0_t, typename container_1_t, typename increment_t,
typename container_2_t>
typename sb_handle_t::event_t _sbmv(
sb_handle_t& sb_handle, char _Uplo, index_t _N, index_t _K,
element_t _alpha, container_0_t _mA, index_t _lda, container_1_t _vx,
increment_t _incx, element_t _beta, container_2_t _vy, increment_t _incy,
const typename sb_handle_t::event_t& _dependencies);
template <uint32_t local_range, uplo_type uplo, typename sb_handle_t,
typename index_t, typename element_t, typename container_t0,
typename container_t1, typename increment_t, typename container_t2>
typename sb_handle_t::event_t _sbmv_impl(
sb_handle_t& sb_handle, index_t _N, index_t _K, element_t _alpha,
container_t0 _mA, index_t _lda, container_t1 _vx, increment_t _incx,
element_t _beta, container_t2 _vy, increment_t _incy,
const typename sb_handle_t::event_t& _dependencies);
/**
* @brief Matrix vector product with symmetric packed matrices.
*
* Matrix vector product with a symmetric packed matrix, i.e. computing the
* mathematical operation:
*
* y = alpha*A*x + beta*y
*
* See the netlib blas interface documentation for more details of the
* interface: https://netlib.org/lapack/explore-html/d8/d68/sspmv_8f.html
*
* @param sb_handle SB_handle
* @param _Uplo Specifies if A is upper or lower triangular
* @param _N Number of rows and columns of A
* @param _alpha Scalar parameter alpha
* @param _mA Buffer containing the coefficient of A in the Packed Triangular
* Matrix format
* @param _vx Buffer containing x of at least (1+(_N-1)*abs(_incx)) elements
* @param _incx Increment for _vx (nonzero)
* @param _beta Scalar parameter beta
* @param _vy Buffer containing y of at least (1+(_N-1)*abs(_incy)) elements
* @param _incy Increment for _vy
*/
template <typename sb_handle_t, typename index_t, typename element_t,
typename container_0_t, typename container_1_t, typename increment_t,
typename container_2_t>
typename sb_handle_t::event_t _spmv(
sb_handle_t& sb_handle, char _Uplo, index_t _N, element_t _alpha,
container_0_t _mA, container_1_t _vx, increment_t _incx, element_t _beta,
container_2_t _vy, increment_t _incy,
const typename sb_handle_t::event_t& _dependencies);
template <uint32_t local_range_x, uint32_t local_range_y, uplo_type uplo,
typename sb_handle_t, typename index_t, typename element_t,
typename container_t0, typename container_t1, typename increment_t,
typename container_t2>
typename sb_handle_t::event_t _spmv_impl(
sb_handle_t& sb_handle, index_t _N, element_t _alpha, container_t0 _mA,
container_t1 _vx, increment_t _incx, element_t _beta, container_t2 _vy,
increment_t _incy, const typename sb_handle_t::event_t& _dependencies);
/**
* @brief Matrix vector product with triangular band matrices.
*
* Matrix vector product with a triangular band matrix, i.e. computing the
* mathematical operation:
*
* x = op(A)*x
*
* See the netlib blas interface documentation for more details of the
* interface: https://netlib.org/lapack/explore-html/d6/d7d/stbmv_8f.html
*
* @param sb_handle SB_handle
* @param _Uplo Specifies if A is upper or lower triangular
* @param _trans Transposition operation applied to A ('n', 't', 'c')
* @param _Diag Specifies if A unit triangular or not
* @param _N Number of rows and columns of A
* @param _K Number of A super-diagonals
* @param _mA Buffer (_LDA,_N) containing the coefficient of A in the Band
* Matrix format
* @param _lda Leading dimension _mA at least (_K + 1)
* @param _vx Buffer containing x of at least (1+(_N-1)*abs(_incx)) elements
* @param _incx Increment for _vx (nonzero)
* @param _dependencies Vector of events
*/
template <typename sb_handle_t, typename index_t, typename container_0_t,
typename container_1_t, typename increment_t>
typename sb_handle_t::event_t _tbmv(
sb_handle_t& sb_handle, char _Uplo, char _trans, char _Diag, index_t _N,
index_t _K, container_0_t _mA, index_t _lda, container_1_t _vx,
increment_t _incx, const typename sb_handle_t::event_t& _dependencies);
template <uint32_t local_range, uplo_type uplo, transpose_type trn,
diag_type diag, typename sb_handle_t, typename index_t,
typename container_t0, typename container_t1, typename increment_t>
typename sb_handle_t::event_t _tbmv_impl(
sb_handle_t& sb_handle, index_t _N, index_t _K, container_t0 _mA,
index_t _lda, container_t1 _vx, increment_t _incx,
const typename sb_handle_t::event_t& _dependencies);
/**
* @brief Matrix vector product with triangular packed matrices.
*
* Matrix vector product with a triangular band matrix, i.e. computing the
* mathematical operation:
*
* x = op(A)*x
*
* See the netlib blas interface documentation for more details of the
* interface: https://netlib.org/lapack/explore-html/db/db1/stpmv_8f.html
*
* @param sb_handle SB_handle
* @param _Uplo Specifies if A is upper or lower triangular
* @param _trans Transposition operation applied to A ('n', 't', 'c')
* @param _Diag Specifies if A unit triangular or not
* @param _N Number of rows and columns of A
* @param _ma buffer containing the coefficient of a in the packed triangular
* matrix format
* @param _vx Buffer containing x of at least (1+(_N-1)*abs(_incx)) elements
* @param _incx Increment for _vx (nonzero)
* @param _dependencies Vector of events
*/
template <typename sb_handle_t, typename index_t, typename container_0_t,
typename container_1_t, typename increment_t>
typename sb_handle_t::event_t _tpmv(
sb_handle_t& sb_handle, char _Uplo, char _trans, char _Diag, index_t _N,
container_0_t _mA, container_1_t _vx, increment_t _incx,
const typename sb_handle_t::event_t& _dependencies);
template <uint32_t local_range_x, uint32_t local_range_y, uplo_type uplo,
transpose_type trn, diag_type diag, typename sb_handle_t,
typename index_t, typename container_t0, typename container_t1,
typename increment_t>
typename sb_handle_t::event_t _tpmv_impl(
sb_handle_t& sb_handle, index_t _N, container_t0 _mA, container_t1 _vx,
increment_t _incx, const typename sb_handle_t::event_t& _dependencies);
/**
* @brief Linear system solver for triangular band matrices.
*
* Linear system solver for triangular band matrices, i.e., computing x s.t.
*
* op(A)*x = b
*
* See the netlib blas interface documentation for more details of the
* interface: https://netlib.org/lapack/explore-html/d0/d1f/stbsv_8f.html
*
* @param sb_handle SB_handle
* @param _Uplo Specifies if A is upper or lower triangular
* @param _trans Transposition operation applied to A ('n', 't', 'c')
* @param _Diag Specifies if A unit triangular or not
* @param _N Number of rows and columns of A
* @param _K Number of A super-diagonals
* @param _mA Buffer (_LDA,_N) containing the coefficient of A in the Band
* Matrix format
* @param _lda Leading dimension _mA at least (_K + 1)
* @param _vx Buffer containing x of at least (1+(_N-1)*abs(_incx)) elements
* @param _incx Increment for _vx (nonzero)
* @param _dependencies Vector of events
*/
template <typename sb_handle_t, typename index_t, typename container_0_t,
typename container_1_t, typename increment_t>
typename sb_handle_t::event_t _tbsv(
sb_handle_t& sb_handle, char _Uplo, char _trans, char _Diag, index_t _N,
index_t _K, container_0_t _mA, index_t _lda, container_1_t _vx,
increment_t _incx, const typename sb_handle_t::event_t& _dependencies);
template <uint32_t subgroup_size, uint32_t subgroups, uplo_type uplo,
transpose_type trn, diag_type diag, typename sb_handle_t,
typename index_t, typename container_t0, typename container_t1,
typename increment_t>
typename sb_handle_t::event_t _tbsv_impl(
sb_handle_t& sb_handle, index_t _N, index_t _K, container_t0 _mA,
index_t _lda, container_t1 _vx, increment_t _incx,
const typename sb_handle_t::event_t& _dependencies);
/**
* @brief Linear system solver for triangular packed matrices.
*
* Linear system solver for triangular packed matrices, i.e., computing x s.t.
*
* op(A)*x = b
*
* See the netlib blas interface documentation for more details of the
* interface: https://netlib.org/lapack/explore-html/d0/d7c/stpsv_8f.html
*
* @param sb_handle SB_handle
* @param _Uplo Specifies if A is upper or lower triangular
* @param _trans Transposition operation applied to A ('n', 't', 'c')
* @param _Diag Specifies if A unit triangular or not
* @param _N Number of rows and columns of A
* @param _mA Buffer containing the coefficient of A in the Packed Triangular
* Matrix format
* @param _vx Buffer containing x of at least (1+(_N-1)*abs(_incx)) elements
* @param _incx Increment for _vx (nonzero)
* @param _dependencies Vector of events
*/
template <typename sb_handle_t, typename index_t, typename container_0_t,
typename container_1_t, typename increment_t>
typename sb_handle_t::event_t _tpsv(sb_handle_t& sb_handle, char _Uplo,
char _trans, char _Diag, index_t _N,
container_0_t _mA, container_1_t _vx,
increment_t _incx,
const typename sb_handle_t::event_t& _dependencies);
template <uint32_t subgroup_size, uint32_t subgroups, uplo_type uplo,
transpose_type trn, diag_type diag, typename sb_handle_t,
typename index_t, typename container_t0, typename container_t1,
typename increment_t>
typename sb_handle_t::event_t _tpsv_impl(sb_handle_t& sb_handle, index_t _N,
container_t0 _mA, container_t1 _vx,
increment_t _incx,
const typename sb_handle_t::event_t& _dependencies);
} // namespace internal
/*!
@brief Generalised matrix vector product with a rectangular non-symmetric
matrix.
Generalised matrix vector product with a rectangular non-symmetric matrix, i.e.
computing the mathematical operation:
y = alpha*A*x + beta*y
See the netlib blas interface documentation for more details of the high level
interface: http://www.netlib.org/lapack/explore-html/db/d58/sgemv_8f.html
*/
template <typename sb_handle_t, typename index_t, typename element_t,
typename container_0_t, typename container_1_t, typename increment_t,
typename container_2_t>
typename sb_handle_t::event_t inline _gemv(
sb_handle_t& sb_handle, // sb_handle_t (sycl, parallel, serial, etc)
char _trans, // The transposition of the matrix ('n', 't', 'c')
index_t _M, // The size of dimension M of the matrix (rows)
index_t _N, // The size of dimension N of the matrix (columns)
element_t _alpha, // Scalar parameter Alpha
container_0_t _mA, // An array (LDA,N), with the first m*n elements
index_t _lda, // Specifies the first dimension of a, max(1, m)
container_1_t _vx, // An array of dimension at least: (1+(n-1)*abs(incx))
// when trans = 'n' and (1+(m-1)*abs(incx) otherwise,
// containing the vector "x"
increment_t _incx, // The increment for elements in x (nonzero).
element_t _beta, // Scalar parameter Beta
container_2_t _vy, // An array of dimension at least: (1+(m-1)*abs(incy))
// when trans = "n" and (1+(n-1)*abs(incy) otherwise,
// containing the vector "y" (if beta is nonzero). When
// finished, y is overwritten with the updated vector.
increment_t _incy, // The increment for elements in y (nonzero).
const typename sb_handle_t::event_t& _dependencies = {} // Vector of events
) {
return internal::_gemv(sb_handle, _trans, _M, _N, _alpha, _mA, _lda, _vx,
_incx, _beta, _vy, _incy, _dependencies);
}
/*!
@brief Generalised matrix vector product with a triangular symmetric matrix.
Generalised matrix vector product with a triangular symmetric matrix, i.e.
computing the mathematical operation:
x = A*x
See the netlib blas interface documentation for more details of the high level
interface: http://www.netlib.org/lapack/explore-html/de/d45/strmv_8f.html
*/
template <typename sb_handle_t, typename index_t, typename container_0_t,
typename container_1_t, typename increment_t>
typename sb_handle_t::event_t inline _trmv(
sb_handle_t& sb_handle, // sb_handle_t (sycl, parallel, serial, etc)
char _Uplo, // Whether the matrix is upper/lower ('u', 'l')
char _trans, // Whether the matrix is transposed ('n', 't', 'c')
char _Diag, // Whether the matrix is unit triangular ('u', 'n')
index_t _N, // >0 The order of matrix A
container_0_t _mA, // (_lda, _N) The input matrix
index_t _lda, // >max(1, _N) The first dimension of _mA
container_1_t _vx, // (1 + (_N-1)*abs(_incx)), output vector X
increment_t _incx, // !=0 The increment for the elements of X
const typename sb_handle_t::event_t& _dependencies = {} // Vector of events
) {
return internal::_trmv(sb_handle, _Uplo, _trans, _Diag, _N, _mA, _lda, _vx,
_incx, _dependencies);
}
/**
* @brief Linear system solver for triangular matrices.
*
* Linear system solver for triangular matrices, i.e., computing x s.t.
*
* op(A)*x = x
*
* See the netlib blas interface documentation for more details of the
* interface: https://netlib.org/lapack/explore-html/d0/d2a/strsv_8f.html
*
* @param sb_handle SB_handle
* @param _Uplo Specifies if A is upper or lower triangular
* @param _trans Transposition operation applied to A ('n', 't', 'c')
* @param _Diag Specifies if A unit triangular or not
* @param _N Number of rows and columns of A
* @param _mA A buffer (_LDA,_N) containing the coefficient of A
* @param _lda Leading dimension _mA at least _N
* @param _vx Buffer containing x of at least (1+(_N-1)*abs(_incx)) elements
* @param _incx Increment for _vx (nonzero)
* @param _dependencies Vector of events
*/
template <typename sb_handle_t, typename index_t, typename container_0_t,
typename container_1_t, typename increment_t>
typename sb_handle_t::event_t inline _trsv(
sb_handle_t& sb_handle, char _Uplo, char _trans, char _Diag, index_t _N,
container_0_t _mA, index_t _lda, container_1_t _vx, increment_t _incx,
const typename sb_handle_t::event_t& _dependencies = {}) {
return internal::_trsv(sb_handle, _Uplo, _trans, _Diag, _N, _mA, _lda, _vx,
_incx, _dependencies);
}
/*!
@brief Generalised matrix vector product with a rectangular symmetric
matrix, followed by a vector sum.
Generalised matrix vector product with a rectangular symmetric
matrix, followed by a vector sum, i.e.
computing the mathematical operation:
x = alpha*A*x + beta*y
See the netlib blas interface documentation for more details of the high level
interface: http://www.netlib.org/lapack/explore-html/d2/d94/ssymv_8f.html
*/
template <typename sb_handle_t, typename index_t, typename element_t,
typename container_0_t, typename container_1_t, typename increment_t,
typename container_2_t>
typename sb_handle_t::event_t inline _symv(
sb_handle_t& sb_handle, // sb_handle_t (sycl, parallel, serial, etc)
char _Uplo, // Whether the matrix is upper/lower ('u', 'l')
index_t _N, // >0 The order of matrix A
element_t _alpha, // Scalar parameter alpha
container_0_t _mA, // (_lda, _N) The input matrix
index_t _lda, // >max(1, _N) The first dimension of _mA
container_1_t _vx, // (1 + (_N-1)*abs(_incx)), input vector X
increment_t _incx, // !=0 The increment for the elements of X
element_t _beta, // Scalar parameter beta
container_2_t _vy, // (1 + (_N-1)*abs(_incy)), output vector Y
increment_t _incy, // !=0 The increment for the elements of Y
const typename sb_handle_t::event_t& _dependencies = {} // Vector of events
) {
return internal::_symv(sb_handle, _Uplo, _N, _alpha, _mA, _lda, _vx, _incx,
_beta, _vy, _incy, _dependencies);
}
/*!
* @brief Generalised vector product followed by a sum with a rectangular
* non-symmetric matrix.
*
* Generalised vector product followed by a sum with a rectangular non-symmetric
* matrix, i.e.
* computing the mathematical operation:
*
* A = alpha*x*yT + A
*
* See the netlib blas interface documentation for more details of the high
* level interface:
* http://www.netlib.org/lapack/explore-html/db/d5c/sger_8f.html
*
* @param sb_handle SB_handle
* @param _M Number of rows in matrix A
* @param _N Number of columns in matrix A
* @param _alpha Scalar alpha
* @param _vx Input vector having (1 + (_M-1)*abs(_incx)) elements
* @param _incx Increment for vector X
* @param _vy, Input vector having having (1 + (_N-1)*abs(_incy)) elements
* @param _incy Increment for vector Y
* @param _mA Input/output matrix A(_lda, n)
* @param _lda Leading dimension of A
* @param _dependencies Vector of events
*/
template <typename sb_handle_t, typename index_t, typename element_t,
typename container_0_t, typename increment_t, typename container_1_t,
typename container_2_t>
typename sb_handle_t::event_t inline _ger(
sb_handle_t& sb_handle, index_t _M, index_t _N, element_t _alpha,
container_0_t _vx, increment_t _incx, container_1_t _vy, increment_t _incy,
container_2_t _mA, index_t _lda,
const typename sb_handle_t::event_t& _dependencies = {}) {
return internal::_ger(sb_handle, _M, _N, _alpha, _vx, _incx, _vy, _incy, _mA,
_lda, _dependencies);
}
/*!
@brief Generalised vector product sum.
Generalised vector squaring followed by a sum with a rectangular symmetric
matrix, i.e.
computing the mathematical operation:
A = alpha*x*xT + A
See the netlib blas interface documentation for more details of the high level
interface: http://www.netlib.org/lapack/explore-html/db/d99/ssyr2_8f.html
*/
template <typename sb_handle_t, typename index_t, typename element_t,
typename container_0_t, typename increment_t, typename container_1_t>
typename sb_handle_t::event_t inline _syr(
sb_handle_t& sb_handle, // sb_handle_t (sycl, parallel, serial, etc)
char _Uplo, // Whether the matrix is upper/lower ('u', 'l')
index_t _N, // >0 The order of matrix A
element_t _alpha, // Scalar alpha
container_0_t _vx, // (1 + (_N-1)*abs(_incx)), input vector X
increment_t _incx, // !=0 The increment for the elements of X
container_1_t _mA, // (_lda, _N) The output matrix
index_t _lda, // >max(1, _N) The first dimension of _mA
const typename sb_handle_t::event_t& _dependencies = {} // Vector of events
) {
return internal::_syr(sb_handle, _Uplo, _N, _alpha, _vx, _incx, _mA, _lda,
_dependencies);
}
/**
* @brief Generalised vector squaring followed by a sum with a packed symmetric
* matrix.
*
* Generalised vector squaring followed by a sum with a packed symmetric matrix,
* i.e. computing the mathematical operation:
* A = alpha*x*xT + A
* See the netlib blas interface documentation for more details of the high
* level interface:
* https://netlib.org/lapack/explore-html/d2/d9b/sspr_8f.html
*
* @param sb_handle sb_handle_t (sycl, parallel, serial, etc)
* @param _Uplo Whether the matrix is upper/lower ('u', 'l')
* @param _N >0 The order of matrix A
* @param _alpha Scalar multiplier
* @param _vx (1 + (_N-1)*abs(_incx)), input vector X
* @param _incx !=0 The increment for the elements of X
* @param _mPA (_lda, _N) The output matrix in packed format
* @param _dependencies Vector of events
*/
template <typename sb_handle_t, typename index_t, typename element_t,
typename container_0_t, typename increment_t, typename container_1_t>
typename sb_handle_t::event_t inline _spr(
sb_handle_t& sb_handle, char _Uplo, index_t _N, element_t _alpha,
container_0_t _vx, increment_t _incx, container_1_t _mPA,
const typename sb_handle_t::event_t& _dependencies = {}) {
return internal::_spr(sb_handle, _Uplo, _N, _alpha, _vx, _incx, _mPA,
_dependencies);
}
/**
* @brief Generalised two vectors squaring followed by a sum with a packed
* symmetric matrix.
*
* Generalised two vector squaring followed by a sum with a packed symmetric
* matrix, i.e. computing the mathematical operation:
* A = alpha*x*yT + alpha*y*xT + A
* See the netlib blas interface documentation for more details of the high
* level interface:
* https://netlib.org/lapack/explore-html/db/d3e/sspr2_8f.html
*
* @param sb_handle sb_handle_t (sycl, parallel, serial, etc)
* @param _Uplo Whether the matrix is upper/lower ('u', 'l')
* @param _N >0 The order of matrix A
* @param _alpha Scalar multiplier
* @param _vx (1 + (_N-1)*abs(_incx)), input vector X
* @param _incx !=0 The increment for the elements of X
* @param _vy (1 + (_N-1)*abs(_incy)), input vector Y
* @param _incy !=0 The increment for the elements of Y
* @param _mPA (_lda, _N) The output matrix in packed format
* @param _dependencies Vector of events
*/
template <typename sb_handle_t, typename index_t, typename element_t,
typename container_t0, typename increment_t, typename container_t1,
typename container_t2>
typename sb_handle_t::event_t inline _spr2(
sb_handle_t& sb_handle, char _Uplo, index_t _N, element_t _alpha,
container_t0 _vx, increment_t _incx, container_t1 _vy, increment_t _incy,
container_t2 _mPA,
const typename sb_handle_t::event_t& _dependencies = {}) {
return internal::_spr2(sb_handle, _Uplo, _N, _alpha, _vx, _incx, _vy, _incy,
_mPA, _dependencies);
}
/*!
@brief Generalised vector product followed by a sum with a rectangular
symmetric matrix.
Generalised vector product followed by a sum with a rectangular symmetric
matrix, i.e.
computing the mathematical operation:
A = alpha*x*yT + alpha*y*xT + A
See the netlib blas interface documentation for more details of the high level
interface: http://www.netlib.org/lapack/explore-html/d6/dac/ssyr_8f.html
*/
template <typename sb_handle_t, typename index_t, typename element_t,
typename container_0_t, typename increment_t, typename container_1_t,
typename container_2_t>
typename sb_handle_t::event_t inline _syr2(
sb_handle_t& sb_handle, // sb_handle_t (sycl, parallel, serial, etc)
char _Uplo, // Whether the matrix is upper/lower ('u', 'l')
index_t _N, // >0 The order of matrix A
element_t _alpha, // Scalar alpha
container_0_t _vx, // (1 + (_N-1)*abs(_incx)), input vector X
increment_t _incx, // !=0 The increment for the elements of X
container_1_t _vy, // (1 + (_N-1)*abs(_incx)), input vector Y
increment_t _incy, // !=0 The increment for the elements of Y
container_2_t _mA, // (_lda, _N) The output matrix
index_t _lda, // >max(1, _N) The first dimension of _mA
const typename sb_handle_t::event_t& _dependencies = {} // Vector of events
) {
return internal::_syr2(sb_handle, _Uplo, _N, _alpha, _vx, _incx, _vy, _incy,
_mA, _lda, _dependencies);
}
/**
* @brief Generalised matrix vector product with band matrices.
*
* Generalised matrix vector product with a band matrix, i.e. computing the
* mathematical operation:
*
* y = alpha*op(A)*x + beta*y
*
* See the netlib blas interface documentation for more details of the
* interface: https://netlib.org/lapack/explore-html/d6/d46/sgbmv_8f.html
*
* @param sb_handle SB_handle
* @param _trans Transposition operation applied to A ('n', 't', 'c')
* @param _M Number of rows of A
* @param _N Number of columns of A
* @param _KL Number of A sub-diagonals
* @param _KU Number of A super-diagonals
* @param _alpha Scalar parameter alpha
* @param _mA Buffer (_LDA,_N) containing the coefficient of A in the Band
* Matrix format
* @param _lda Leading dimension _mA at least (_KL + _KU + 1)
* @param _vx Buffer containing x of at least (1+(_N-1)*abs(_incx)) elements
* when trans = 'n' and (1+(_M-1)*abs(_incx) otherwise
* @param _incx Increment for _vx (nonzero)
* @param _beta Scalar parameter beta
* @param _vy Buffer containing y of at least (1+(_M-1)*abs(_incy)) elements
* when trans = 'n' and (1+(_N-1)*abs(_incy) otherwise
* @param _incy Increment for _vy
* @param _dependencies Vector of events
*/
template <typename sb_handle_t, typename index_t, typename element_t,
typename container_0_t, typename container_1_t, typename increment_t,
typename container_2_t>
typename sb_handle_t::event_t inline _gbmv(
sb_handle_t& sb_handle, char _trans, index_t _M, index_t _N, index_t _KL,
index_t _KU, element_t _alpha, container_0_t _mA, index_t _lda,
container_1_t _vx, increment_t _incx, element_t _beta, container_2_t _vy,
increment_t _incy,
const typename sb_handle_t::event_t& _dependencies = {}) {
return internal::_gbmv(sb_handle, _trans, _M, _N, _KL, _KU, _alpha, _mA, _lda,
_vx, _incx, _beta, _vy, _incy, _dependencies);
}
/**
* @brief Matrix vector product with symmetric band matrices.
*
* Matrix vector product with a symmetric band matrix, i.e. computing the
* mathematical operation:
*
* y = alpha*A*x + beta*y
*
* See the netlib blas interface documentation for more details of the
* interface: https://netlib.org/lapack/explore-html/d3/da1/ssbmv_8f.html
*
* @param sb_handle SB_handle
* @param _Uplo Specifies if A is upper or lower triangular
* @param _N Number of rows and columns of A
* @param _K Number of A super-diagonals
* @param _alpha Scalar parameter alpha
* @param _mA Buffer (_LDA,_N) containing the coefficient of A in the Band
* Matrix format
* @param _lda Leading dimension _mA at least (_K + 1)
* @param _vx Buffer containing x of at least (1+(_N-1)*abs(_incx)) elements
* @param _incx Increment for _vx (nonzero)
* @param _beta Scalar parameter beta
* @param _vy Buffer containing y of at least (1+(_N-1)*abs(_incy)) elements
* @param _incy Increment for _vy
* @param _dependencies Vector of events
*/
template <typename sb_handle_t, typename index_t, typename element_t,
typename container_0_t, typename container_1_t, typename increment_t,
typename container_2_t>
typename sb_handle_t::event_t _sbmv(
sb_handle_t& sb_handle, char _Uplo, index_t _N, index_t _K,
element_t _alpha, container_0_t _mA, index_t _lda, container_1_t _vx,
increment_t _incx, element_t _beta, container_2_t _vy, increment_t _incy,
const typename sb_handle_t::event_t& _dependencies = {}) {
return internal::_sbmv(sb_handle, _Uplo, _N, _K, _alpha, _mA, _lda, _vx,
_incx, _beta, _vy, _incy, _dependencies);