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.
33
#include "atlas_misc.h"
35
#ifdef ATL_USEPTHREADS
36
#include "atlas_ptalias2.h"
38
#include "atlas_level2.h"
40
void cblas_cgeru(const enum CBLAS_ORDER Order, const int M, const int N,
41
const void *alpha, const void *X, const int incX,
42
const void *Y, const int incY, void *A, const int lda)
45
const float *x = X, *y = Y;
47
#ifndef NoCblasErrorChecks
48
if (M < 0) info = cblas_errprn(2, info,
49
"M cannot be less than zero; is set to %d.", M);
50
if (N < 0) info = cblas_errprn(3, info,
51
"N cannot be less than zero; is set to %d.", N);
52
if (!incX) info = cblas_errprn(6, info,
53
"incX cannot be zero; is set to %d.", incX);
54
if (!incY) info = cblas_errprn(8, info,
55
"incY cannot be zero; is set to %d.", incY);
56
if (Order == CblasColMajor)
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 (Order == CblasRowMajor)
64
if (lda < N || lda < 1)
65
info = cblas_errprn(10, info, "lda must be >= MAX(N,1): lda=%d M=%d",
69
info = cblas_errprn(1, info, "Order must be %d or %d, but is set to %d",
70
CblasRowMajor, CblasColMajor, Order);
73
cblas_xerbla(info, "cblas_cgeru", "");
78
if (incX < 0) x += (1-M)*incX<<1;
79
if (incY < 0) y += (1-N)*incY<<1;
81
if (Order == CblasColMajor)
82
ATL_cgeru(M, N, alpha, x, incX, y, incY, A, lda);
84
ATL_cgeru(N, M, alpha, y, incY, x, incX, A, lda);