futhark-0.19.7: An optimising compiler for a functional, array-oriented language.
Safe HaskellTrustworthy
LanguageHaskell2010

Futhark.CodeGen.Backends.SimpleRep

Description

Simple C runtime representation.

Synopsis

Documentation

tupleField :: Int -> String Source #

tupleField i is the name of field number i in a tuple.

funName :: Name -> String Source #

funName f is the name of the C function corresponding to the Futhark function f.

defaultMemBlockType :: Type Source #

The type of memory blocks in the default memory space.

intTypeToCType :: IntType -> Type Source #

The C type corresponding to a signed integer type.

primTypeToCType :: PrimType -> Type Source #

The C type corresponding to a primitive type. Integers are assumed to be unsigned.

signedPrimTypeToCType :: Signedness -> PrimType -> Type Source #

The C type corresponding to a primitive type. Integers are assumed to have the specified sign.

arrayName :: PrimType -> Signedness -> Int -> String Source #

The name of exposed array type structs.

opaqueName :: String -> [ValueDesc] -> String Source #

The name of exposed opaque types.

externalValueType :: ExternalValue -> Type Source #

The type used to expose a Futhark value in the C API. A pointer in the case of arrays and opaques.

cproduct :: [Exp] -> Exp Source #

Return an expression multiplying together the given expressions. If an empty list is given, the expression 1 is returned.

csum :: [Exp] -> Exp Source #

Return an expression summing the given expressions. If an empty list is given, the expression 0 is returned.

Primitive value operations

Storing/restoring values in byte sequences

Orphan instances

ToIdent VName Source # 
Instance details

Methods

toIdent :: VName -> SrcLoc -> Id #

ToIdent Name Source # 
Instance details

Methods

toIdent :: Name -> SrcLoc -> Id #

ToExp PrimValue Source # 
Instance details

Methods

toExp :: PrimValue -> SrcLoc -> Exp #

ToExp FloatValue Source # 
Instance details

Methods

toExp :: FloatValue -> SrcLoc -> Exp #

ToExp IntValue Source # 
Instance details

Methods

toExp :: IntValue -> SrcLoc -> Exp #

ToExp VName Source # 
Instance details

Methods

toExp :: VName -> SrcLoc -> Exp #

ToExp SubExp Source # 
Instance details

Methods

toExp :: SubExp -> SrcLoc -> Exp #