1 /*********************************************************************/
2 /* Copyright 2009, 2010 The University of Texas at Austin. */
3 /* All rights reserved. */
5 /* Redistribution and use in source and binary forms, with or */
6 /* without modification, are permitted provided that the following */
7 /* conditions are met: */
9 /* 1. Redistributions of source code must retain the above */
10 /* copyright notice, this list of conditions and the following */
13 /* 2. Redistributions in binary form must reproduce the above */
14 /* copyright notice, this list of conditions and the following */
15 /* disclaimer in the documentation and/or other materials */
16 /* provided with the distribution. */
18 /* THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY OF TEXAS AT */
19 /* AUSTIN ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, */
20 /* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
21 /* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
22 /* DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF TEXAS AT */
23 /* AUSTIN OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
24 /* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */
25 /* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE */
26 /* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR */
27 /* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */
28 /* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
29 /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT */
30 /* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
31 /* POSSIBILITY OF SUCH DAMAGE. */
33 /* The views and conclusions contained in the software and */
34 /* documentation are those of the authors and should not be */
35 /* interpreted as representing official policies, either expressed */
36 /* or implied, of The University of Texas at Austin. */
37 /*********************************************************************/
41 #ifdef FUNCTION_PROFILE
42 #include "functable.h"
45 #ifdef RETURN_BY_STRUCT
47 #define MYTYPE myxcomplex_t
49 #define MYTYPE myzcomplex_t
51 #define MYTYPE myccomplex_t
57 #ifdef RETURN_BY_STRUCT
58 MYTYPE NAME( blasint *N, FLOAT *x, blasint *INCX, FLOAT *y, blasint *INCY) {
59 #elif defined RETURN_BY_STACK
60 void NAME(OPENBLAS_COMPLEX_FLOAT *result, blasint *N, FLOAT *x, blasint *INCX, FLOAT *y, blasint *INCY) {
62 OPENBLAS_COMPLEX_FLOAT NAME( blasint *N, FLOAT *x, blasint *INCX, FLOAT *y, blasint *INCY) {
66 BLASLONG incx = *INCX;
67 BLASLONG incy = *INCY;
68 #ifndef RETURN_BY_STACK
69 OPENBLAS_COMPLEX_FLOAT ret;
71 #ifdef RETURN_BY_STRUCT
75 #ifndef RETURN_BY_STRUCT
76 OPENBLAS_COMPLEX_FLOAT zero=OPENBLAS_MAKE_COMPLEX_FLOAT(0.0, 0.0);
82 #ifdef RETURN_BY_STRUCT
86 #elif defined RETURN_BY_STACK
96 FUNCTION_PROFILE_START();
98 if (incx < 0) x -= (n - 1) * incx * 2;
99 if (incy < 0) y -= (n - 1) * incy * 2;
101 #ifdef RETURN_BY_STRUCT
104 ret = DOTU_K(n, x, incx, y, incy);
106 ret = DOTC_K(n, x, incx, y, incy);
112 FUNCTION_PROFILE_END(4, 2 * n, 2 * n);
118 #elif defined RETURN_BY_STACK
121 *result = DOTU_K(n, x, incx, y, incy);
123 *result = DOTC_K(n, x, incx, y, incy);
126 FUNCTION_PROFILE_END(4, 2 * n, 2 * n);
133 ret = DOTU_K(n, x, incx, y, incy);
135 ret = DOTC_K(n, x, incx, y, incy);
138 FUNCTION_PROFILE_END(4, 2 * n, 2 * n);
150 #ifdef FORCE_USE_STACK
151 void CNAME(blasint n, void *vx, blasint incx, void *vy, blasint incy, void* vresult){
152 OPENBLAS_COMPLEX_FLOAT *result= (OPENBLAS_COMPLEX_FLOAT*)vresult;
154 OPENBLAS_COMPLEX_FLOAT CNAME(blasint n, void *vx, blasint incx, void *vy, blasint incy){
156 OPENBLAS_COMPLEX_FLOAT ret;
157 OPENBLAS_COMPLEX_FLOAT zero=OPENBLAS_MAKE_COMPLEX_FLOAT(0.0, 0.0);
159 FLOAT *x = (FLOAT*) vx;
160 FLOAT *y = (FLOAT*) vy;
165 #ifdef FORCE_USE_STACK
166 OPENBLAS_COMPLEX_FLOAT zero=OPENBLAS_MAKE_COMPLEX_FLOAT(0.0, 0.0);
168 // CREAL(*result) = 0.0;
169 // CIMAG(*result) = 0.0;
176 if (incx < 0) x -= (n - 1) * incx * 2;
177 if (incy < 0) y -= (n - 1) * incy * 2;
181 FUNCTION_PROFILE_START();
183 #ifdef FORCE_USE_STACK
186 *result = DOTU_K(n, x, incx, y, incy);
188 *result = DOTC_K(n, x, incx, y, incy);
191 FUNCTION_PROFILE_END(4, 2 * n, 2 * n);
198 ret = DOTU_K(n, x, incx, y, incy);
200 ret = DOTC_K(n, x, incx, y, incy);
203 FUNCTION_PROFILE_END(4, 2 * n, 2 * n);