hopencl-0.2.0: Haskell bindings for OpenCL

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

Foreign.OpenCL.Bindings.MemoryObject

Description

OpenCL bindings for manipulating memory objects. See section 5.2 in the OpenCL specification

Synopsis

Documentation

mallocArray

Arguments

:: Storable a 
=> Context

The Context to which the MemObject should be associated.

-> [MemFlags]

A list of MemFlags determining permissions etc. for the MemObject

-> Int

The number of elements to allocate memory for.

-> IO (MemObject a)

The type (and there by size) of elements is determined by the result type.

Allocates a device memory object.

allocaArray

Arguments

:: Storable a 
=> Context

The Context to which the MemObject should be associated.

-> [MemFlags]

A list of MemFlags determining permissions etc. for the MemObject

-> Int

The number of elements to allocate memory for.

-> (MemObject a -> IO b)

The function where the MemObject should be available

-> IO b 

Allocates a device memory object temporarily, and makes it available for the argument function.

free :: MemObject a -> IO ()

Deallocates a memory object.

peekArray

Arguments

:: Storable a 
=> CommandQueue

The CommandQueue in which this action should be queued

-> Int

The offset inside the MemObject where the first element should be read. (In number of elements, not bytes)

-> Int

The number of elements to read.

-> MemObject a

The MemObject to read from.

-> Ptr a

A pointer where the elements read should be stored.

-> IO () 

Moves the content of a memory object from device to host exposing it as C array.

peekListArray

Arguments

:: Storable a 
=> CommandQueue 
-> Int

The number of elements to read.

-> MemObject a 
-> IO [a] 

Moves the content of a memory object from device to host exposing it as Haskell List.

pokeArray

Arguments

:: Storable a 
=> CommandQueue 
-> Int

The offset inside the MemObject where the first element should be written. (In number of elements, not bytes)

-> Int

The number of elements to write.

-> Ptr a

A pointer where the elements should be read from

-> MemObject a

The MemObject to write the elements to

-> IO () 

Moves a host side C array to a device-side memory object

pokeListArray :: Storable a => CommandQueue -> [a] -> MemObject a -> IO ()

Moves a host side Haskell list to a device-side memory object

newListArray :: Storable a => Context -> [a] -> IO (MemObject a)

Create a memory object containing the specified list of elements.

newListArrayLen :: Storable a => Context -> [a] -> IO (MemObject a, Int)

Create a memory object containing the specified list of elements, returning the memory object together with the number of elements in the list.

withListArray :: Storable a => Context -> [a] -> (MemObject a -> IO b) -> IO b

withListArrayLen :: Storable a => Context -> [a] -> (Int -> MemObject a -> IO b) -> IO b

memobjType :: MemObject a -> IO MemObjectType

The type of a memory object

memobjFlags :: MemObject a -> IO [MemFlags]

The flags specified when a memory object was allocated

memobjSize :: MemObject a -> IO CSize

The size of a memory object

memobjContext :: MemObject a -> IO Context

The Context this memory object is associated with.