diff options
Diffstat (limited to 'boltzgen/kernel')
-rw-r--r-- | boltzgen/kernel/target/precision.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/boltzgen/kernel/target/precision.py b/boltzgen/kernel/target/precision.py index 45f84cf..d22e922 100644 --- a/boltzgen/kernel/target/precision.py +++ b/boltzgen/kernel/target/precision.py @@ -1,15 +1,16 @@ -class cpp: +class common: @classmethod def get_float_type(self, precision): - return { - 'single': 'float', - 'double': 'double' - }.get(precision) + if precision not in ['single', 'double']: + raise Exception("Precision must be either 'single' or 'double'") -class cl: - @classmethod - def get_float_type(self, precision): return { 'single': 'float', 'double': 'double' }.get(precision) + +class cpp(common): + pass + +class cl(common): + pass |