|
| 1 | +class _not_implemented: # noqa |
| 2 | + """Not Implemented""" |
| 3 | + |
| 4 | + |
| 5 | +class AbstractComputeBackend: |
| 6 | + """ |
| 7 | + Abstract class to record all the backend specific implementation of |
| 8 | + :mod:`pyop2`'s data structures. |
| 9 | + """ |
| 10 | + GlobalKernel = _not_implemented |
| 11 | + Parloop = _not_implemented |
| 12 | + Set = _not_implemented |
| 13 | + ExtrudedSet = _not_implemented |
| 14 | + MixedSet = _not_implemented |
| 15 | + Subset = _not_implemented |
| 16 | + DataSet = _not_implemented |
| 17 | + MixedDataSet = _not_implemented |
| 18 | + Map = _not_implemented |
| 19 | + MixedMap = _not_implemented |
| 20 | + Dat = _not_implemented |
| 21 | + MixedDat = _not_implemented |
| 22 | + DatView = _not_implemented |
| 23 | + Mat = _not_implemented |
| 24 | + Global = _not_implemented |
| 25 | + GlobalDataSet = _not_implemented |
| 26 | + PETScVecType = _not_implemented |
| 27 | + |
| 28 | + def _getattr_(self, key): |
| 29 | + val = super(AbstractComputeBackend, self)._getattr_(key) |
| 30 | + if val is _not_implemented: |
| 31 | + raise NotImplementedError("'{}' is not implemented for backend" |
| 32 | + " '{}'.".format(val, self.__name__)) |
| 33 | + return val |
| 34 | + |
| 35 | + def turn_on_offloading(self): |
| 36 | + raise NotImplementedError() |
| 37 | + |
| 38 | + def turn_off_offloading(self): |
| 39 | + raise NotImplementedError() |
| 40 | + |
| 41 | + @property |
| 42 | + def cache_key(self): |
| 43 | + raise NotImplementedError() |
0 commit comments