nvvm-0.8.0.1: FFI bindings to NVVM

Copyright[2016] Trevor L. McDonell
LicenseBSD
Safe HaskellNone
LanguageHaskell2010

Foreign.NVVM.Compile

Description

Program compilation

Synopsis

Documentation

data Program Source #

An NVVM program

data Result Source #

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)

compileModule Source #

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.

compileModules Source #

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

addModule Source #

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 () 

addModuleFromPtr Source #

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.

http://docs.nvidia.com/cuda/libnvvm-api/group__compilation.html#group__compilation_1g76ac1e23f5d0e2240e78be0e63450346

verify :: Program -> [CompileOption] -> IO (Status, ByteString) Source #

Verify the NVVM program. Returns whether compilation will succeed, together with any error or warning messages.