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

Futhark.Compiler

Description

High-level API for invoking the Futhark compiler.

Synopsis

Documentation

runPipelineOnProgram :: FutharkConfig -> Pipeline SOACS torep -> FilePath -> FutharkM (Prog torep) Source #

Read a program from the given FilePath, run the given Pipeline, and return it.

runCompilerOnProgram :: FutharkConfig -> Pipeline SOACS rep -> Action rep -> FilePath -> IO () Source #

Read a program from the given FilePath, run the given Pipeline, and finish up with the given Action.

dumpError :: FutharkConfig -> CompilerError -> IO () Source #

Print a compiler error to stdout. The FutharkConfig controls to which degree auxiliary information (e.g. the failing program) is also printed.

handleWarnings :: FutharkConfig -> FutharkM (Warnings, a) -> FutharkM a Source #

Run an operation that produces warnings, and handle them appropriately, yielding the non-warning return value. "Proper handling" means e.g. to print them to the screen, as directed by the compiler configuration.

readProgram :: (MonadError CompilerError m, MonadIO m) => [Name] -> FilePath -> m (Warnings, Imports, VNameSource) Source #

Read and type-check a Futhark program, including all imports.

readProgramOrDie :: MonadIO m => FilePath -> m (Warnings, Imports, VNameSource) Source #

Not verbose, and terminates process on error.

readUntypedProgram :: (MonadError CompilerError m, MonadIO m) => FilePath -> m [(String, UncheckedProg)] Source #

Read and parse (but do not type-check) a Futhark program, including all imports.

readUntypedProgramOrDie :: MonadIO m => FilePath -> m [(String, UncheckedProg)] Source #

Not verbose, and terminates process on error.