2
* Automatically Tuned Linear Algebra Software v3.2
3
* (C) Copyright 1999 R. Clint Whaley
5
* Redistribution and use in source and binary forms, with or without
6
* modification, are permitted provided that the following conditions
8
* 1. Redistributions of source code must retain the above copyright
9
* notice, this list of conditions and the following disclaimer.
10
* 2. Redistributions in binary form must reproduce the above copyright
11
* notice, this list of conditions, and the following disclaimer in the
12
* documentation and/or other materials provided with the distribution.
13
* 3. The name of the University of Tennessee, the ATLAS group,
14
* or the names of its contributers may not be used to endorse
15
* or promote products derived from this software without specific
18
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE
22
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28
* POSSIBILITY OF SUCH DAMAGE.
31
#include "atlas_misc.h"
32
#ifdef ATL_USEPTHREADS
33
#include "atlas_ptalias3.h"
37
void ATL_strsm(const enum CBLAS_SIDE Side,
38
const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TA,
39
const enum CBLAS_DIAG Diag, const int M, const int N,
40
const float alpha, const float *A, const int lda,
41
float *B, const int ldb);
43
void cblas_strsm(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side,
44
const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TA,
45
const enum CBLAS_DIAG Diag, const int M, const int N,
46
const float alpha, const float *A, const int lda,
47
float *B, const int ldb)
53
#ifndef NoCblasErrorChecks
54
if (Order == CblasColMajor)
56
if (Side == CblasLeft)
58
if ( (lda < M) || (lda < 1) )
59
info = cblas_errprn(10, info,"lda must be >= MAX(M,1): lda=%d M=%d",
62
else if (Side == CblasRight)
64
if ( (lda < N) || (lda < 1) )
65
info = cblas_errprn(10, info,"lda must be >= MAX(N,1): lda=%d N=%d",
68
else info = cblas_errprn(2, info,
69
"SIDE must be %d or %d, but is set to %d",
70
CblasRight, CblasLeft, Side);
71
if ( (ldb < M) || (ldb < 1) )
72
info = cblas_errprn(12, info, "ldb must be >= MAX(M,1): ldb=%d M=%d",
75
else if (Order == CblasRowMajor)
77
if (Side == CblasLeft)
79
if ( (lda < M) || (lda < 1) )
80
info = cblas_errprn(10, info,"lda must be >= MAX(M,1): lda=%d M=%d",
83
else if (Side == CblasRight)
85
if ( (lda < N) || (lda < 1) )
86
info = cblas_errprn(10, info,"lda must be >= MAX(N,1): lda=%d N=%d",
89
else info = cblas_errprn(2, info,
90
"SIDE must be %d or %d, but is set to %d",
91
CblasRight, CblasLeft, Side);
92
if ( (ldb < N) || (ldb < 1) )
93
info = cblas_errprn(12, info, "ldb must be >= MAX(N,1): ldb=%d N=%d",
97
info = cblas_errprn(1, info, "Order must be %d or %d, but is set to %d",
98
CblasRowMajor, CblasColMajor, Order);
100
if (Uplo != CblasUpper && Uplo != CblasLower)
101
info = cblas_errprn(3, info, "UPLO must be %d or %d, but is set to %d",
102
CblasUpper, CblasLower, Uplo);
104
if (TA != AtlasNoTrans && TA != AtlasTrans && TA != AtlasConjTrans)
105
info = cblas_errprn(4, info,
106
"TransA must be %d, %d or %d, but is set to %d",
107
CblasNoTrans, CblasTrans, CblasConjTrans, TA);
109
if (Diag != CblasUnit && Diag != CblasNonUnit)
110
info = cblas_errprn(5, info, "UPLO must be %d or %d, but is set to %d",
111
CblasUnit, CblasNonUnit, Diag);
113
if (M < 0) info = cblas_errprn(6, info,
114
"M cannot be less than zero; it is set to %d.", M);
115
if (N < 0) info = cblas_errprn(7, info,
116
"N cannot be less than zero; it is set to %d.", N);
121
cblas_xerbla(info, "cblas_strsm", "");
126
if (Order == CblasColMajor)
127
ATL_strsm(Side, Uplo, TA, Diag, M, N, alpha, A, lda, B, ldb);
130
if (Side == CblasLeft) side = CblasRight;
131
else side = CblasLeft;
132
if (Uplo == CblasUpper) uplo = CblasLower;
133
else uplo = CblasUpper;
134
ATL_strsm(side, uplo, TA, Diag, N, M, alpha, A, lda, B, ldb);