Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Kokkos_AnalyzeStokhosShape.hpp
Go to the documentation of this file.
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Stokhos Package
5 // Copyright (2009) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Eric T. Phipps (etphipp@sandia.gov).
38 //
39 // ***********************************************************************
40 // @HEADER
41 #if false
42 #ifndef KOKKOS_ANALYZE_STOKHOS_SHAPE_HPP
43 #define KOKKOS_ANALYZE_STOKHOS_SHAPE_HPP
44 
45 //#include <impl/Kokkos_Shape.hpp>
46 
47 //----------------------------------------------------------------------------
48 //----------------------------------------------------------------------------
49 
50 namespace Kokkos {
51 namespace Impl {
52 
53 //----------------------------------------------------------------------------
54 
71 template< class T, class Layout >
72 struct AnalyzeStokhosShape : public Shape< sizeof(T) , 0 >
73 {
74  typedef void specialize ;
75 
76  typedef Shape< sizeof(T), 0 > shape ;
77 
78  typedef T array_intrinsic_type ;
79  typedef T flat_array_type ;
80  typedef T value_type ;
81  typedef T type ;
82  typedef const T const_array_intrinsic_type ;
83  typedef const T const_flat_array_type ;
84  typedef const T const_value_type ;
85  typedef const T const_type ;
86  typedef T non_const_array_intrinsic_type ;
87  typedef T non_const_flat_array_type ;
88  typedef T non_const_value_type ;
89  typedef T non_const_type ;
90 };
91 
92 template< class Layout>
93 struct AnalyzeStokhosShape<void, Layout> : public Shape< 0 , 0 >
94 {
95  typedef void specialize ;
96 
97  typedef Shape< 0 , 0 > shape ;
98 
99  typedef void array_intrinsic_type ;
100  typedef void flat_array_type ;
101  typedef void value_type ;
102  typedef void type ;
103  typedef const void const_array_intrinsic_type ;
104  typedef const void const_flat_array_type ;
105  typedef const void const_value_type ;
106  typedef const void const_type ;
107  typedef void non_const_array_intrinsic_type ;
108  typedef void non_const_flat_array_type ;
109  typedef void non_const_value_type ;
110  typedef void non_const_type ;
111 };
112 
113 template< class T, class Layout >
114 struct AnalyzeStokhosShape< const T, Layout > :
115  public AnalyzeStokhosShape<T, Layout>::shape
116 {
117 private:
118  typedef AnalyzeStokhosShape<T, Layout> nested ;
119 public:
120 
121  typedef typename nested::specialize specialize ;
122 
123  typedef typename nested::shape shape ;
124 
125  typedef typename nested::const_array_intrinsic_type array_intrinsic_type ;
126  typedef typename nested::const_flat_array_type flat_array_type ;
127  typedef typename nested::const_value_type value_type ;
128  typedef typename nested::const_type type ;
129 
130  typedef typename nested::const_array_intrinsic_type const_array_intrinsic_type ;
131  typedef typename nested::const_flat_array_type const_flat_array_type ;
132  typedef typename nested::const_value_type const_value_type ;
133  typedef typename nested::const_type const_type ;
134 
135  typedef typename nested::non_const_array_intrinsic_type non_const_array_intrinsic_type ;
136  typedef typename nested::non_const_flat_array_type non_const_flat_array_type ;
137  typedef typename nested::non_const_value_type non_const_value_type ;
138  typedef typename nested::non_const_type non_const_type ;
139 };
140 
141 template< class T, class Layout >
142 struct AnalyzeStokhosShape< T *, Layout >
143  : public ShapeInsert< typename AnalyzeStokhosShape<T,Layout>::shape , 0 >::type
144 {
145 private:
146  typedef AnalyzeStokhosShape<T, Layout> nested ;
147 public:
148 
149  typedef typename nested::specialize specialize ;
150 
151  typedef typename ShapeInsert< typename nested::shape , 0 >::type shape ;
152 
153  typedef typename nested::array_intrinsic_type * array_intrinsic_type ;
154  typedef typename nested::flat_array_type * flat_array_type ;
155  typedef typename nested::value_type value_type ;
156  typedef typename nested::type * type ;
157 
158  typedef typename nested::const_array_intrinsic_type * const_array_intrinsic_type ;
159  typedef typename nested::const_flat_array_type * const_flat_array_type ;
160  typedef typename nested::const_value_type const_value_type ;
161  typedef typename nested::const_type * const_type ;
162 
163  typedef typename nested::non_const_array_intrinsic_type * non_const_array_intrinsic_type ;
164  typedef typename nested::non_const_flat_array_type * non_const_flat_array_type ;
165  typedef typename nested::non_const_value_type non_const_value_type ;
166  typedef typename nested::non_const_type * non_const_type ;
167 };
168 
169 template< class T, class Layout >
170 struct AnalyzeStokhosShape< T[], Layout >
171  : public ShapeInsert< typename AnalyzeStokhosShape<T, Layout>::shape , 0 >::type
172 {
173 private:
174  typedef AnalyzeStokhosShape<T, Layout> nested ;
175 public:
176 
177  typedef typename nested::specialize specialize ;
178 
179  typedef typename ShapeInsert< typename nested::shape , 0 >::type shape ;
180 
181  typedef typename nested::array_intrinsic_type array_intrinsic_type [] ;
182  typedef typename nested::flat_array_type flat_array_type [] ;
183  typedef typename nested::value_type value_type ;
184  typedef typename nested::type type [] ;
185 
186  typedef typename nested::const_array_intrinsic_type const_array_intrinsic_type [] ;
187  typedef typename nested::const_flat_array_type const_flat_array_type [] ;
188  typedef typename nested::const_value_type const_value_type ;
189  typedef typename nested::const_type const_type [] ;
190 
191  typedef typename nested::non_const_array_intrinsic_type non_const_array_intrinsic_type [] ;
192  typedef typename nested::non_const_flat_array_type non_const_flat_array_type [] ;
193  typedef typename nested::non_const_value_type non_const_value_type ;
194  typedef typename nested::non_const_type non_const_type [] ;
195 };
196 
197 template< class T, class Layout >
198 struct AnalyzeStokhosShape< const T[], Layout >
199  : public ShapeInsert< typename AnalyzeStokhosShape< const T, Layout >::shape , 0 >::type
200 {
201 private:
202  typedef AnalyzeStokhosShape< const T, Layout > nested ;
203 public:
204 
205  typedef typename nested::specialize specialize ;
206 
207  typedef typename ShapeInsert< typename nested::shape , 0 >::type shape ;
208 
209  typedef typename nested::array_intrinsic_type array_intrinsic_type [] ;
210  typedef typename nested::flat_array_type flat_array_type [] ;
211  typedef typename nested::value_type value_type ;
212  typedef typename nested::type type [] ;
213 
214  typedef typename nested::const_array_intrinsic_type const_array_intrinsic_type [] ;
215  typedef typename nested::const_flat_array_type const_flat_array_type [] ;
216  typedef typename nested::const_value_type const_value_type ;
217  typedef typename nested::const_type const_type [] ;
218 
219  typedef typename nested::non_const_array_intrinsic_type non_const_array_intrinsic_type [] ;
220  typedef typename nested::non_const_flat_array_type non_const_flat_array_type [] ;
221  typedef typename nested::non_const_value_type non_const_value_type ;
222  typedef typename nested::non_const_type non_const_type [] ;
223 };
224 
225 template< class T, class Layout , unsigned N >
226 struct AnalyzeStokhosShape< T[N], Layout >
227  : public ShapeInsert< typename AnalyzeStokhosShape<T, Layout>::shape , N >::type
228 {
229 private:
230  typedef AnalyzeStokhosShape<T, Layout> nested ;
231 public:
232 
233  typedef typename nested::specialize specialize ;
234 
235  typedef typename ShapeInsert< typename nested::shape , N >::type shape ;
236 
237  typedef typename nested::array_intrinsic_type array_intrinsic_type [N] ;
238  typedef typename nested::flat_array_type flat_array_type [N] ;
239  typedef typename nested::value_type value_type ;
240  typedef typename nested::type type [N] ;
241 
242  typedef typename nested::const_array_intrinsic_type const_array_intrinsic_type [N] ;
243  typedef typename nested::const_flat_array_type const_flat_array_type [N] ;
244  typedef typename nested::const_value_type const_value_type ;
245  typedef typename nested::const_type const_type [N] ;
246 
247  typedef typename nested::non_const_array_intrinsic_type non_const_array_intrinsic_type [N] ;
248  typedef typename nested::non_const_flat_array_type non_const_flat_array_type [N] ;
249  typedef typename nested::non_const_value_type non_const_value_type ;
250  typedef typename nested::non_const_type non_const_type [N] ;
251 };
252 
253 template< class T, class Layout , unsigned N >
254 struct AnalyzeStokhosShape< const T[N], Layout >
255  : public ShapeInsert< typename AnalyzeStokhosShape< const T, Layout >::shape , N >::type
256 {
257 private:
258  typedef AnalyzeStokhosShape< const T, Layout > nested ;
259 public:
260 
261  typedef typename nested::specialize specialize ;
262 
263  typedef typename ShapeInsert< typename nested::shape , N >::type shape ;
264 
265  typedef typename nested::array_intrinsic_type array_intrinsic_type [N] ;
266  typedef typename nested::flat_array_type flat_array_type [N] ;
267  typedef typename nested::value_type value_type ;
268  typedef typename nested::type type [N] ;
269 
270  typedef typename nested::const_array_intrinsic_type const_array_intrinsic_type [N] ;
271  typedef typename nested::const_flat_array_type const_flat_array_type [N] ;
272  typedef typename nested::const_value_type const_value_type ;
273  typedef typename nested::const_type const_type [N] ;
274 
275  typedef typename nested::non_const_array_intrinsic_type non_const_array_intrinsic_type [N] ;
276  typedef typename nested::non_const_flat_array_type non_const_flat_array_type [N] ;
277  typedef typename nested::non_const_value_type non_const_value_type ;
278  typedef typename nested::non_const_type non_const_type [N] ;
279 };
280 
281 } // namespace Impl
282 } // namespace Kokkos
283 #endif
284 #endif /* #ifndef KOKKOS_ANALYZE_STOKHOS_SHAPE_HPP */