aboutsummaryrefslogtreecommitdiff
path: root/boltzgen/kernel/memory/precision.py
blob: d22e922a1255f0417a350957b0552f717a1df58f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class common:
    @classmethod
    def get_float_type(self, precision):
        if precision not in ['single', 'double']:
            raise Exception("Precision must be either 'single' or 'double'")

        return {
            'single': 'float',
            'double': 'double'
        }.get(precision)

class cpp(common):
    pass

class cl(common):
    pass