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

Futhark.Compiler

Description

High-level API for invoking the Futhark compiler.

Synopsis

Documentation

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

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

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

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

data FutharkConfig Source #

The compiler configuration. This only contains options related to core compiler functionality, such as reading the initial program and running passes. Options related to code generation are handled elsewhere.

Constructors

FutharkConfig 

Fields

newFutharkConfig :: FutharkConfig Source #

The default compiler configuration.

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.