Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Futhark.Compiler
Description
High-level API for invoking the Futhark compiler.
Synopsis
- runPipelineOnProgram :: FutharkConfig -> Pipeline SOACS tolore -> FilePath -> FutharkM (Prog tolore)
- runCompilerOnProgram :: FutharkConfig -> Pipeline SOACS lore -> Action lore -> FilePath -> IO ()
- data FutharkConfig = FutharkConfig {}
- newFutharkConfig :: FutharkConfig
- dumpError :: FutharkConfig -> CompilerError -> IO ()
- handleWarnings :: FutharkConfig -> FutharkM (Warnings, a) -> FutharkM a
- module Futhark.Compiler.Program
- readProgram :: (MonadError CompilerError m, MonadIO m) => [Name] -> FilePath -> m (Warnings, Imports, VNameSource)
- readProgramOrDie :: MonadIO m => FilePath -> m (Warnings, Imports, VNameSource)
- readUntypedProgram :: (MonadError CompilerError m, MonadIO m) => FilePath -> m [(String, UncheckedProg)]
- readUntypedProgramOrDie :: MonadIO m => FilePath -> m [(String, UncheckedProg)]
Documentation
runPipelineOnProgram :: FutharkConfig -> Pipeline SOACS tolore -> FilePath -> FutharkM (Prog tolore) Source #
runCompilerOnProgram :: FutharkConfig -> Pipeline SOACS lore -> Action lore -> FilePath -> IO () Source #
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.
module Futhark.Compiler.Program
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.