Optimize cdot function for POWER10
[platform/upstream/openblas.git] / common_level1.h
1 /*********************************************************************/
2 /* Copyright 2009, 2010 The University of Texas at Austin.           */
3 /* All rights reserved.                                              */
4 /*                                                                   */
5 /* Redistribution and use in source and binary forms, with or        */
6 /* without modification, are permitted provided that the following   */
7 /* conditions are met:                                               */
8 /*                                                                   */
9 /*   1. Redistributions of source code must retain the above         */
10 /*      copyright notice, this list of conditions and the following  */
11 /*      disclaimer.                                                  */
12 /*                                                                   */
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.                              */
17 /*                                                                   */
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.                                    */
32 /*                                                                   */
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 /*********************************************************************/
38
39 #ifndef ASSEMBLER
40
41 #ifdef __CUDACC__
42 extern "C" {
43 #endif
44
45 float   sdot_k(BLASLONG, float   *, BLASLONG, float   *, BLASLONG);
46 double dsdot_k(BLASLONG, float   *, BLASLONG, float *, BLASLONG);
47 double  ddot_k(BLASLONG, double  *, BLASLONG, double  *, BLASLONG);
48 xdouble qdot_k(BLASLONG, xdouble *, BLASLONG, xdouble *, BLASLONG);
49 float  sbdot_k(BLASLONG, bfloat16 *, BLASLONG, bfloat16 *, BLASLONG);
50
51 void   sbstobf16_k(BLASLONG, float    *, BLASLONG, bfloat16 *, BLASLONG);
52 void   sbdtobf16_k(BLASLONG, double   *, BLASLONG, bfloat16 *, BLASLONG);
53 void   sbf16tos_k (BLASLONG, bfloat16 *, BLASLONG, float    *, BLASLONG);
54 void   dbf16tod_k (BLASLONG, bfloat16 *, BLASLONG, double   *, BLASLONG);
55
56 openblas_complex_float cdotc_k (BLASLONG, float  *, BLASLONG, float  *, BLASLONG);
57 openblas_complex_float cdotu_k (BLASLONG, float  *, BLASLONG, float  *, BLASLONG);
58 openblas_complex_double zdotc_k (BLASLONG, double *, BLASLONG, double *, BLASLONG);
59 openblas_complex_double zdotu_k (BLASLONG, double *, BLASLONG, double *, BLASLONG);
60 openblas_complex_xdouble xdotc_k (BLASLONG, xdouble *, BLASLONG, xdouble *, BLASLONG);
61 openblas_complex_xdouble xdotu_k (BLASLONG, xdouble *, BLASLONG, xdouble *, BLASLONG);
62
63 int    saxpy_k (BLASLONG, BLASLONG, BLASLONG, float,
64                float  *, BLASLONG, float  *, BLASLONG, float  *, BLASLONG);
65 int    daxpy_k (BLASLONG, BLASLONG, BLASLONG, double,
66                double *, BLASLONG, double *, BLASLONG, double *, BLASLONG);
67 int    qaxpy_k (BLASLONG, BLASLONG, BLASLONG, xdouble,
68                xdouble *, BLASLONG, xdouble *, BLASLONG, xdouble *, BLASLONG);
69 int    caxpy_k (BLASLONG, BLASLONG, BLASLONG, float,  float,
70                float  *, BLASLONG, float  *, BLASLONG, float  *, BLASLONG);
71 int    zaxpy_k (BLASLONG, BLASLONG, BLASLONG, double, double,
72                double *, BLASLONG, double *, BLASLONG, double *, BLASLONG);
73 int    xaxpy_k (BLASLONG, BLASLONG, BLASLONG, xdouble, xdouble,
74                xdouble *, BLASLONG, xdouble *, BLASLONG, xdouble *, BLASLONG);
75 int    caxpyc_k (BLASLONG, BLASLONG, BLASLONG, float,  float,
76                float  *, BLASLONG, float  *, BLASLONG, float  *, BLASLONG);
77 int    zaxpyc_k (BLASLONG, BLASLONG, BLASLONG, double, double,
78                double *, BLASLONG, double *, BLASLONG, double *, BLASLONG);
79 int    xaxpyc_k (BLASLONG, BLASLONG, BLASLONG, xdouble, xdouble,
80                xdouble *, BLASLONG, xdouble *, BLASLONG, xdouble *, BLASLONG);
81
82 int    scopy_k(BLASLONG, float  *, BLASLONG, float  *, BLASLONG);
83 int    dcopy_k(BLASLONG, double *, BLASLONG, double *, BLASLONG);
84 int    qcopy_k(BLASLONG, xdouble *, BLASLONG, xdouble *, BLASLONG);
85 int    ccopy_k(BLASLONG, float  *, BLASLONG, float  *, BLASLONG);
86 int    zcopy_k(BLASLONG, double *, BLASLONG, double *, BLASLONG);
87 int    xcopy_k(BLASLONG, xdouble *, BLASLONG, xdouble *, BLASLONG);
88
89 int    sswap_k (BLASLONG, BLASLONG, BLASLONG, float,
90                float  *, BLASLONG, float  *, BLASLONG, float *, BLASLONG);
91 int    dswap_k (BLASLONG, BLASLONG, BLASLONG, double,
92                double *, BLASLONG, double *, BLASLONG, double*, BLASLONG);
93 int    qswap_k (BLASLONG, BLASLONG, BLASLONG, xdouble,
94                xdouble *, BLASLONG, xdouble *, BLASLONG, xdouble*, BLASLONG);
95 int    cswap_k (BLASLONG, BLASLONG, BLASLONG, float,  float,
96                float  *, BLASLONG, float  *, BLASLONG, float *, BLASLONG);
97 int    zswap_k (BLASLONG, BLASLONG, BLASLONG, double, double,
98                double *, BLASLONG, double *, BLASLONG, double*, BLASLONG);
99 int    xswap_k (BLASLONG, BLASLONG, BLASLONG, xdouble, xdouble,
100                xdouble *, BLASLONG, xdouble *, BLASLONG, xdouble*, BLASLONG);
101
102 float   sasum_k (BLASLONG, float  *, BLASLONG);
103 double  dasum_k (BLASLONG, double *, BLASLONG);
104 xdouble qasum_k (BLASLONG, xdouble *, BLASLONG);
105 float   casum_k (BLASLONG, float  *, BLASLONG);
106 double  zasum_k (BLASLONG, double *, BLASLONG);
107 xdouble xasum_k (BLASLONG, xdouble *, BLASLONG);
108
109 float   ssum_k (BLASLONG, float  *, BLASLONG);
110 double  dsum_k (BLASLONG, double *, BLASLONG);
111 xdouble qsum_k (BLASLONG, xdouble *, BLASLONG);
112 float   csum_k (BLASLONG, float  *, BLASLONG);
113 double  zsum_k (BLASLONG, double *, BLASLONG);
114 xdouble xsum_k (BLASLONG, xdouble *, BLASLONG);
115
116 float   samax_k (BLASLONG, float  *, BLASLONG);
117 double  damax_k (BLASLONG, double *, BLASLONG);
118 xdouble qamax_k (BLASLONG, xdouble *, BLASLONG);
119 float   camax_k (BLASLONG, float  *, BLASLONG);
120 double  zamax_k (BLASLONG, double *, BLASLONG);
121 xdouble xamax_k (BLASLONG, xdouble *, BLASLONG);
122
123 float   samin_k (BLASLONG, float  *, BLASLONG);
124 double  damin_k (BLASLONG, double *, BLASLONG);
125 xdouble qamin_k (BLASLONG, xdouble *, BLASLONG);
126 float   camin_k (BLASLONG, float  *, BLASLONG);
127 double  zamin_k (BLASLONG, double *, BLASLONG);
128 xdouble xamin_k (BLASLONG, xdouble *, BLASLONG);
129
130 BLASLONG   isamax_k(BLASLONG, float  *, BLASLONG);
131 BLASLONG   idamax_k(BLASLONG, double *, BLASLONG);
132 BLASLONG   iqamax_k(BLASLONG, xdouble *, BLASLONG);
133 BLASLONG   icamax_k(BLASLONG, float  *, BLASLONG);
134 BLASLONG   izamax_k(BLASLONG, double *, BLASLONG);
135 BLASLONG   ixamax_k(BLASLONG, xdouble *, BLASLONG);
136
137 BLASLONG   isamin_k(BLASLONG, float  *, BLASLONG);
138 BLASLONG   idamin_k(BLASLONG, double *, BLASLONG);
139 BLASLONG   iqamin_k(BLASLONG, xdouble *, BLASLONG);
140 BLASLONG   icamin_k(BLASLONG, float  *, BLASLONG);
141 BLASLONG   izamin_k(BLASLONG, double *, BLASLONG);
142 BLASLONG   ixamin_k(BLASLONG, xdouble *, BLASLONG);
143
144 float   smax_k (BLASLONG, float  *, BLASLONG);
145 double  dmax_k (BLASLONG, double *, BLASLONG);
146 xdouble qmax_k (BLASLONG, xdouble *, BLASLONG);
147 float   cmax_k (BLASLONG, float  *, BLASLONG);
148 double  zmax_k (BLASLONG, double *, BLASLONG);
149 xdouble xmax_k (BLASLONG, xdouble *, BLASLONG);
150
151 float   smin_k (BLASLONG, float  *, BLASLONG);
152 double  dmin_k (BLASLONG, double *, BLASLONG);
153 xdouble qmin_k (BLASLONG, xdouble *, BLASLONG);
154 float   cmin_k (BLASLONG, float  *, BLASLONG);
155 double  zmin_k (BLASLONG, double *, BLASLONG);
156 xdouble xmin_k (BLASLONG, xdouble *, BLASLONG);
157
158 BLASLONG   ismax_k(BLASLONG, float  *, BLASLONG);
159 BLASLONG   idmax_k(BLASLONG, double *, BLASLONG);
160 BLASLONG   iqmax_k(BLASLONG, xdouble *, BLASLONG);
161 BLASLONG   icmax_k(BLASLONG, float  *, BLASLONG);
162 BLASLONG   izmax_k(BLASLONG, double *, BLASLONG);
163 BLASLONG   ixmax_k(BLASLONG, xdouble *, BLASLONG);
164
165 BLASLONG   ismin_k(BLASLONG, float  *, BLASLONG);
166 BLASLONG   idmin_k(BLASLONG, double *, BLASLONG);
167 BLASLONG   iqmin_k(BLASLONG, xdouble *, BLASLONG);
168 BLASLONG   icmin_k(BLASLONG, float  *, BLASLONG);
169 BLASLONG   izmin_k(BLASLONG, double *, BLASLONG);
170 BLASLONG   ixmin_k(BLASLONG, xdouble *, BLASLONG);
171
172 int    sscal_k(BLASLONG, BLASLONG, BLASLONG, float,
173               float *, BLASLONG, float *, BLASLONG,  float  *, BLASLONG);
174 int    dscal_k(BLASLONG, BLASLONG, BLASLONG, double,
175               double *, BLASLONG, double *, BLASLONG,  double  *, BLASLONG);
176 int    qscal_k(BLASLONG, BLASLONG, BLASLONG, xdouble,
177               xdouble *, BLASLONG, xdouble *, BLASLONG,  xdouble  *, BLASLONG);
178 int    cscal_k(BLASLONG, BLASLONG, BLASLONG, float, float,
179               float *, BLASLONG, float *, BLASLONG,  float  *, BLASLONG);
180 int    zscal_k(BLASLONG, BLASLONG, BLASLONG, double, double,
181               double *, BLASLONG, double *, BLASLONG,  double  *, BLASLONG);
182 int    xscal_k(BLASLONG, BLASLONG, BLASLONG, xdouble, xdouble,
183               xdouble *, BLASLONG, xdouble *, BLASLONG,  xdouble  *, BLASLONG);
184 int    csscal_k(BLASLONG, BLASLONG, BLASLONG, float, float,
185                float *, BLASLONG, float *, BLASLONG,  float  *, BLASLONG);
186 int    zdscal_k(BLASLONG, BLASLONG, BLASLONG, double, double,
187                double *, BLASLONG, double *, BLASLONG,  double  *, BLASLONG);
188 int    xqscal_k(BLASLONG, BLASLONG, BLASLONG, xdouble, xdouble,
189                xdouble *, BLASLONG, xdouble *, BLASLONG,  xdouble  *, BLASLONG);
190
191 float   snrm2_k(BLASLONG, float   *, BLASLONG);
192 double  dnrm2_k(BLASLONG, double  *, BLASLONG);
193 xdouble qnrm2_k(BLASLONG, xdouble *, BLASLONG);
194 float   cnrm2_k(BLASLONG, float   *, BLASLONG);
195 double  znrm2_k(BLASLONG, double  *, BLASLONG);
196 xdouble xnrm2_k(BLASLONG, xdouble *, BLASLONG);
197
198 int    srot_k (BLASLONG, float  *, BLASLONG, float  *, BLASLONG, float , float );
199 int    drot_k (BLASLONG, double *, BLASLONG, double *, BLASLONG, double, double);
200 int    qrot_k (BLASLONG, xdouble *, BLASLONG, xdouble *, BLASLONG, xdouble, xdouble);
201 int    csrot_k(BLASLONG, float  *, BLASLONG, float  *, BLASLONG, float , float );
202 int    zdrot_k(BLASLONG, double *, BLASLONG, double *, BLASLONG, double, double);
203 int    xqrot_k(BLASLONG, xdouble *, BLASLONG, xdouble *, BLASLONG, xdouble, xdouble);
204
205 int    srotg_k(float  *, float  *, float  *, float  *);
206 int    drotg_k(double *, double *, double *, double *);
207 int    qrotg_k(xdouble *, xdouble *, xdouble *, xdouble *);
208 int    csrotg_k(float  *, float  *, float  *, float  *);
209 int    zdrotg_k(double *, double *, double *, double *);
210 int    xqrotg_k(xdouble *, xdouble *, xdouble *, xdouble *);
211
212 int    srotmg_k(float  *, float  *, float  *, float  *, float  *);
213 int    drotmg_k(double *, double *, double *, double *, double *);
214 int    qrotmg_k(xdouble *, xdouble *, xdouble *, xdouble *, xdouble *);
215
216 int    srotm_k (BLASLONG, float,  BLASLONG, float,  BLASLONG, float);
217 int    drotm_k (BLASLONG, double, BLASLONG, double, BLASLONG, double);
218 int    qrotm_k (BLASLONG, xdouble, BLASLONG, xdouble, BLASLONG, xdouble);
219
220
221 int    saxpby_k (BLASLONG, float,  float  *, BLASLONG, float,  float  *, BLASLONG);
222 int    daxpby_k (BLASLONG, double, double *, BLASLONG, double, double *, BLASLONG);
223 int    caxpby_k (BLASLONG, float,  float,  float  *, BLASLONG, float,  float,  float  *, BLASLONG);
224 int    zaxpby_k (BLASLONG, double, double, double *, BLASLONG, double, double, double *, BLASLONG);
225
226
227 #ifdef __CUDACC__
228 }
229 #endif
230
231 #endif
232