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
|
Instances
FromJSON Manifest Source # | |
ToJSON Manifest Source # | |
Show Manifest Source # | |
Eq Manifest Source # | |
Ord Manifest Source # | |
Defined in Futhark.Manifest |
Manifest info for an entry point parameter.
Manifest info for an entry point return value.
Constructors
Output | |
Fields
|
Instances
FromJSON Output Source # | |
Show Output Source # | |
Eq Output Source # | |
Ord Output Source # | |
data EntryPoint Source #
Manifest info for an entry point.
Constructors
EntryPoint | |
Fields
|
Instances
FromJSON EntryPoint Source # | |
Defined in Futhark.Manifest Methods parseJSON :: Value -> Parser EntryPoint Source # parseJSONList :: Value -> Parser [EntryPoint] Source # | |
Show EntryPoint Source # | |
Defined in Futhark.Manifest | |
Eq EntryPoint Source # | |
Defined in Futhark.Manifest Methods (==) :: EntryPoint -> EntryPoint -> Bool Source # (/=) :: EntryPoint -> EntryPoint -> Bool Source # | |
Ord EntryPoint Source # | |
Defined in Futhark.Manifest Methods compare :: EntryPoint -> EntryPoint -> Ordering Source # (<) :: EntryPoint -> EntryPoint -> Bool Source # (<=) :: EntryPoint -> EntryPoint -> Bool Source # (>) :: EntryPoint -> EntryPoint -> Bool Source # (>=) :: EntryPoint -> EntryPoint -> Bool Source # max :: EntryPoint -> EntryPoint -> EntryPoint Source # min :: EntryPoint -> EntryPoint -> EntryPoint Source # |
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
|
Instances
FromJSON ArrayOps Source # | |
ToJSON ArrayOps Source # | |
Show ArrayOps Source # | |
Eq ArrayOps Source # | |
Ord ArrayOps Source # | |
Defined in Futhark.Manifest |
data RecordField Source #
Information about a record field. Also used for fields of record
arrays; see RecordArrayOps
.
Constructors
RecordField | |
Fields
|
Instances
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 # | |
ToJSON RecordOps Source # | |
Show RecordOps Source # | |
Eq RecordOps Source # | |
Ord RecordOps Source # | |
Defined in Futhark.Manifest |
data SumVariant Source #
Information about a variant of a sum type.
Constructors
SumVariant | |
Fields
|
Instances
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
|
Instances
FromJSON SumOps Source # | |
ToJSON SumOps Source # | |
Show SumOps Source # | |
Eq SumOps Source # | |
Ord SumOps Source # | |
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 TypeArray
s, and arrays of
records support RecordArrayOps
.
Constructors
OpaqueArrayOps | |
Fields |
Instances
data RecordArrayOps Source #
Some opaque types are arrays of records. The RecordField
s 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 | |
Eq OpaqueExtraOps Source # | |
Defined in Futhark.Manifest Methods (==) :: OpaqueExtraOps -> OpaqueExtraOps -> Bool Source # (/=) :: OpaqueExtraOps -> OpaqueExtraOps -> Bool Source # | |
Ord OpaqueExtraOps Source # | |
Defined in Futhark.Manifest Methods compare :: OpaqueExtraOps -> OpaqueExtraOps -> Ordering Source # (<) :: OpaqueExtraOps -> OpaqueExtraOps -> Bool Source # (<=) :: OpaqueExtraOps -> OpaqueExtraOps -> Bool Source # (>) :: OpaqueExtraOps -> OpaqueExtraOps -> Bool Source # (>=) :: OpaqueExtraOps -> OpaqueExtraOps -> Bool Source # max :: OpaqueExtraOps -> OpaqueExtraOps -> OpaqueExtraOps Source # min :: OpaqueExtraOps -> OpaqueExtraOps -> OpaqueExtraOps Source # |
The names of the C functions implementing the operations on some opaque type.
Constructors
OpaqueOps | |
Fields |
Instances
FromJSON OpaqueOps Source # | |
ToJSON OpaqueOps Source # | |
Show OpaqueOps Source # | |
Eq OpaqueOps Source # | |
Ord OpaqueOps Source # | |
Defined in Futhark.Manifest |
manifestToJSON :: Manifest -> Text Source #
Serialise a manifest to JSON.