| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Futhark.Manifest
Contents
Description
C manifest data structure and serialisation to JSON.
A manifest contains machine-readable information about the API of the compiled Futhark program. Specifically which entry points are available, which types are exposed, and what their C names are. This module documentation is not intended as a full description of the Futhark C API - you will need to consult the Futhark User's Guide to understand most of the information here.
The type aliases are purely informative and do not actually enforce correct usage. They are present only because most of the information here is ultimately just text.
Synopsis
- type CFuncName = Text
- type CTypeName = Text
- type TypeName = Text
- data Manifest = Manifest {}
- data Input = Input {}
- data Output = Output {}
- data EntryPoint = EntryPoint {}
- data Type
- data ArrayOps = ArrayOps {}
- data RecordField = RecordField {}
- data RecordOps = RecordOps {}
- data SumVariant = SumVariant {}
- data SumOps = SumOps {
- sumVariants :: [SumVariant]
- sumVariant :: CFuncName
- data OpaqueArrayOps = OpaqueArrayOps {}
- data RecordArrayOps = RecordArrayOps {}
- data OpaqueExtraOps
- data OpaqueOps = OpaqueOps {}
- manifestToJSON :: Manifest -> Text
- manifestFromJSON :: Text -> Maybe Manifest
Type aliases
The name of a Futhark-level type. This may be an array type
(without sizes, just empty brackets), a primitive type, or another
string denoting an opaque type. The latter must have a
corresponding entry in manifestTypes.
Manifest
A manifest for a compiled program.
Constructors
| Manifest | |
Fields
| |
Manifest info for an entry point parameter.
Manifest info for an entry point return value.
Constructors
| Output | |
Fields
| |
data EntryPoint Source #
Manifest info for an entry point.
Constructors
| EntryPoint | |
Fields
| |
Instances
| FromJSON EntryPoint Source # | |
Defined in Futhark.Manifest | |
| Show EntryPoint Source # | |
Defined in Futhark.Manifest Methods showsPrec :: Int -> EntryPoint -> ShowS # show :: EntryPoint -> String # showList :: [EntryPoint] -> ShowS # | |
| Eq EntryPoint Source # | |
Defined in Futhark.Manifest | |
| Ord EntryPoint Source # | |
Defined in Futhark.Manifest Methods compare :: EntryPoint -> EntryPoint -> Ordering # (<) :: EntryPoint -> EntryPoint -> Bool # (<=) :: EntryPoint -> EntryPoint -> Bool # (>) :: EntryPoint -> EntryPoint -> Bool # (>=) :: EntryPoint -> EntryPoint -> Bool # max :: EntryPoint -> EntryPoint -> EntryPoint # min :: EntryPoint -> EntryPoint -> EntryPoint # | |
Manifest info for a non-scalar type. Scalar types are not part of the manifest for a program. Although this representation allows a type to be both a a record and a sum type, this will never actually happen.
Constructors
| TypeArray CTypeName TypeName Int ArrayOps | ctype, Futhark elemtype, rank. |
| TypeOpaque CTypeName OpaqueOps (Maybe OpaqueExtraOps) |
The names of the C functions implementing the operations on some array type.
Constructors
| ArrayOps | |
Fields
| |
data RecordField Source #
Information about a record field. Also used for fields of record
arrays; see RecordArrayOps.
Constructors
| RecordField | |
Fields
| |
Instances
| FromJSON RecordField Source # | |
Defined in Futhark.Manifest | |
| ToJSON RecordField Source # | |
Defined in Futhark.Manifest Methods toJSON :: RecordField -> Value # toEncoding :: RecordField -> Encoding # toJSONList :: [RecordField] -> Value # toEncodingList :: [RecordField] -> Encoding # omitField :: RecordField -> Bool # | |
| Show RecordField Source # | |
Defined in Futhark.Manifest Methods showsPrec :: Int -> RecordField -> ShowS # show :: RecordField -> String # showList :: [RecordField] -> ShowS # | |
| Eq RecordField Source # | |
Defined in Futhark.Manifest | |
| Ord RecordField Source # | |
Defined in Futhark.Manifest Methods compare :: RecordField -> RecordField -> Ordering # (<) :: RecordField -> RecordField -> Bool # (<=) :: RecordField -> RecordField -> Bool # (>) :: RecordField -> RecordField -> Bool # (>=) :: RecordField -> RecordField -> Bool # max :: RecordField -> RecordField -> RecordField # min :: RecordField -> RecordField -> RecordField # | |
Some opaque types are records, from which we can extract fields, and also construct them from values for their fields. Beyond that, they support the usual opaque operations. These record facilities can be ignored if you wish, and the types treated as ordinary opaque types.
Constructors
| RecordOps | |
Fields
| |
Instances
| FromJSON RecordOps Source # | |
Defined in Futhark.Manifest | |
| ToJSON RecordOps Source # | |
| Show RecordOps Source # | |
| Eq RecordOps Source # | |
| Ord RecordOps Source # | |
data SumVariant Source #
Information about a variant of a sum type.
Constructors
| SumVariant | |
Fields
| |
Instances
| FromJSON SumVariant Source # | |
Defined in Futhark.Manifest | |
| ToJSON SumVariant Source # | |
Defined in Futhark.Manifest Methods toJSON :: SumVariant -> Value # toEncoding :: SumVariant -> Encoding # toJSONList :: [SumVariant] -> Value # toEncodingList :: [SumVariant] -> Encoding # omitField :: SumVariant -> Bool # | |
| Show SumVariant Source # | |
Defined in Futhark.Manifest Methods showsPrec :: Int -> SumVariant -> ShowS # show :: SumVariant -> String # showList :: [SumVariant] -> ShowS # | |
| Eq SumVariant Source # | |
Defined in Futhark.Manifest | |
| Ord SumVariant Source # | |
Defined in Futhark.Manifest Methods compare :: SumVariant -> SumVariant -> Ordering # (<) :: SumVariant -> SumVariant -> Bool # (<=) :: SumVariant -> SumVariant -> Bool # (>) :: SumVariant -> SumVariant -> Bool # (>=) :: SumVariant -> SumVariant -> Bool # max :: SumVariant -> SumVariant -> SumVariant # min :: SumVariant -> SumVariant -> SumVariant # | |
Some opaque types are sum types, from which we can (try to) extract the payload of a constructor, as well as construct them from payloads. As with records, we can ignore these facilities and simply treat them as completely opaque.
Constructors
| SumOps | |
Fields
| |
data OpaqueArrayOps Source #
Some opaque types are arrays of opaque types. These still support
some array-like operations, but their types are somewhat different.
Note that arrays of primitives are TypeArrays, and arrays of
records support RecordArrayOps.
Constructors
| OpaqueArrayOps | |
Fields | |
Instances
data RecordArrayOps Source #
Some opaque types are arrays of records. The RecordFields here
will contain array types, and the projection functions will
retrieve arrays.
Constructors
| RecordArrayOps | |
Fields | |
Instances
data OpaqueExtraOps Source #
Some opaque types have a known structure, which allows additional operations.
Constructors
| OpaqueRecord RecordOps | |
| OpaqueSum SumOps | |
| OpaqueArray OpaqueArrayOps | |
| OpaqueRecordArray RecordArrayOps |
Instances
| Show OpaqueExtraOps Source # | |
Defined in Futhark.Manifest Methods showsPrec :: Int -> OpaqueExtraOps -> ShowS # show :: OpaqueExtraOps -> String # showList :: [OpaqueExtraOps] -> ShowS # | |
| Eq OpaqueExtraOps Source # | |
Defined in Futhark.Manifest Methods (==) :: OpaqueExtraOps -> OpaqueExtraOps -> Bool # (/=) :: OpaqueExtraOps -> OpaqueExtraOps -> Bool # | |
| Ord OpaqueExtraOps Source # | |
Defined in Futhark.Manifest Methods compare :: OpaqueExtraOps -> OpaqueExtraOps -> Ordering # (<) :: OpaqueExtraOps -> OpaqueExtraOps -> Bool # (<=) :: OpaqueExtraOps -> OpaqueExtraOps -> Bool # (>) :: OpaqueExtraOps -> OpaqueExtraOps -> Bool # (>=) :: OpaqueExtraOps -> OpaqueExtraOps -> Bool # max :: OpaqueExtraOps -> OpaqueExtraOps -> OpaqueExtraOps # min :: OpaqueExtraOps -> OpaqueExtraOps -> OpaqueExtraOps # | |
The names of the C functions implementing the operations on some opaque type.
Constructors
| OpaqueOps | |
Fields | |
Instances
| FromJSON OpaqueOps Source # | |
Defined in Futhark.Manifest | |
| ToJSON OpaqueOps Source # | |
| Show OpaqueOps Source # | |
| Eq OpaqueOps Source # | |
| Ord OpaqueOps Source # | |
manifestToJSON :: Manifest -> Text Source #
Serialise a manifest to JSON.