| Copyright | [2016] Trevor L. McDonell |
|---|---|
| License | BSD |
| Safe Haskell | None |
| Language | Haskell2010 |
Foreign.NVVM.Compile
Description
Program compilation
- data Program
- data Result = Result {}
- data CompileOption
- compileModule :: String -> ByteString -> [CompileOption] -> IO Result
- compileModules :: [(String, ByteString)] -> [CompileOption] -> IO Result
- create :: IO Program
- destroy :: Program -> IO ()
- addModule :: Program -> String -> ByteString -> IO ()
- addModuleFromPtr :: Program -> String -> Int -> Ptr Word8 -> IO ()
- compile :: Program -> [CompileOption] -> IO (ByteString, Maybe ByteString)
- verify :: Program -> [CompileOption] -> IO (Status, ByteString)
Documentation
The result of compiling an NVVM program.
Constructors
| Result | |
Fields
| |
data CompileOption Source #
Program compilation options
Constructors
| OptimisationLevel !Int | optimisation level, from 0 (disable optimisations) to 3 (default) |
| Target !Compute | target architecture to compile for (default: compute 2.0) |
| FlushToZero | flush denormal values to zero when performing single-precision floating-point operations (default: no) |
| NoFMA | disable fused-multiply-add instructions (default: enabled) |
| FastSqrt | use a fast approximation for single-precision floating-point square root (default: no) |
| FastDiv | use a fast approximation for single-precision floating-point division and reciprocal (default: no) |
| GenerateDebugInfo | generate debugging information (-g) (default: no) |
Instances
Arguments
| :: String | name of the module |
| -> ByteString | NVVM IR in either textual or bitcode representation |
| -> [CompileOption] | compiler options |
| -> IO Result |
Compile an NVVM IR module, in either bitcode or textual representation, into PTX code.
Arguments
| :: [(String, ByteString)] | (module name, module NVVM IR) pairs to compile |
| -> [CompileOption] | compiler options |
| -> IO Result |
Compile a collection of NVVM IR modules into PTX code
Arguments
| :: Program | NVVM program to add to |
| -> String | Name of the module (defaults to "unnamed" if empty) |
| -> ByteString | NVVM IR module in either bitcode or textual representation |
| -> IO () |
Add a module level NVVM IR to a program
Arguments
| :: Program | NVVM program to add to |
| -> String | Name of the module (defaults to "unnamed" if empty) |
| -> Int | Number of bytes in the module |
| -> Ptr Word8 | NVVM IR module in bitcode or textual representation |
| -> IO () |
As with addModule, but read the specified number of bytes from the given
pointer.
compile :: Program -> [CompileOption] -> IO (ByteString, Maybe ByteString) Source #
Compile the NVVM program. Returns the log from the compiler/verifier and, if successful, the compiled program.
verify :: Program -> [CompileOption] -> IO (Status, ByteString) Source #
Verify the NVVM program. Returns whether compilation will succeed, together with any error or warning messages.