17 | module Compiler.Xla.XlaData
19 | import Compiler.MLIR.IR.BuiltinTypes
20 | import Compiler.MLIR.IR.MLIRContext
21 | import Compiler.MLIR.IR.Types
24 | interface Primitive dtype where
29 | mlirType : HasIO io => MLIRContext -> io Type_
31 | export data PRED : Type where
34 | Primitive PRED where
39 | mlirType ctx = cast <$> IntegerType.get ctx 1 Signless
41 | export data S32 : Type where
49 | mlirType ctx = cast <$> IntegerType.get ctx 32 Signless
51 | export data S64 : Type where
59 | mlirType ctx = cast <$> IntegerType.get ctx 64 Signless
61 | export data U32 : Type where
69 | mlirType ctx = cast <$> IntegerType.get ctx 32 Unsigned
71 | export data U64 : Type where
79 | mlirType ctx = cast <$> IntegerType.get ctx 64 Unsigned
81 | export data F64 : Type where
89 | mlirType ctx = cast <$> Float64Type.get ctx