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 #ifndef BLIS_AUXINFO_MACRO_DEFS_H
36 #define BLIS_AUXINFO_MACRO_DEFS_H
37 
38 
39 // auxinfo_t field query
40 
bli_auxinfo_schema_a(auxinfo_t * ai)41 BLIS_INLINE pack_t bli_auxinfo_schema_a( auxinfo_t* ai )
42 {
43 	return ai->schema_a;
44 }
bli_auxinfo_schema_b(auxinfo_t * ai)45 BLIS_INLINE pack_t bli_auxinfo_schema_b( auxinfo_t* ai )
46 {
47 	return ai->schema_b;
48 }
49 
bli_auxinfo_next_a(auxinfo_t * ai)50 BLIS_INLINE void* bli_auxinfo_next_a( auxinfo_t* ai )
51 {
52 	return ai->a_next;
53 }
bli_auxinfo_next_b(auxinfo_t * ai)54 BLIS_INLINE void* bli_auxinfo_next_b( auxinfo_t* ai )
55 {
56 	return ai->b_next;
57 }
58 
bli_auxinfo_is_a(auxinfo_t * ai)59 BLIS_INLINE inc_t bli_auxinfo_is_a( auxinfo_t* ai )
60 {
61 	return ai->is_a;
62 }
bli_auxinfo_is_b(auxinfo_t * ai)63 BLIS_INLINE inc_t bli_auxinfo_is_b( auxinfo_t* ai )
64 {
65 	return ai->is_b;
66 }
67 
bli_auxinfo_ps_a(auxinfo_t * ai)68 BLIS_INLINE inc_t bli_auxinfo_ps_a( auxinfo_t* ai )
69 {
70 	return ai->ps_a;
71 }
bli_auxinfo_ps_b(auxinfo_t * ai)72 BLIS_INLINE inc_t bli_auxinfo_ps_b( auxinfo_t* ai )
73 {
74 	return ai->ps_b;
75 }
76 
77 #if 0
78 BLIS_INLINE inc_t bli_auxinfo_dt_on_output( auxinfo_t* ai )
79 {
80 	return ai->dt_on_output;
81 }
82 #endif
83 
84 
85 // auxinfo_t field modification
86 
bli_auxinfo_set_schema_a(pack_t schema,auxinfo_t * ai)87 BLIS_INLINE void bli_auxinfo_set_schema_a( pack_t schema, auxinfo_t* ai )
88 {
89 	ai->schema_a = schema;
90 }
bli_auxinfo_set_schema_b(pack_t schema,auxinfo_t * ai)91 BLIS_INLINE void bli_auxinfo_set_schema_b( pack_t schema, auxinfo_t* ai )
92 {
93 	ai->schema_b = schema;
94 }
95 
bli_auxinfo_set_next_a(void * p,auxinfo_t * ai)96 BLIS_INLINE void bli_auxinfo_set_next_a( void* p, auxinfo_t* ai )
97 {
98 	ai->a_next = p;
99 }
bli_auxinfo_set_next_b(void * p,auxinfo_t * ai)100 BLIS_INLINE void bli_auxinfo_set_next_b( void* p, auxinfo_t* ai )
101 {
102 	ai->b_next = p;
103 }
bli_auxinfo_set_next_ab(void * ap,void * bp,auxinfo_t * ai)104 BLIS_INLINE void bli_auxinfo_set_next_ab( void* ap, void* bp, auxinfo_t* ai )
105 {
106 	ai->a_next = ap;
107 	ai->b_next = bp;
108 }
109 
bli_auxinfo_set_is_a(inc_t is,auxinfo_t * ai)110 BLIS_INLINE void bli_auxinfo_set_is_a( inc_t is, auxinfo_t* ai )
111 {
112 	ai->is_a = is;
113 }
bli_auxinfo_set_is_b(inc_t is,auxinfo_t * ai)114 BLIS_INLINE void bli_auxinfo_set_is_b( inc_t is, auxinfo_t* ai )
115 {
116 	ai->is_b = is;
117 }
118 
bli_auxinfo_set_ps_a(inc_t ps,auxinfo_t * ai)119 BLIS_INLINE void bli_auxinfo_set_ps_a( inc_t ps, auxinfo_t* ai )
120 {
121 	ai->ps_a = ps;
122 }
bli_auxinfo_set_ps_b(inc_t ps,auxinfo_t * ai)123 BLIS_INLINE void bli_auxinfo_set_ps_b( inc_t ps, auxinfo_t* ai )
124 {
125 	ai->ps_b = ps;
126 }
127 
128 #if 0
129 BLIS_INLINE void bli_auxinfo_set_dt_on_output( num_t dt_on_output, auxinfo_t* ai )
130 {
131 	ai->dt_on_output = dt_on_output;
132 }
133 #endif
134 
135 #endif
136 
137