hopencl-0.2.0: Haskell bindings for OpenCL

Portabilitynon-portable (GHC extensions)
Stabilityexperimental
MaintainerMartin Dybdal <dybber@dybber.dk>

Foreign.OpenCL.Bindings.Program

Description

Loading and compilation of OpenCL programs.

Synopsis

Documentation

createProgram

Arguments

:: Context

The context to associate the program with

-> String

The program source

-> IO Program

The newly created program

Create a program from a string containing the source code

createProgramWithBinary

Arguments

:: Context

The context to associate the program with

-> [(DeviceID, ByteString)]

Binary program specific to different devices

-> IO Program

The newly created program

Create a program from the ByteStrings obtained from programBinaries

buildProgram

Arguments

:: Program

The program to compile

-> [DeviceID]

List of devices to compile for

-> String

Compiler arguments, see OpenCL specification for possible values.

-> IO () 

Compile a program for a given set of devices.

unloadCompiler :: IO ()

Hints to the OpenCL implementation that the resources allocated by the OpenCL compiler can be released. It does not guarantee that the compiler will not be used in the future or that the compiler will actually be unloaded by the implementation. Calls to buildProgram after unloadCompiler will reload the compiler, if necessary, to build the appropriate program executable.

programContext :: Program -> IO Context

The context to which the Program is associated

programDevices :: Program -> IO [DeviceID]

The devices to which the Program is associated

programSource :: Program -> IO String

The source code of the Program as specified in the call to createProgram. If program is created using createProgramWithBinary, an empty string or the appropriate program source code is returned depending on whether or not the program source code is stored in the binary.

programBinaries :: Program -> IO [(DeviceID, ByteString)]

Collects binaries for an unspecified subset of the devices associated with the Program (depending on which it is compiled to)