]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - dense-linear-algebra-libraries/linalg.git/blob - blis/frame/3/her2k/4m/bli_her2k4m.c
Consolidate all git repos of linalg into one.
[dense-linear-algebra-libraries/linalg.git] / blis / frame / 3 / her2k / 4m / bli_her2k4m.c
1 /*
3    BLIS    
4    An object-based framework for developing high-performance BLAS-like
5    libraries.
7    Copyright (C) 2014, The University of Texas at Austin
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 of The University of Texas at Austin nor the names
18       of its contributors may be used to endorse or promote products
19       derived from this software without specific prior written permission.
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.
33 */
35 #include "blis.h"
37 //
38 // Define object-based interface.
39 //
40 void bli_her2k4m( obj_t*  alpha,
41                   obj_t*  a,
42                   obj_t*  b,
43                   obj_t*  beta,
44                   obj_t*  c )
45 {
46         // Since 4m only applies to the complex domain, we use the regular
47     // implementation for real domain cases.
48     if ( bli_obj_is_complex( *c ) )
49         bli_her2k4m_entry( alpha, a, b, beta, c );
50     else
51         bli_her2k_entry( alpha, a, b, beta, c );
52 }
54 //
55 // Define BLAS-like interfaces with homogeneous-typed operands.
56 //
57 #undef  GENTFUNCR
58 #define GENTFUNCR( ctype, ctype_r, ch, chr, opname, varname ) \
59 \
60 void PASTEMAC(ch,opname)( \
61                           uplo_t    uploc, \
62                           trans_t   transa, \
63                           trans_t   transb, \
64                           dim_t     m, \
65                           dim_t     k, \
66                           ctype*    alpha, \
67                           ctype*    a, inc_t rs_a, inc_t cs_a, \
68                           ctype*    b, inc_t rs_b, inc_t cs_b, \
69                           ctype_r*  beta, \
70                           ctype*    c, inc_t rs_c, inc_t cs_c  \
71                         ) \
72 { \
73         const num_t dt_r = PASTEMAC(chr,type); \
74         const num_t dt   = PASTEMAC(ch,type); \
75 \
76         obj_t       alphao, ao, bo, betao, co; \
77 \
78         dim_t       m_a, n_a; \
79         dim_t       m_b, n_b; \
80 \
81         bli_set_dims_with_trans( transa, m, k, m_a, n_a ); \
82         bli_set_dims_with_trans( transb, m, k, m_b, n_b ); \
83 \
84         bli_obj_create_1x1_with_attached_buffer( dt,   alpha, &alphao ); \
85         bli_obj_create_1x1_with_attached_buffer( dt_r, beta,  &betao  ); \
86 \
87         bli_obj_create_with_attached_buffer( dt, m_a, n_a, a, rs_a, cs_a, &ao ); \
88         bli_obj_create_with_attached_buffer( dt, m_b, n_b, b, rs_b, cs_b, &bo ); \
89         bli_obj_create_with_attached_buffer( dt, m,   m,   c, rs_c, cs_c, &co ); \
90 \
91         bli_obj_set_uplo( uploc, co ); \
92         bli_obj_set_conjtrans( transa, ao ); \
93         bli_obj_set_conjtrans( transb, bo ); \
94 \
95         bli_obj_set_struc( BLIS_HERMITIAN, co ); \
96 \
97         PASTEMAC0(opname)( &alphao, \
98                            &ao, \
99                            &bo, \
100                            &betao, \
101                            &co ); \
104 INSERT_GENTFUNCR_BASIC( her2k4m, her2k4m )