Safe Haskell | None |
---|---|
Language | Haskell2010 |
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.
Manifest | |
|
Manifest info for an entry point parameter.
Manifest info for an entry point return value.
Output | |
|
data EntryPoint Source #
Manifest info for an entry point.
Instances
Eq EntryPoint Source # | |
Defined in Futhark.Manifest (==) :: EntryPoint -> EntryPoint -> Bool # (/=) :: EntryPoint -> EntryPoint -> Bool # | |
Ord EntryPoint Source # | |
Defined in Futhark.Manifest 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 showsPrec :: Int -> EntryPoint -> ShowS # show :: EntryPoint -> String # showList :: [EntryPoint] -> ShowS # | |
FromJSON EntryPoint Source # | |
Defined in Futhark.Manifest parseJSON :: Value -> Parser EntryPoint # parseJSONList :: Value -> Parser [EntryPoint] # |
Manifest info for a non-scalar type. Scalar types are not part of the manifest for a program.
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.
ArrayOps | |
|
data RecordField Source #
Information about a record field.
RecordField | |
|
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.
RecordOps | |
|
The names of the C functions implementing the operations on some opaque type.
manifestToJSON :: Manifest -> Text Source #
Serialise a manifest to JSON.