| 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 |
#pragma once |
| 11 |
|
| 12 |
#include "atlas/array/gridtools/GridToolsTraits.h" |
| 13 |
#include "atlas/array_fwd.h" |
| 14 |
|
| 15 |
namespace atlas { |
| 16 |
namespace array { |
| 17 |
namespace gridtools { |
| 18 |
|
| 19 |
template <typename Value, unsigned int Rank> |
| 20 |
struct gt_view { |
| 21 |
using value_t = typename std::remove_const<Value>::type; |
| 22 |
using type = ::gridtools::data_view< |
| 23 |
gridtools::storage_traits::data_store_t<value_t, gridtools::storage_traits::storage_info_t<0, Rank>>, |
| 24 |
gridtools::get_access_mode<Value>()>; |
| 25 |
}; |
| 26 |
|
| 27 |
template <typename Value, unsigned int Rank> |
| 28 |
typename gt_view<Value, Rank>::type make_gt_host_view(const Array& array); |
| 29 |
|
| 30 |
template <typename Value, unsigned int Rank> |
| 31 |
typename gt_view<Value, Rank>::type make_gt_device_view(const Array& array); |
| 32 |
|
| 33 |
} // namespace gridtools |
| 34 |
} // namespace array |
| 35 |
} // namespace atlas |