Debian Codegraph @

src/atlas/field/detail/FieldInterface.h

raw
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 /// @file FieldInterface.h
12 /// @author Willem Deconinck
13 /// @date Sep 2014
14
15 #pragma once
16
17 #include "atlas/field/detail/FieldImpl.h"
18
19 namespace atlas {
20 namespace functionspace {
21 class FunctionSpaceImpl;
22 }
23 } // namespace atlas
24
25 namespace atlas {
26 namespace field {
27
28 //----------------------------------------------------------------------------------------------------------------------
29
30 // C wrapper interfaces to C++ routines
31 extern "C" {
32 FieldImpl* atlas__Field__wrap_int_specf(const char* name, int data[], int rank, int shapef[], int stridesf[]);
33 FieldImpl* atlas__Field__wrap_long_specf(const char* name, long data[], int rank, int shapef[], int stridesf[]);
34 FieldImpl* atlas__Field__wrap_float_specf(const char* name, float data[], int rank, int shapef[], int stridesf[]);
35 FieldImpl* atlas__Field__wrap_double_specf(const char* name, double data[], int rank, int shapef[], int stridesf[]);
36 FieldImpl* atlas__Field__create(eckit::Parametrisation* params);
37 void atlas__Field__delete(FieldImpl* This);
38 const char* atlas__Field__name(FieldImpl* This);
39 void atlas__Field__datatype(FieldImpl* This, char*& datatype, int& size, int& allocated);
40 int atlas__Field__kind(FieldImpl* This);
41 int atlas__Field__rank(FieldImpl* This);
42 int atlas__Field__size(FieldImpl* This);
43 int atlas__Field__levels(FieldImpl* This);
44 double atlas__Field__bytes(FieldImpl* This);
45 void atlas__Field__shapef(FieldImpl* This, int*& shape, int& rank);
46 void atlas__Field__stridesf(FieldImpl* This, int*& strides, int& rank);
47 void atlas__Field__data_int_specf(FieldImpl* This, int*& field_data, int& rank, int*& field_shapef,
48 int*& field_stridesf);
49 void atlas__Field__data_long_specf(FieldImpl* This, long*& field_data, int& rank, int*& field_shapef,
50 int*& field_stridesf);
51 void atlas__Field__data_float_specf(FieldImpl* This, float*& field_data, int& rank, int*& field_shapef,
52 int*& field_stridesf);
53 void atlas__Field__data_double_specf(FieldImpl* This, double*& field_data, int& rank, int*& field_shapef,
54 int*& field_stridesf);
55 void atlas__Field__device_data_int_specf(FieldImpl* This, int*& field_data, int& rank, int*& field_shapef,
56 int*& field_stridesf);
57 void atlas__Field__device_data_long_specf(FieldImpl* This, long*& field_data, int& rank, int*& field_shapef,
58 int*& field_stridesf);
59 void atlas__Field__device_data_float_specf(FieldImpl* This, float*& field_data, int& rank, int*& field_shapef,
60 int*& field_stridesf);
61 void atlas__Field__device_data_double_specf(FieldImpl* This, double*& field_data, int& rank, int*& field_shapef,
62 int*& field_stridesf);
63 util::Metadata* atlas__Field__metadata(FieldImpl* This);
64 const functionspace::FunctionSpaceImpl* atlas__Field__functionspace(FieldImpl* This);
65 void atlas__Field__rename(FieldImpl* This, const char* name);
66 void atlas__Field__set_levels(FieldImpl* This, int levels);
67 void atlas__Field__set_functionspace(FieldImpl* This, const functionspace::FunctionSpaceImpl* functionspace);
68 int atlas__Field__host_needs_update(const FieldImpl* This);
69 int atlas__Field__device_needs_update(const FieldImpl* This);
70 int atlas__Field__device_allocated(const FieldImpl* This);
71 void atlas__Field__set_host_needs_update(const FieldImpl* This, int value);
72 void atlas__Field__set_device_needs_update(const FieldImpl* This, int value);
73 void atlas__Field__update_device(FieldImpl* This);
74 void atlas__Field__update_host(FieldImpl* This);
75 void atlas__Field__sync_device(FieldImpl* This);
76 void atlas__Field__sync_host(FieldImpl* This);
77 void atlas__Field__sync_host_device(FieldImpl* This);
78 void atlas__Field__allocate_device(FieldImpl* This);
79 void atlas__Field__deallocate_device(FieldImpl* This);
80 void atlas__Field__set_dirty(FieldImpl* This, int value);
81 void atlas__Field__halo_exchange(FieldImpl* This, int on_device);
82 void atlas__Field__adjoint_halo_exchange(FieldImpl* This, int on_device);
83 int atlas__Field__dirty(FieldImpl* This);
84 int atlas__Field__contiguous(FieldImpl* This);
85 }
86
87 //----------------------------------------------------------------------------------------------------------------------
88
89 } // namespace field
90 } // namespace atlas