1 /*
2 
3     Copyright (C) 2014, The University of Texas at Austin
4 
5     This file is part of libflame and is available under the 3-Clause
6     BSD license, which can be found in the LICENSE file at the top-level
7     directory, or at http://opensource.org/licenses/BSD-3-Clause
8 
9 */
10 
11 #include "blis1.h"
12 
bl1_saxpyv(conj1_t conj,int n,float * alpha,float * x,int incx,float * y,int incy)13 void bl1_saxpyv( conj1_t conj, int n, float* alpha, float* x, int incx, float* y, int incy )
14 {
15 	bl1_saxpy( n,
16 	           alpha,
17 	           x, incx,
18 	           y, incy );
19 }
20 
bl1_daxpyv(conj1_t conj,int n,double * alpha,double * x,int incx,double * y,int incy)21 void bl1_daxpyv( conj1_t conj, int n, double* alpha, double* x, int incx, double* y, int incy )
22 {
23 	bl1_daxpy( n,
24 	           alpha,
25 	           x, incx,
26 	           y, incy );
27 }
28 
bl1_caxpyv(conj1_t conj,int n,scomplex * alpha,scomplex * x,int incx,scomplex * y,int incy)29 void bl1_caxpyv( conj1_t conj, int n, scomplex* alpha, scomplex* x, int incx, scomplex* y, int incy )
30 {
31 	scomplex* x_copy;
32 	int       incx_copy;
33 
34 	// Return early if possible.
35 	if ( bl1_zero_dim1( n ) ) return;
36 
37 	x_copy    = x;
38 	incx_copy = incx;
39 
40 	if ( bl1_is_conj( conj ) )
41 	{
42 		x_copy    = bl1_callocv( n );
43 		incx_copy = 1;
44 
45 		bl1_ccopyv( conj,
46 		            n,
47 		            x,      incx,
48 		            x_copy, incx_copy );
49 	}
50 
51 	bl1_caxpy( n,
52 	           alpha,
53 	           x_copy, incx_copy,
54 	           y,      incy );
55 
56 	if ( bl1_is_conj( conj ) )
57 		bl1_cfree( x_copy );
58 }
59 
bl1_zaxpyv(conj1_t conj,int n,dcomplex * alpha,dcomplex * x,int incx,dcomplex * y,int incy)60 void bl1_zaxpyv( conj1_t conj, int n, dcomplex* alpha, dcomplex* x, int incx, dcomplex* y, int incy )
61 {
62 	dcomplex* x_copy;
63 	int       incx_copy;
64 
65 	// Return early if possible.
66 	if ( bl1_zero_dim1( n ) ) return;
67 
68 	x_copy    = x;
69 	incx_copy = incx;
70 
71 	if ( bl1_is_conj( conj ) )
72 	{
73 		x_copy    = bl1_zallocv( n );
74 		incx_copy = 1;
75 
76 		bl1_zcopyv( conj,
77 		            n,
78 		            x,      incx,
79 		            x_copy, incx_copy );
80 	}
81 
82 	bl1_zaxpy( n,
83 	           alpha,
84 	           x_copy, incx_copy,
85 	           y,      incy );
86 
87 	if ( bl1_is_conj( conj ) )
88 		bl1_zfree( x_copy );
89 }
90 
91