Debian Codegraph @

src/atlas/linalg/dense/Backend.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 #pragma once
12
13 #include <string>
14 #include "atlas/util/Config.h"
15
16 namespace atlas {
17 namespace linalg {
18 namespace dense {
19
20 struct Backend;
21
22 void current_backend(const std::string& backend);
23 dense::Backend& current_backend();
24 dense::Backend& default_backend(const std::string& backend);
25
26
27 struct Backend : util::Config {
28 Backend(): util::Config() { set(current_backend()); }
29 Backend(const std::string type);
30 Backend(const eckit::Configuration& other);
31 std::string type() const { return getString("type"); }
32 operator std::string() const;
33 bool available() const;
34 };
35
36 namespace backend {
37 struct eckit_linalg : Backend {
38 static std::string type() { return "eckit_linalg"; }
39 eckit_linalg(): Backend(type()) {}
40 };
41 } // namespace backend
42
43
44 } // namespace dense
45 } // namespace linalg
46 } // namespace atlas