SuperLU Distributed 9.0.0
gpu3d
superlu_blas.hpp
Go to the documentation of this file.
1#pragma once
2#include "superlu_defs.h"
3#include "superlu_zdefs.h"
4#include "superlu_sdefs.h"
5//#include "lupanels.hpp"
6
7template<typename T>
8void superlu_trsm(const char *side, const char *uplo, const char *transa, const char *diag,
9 int m, int n, T alpha, T *A, int lda, T *B, int ldb);
10
11// Specialization for double
12template<>
13void superlu_trsm<double>(const char *side, const char *uplo, const char *transa, const char *diag,
14 int m, int n, double alpha, double *A, int lda, double *B, int ldb) {
15 superlu_dtrsm(side, uplo, transa, diag, m, n, alpha, A, lda, B, ldb);
16}
17
18// Specialization for float
19template<>
20void superlu_trsm<float>(const char *side, const char *uplo, const char *transa, const char *diag,
21 int m, int n, float alpha, float *A, int lda, float *B, int ldb) {
22 superlu_strsm(side, uplo, transa, diag, m, n, alpha, A, lda, B, ldb);
23}
24
25
26template<typename T>
27void superlu_gemm(const char *transa, const char *transb, int m, int n, int k, T alpha,
28 T *A, int lda, T *B, int ldb, T beta, T *C, int ldc);
29
30// Specialization for double
31template<>
32void superlu_gemm<double>(const char *transa, const char *transb, int m, int n, int k, double alpha,
33 double *A, int lda, double *B, int ldb, double beta,
34 double *C, int ldc) {
35 superlu_dgemm(transa, transb, m, n, k, alpha, A, lda, B, ldb, beta, C, ldc);
36}
37
38// Specialization for float
39template<>
40void superlu_gemm<float>(const char *transa, const char *transb, int m, int n, int k, float alpha,
41 float *A, int lda, float *B, int ldb, float beta,
42 float *C, int ldc) {
43 superlu_sgemm(transa, transb, m, n, k, alpha, A, lda, B, ldb, beta, C, ldc);
44}
45
46// create variant for superlu_dscal, superlu_sscal, superlu_cscal, superlu_zscal
47template<typename T>
48void superlu_scal(int n, T alpha, T *x, int incx);
49
50// Specialization for double
51template<>
52void superlu_scal<double>(int n, double alpha, double *x, int incx) {
53 superlu_dscal(n, alpha, x, incx);
54}
55
56// Specialization for float
57template<>
58void superlu_scal<float>(int n, float alpha, float *x, int incx) {
59 superlu_sscal(n, alpha, x, incx);
60}
61
62
63// Specialization for double complex
64
65// create variant for superlu_daxpy, superlu_saxpy, superlu_caxpy, superlu_zaxpy
66template<typename T>
67void superlu_axpy(int n, T alpha, T *x, int incx, T *y, int incy);
68
69// Specialization for double
70template<>
71void superlu_axpy<double>(int n, double alpha, double *x, int incx, double *y, int incy) {
72 superlu_daxpy(n, alpha, x, incx, y, incy);
73}
74
75// Specialization for float
76template<>
77void superlu_axpy<float>(int n, float alpha, float *x, int incx, float *y, int incy) {
78 superlu_saxpy(n, alpha, x, incx, y, incy);
79}
80
81template<typename T>
82void superlu_ger(const int m, const int n, const T alpha,
83 const T *x, const int incx, const T *y,
84 const int incy, T *a, const int lda);
85
86// Specialization for double
87template<>
88void superlu_ger<double>(const int m, const int n, const double alpha,
89 const double *x, const int incx, const double *y,
90 const int incy, double *a, const int lda) {
91 superlu_dger(m, n, alpha, x, incx, y, incy, a, lda);
92}
93
94// Specialization for float
95template<>
96void superlu_ger<float>(const int m, const int n, const float alpha,
97 const float *x, const int incx, const float *y,
98 const int incy, float *a, const int lda) {
99 superlu_sger(m, n, alpha, x, incx, y, incy, a, lda);
100}
101
102
103
104
105
106// #ifdef enable_complex16
107// Specialization for double complex
108template<>
109void superlu_axpy<doublecomplex>(int n, doublecomplex alpha, doublecomplex *x, int incx, doublecomplex *y, int incy) {
110 superlu_zaxpy(n, alpha, x, incx, y, incy);
111}
112
113template<>
115 superlu_zscal(n, alpha, x, incx);
116}
117
118
119template<>
120void superlu_gemm<doublecomplex>(const char *transa, const char *transb, int m, int n, int k, doublecomplex alpha,
121 doublecomplex *A, int lda, doublecomplex *B, int ldb, doublecomplex beta,
122 doublecomplex *C, int ldc) {
123 superlu_zgemm(transa, transb, m, n, k, alpha, A, lda, B, ldb, beta, C, ldc);
124}
125
126
127template<>
128void superlu_trsm<doublecomplex>(const char *side, const char *uplo, const char *transa, const char *diag,
129 int m, int n, doublecomplex alpha, doublecomplex *A, int lda, doublecomplex *B, int ldb) {
130 superlu_ztrsm(side, uplo, transa, diag, m, n, alpha, A, lda, B, ldb);
131}
132
133template<>
134void superlu_ger<doublecomplex>(const int m, const int n, const doublecomplex alpha,
135 const doublecomplex *x, const int incx, const doublecomplex *y,
136 const int incy, doublecomplex *a, const int lda) {
137 superlu_zger(m, n, alpha, x, incx, y, incy, a, lda);
138}
139// #endif
Definition: dcomplex.h:30
void superlu_scal(int n, T alpha, T *x, int incx)
void superlu_ger(const int m, const int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *a, const int lda)
void superlu_axpy< double >(int n, double alpha, double *x, int incx, double *y, int incy)
Definition: superlu_blas.hpp:71
void superlu_gemm< doublecomplex >(const char *transa, const char *transb, int m, int n, int k, doublecomplex alpha, doublecomplex *A, int lda, doublecomplex *B, int ldb, doublecomplex beta, doublecomplex *C, int ldc)
Definition: superlu_blas.hpp:120
void superlu_axpy(int n, T alpha, T *x, int incx, T *y, int incy)
void superlu_gemm< float >(const char *transa, const char *transb, int m, int n, int k, float alpha, float *A, int lda, float *B, int ldb, float beta, float *C, int ldc)
Definition: superlu_blas.hpp:40
void superlu_trsm< double >(const char *side, const char *uplo, const char *transa, const char *diag, int m, int n, double alpha, double *A, int lda, double *B, int ldb)
Definition: superlu_blas.hpp:13
void superlu_ger< doublecomplex >(const int m, const int n, const doublecomplex alpha, const doublecomplex *x, const int incx, const doublecomplex *y, const int incy, doublecomplex *a, const int lda)
Definition: superlu_blas.hpp:134
void superlu_gemm< double >(const char *transa, const char *transb, int m, int n, int k, double alpha, double *A, int lda, double *B, int ldb, double beta, double *C, int ldc)
Definition: superlu_blas.hpp:32
void superlu_trsm(const char *side, const char *uplo, const char *transa, const char *diag, int m, int n, T alpha, T *A, int lda, T *B, int ldb)
void superlu_scal< double >(int n, double alpha, double *x, int incx)
Definition: superlu_blas.hpp:52
void superlu_trsm< doublecomplex >(const char *side, const char *uplo, const char *transa, const char *diag, int m, int n, doublecomplex alpha, doublecomplex *A, int lda, doublecomplex *B, int ldb)
Definition: superlu_blas.hpp:128
void superlu_scal< float >(int n, float alpha, float *x, int incx)
Definition: superlu_blas.hpp:58
void superlu_ger< double >(const int m, const int n, const double alpha, const double *x, const int incx, const double *y, const int incy, double *a, const int lda)
Definition: superlu_blas.hpp:88
void superlu_trsm< float >(const char *side, const char *uplo, const char *transa, const char *diag, int m, int n, float alpha, float *A, int lda, float *B, int ldb)
Definition: superlu_blas.hpp:20
void superlu_gemm(const char *transa, const char *transb, int m, int n, int k, T alpha, T *A, int lda, T *B, int ldb, T beta, T *C, int ldc)
void superlu_axpy< doublecomplex >(int n, doublecomplex alpha, doublecomplex *x, int incx, doublecomplex *y, int incy)
Definition: superlu_blas.hpp:109
void superlu_ger< float >(const int m, const int n, const float alpha, const float *x, const int incx, const float *y, const int incy, float *a, const int lda)
Definition: superlu_blas.hpp:96
void superlu_scal< doublecomplex >(int n, doublecomplex alpha, doublecomplex *x, int incx)
Definition: superlu_blas.hpp:114
void superlu_axpy< float >(int n, float alpha, float *x, int incx, float *y, int incy)
Definition: superlu_blas.hpp:77
int superlu_dger(const int m, const int n, const double alpha, const double *x, const int incx, const double *y, const int incy, double *a, const int lda)
int superlu_daxpy(const int n, const double alpha, const double *x, const int incx, double *y, const int incy)
int superlu_dtrsm(const char *sideRL, const char *uplo, const char *transa, const char *diag, const int m, const int n, const double alpha, const double *a, const int lda, double *b, const int ldb)
int superlu_dgemm(const char *transa, const char *transb, int m, int n, int k, double alpha, double *a, int lda, double *b, int ldb, double beta, double *c, int ldc)
int superlu_dscal(const int n, const double alpha, double *x, const int incx)
Definitions which are precision-neutral.
Distributed SuperLU data types and function prototypes.
int superlu_sscal(const int n, const float alpha, float *x, const int incx)
int superlu_saxpy(const int n, const float alpha, const float *x, const int incx, float *y, const int incy)
int superlu_sgemm(const char *transa, const char *transb, int m, int n, int k, float alpha, float *a, int lda, float *b, int ldb, float beta, float *c, int ldc)
int superlu_strsm(const char *sideRL, const char *uplo, const char *transa, const char *diag, const int m, const int n, const float alpha, const float *a, const int lda, float *b, const int ldb)
int superlu_sger(const int m, const int n, const float alpha, const float *x, const int incx, const float *y, const int incy, float *a, const int lda)
Distributed SuperLU data types and function prototypes.
int superlu_zgemm(const char *transa, const char *transb, int m, int n, int k, doublecomplex alpha, doublecomplex *a, int lda, doublecomplex *b, int ldb, doublecomplex beta, doublecomplex *c, int ldc)
int superlu_zscal(const int n, const doublecomplex alpha, doublecomplex *x, const int incx)
int superlu_zaxpy(const int n, const doublecomplex alpha, const doublecomplex *x, const int incx, doublecomplex *y, const int incy)
int superlu_zger(const int m, const int n, const doublecomplex alpha, const doublecomplex *x, const int incx, const doublecomplex *y, const int incy, doublecomplex *a, const int lda)
int superlu_ztrsm(const char *sideRL, const char *uplo, const char *transa, const char *diag, const int m, const int n, const doublecomplex alpha, const doublecomplex *a, const int lda, doublecomplex *b, const int ldb)