    -- | @futhark hip@
    module Futhark.CLI.HIP (main) where

    import Futhark.Actions (compileHIPAction)
    import Futhark.Compiler.CLI
    import Futhark.Passes (gpumemPipeline)

    -- | Run @futhark hip@.
    main :: String -> [String] -> IO ()
    main :: String -> [String] -> IO ()
    main = ()
    -> [CompilerOption ()]
    -> String
    -> String
    -> Pipeline SOACS GPUMem
    -> (FutharkConfig
        -> () -> CompilerMode -> String -> Prog GPUMem -> FutharkM ())
    -> String
    -> [String]
    -> IO ()
    forall cfg rep.
    cfg
    -> [CompilerOption cfg]
    -> String
    -> String
    -> Pipeline SOACS rep
    -> (FutharkConfig
        -> cfg -> CompilerMode -> String -> Prog rep -> FutharkM ())
    -> String
    -> [String]
    -> IO ()
    compilerMain
      ()
      []
      String
    "Compile HIP"
      String
    "Generate HIP/C code from optimised Futhark program."
      Pipeline SOACS GPUMem
    gpumemPipeline
      ((FutharkConfig
      -> () -> CompilerMode -> String -> Prog GPUMem -> FutharkM ())
     -> String -> [String] -> IO ())
    -> (FutharkConfig
        -> () -> CompilerMode -> String -> Prog GPUMem -> FutharkM ())
    -> String
    -> [String]
    -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \FutharkConfig
    fcfg () CompilerMode
    mode String
    outpath Prog GPUMem
    prog ->
        Action GPUMem -> Prog GPUMem -> FutharkM ()
    forall rep. Action rep -> Prog rep -> FutharkM ()
    actionProcedure (FutharkConfig -> CompilerMode -> String -> Action GPUMem
    compileHIPAction FutharkConfig
    fcfg CompilerMode
    mode String
    outpath) Prog GPUMem
    prog