| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Futhark.Test.Values
Contents
Description
This module provides an efficient value representation as well as parsing and comparison functions.
Synopsis
- data Value
- = I8Value (Vector Int) (Vector Int8)
- | I16Value (Vector Int) (Vector Int16)
- | I32Value (Vector Int) (Vector Int32)
- | I64Value (Vector Int) (Vector Int64)
- | U8Value (Vector Int) (Vector Word8)
- | U16Value (Vector Int) (Vector Word16)
- | U32Value (Vector Int) (Vector Word32)
- | U64Value (Vector Int) (Vector Word64)
- | F16Value (Vector Int) (Vector Half)
- | F32Value (Vector Int) (Vector Float)
- | F64Value (Vector Int) (Vector Double)
- | BoolValue (Vector Int) (Vector Bool)
- data PrimType
- type Vector = Vector
- class PutValue1 t where
- class PutValue t where
- class GetValue t where
- data ValueType = ValueType [Int] PrimType
- valueText :: Value -> Text
- primTypeText :: PrimType -> Text
- primTypeBytes :: PrimType -> Int
- valueTypeText :: ValueType -> Text
- valueTypeTextNoDims :: ValueType -> Text
- valueType :: Value -> ValueType
- valueElemType :: Value -> PrimType
- valueShape :: Value -> [Int]
- valueElems :: Value -> [Value]
- newtype Tolerance = Tolerance Double
- data Mismatch
- compareValues :: Tolerance -> Value -> Value -> [Mismatch]
- compareSeveralValues :: Tolerance -> [Value] -> [Value] -> [Mismatch]
- readValues :: ByteString -> Maybe [Value]
- data Compound v
- = ValueRecord (Map Text (Compound v))
- | ValueTuple [Compound v]
- | ValueAtom v
- type CompoundValue = Compound Value
- mkCompound :: [Compound v] -> Compound v
- unCompound :: Compound v -> [Compound v]
Documentation
Constructors
| I8Value (Vector Int) (Vector Int8) | |
| I16Value (Vector Int) (Vector Int16) | |
| I32Value (Vector Int) (Vector Int32) | |
| I64Value (Vector Int) (Vector Int64) | |
| U8Value (Vector Int) (Vector Word8) | |
| U16Value (Vector Int) (Vector Word16) | |
| U32Value (Vector Int) (Vector Word32) | |
| U64Value (Vector Int) (Vector Word64) | |
| F16Value (Vector Int) (Vector Half) | |
| F32Value (Vector Int) (Vector Float) | |
| F64Value (Vector Int) (Vector Double) | |
| BoolValue (Vector Int) (Vector Bool) |
Instances
| Bounded PrimType | |
| Enum PrimType | |
Defined in Futhark.Data Methods succ :: PrimType -> PrimType Source # pred :: PrimType -> PrimType Source # toEnum :: Int -> PrimType Source # fromEnum :: PrimType -> Int Source # enumFrom :: PrimType -> [PrimType] Source # enumFromThen :: PrimType -> PrimType -> [PrimType] Source # enumFromTo :: PrimType -> PrimType -> [PrimType] Source # enumFromThenTo :: PrimType -> PrimType -> PrimType -> [PrimType] Source # | |
| Show PrimType | |
| Eq PrimType | |
| Ord PrimType | |
Defined in Futhark.Data | |
Instances
| PutValue1 ByteString | |
Defined in Futhark.Data Methods putValue1 :: ByteString -> Value # | |
| PutValue1 ByteString | |
Defined in Futhark.Data Methods putValue1 :: ByteString -> Value # | |
| PutValue1 Int16 | |
Defined in Futhark.Data | |
| PutValue1 Int32 | |
Defined in Futhark.Data | |
| PutValue1 Int64 | |
Defined in Futhark.Data | |
| PutValue1 Int8 | |
Defined in Futhark.Data | |
| PutValue1 Word16 | |
Defined in Futhark.Data | |
| PutValue1 Word32 | |
Defined in Futhark.Data | |
| PutValue1 Word64 | |
Defined in Futhark.Data | |
| PutValue1 Word8 | |
Defined in Futhark.Data | |
| PutValue1 Text | |
Defined in Futhark.Data | |
Instances
| PutValue ByteString | |
Defined in Futhark.Data Methods putValue :: ByteString -> Maybe Value # | |
| PutValue ByteString | |
Defined in Futhark.Data Methods putValue :: ByteString -> Maybe Value # | |
| PutValue Int16 | |
| PutValue Int32 | |
| PutValue Int64 | |
| PutValue Int8 | |
| PutValue Word16 | |
| PutValue Word32 | |
| PutValue Word64 | |
| PutValue Word8 | |
| PutValue Text | |
| PutValue [Value] | |
Instances
| Show ValueType | |
| Eq ValueType | |
| Ord ValueType | |
Defined in Futhark.Data | |
| Pretty ValueType Source # | |
Defined in Futhark.Test.Values | |
primTypeText :: PrimType -> Text #
primTypeBytes :: PrimType -> Int #
valueTypeText :: ValueType -> Text #
valueTypeTextNoDims :: ValueType -> Text #
valueElemType :: Value -> PrimType #
valueShape :: Value -> [Int] #
valueElems :: Value -> [Value] #
Instances
| Show Tolerance | |
| Eq Tolerance | |
| Ord Tolerance | |
Defined in Futhark.Data.Compare | |
readValues :: ByteString -> Maybe [Value] #
The structure of a compound value, parameterised over the actual
values. For most cases you probably want CompoundValue.
Constructors
| ValueRecord (Map Text (Compound v)) | |
| ValueTuple [Compound v] | Must not be single value. |
| ValueAtom v |
Instances
type CompoundValue = Compound Value Source #
Like a Value, but also grouped in compound ways that are not
supported by raw values. You cannot parse or read these in
standard ways, and they cannot be elements of arrays.
mkCompound :: [Compound v] -> Compound v Source #
Create a tuple for a non-unit list, and otherwise a ValueAtom
unCompound :: Compound v -> [Compound v] Source #
If the value is a tuple, extract the components, otherwise return a singleton list of the value.