Safe Haskell | None |
---|---|
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 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
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 # | |
Show EntryPoint Source # | |
Defined in Futhark.Manifest Methods showsPrec :: Int -> EntryPoint -> ShowS # show :: EntryPoint -> String # showList :: [EntryPoint] -> ShowS # | |
FromJSON EntryPoint Source # | |
Defined in Futhark.Manifest |
Manifest info for a non-scalar type. Scalar types are not part of the manifest for a program.
Constructors
TypeArray CTypeName TypeName Int ArrayOps | ctype, Futhark elemtype, rank. |
TypeOpaque CTypeName OpaqueOps (Maybe RecordOps) |
The names of the C functions implementing the operations on some array type.
Constructors
ArrayOps | |
Fields
|
data RecordField Source #
Information about a record field.
Constructors
RecordField | |
Fields
|
Instances
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 # | |
Show RecordField Source # | |
Defined in Futhark.Manifest Methods showsPrec :: Int -> RecordField -> ShowS # show :: RecordField -> String # showList :: [RecordField] -> ShowS # | |
ToJSON RecordField Source # | |
Defined in Futhark.Manifest Methods toJSON :: RecordField -> Value # toEncoding :: RecordField -> Encoding # toJSONList :: [RecordField] -> Value # toEncodingList :: [RecordField] -> Encoding # | |
FromJSON RecordField Source # | |
Defined in Futhark.Manifest |
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
Eq RecordOps Source # | |
Ord RecordOps Source # | |
Show RecordOps Source # | |
ToJSON RecordOps Source # | |
Defined in Futhark.Manifest | |
FromJSON RecordOps Source # | |
The names of the C functions implementing the operations on some opaque type.
Constructors
OpaqueOps | |
Fields |
Instances
Eq OpaqueOps Source # | |
Ord OpaqueOps Source # | |
Show OpaqueOps Source # | |
ToJSON OpaqueOps Source # | |
Defined in Futhark.Manifest | |
FromJSON OpaqueOps Source # | |
manifestToJSON :: Manifest -> Text Source #
Serialise a manifest to JSON.