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

Copyright[2009..2017] Trevor L. McDonell
LicenseBSD
Safe HaskellSafe
LanguageHaskell98

Foreign.CUDA.Types

Contents

Description

Data types that are equivalent and can be shared freely between the CUDA Runtime and Driver APIs.

Synopsis

Pointers

newtype DevicePtr a Source #

A reference to data stored on the device.

Constructors

DevicePtr 

Fields

Instances

newtype HostPtr a Source #

A reference to page-locked host memory.

A HostPtr is just a plain Ptr, but the memory has been allocated by CUDA into page locked memory. This means that the data can be copied to the GPU via DMA (direct memory access). Note that the use of the system function mlock is not sufficient here --- the CUDA version ensures that the physical address stays this same, not just the virtual address.

To copy data into a HostPtr array, you may use for example withHostPtr together with copyArray or moveArray.

Constructors

HostPtr 

Fields

Instances

Eq (HostPtr a) Source # 

Methods

(==) :: HostPtr a -> HostPtr a -> Bool #

(/=) :: HostPtr a -> HostPtr a -> Bool #

Ord (HostPtr a) Source # 

Methods

compare :: HostPtr a -> HostPtr a -> Ordering #

(<) :: HostPtr a -> HostPtr a -> Bool #

(<=) :: HostPtr a -> HostPtr a -> Bool #

(>) :: HostPtr a -> HostPtr a -> Bool #

(>=) :: HostPtr a -> HostPtr a -> Bool #

max :: HostPtr a -> HostPtr a -> HostPtr a #

min :: HostPtr a -> HostPtr a -> HostPtr a #

Show (HostPtr a) Source # 

Methods

showsPrec :: Int -> HostPtr a -> ShowS #

show :: HostPtr a -> String #

showList :: [HostPtr a] -> ShowS #

Storable (HostPtr a) Source # 

Methods

sizeOf :: HostPtr a -> Int #

alignment :: HostPtr a -> Int #

peekElemOff :: Ptr (HostPtr a) -> Int -> IO (HostPtr a) #

pokeElemOff :: Ptr (HostPtr a) -> Int -> HostPtr a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (HostPtr a) #

pokeByteOff :: Ptr b -> Int -> HostPtr a -> IO () #

peek :: Ptr (HostPtr a) -> IO (HostPtr a) #

poke :: Ptr (HostPtr a) -> HostPtr a -> IO () #

Events

newtype Event Source #

Events are markers that can be inserted into the CUDA execution stream and later queried.

Constructors

Event 

Fields

Instances

Eq Event Source # 

Methods

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

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

Show Event Source # 

Methods

showsPrec :: Int -> Event -> ShowS #

show :: Event -> String #

showList :: [Event] -> ShowS #

Streams

newtype Stream Source #

A processing stream. All operations in a stream are synchronous and executed in sequence, but operations in different non-default streams may happen out-of-order or concurrently with one another.

Use Events to synchronise operations between streams.

Constructors

Stream 

Fields

Instances

type StreamPriority = Int Source #

Priority of an execution stream. Work submitted to a higher priority stream may preempt execution of work already executing in a lower priority stream. Lower numbers represent higher priorities.

data StreamFlag Source #

Possible option flags for stream initialisation. Dummy instance until the API exports actual option values.

defaultStream :: Stream Source #

The main execution stream. No operations overlap with operations in the default stream.