atlas
ArrayView.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2013 ECMWF.
3  *
4  * This software is licensed under the terms of the Apache Licence Version 2.0
5  * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6  * In applying this licence, ECMWF does not waive the privileges and immunities
7  * granted to it by virtue of its status as an intergovernmental organisation
8  * nor does it submit to any jurisdiction.
9  */
10 
11 #pragma once
12 
13 #include "atlas/library/config.h"
14 
15 #if ATLAS_HAVE_GRIDTOOLS_STORAGE
16 #include "atlas/array/gridtools/GridToolsArrayView.h"
17 #else
18 #include "atlas/array/native/NativeArrayView.h"
19 #endif
20 
21 namespace atlas {
22 namespace array {
23 
24 #define EXPLICIT_TEMPLATE_DECLARATION_TYPE_RANK( TYPE, RANK ) \
25  extern template class ArrayView<TYPE, RANK>; \
26  extern template class ArrayView<const TYPE, RANK>;
27 
28 #define EXPLICIT_TEMPLATE_DECLARATION( RANK ) \
29  EXPLICIT_TEMPLATE_DECLARATION_TYPE_RANK( int, RANK ); \
30  EXPLICIT_TEMPLATE_DECLARATION_TYPE_RANK( long, RANK ); \
31  EXPLICIT_TEMPLATE_DECLARATION_TYPE_RANK( float, RANK ); \
32  EXPLICIT_TEMPLATE_DECLARATION_TYPE_RANK( double, RANK );
33 
34 // For each RANK in [1..9]
35 EXPLICIT_TEMPLATE_DECLARATION( 1 )
36 EXPLICIT_TEMPLATE_DECLARATION( 2 )
37 EXPLICIT_TEMPLATE_DECLARATION( 3 )
38 EXPLICIT_TEMPLATE_DECLARATION( 4 )
39 EXPLICIT_TEMPLATE_DECLARATION( 5 )
40 EXPLICIT_TEMPLATE_DECLARATION( 6 )
41 EXPLICIT_TEMPLATE_DECLARATION( 7 )
42 EXPLICIT_TEMPLATE_DECLARATION( 8 )
43 EXPLICIT_TEMPLATE_DECLARATION( 9 )
44 
45 #undef EXPLICIT_TEMPLATE_DECLARATION_TYPE_RANK
46 #undef EXPLICIT_TEMPLATE_DECLARATION
47 
48 } // namespace array
49 } // namespace atlas
Contains all atlas classes and methods.
Definition: atlas-grids.cc:33