1 /*
2 
3    BLIS
4    An object-based framework for developing high-performance BLAS-like
5    libraries.
6 
7    Copyright (C) 2014, The University of Texas at Austin
8 
9    Redistribution and use in source and binary forms, with or without
10    modification, are permitted provided that the following conditions are
11    met:
12     - Redistributions of source code must retain the above copyright
13       notice, this list of conditions and the following disclaimer.
14     - Redistributions in binary form must reproduce the above copyright
15       notice, this list of conditions and the following disclaimer in the
16       documentation and/or other materials provided with the distribution.
17     - Neither the name(s) of the copyright holder(s) nor the names of its
18       contributors may be used to endorse or promote products derived
19       from this software without specific prior written permission.
20 
21    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25    HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 
33 */
34 
35 #include "blis.h"
36 
37 
38 #undef  GENTFUNC
39 #define GENTFUNC( ctype, ch, varname ) \
40 \
41 void PASTEMAC(ch,varname) \
42      ( \
43        conj_t          conjat, \
44        conj_t          conja, \
45        conj_t          conjw, \
46        conj_t          conjx, \
47        dim_t           m, \
48        dim_t           b_n, \
49        ctype* restrict alpha, \
50        ctype* restrict a, inc_t inca, inc_t lda, \
51        ctype* restrict w, inc_t incw, \
52        ctype* restrict x, inc_t incx, \
53        ctype* restrict beta, \
54        ctype* restrict y, inc_t incy, \
55        ctype* restrict z, inc_t incz, \
56        cntx_t*         cntx  \
57      ) \
58 { \
59 	ctype* a1; \
60 	ctype* chi1; \
61 	ctype* w1; \
62 	ctype* psi1; \
63 	ctype* z1; \
64 	ctype  conjx_chi1; \
65 	ctype  alpha_chi1; \
66 	dim_t  i; \
67 \
68 	/* Query the context for the kernel function pointer. */ \
69 	const num_t          dt     = PASTEMAC(ch,type); \
70 	PASTECH(ch,dotxv_ft) kfp_dv = bli_cntx_get_l1v_ker_dt( dt, BLIS_DOTXV_KER, cntx ); \
71 	PASTECH(ch,axpyv_ft) kfp_av = bli_cntx_get_l1v_ker_dt( dt, BLIS_AXPYV_KER, cntx ); \
72 \
73 	/* A is m x n.                   */ \
74 	/* y = beta * y + alpha * A^T w; */ \
75 	/* z =        z + alpha * A   x; */ \
76 	for ( i = 0; i < b_n; ++i ) \
77 	{ \
78 		a1   = a + (0  )*inca + (i  )*lda; \
79 		w1   = w + (0  )*incw; \
80 		psi1 = y + (i  )*incy; \
81 \
82 		kfp_dv \
83 		( \
84 		  conjat, \
85 		  conjw, \
86 		  m, \
87 		  alpha, \
88 		  a1, inca, \
89 		  w1, incw, \
90 		  beta, \
91 		  psi1, \
92 		  cntx  \
93 		); \
94 	} \
95 \
96 	for ( i = 0; i < b_n; ++i ) \
97 	{ \
98 		a1   = a + (0  )*inca + (i  )*lda; \
99 		chi1 = x + (i  )*incx; \
100 		z1   = z + (0  )*incz; \
101 \
102 		PASTEMAC(ch,copycjs)( conjx, *chi1, conjx_chi1 ); \
103 		PASTEMAC(ch,scal2s)( *alpha, conjx_chi1, alpha_chi1 ); \
104 \
105 		kfp_av \
106 		( \
107 		  conja, \
108 		  m, \
109 		  &alpha_chi1, \
110 		  a1, inca, \
111 		  z1, incz, \
112 		  cntx  \
113 		); \
114 	} \
115 }
116 
117 INSERT_GENTFUNC_BASIC0( dotxaxpyf_ref_var1 )
118 
119