futhark-0.25.7: An optimising compiler for a functional, array-oriented language.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Futhark.CodeGen.Backends.GenericC.Code

Description

Translation of ImpCode Exp and Code to C.

Synopsis

Documentation

compilePrimExp :: Monad m => (v -> m Exp) -> PrimExp v -> m Exp Source #

Tell me how to compile a v, and I'll Compile any PrimExp v for you.

compileCode :: Code op -> CompilerM op s () Source #

compileDest :: VName -> CompilerM op s (VName, [Stm]) Source #

Prepare a destination for function application.

compileArg :: Arg -> CompilerM op s Exp Source #

Compile an argument to a function applicaiton.

compileLMADCopy :: PrimType -> [Count Elements (TExp Int64)] -> (VName, Space) -> (Count Elements (TExp Int64), [Count Elements (TExp Int64)]) -> (VName, Space) -> (Count Elements (TExp Int64), [Count Elements (TExp Int64)]) -> CompilerM op s () Source #

Compile an LMADCopy using sequential nested loops and Code/Write of individual scalars. This always works, but can be pretty slow if those reads and writes are costly.

compileLMADCopyWith :: [Count Elements (TExp Int64)] -> (Exp -> Exp -> CompilerM op s ()) -> (Count Elements (TExp Int64), [Count Elements (TExp Int64)]) -> (Exp -> CompilerM op s Exp) -> (Count Elements (TExp Int64), [Count Elements (TExp Int64)]) -> CompilerM op s () Source #

Compile an LMADCopy using sequential nested loops, but parameterised over how to do the reads and writes.

linearCode :: Code op -> [Code op] Source #