| 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 |
// The Fujitsu compiler complains about missing references with the below |
| 35 |
// so we just skip it in that case |
| 36 |
#if !defined(__FUJITSU) |
| 37 |
|
| 38 |
// For each RANK in [1..9] |
| 39 |
EXPLICIT_TEMPLATE_DECLARATION(1) |
| 40 |
EXPLICIT_TEMPLATE_DECLARATION(2) |
| 41 |
EXPLICIT_TEMPLATE_DECLARATION(3) |
| 42 |
EXPLICIT_TEMPLATE_DECLARATION(4) |
| 43 |
EXPLICIT_TEMPLATE_DECLARATION(5) |
| 44 |
EXPLICIT_TEMPLATE_DECLARATION(6) |
| 45 |
EXPLICIT_TEMPLATE_DECLARATION(7) |
| 46 |
EXPLICIT_TEMPLATE_DECLARATION(8) |
| 47 |
EXPLICIT_TEMPLATE_DECLARATION(9) |
| 48 |
|
| 49 |
#endif |
| 50 |
|
| 51 |
#undef EXPLICIT_TEMPLATE_DECLARATION_TYPE_RANK |
| 52 |
#undef EXPLICIT_TEMPLATE_DECLARATION |
| 53 |
|
| 54 |
} // namespace array |
| 55 |
} // namespace atlas |