/
base.py
60 lines (34 loc) · 1.46 KB
/
base.py
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
"""Metaclasses used to construct classes of proper backend type at runtime."""
from sympy.core.compatibility import with_metaclass
from devito.backends import _BackendSelector
import devito.types.basic as basic
import devito.types.caching as caching
import devito.types.dense as dense
import devito.types.grid as grid
import devito.types.sparse as sparse
import devito.types.constant as constant
import devito.operator as operator
class Scalar(with_metaclass(_BackendSelector, basic.Scalar)):
pass
class Array(with_metaclass(_BackendSelector, basic.Array)):
pass
class Constant(with_metaclass(_BackendSelector, constant.Constant)):
pass
class Function(with_metaclass(_BackendSelector, dense.Function)):
pass
class TimeFunction(with_metaclass(_BackendSelector, dense.TimeFunction)):
pass
class SparseFunction(with_metaclass(_BackendSelector, sparse.SparseFunction)):
pass
class SparseTimeFunction(with_metaclass(_BackendSelector, sparse.SparseTimeFunction)):
pass
class PrecomputedSparseFunction(with_metaclass(_BackendSelector, sparse.PrecomputedSparseFunction)): # noqa
pass
class PrecomputedSparseTimeFunction(with_metaclass(_BackendSelector, sparse.PrecomputedSparseTimeFunction)): # noqa
pass
class Grid(with_metaclass(_BackendSelector, grid.Grid)):
pass
class Operator(with_metaclass(_BackendSelector, operator.Operator)):
pass
class CacheManager(with_metaclass(_BackendSelector, caching.CacheManager)):
pass