| Copyright | [2016..2023] Trevor L. McDonell |
|---|---|
| License | BSD |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Foreign.NVVM.Compile
Description
Program compilation
Synopsis
- data Program
- data Result = Result {}
- data CompileOption
- compileModule :: ShortByteString -> ByteString -> [CompileOption] -> IO Result
- compileModules :: [(ShortByteString, ByteString)] -> [CompileOption] -> IO Result
- create :: IO Program
- destroy :: Program -> IO ()
- addModule :: Program -> ShortByteString -> ByteString -> IO ()
- addModuleFromPtr :: Program -> ShortByteString -> Int -> Ptr Word8 -> IO ()
- addModuleLazy :: Program -> ShortByteString -> ByteString -> IO ()
- addModuleLazyFromPtr :: Program -> ShortByteString -> Int -> Ptr Word8 -> IO ()
- compile :: Program -> [CompileOption] -> IO (ByteString, Maybe ByteString)
- verify :: Program -> [CompileOption] -> IO (Status, ByteString)
Documentation
An NVVM program
Instances
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
| Show CompileOption Source # | |
Defined in Foreign.NVVM.Compile Methods showsPrec :: Int -> CompileOption -> ShowS # show :: CompileOption -> String # showList :: [CompileOption] -> ShowS # | |
| Eq CompileOption Source # | |
Defined in Foreign.NVVM.Compile Methods (==) :: CompileOption -> CompileOption -> Bool # (/=) :: CompileOption -> CompileOption -> Bool # | |
Arguments
| :: ShortByteString | 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
| :: [(ShortByteString, 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 |
| -> ShortByteString | Name of the module (defaults to " |
| -> 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 |
| -> ShortByteString | Name of the module (defaults to " |
| -> 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.
Arguments
| :: Program | NVVM program to add to |
| -> ShortByteString | Name of the module (defaults to " |
| -> ByteString | NVVM IR module in either bitcode or textual representation |
| -> IO () |
Add a module level NVVM IR to a program.
The module is loaded lazily: only symbols required by modules loaded using
addModule or addModuleFromPtr will be loaded.
Requires CUDA-10.0
Since: 0.9.0.0
Arguments
| :: Program | NVVM program to add to |
| -> ShortByteString | Name of the module (defaults to " |
| -> Int | Number of bytes in the module |
| -> Ptr Word8 | NVVM IR in bitcode or textual representation |
| -> IO () |
As with addModuleLazy, but read the specified number of bytes from the
given pointer (the symbols are loaded lazily, the data in the buffer will be
read immediately).
Requires CUDA-10.0
Since: 0.9.0.0
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.