Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module defines an efficient value representation as well as parsing and comparison functions. This is because the standard Futhark parser is not able to cope with large values (like arrays that are tens of megabytes in size). The representation defined here does not support tuples, so don't use those as input/output for your test programs.
Synopsis
- data Value
- = Int8Value (Vector Int) (Vector Int8)
- | Int16Value (Vector Int) (Vector Int16)
- | Int32Value (Vector Int) (Vector Int32)
- | Int64Value (Vector Int) (Vector Int64)
- | Word8Value (Vector Int) (Vector Word8)
- | Word16Value (Vector Int) (Vector Word16)
- | Word32Value (Vector Int) (Vector Word32)
- | Word64Value (Vector Int) (Vector Word64)
- | Float32Value (Vector Int) (Vector Float)
- | Float64Value (Vector Int) (Vector Double)
- | BoolValue (Vector Int) (Vector Bool)
- readValues :: ByteString -> Maybe [Value]
- data ValueType = ValueType [Int] PrimType
- valueType :: Value -> ValueType
- compareValues :: [Value] -> [Value] -> [Mismatch]
- compareValues1 :: [Value] -> [Value] -> Maybe Mismatch
- data Mismatch
Documentation
An efficiently represented Futhark value. Use pretty
to get a
human-readable representation, and the instances of Get
and Put
to obtain binary representations
Int8Value (Vector Int) (Vector Int8) | |
Int16Value (Vector Int) (Vector Int16) | |
Int32Value (Vector Int) (Vector Int32) | |
Int64Value (Vector Int) (Vector Int64) | |
Word8Value (Vector Int) (Vector Word8) | |
Word16Value (Vector Int) (Vector Word16) | |
Word32Value (Vector Int) (Vector Word32) | |
Word64Value (Vector Int) (Vector Word64) | |
Float32Value (Vector Int) (Vector Float) | |
Float64Value (Vector Int) (Vector Double) | |
BoolValue (Vector Int) (Vector Bool) |
Reading Values
readValues :: ByteString -> Maybe [Value] Source #
Parse Futhark values from the given bytestring.
Types of values
A representation of the simple values we represent in this module.
valueType :: Value -> ValueType Source #
A textual description of the type of a value. Follows Futhark type notation, and contains the exact dimension sizes if an array.
Comparing Values
compareValues :: [Value] -> [Value] -> [Mismatch] Source #
Compare two sets of Futhark values for equality. Shapes and types must also match.
compareValues1 :: [Value] -> [Value] -> Maybe Mismatch Source #
As compareValues
, but only reports one mismatch.