futhark-0.25.32: An optimising compiler for a functional, array-oriented language.

Safe Haskell | None
Language | GHC2021

Futhark.Compiler.CLI

Description

Convenient common interface for command line Futhark compilers. Using this module ensures that all compilers take the same options. A small amount of flexibility is provided for backend-specific options.

Synopsis

- compilerMain :: cfg -> [CompilerOption cfg] -> String -> String -> Pipeline SOACS rep -> (FutharkConfig -> cfg -> CompilerMode -> FilePath -> Prog rep -> FutharkM ()) -> String -> [String] -> IO ()
- type CompilerOption cfg = OptDescr (Either (IO ()) (cfg -> cfg))
- data CompilerMode
  - = ToLibrary
  - | ToExecutable
  - | ToServer
- module Futhark.Pipeline
- module Futhark.Compiler

# Documentation

compilerMain Source #

Arguments

:: cfg | Initial configuration.
-> [CompilerOption cfg] | Options that affect the configuration.
-> String | The short action name (e.g. "compile to C").
-> String | The longer action description.
-> Pipeline SOACS rep | The pipeline to use.
-> (FutharkConfig -> cfg -> CompilerMode -> FilePath -> Prog rep -> FutharkM ()) | The action to take on the result of the pipeline.
-> String | Program name
-> [String] | Command line arguments.
-> IO () |

Run a parameterised Futhark compiler, where `cfg` is a user-given configuration type. Call this from `main`.

type CompilerOption cfg = OptDescr (Either (IO ()) (cfg -> cfg)) Source #

An option that modifies the configuration of type `cfg`.

data CompilerMode Source #

Are we compiling a library or an executable?

Constructors

ToLibrary |
ToExecutable |
ToServer |

#### Instances

Instances details

Show CompilerMode Source # |
Instance details Defined in Futhark.Compiler.Config Methods showsPrec :: Int -> CompilerMode -> ShowS Source # show :: CompilerMode -> String Source # showList :: [CompilerMode] -> ShowS Source #
Eq CompilerMode Source # |
Instance details Defined in Futhark.Compiler.Config Methods (==) :: CompilerMode -> CompilerMode -> Bool Source # (/=) :: CompilerMode -> CompilerMode -> Bool Source #
Ord CompilerMode Source # |

Instance details

Defined in Futhark.Compiler.Config

Methods

compare :: CompilerMode -> CompilerMode -> Ordering Source #

(<) :: CompilerMode -> CompilerMode -> Bool Source #

(<=) :: CompilerMode -> CompilerMode -> Bool Source #

(>) :: CompilerMode -> CompilerMode -> Bool Source #

(>=) :: CompilerMode -> CompilerMode -> Bool Source #

max :: CompilerMode -> CompilerMode -> CompilerMode Source #

min :: CompilerMode -> CompilerMode -> CompilerMode Source #

module Futhark.Pipeline

module Futhark.Compiler