cuda-0.6.7.0: FFI binding to the CUDA interface for programming NVIDIA GPUs

Copyright[2009..2014] Trevor L. McDonell
LicenseBSD
Safe HaskellNone
LanguageHaskell98

Foreign.CUDA.Driver.Exec

Contents

Description

Kernel execution control for low-level driver interface

Synopsis

Kernel Execution

newtype Fun Source

A global device function

Constructors

Fun (Ptr ()) 

data FunParam where Source

Constructors

IArg :: !Int32 -> FunParam 
FArg :: !Float -> FunParam 
VArg :: Storable a => !a -> FunParam 

requires :: Fun -> FunAttribute -> IO Int Source

Returns the value of the selected attribute requirement for the given kernel

setBlockShape :: Fun -> (Int, Int, Int) -> IO () Source

Deprecated: use launchKernel instead

Specify the (x,y,z) dimensions of the thread blocks that are created when the given kernel function is launched.

setSharedSize :: Fun -> Integer -> IO () Source

Deprecated: use launchKernel instead

Set the number of bytes of dynamic shared memory to be available to each thread block when the function is launched

setParams :: Fun -> [FunParam] -> IO () Source

Deprecated: use launchKernel instead

Set the parameters that will specified next time the kernel is invoked

setCacheConfigFun :: Fun -> Cache -> IO () Source

On devices where the L1 cache and shared memory use the same hardware resources, this sets the preferred cache configuration for the given device function. This is only a preference; the driver is free to choose a different configuration as required to execute the function.

Switching between configuration modes may insert a device-side synchronisation point for streamed kernel launches.

launch :: Fun -> (Int, Int) -> Maybe Stream -> IO () Source

Deprecated: use launchKernel instead

Invoke the kernel on a size (w,h) grid of blocks. Each block contains the number of threads specified by a previous call to setBlockShape. The launch may also be associated with a specific Stream.

launchKernel Source

Arguments

:: Fun

function to execute

-> (Int, Int, Int)

block grid dimension

-> (Int, Int, Int)

thread block shape

-> Int

shared memory (bytes)

-> Maybe Stream

(optional) stream to execute in

-> [FunParam]

list of function parameters

-> IO () 

Invoke a kernel on a (gx * gy * gz) grid of blocks, where each block contains (tx * ty * tz) threads and has access to a given number of bytes of shared memory. The launch may also be associated with a specific Stream.

In launchKernel, the number of kernel parameters and their offsets and sizes do not need to be specified, as this information is retrieved directly from the kernel's image. This requires the kernel to have been compiled with toolchain version 3.2 or later.

The alternative launchKernel' will pass the arguments in directly, requiring the application to know the size and alignment/padding of each kernel parameter.

launchKernel' Source

Arguments

:: Fun

function to execute

-> (Int, Int, Int)

block grid dimension

-> (Int, Int, Int)

thread block shape

-> Int

shared memory (bytes)

-> Maybe Stream

(optional) stream to execute in

-> [FunParam]

list of function parameters

-> IO () 

Invoke a kernel on a (gx * gy * gz) grid of blocks, where each block contains (tx * ty * tz) threads and has access to a given number of bytes of shared memory. The launch may also be associated with a specific Stream.

In launchKernel, the number of kernel parameters and their offsets and sizes do not need to be specified, as this information is retrieved directly from the kernel's image. This requires the kernel to have been compiled with toolchain version 3.2 or later.

The alternative launchKernel' will pass the arguments in directly, requiring the application to know the size and alignment/padding of each kernel parameter.