nvvm-0.10.0.0: 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

Instances

Instances details
Eq Program Source # 
Instance details

Defined in Foreign.NVVM.Compile

Methods

(==) :: Program -> Program -> Bool #

(/=) :: Program -> Program -> Bool #

Show Program Source # 
Instance details

Defined in Foreign.NVVM.Compile

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)

Instances

Instances details
Eq CompileOption Source # 
Instance details

Defined in Foreign.NVVM.Compile

Show CompileOption Source # 
Instance details

Defined in Foreign.NVVM.Compile

compileModule Source #

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.

compileModules Source #

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

addModule Source #

Arguments

:: Program

NVVM program to add to

-> ShortByteString

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

-> ShortByteString

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.

addModuleLazy Source #

Arguments

:: Program

NVVM program to add to

-> ShortByteString

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.

The module is loaded lazily: only symbols required by modules loaded using addModule or addModuleFromPtr will be loaded.

Requires CUDA-10.0

https://docs.nvidia.com/cuda/libnvvm-api/group__compilation.html#group__compilation_1g5356ce5063db232cd4330b666c62219b

Since: 0.9.0.0

addModuleLazyFromPtr Source #

Arguments

:: Program

NVVM program to add to

-> ShortByteString

Name of the module (defaults to "<unnamed>" if empty)

-> 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.

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.