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

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.

prettyProgErrors :: NonEmpty ProgError -> Doc AnsiStyle Source #

Prettyprint program errors as suitable for showing on a text console.

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

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

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

Read and type-check a Futhark library, comprising multiple files, 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.