forked from lukasm91/atlas4py
-
Notifications
You must be signed in to change notification settings - Fork 0
/
computation.cpp
38 lines (35 loc) · 1.35 KB
/
computation.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*cppimport
<%
cfg['compiler_args'] = ['-std=c++17', '-fopenmp', '-O0']
cfg['linker_args'] = [
'-L/home/lukas/documents/work/eckit/install/lib/',
'-L/home/lukas/documents/work/atlas/install/lib/',
'-Wl,-rpath,/home/lukas/documents/work/atlas/install/lib:/home/lukas/documents/work/eckit/install/lib',
'-fopenmp'
]
cfg['include_dirs'] = [
'/home/lukas/documents/work/atlas4py/build/_deps/pybind11_fetch-src/include',
'/home/lukas/documents/work/atlas/install/include',
'/home/lukas/documents/work/eckit/install/include',
'/home/lukas/documents/work/dawn/dawn/prototype/',
'/home/lukas/documents/work/dawn/dawn/src/'
]
cfg['libraries'] = ['eckit', 'atlas']
setup_pybind11(cfg)
%>
*/
#include <pybind11/pybind11.h>
#include "atlas_interface.hpp"
#include "generated_Diffusion.hpp"
PYBIND11_MODULE(computation, m) {
m.def("run_computation", [](atlas::Mesh const& mesh, int ksize,
atlas::Field in_field, atlas::Field out_field) {
auto in_view = atlasInterface::Field<double>(
atlas::array::make_view<double, 2>(in_field));
auto out_view = atlasInterface::Field<double>(
atlas::array::make_view<double, 2>(out_field));
dawn_generated::cxxnaiveico::generated<atlasInterface::atlasTag>(
mesh, ksize, in_view, out_view)
.run();
});
}