-- | @futhark cuda@
module Futhark.CLI.CUDA (main) where

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

-- | Run @futhark cuda@.
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 CUDA"
  String
"Generate CUDA/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
compileCUDAAction FutharkConfig
fcfg CompilerMode
mode String
outpath) Prog GPUMem
prog