001: /* ///////////////////////////// P /// L /// A /// S /// M /// A /////////////////////////////// */
002: /* ///                    PLASMA auxiliary routines (version 2.1.0)                          ///
003:  * ///                    Author: Jakub Kurzak, Hatem Ltaief                                 ///
004:  * ///                    Release Date: November, 15th 2009                                  ///
005:  * ///                    PLASMA is a software package provided by Univ. of Tennessee,       ///
006:  * ///                    Univ. of California Berkeley and Univ. of Colorado Denver          /// */
007: /* ///////////////////////////////////////////////////////////////////////////////////////////// */
008: #include "common.h"
009: #include "core_blas.h"
010: #include "lapack.h"
011: 
012: /* ///////////////////////////////////////////////////////////////////////////////////////////// */
013: void CORE_sgelqt(int M, int N, int IB,
014:                  float *A, int LDA,
015:                  float *T, int LDT,
016:                  float *TAU, float *WORK)
017: {
018:     int INFO;
019: 
020:     core_sgelqt(
021:         &M, &N, &IB,
022:         A, &LDA,
023:         T, &LDT,
024:         TAU, WORK, &INFO);
025: }
026: 
027: /* ///////////////////////////////////////////////////////////////////////////////////////////// */
028: void CORE_sgemm(int transA, int transB,
029:                 int M, int N, int K,
030:                 float alpha, float *A, int LDA,
031:                 float *B, int LDB,
032:                 float beta, float *C, int LDC)
033: {
034:     cblas_sgemm(
035:         CblasColMajor,
036:         (CBLAS_TRANSPOSE)transA, (CBLAS_TRANSPOSE)transB,
037:         M, N, K,
038:         (alpha), A, LDA,
039:         B, LDB,
040:         (beta), C, LDC);
041: }
042: 
043: /* ///////////////////////////////////////////////////////////////////////////////////////////// */
044: void CORE_sgeqrt(int M, int N, int IB,
045:                  float *A, int LDA,
046:                  float *T, int LDT,
047:                  float *TAU, float *WORK)
048: {
049:     int INFO;
050: 
051:     core_sgeqrt(
052:         &M, &N, &IB,
053:         A, &LDA,
054:         T, &LDT,
055:         TAU, WORK, &INFO);
056: }
057: 
058: /* ///////////////////////////////////////////////////////////////////////////////////////////// */
059: void CORE_sgessm(int M, int N, int K, int IB,
060:                  int *IPIV,
061:                  float *L, int LDL,
062:                  float *A, int LDA)
063: {
064:     int INFO;
065: 
066:     core_sgessm(
067:         &M, &N, &K, &IB,
068:         IPIV,
069:         L, &LDL,
070:         A, &LDA,
071:         &INFO);
072: }
073: 
074: /* ///////////////////////////////////////////////////////////////////////////////////////////// */
075: void CORE_sgetrf(int M, int N, int IB,
076:                  float *A, int LDA,
077:                  int *IPIV, int *INFO)
078: {
079:     core_sgetrf(
080:         &M, &N, &IB,
081:         A, &LDA,
082:         IPIV, INFO);
083: }
084: 
085: /* ///////////////////////////////////////////////////////////////////////////////////////////// */
086: void CORE_spotrf(int uplo, int N, float *A, int LDA, int *INFO)
087: {
088:     spotrf(lapack_const(uplo), &N, A, &LDA, INFO);
089: }
090: 
091: /* ///////////////////////////////////////////////////////////////////////////////////////////// */
092: void CORE_sssmlq(int side, int trans,
093:                  int M1, int M2, int NN, int IB, int K,
094:                  float *A1, int LDA1,
095:                  float *A2, int LDA2,
096:                  float *V, int LDV,
097:                  float *T, int LDT,
098:                  float *WORK, int LDWORK)
099: {
100:     int INFO;
101: 
102:     core_sssmlq(
103:         lapack_const(side), lapack_const(trans),
104:         &M1, &M2, &NN, &IB, &K,
105:         A1, &LDA1,
106:         A2, &LDA2,
107:         V, &LDV,
108:         T, &LDT,
109:         WORK, &LDWORK, &INFO);
110: }
111: 
112: /* ///////////////////////////////////////////////////////////////////////////////////////////// */
113: void CORE_sssmqr(int side, int trans,
114:                  int M1, int M2, int NN, int IB, int K,
115:                  float *A1, int LDA1,
116:                  float *A2, int LDA2,
117:                  float *V, int LDV,
118:                  float *T, int LDT,
119:                  float *WORK, int LDWORK)
120: {
121:     int INFO;
122: 
123:     core_sssmqr(
124:         lapack_const(side), lapack_const(trans),
125:         &M1, &M2, &NN, &IB, &K,
126:         A1, &LDA1,
127:         A2, &LDA2,
128:         V, &LDV,
129:         T, &LDT,
130:         WORK, &LDWORK, &INFO);
131: }
132: 
133: /* ///////////////////////////////////////////////////////////////////////////////////////////// */
134: void CORE_sssssm(int M1, int M2, int NN, int IB, int K,
135:                  float *A1, int LDA1,
136:                  float *A2, int LDA2,
137:                  float *L1, int LDL1,
138:                  float *L2, int LDL2,
139:                  int *IPIV)
140: {
141:     int INFO;
142: 
143:     core_sssssm(
144:         &M1, &M2, &NN, &IB, &K,
145:         A1, &LDA1,
146:         A2, &LDA2,
147:         L1, &LDL1,
148:         L2, &LDL2,
149:         IPIV,
150:         &INFO);
151: }
152: /* ///////////////////////////////////////////////////////////////////////////////////////////// */
153: void CORE_ssyrk(int uplo, int trans,
154:                 int N, int K,
155:                 float alpha, float *A, int LDA,
156:                 float beta, float *C, int LDC)
157: {
158:     cblas_ssyrk(
159:         CblasColMajor,
160:         (CBLAS_UPLO)uplo, (CBLAS_TRANSPOSE)trans,
161:         N, K,
162:         (alpha), A, LDA,
163:         (beta), C, LDC);
164: }
165: /* ///////////////////////////////////////////////////////////////////////////////////////////// */
166: void CORE_strsm(int side, int uplo,
167:                 int transA, int diag,
168:                 int M, int N,
169:                 float alpha, float *A, int LDA,
170:                 float *B, int LDB)
171: {
172:     cblas_strsm(
173:         CblasColMajor,
174:         (CBLAS_SIDE)side, (CBLAS_UPLO)uplo,
175:         (CBLAS_TRANSPOSE)transA, (CBLAS_DIAG)diag,
176:         M, N,
177:         (alpha), A, LDA,
178:         B, LDB);
179: }
180: 
181: /* ///////////////////////////////////////////////////////////////////////////////////////////// */
182: void CORE_stslqt(int M, int N, int IB,
183:                  float *A1, int LDA1,
184:                  float *A2, int LDA2,
185:                  float *T, int LDT,
186:                  float *TAU, float *WORK)
187: {
188:     int INFO;
189: 
190:     core_stslqt(
191:         &M, &N, &IB,
192:         A1, &LDA1,
193:         A2, &LDA2,
194:         T, &LDT,
195:         TAU, WORK, &INFO);
196: }
197: 
198: /* ///////////////////////////////////////////////////////////////////////////////////////////// */
199: void CORE_stsqrt(int M, int N, int IB,
200:                  float *A1, int LDA1,
201:                  float *A2, int LDA2,
202:                  float *T, int LDT,
203:                  float *TAU, float *WORK)
204: {
205:     int INFO;
206: 
207:     core_stsqrt(
208:         &M, &N, &IB,
209:         A1, &LDA1,
210:         A2, &LDA2,
211:         T, &LDT,
212:         TAU, WORK, &INFO);
213: }
214: 
215: /* ///////////////////////////////////////////////////////////////////////////////////////////// */
216: void CORE_ststrf(int M, int N, int IB, int NB,
217:                  float *U, int LDU,
218:                  float *A, int LDA,
219:                  float *L, int LDL,
220:                  int *IPIV, float *WORK,
221:                  int LDWORK, int *INFO)
222: {
223:     core_ststrf(
224:         &M, &N, &IB, &NB,
225:         U, &LDU,
226:         A, &LDA,
227:         L, &LDL,
228:         IPIV,
229:         WORK, &LDWORK, INFO);
230: }
231: 
232: /* ///////////////////////////////////////////////////////////////////////////////////////////// */
233: void CORE_sormlq(int side, int trans,
234:                  int M, int N, int IB, int K,
235:                  float *V, int LDV,
236:                  float *T, int LDT,
237:                  float *C, int LDC,
238:                  float *WORK, int LDWORK)
239: {
240:     int INFO;
241: 
242:     core_sormlq(
243:         lapack_const(side), lapack_const(trans),
244:         &M, &N, &IB, &K,
245:         V, &LDV,
246:         T, &LDT,
247:         C, &LDC,
248:         WORK, &LDWORK, &INFO);
249: }
250: 
251: /* ///////////////////////////////////////////////////////////////////////////////////////////// */
252: void CORE_sormqr(int side, int trans,
253:                  int M, int N, int IB, int K,
254:                  float *V, int LDV,
255:                  float *T, int LDT,
256:                  float *C, int LDC,
257:                  float *WORK, int LDWORK)
258: {
259:     int INFO;
260: 
261:     core_sormqr(
262:         lapack_const(side), lapack_const(trans),
263:         &M, &N, &IB, &K,
264:         V, &LDV,
265:         T, &LDT,
266:         C, &LDC,
267:         WORK, &LDWORK, &INFO);
268: }
269: