2
* Automatically Tuned Linear Algebra Software v3.10.1
3
* Copyright (C) 2010 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 ATLAS group or the names of its contributers may
14
* not be used to endorse or promote products derived from this
15
* software without specific written permission.
17
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ATLAS GROUP OR ITS CONTRIBUTORS
21
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27
* POSSIBILITY OF SUCH DAMAGE.
32
#include "atlas_misc.h"
34
#ifdef ATL_USEPTHREADS
35
#include "atlas_ptalias2.h"
37
#include "atlas_level2.h"
39
void cblas_dger2(const enum CBLAS_ORDER Order, ATL_CINT M, ATL_CINT N,
40
const double alpha, const double *X, ATL_CINT incX,
41
const double *Y, ATL_CINT incY, const double beta,
42
const double *W, ATL_CINT incW,
43
const double *Z, ATL_CINT incZ, double *A, ATL_CINT lda)
51
#ifndef NoCblasErrorChecks
52
if (M < 0) info = cblas_errprn(2, info,
53
"M cannot be less than zero; is set to %d.", M);
54
if (N < 0) info = cblas_errprn(3, info,
55
"N cannot be less than zero; is set to %d.", N);
56
if (!incX) info = cblas_errprn(6, info,
57
"incX cannot be zero; is set to %d.", incX);
58
if (!incY) info = cblas_errprn(8, info,
59
"incY cannot be zero; is set to %d.", incY);
60
if (!incW) info = cblas_errprn(11, info,
61
"incW cannot be zero; is set to %d.", incW);
62
if (!incZ) info = cblas_errprn(13, info,
63
"incZ cannot be zero; is set to %d.", incZ);
64
if (Order == CblasColMajor)
66
if (lda < M || lda < 1)
67
info = cblas_errprn(15, info, "lda must be >= MAX(M,1): lda=%d M=%d",
70
else if (Order == CblasRowMajor)
72
if (lda < N || lda < 1)
73
info = cblas_errprn(15, info, "lda must be >= MAX(N,1): lda=%d M=%d",
77
info = cblas_errprn(1, info, "Order must be %d or %d, but is set to %d",
78
CblasRowMajor, CblasColMajor, Order);
81
cblas_xerbla(info, "cblas_dger2", "");
86
if (incX < 0) x += (1-M)*incX;
87
if (incY < 0) y += (1-N)*incY;
88
if (incW < 0) w += (1-M)*incW;
89
if (incZ < 0) z += (1-N)*incZ;
91
if (Order == CblasColMajor)
92
ATL_dger2(M, N, alpha, x, incX, y, incY, beta, w, incW, z, incZ, A, lda);
94
ATL_dger2(N, M, alpha, y, incY, x, incX, beta, w, incW, z, incZ, A, lda);