-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | The OpenCL Standard for heterogenous data-parallel computing -- -- The OpenCL system for open heterogenous data parallel supercomputing. -- **General Notes on the differences between Haskell and the OpenCL-C -- implementation** * Side-effectful procedures capable of returning an -- error code only return a Maybe ErrorCode, with Nothing returned upon -- success * Procedures which follow the pattern of returning a pointer -- to an object and taking a final parameter as an error code instead -- return Either ErrorCode ObjectType * Procedures which prefix with -- clGetInfo* merely take the object, parameter name, and parameter size -- to allocate. The allocation handled by OpenCLRaw and returned as a -- Haskell-managed ForeignPtr () * Enumerations and constants are -- replaced by newtypes for the sake of type-safety. @package OpenCLRaw @version 1.0.1001 -- | Declaration of types, bounds and constants for OpenCL 1.0 module System.OpenCL.Raw.V10.Types data PlatformIDc PlatformIDc :: PlatformIDc data DeviceIDc DeviceIDc :: DeviceIDc data Contextc Contextc :: Contextc data CommandQueuec CommandQueuec :: CommandQueuec data Memc Memc :: Memc data Programc Programc :: Programc data Kernelc Kernelc :: Kernelc data Eventc Eventc :: Eventc data Samplerc Samplerc :: Samplerc data ImageFormatc ImageFormatc :: ImageFormatc type ContextProperties = Ptr CLint type PlatformID = Ptr PlatformIDc type DeviceID = Ptr DeviceIDc type Context = Ptr Contextc type CommandQueue = Ptr CommandQueuec type Mem = Ptr Memc type Program = Ptr Programc type Event = Ptr Eventc type Sampler = Ptr Samplerc type Kernel = Ptr Kernelc type CLsizei = CSize type CLint = CInt type CLuint = CUInt type CLbool = CLuint type CLulong = CULong type CLbitfield = CLulong type ImageFormatp = Ptr ImageFormat type ImageFormat = (ChannelOrder, ChannelType) newtype ChannelOrder ChannelOrder :: CLuint -> ChannelOrder newtype ChannelType ChannelType :: CLuint -> ChannelType newtype DeviceType DeviceType :: CLbitfield -> DeviceType newtype ContextInfo ContextInfo :: CLuint -> ContextInfo newtype CommandQueueProperties CommandQueueProperties :: CLbitfield -> CommandQueueProperties newtype CommandQueueInfo CommandQueueInfo :: CLuint -> CommandQueueInfo newtype ErrorCode ErrorCode :: CLint -> ErrorCode newtype EventInfo EventInfo :: CLuint -> EventInfo newtype ProfilingInfo ProfilingInfo :: CLuint -> ProfilingInfo newtype KernelInfo KernelInfo :: CLuint -> KernelInfo newtype KernelWorkGroupInfo KernelWorkGroupInfo :: CLuint -> KernelWorkGroupInfo newtype MapFlags MapFlags :: CLbitfield -> MapFlags newtype MemFlags MemFlags :: CLbitfield -> MemFlags newtype MemObjectType MemObjectType :: CLuint -> MemObjectType newtype MemInfo MemInfo :: CLuint -> MemInfo newtype ImageInfo ImageInfo :: CLuint -> ImageInfo newtype PlatformInfo PlatformInfo :: CLuint -> PlatformInfo newtype SamplerInfo SamplerInfo :: CLuint -> SamplerInfo newtype AddressingMode AddressingMode :: CLuint -> AddressingMode newtype FilterMode FilterMode :: CLuint -> FilterMode newtype ProgramInfo ProgramInfo :: CLuint -> ProgramInfo newtype ProgramBuildInfo ProgramBuildInfo :: CLuint -> ProgramBuildInfo newtype BuildStatus BuildStatus :: CLint -> BuildStatus newtype DeviceInfo DeviceInfo :: CLuint -> DeviceInfo newtype DeviceFPConfig DeviceFPConfig :: CLbitfield -> DeviceFPConfig clQueueOutOfOrderExecModeEnable :: CommandQueueProperties clQueueProfilingEnable :: CommandQueueProperties clQueueContext :: CommandQueueInfo clQueueDevice :: CommandQueueInfo clQueueReferenceCount :: CommandQueueInfo clQueueProperties :: CommandQueueInfo clDeviceType :: DeviceInfo clDeviceVendorID :: DeviceInfo clDeviceMaxComputeUnits :: DeviceInfo clDeviceMaxWorkItemDimensions :: DeviceInfo clDeviceMaxWorkGroupSize :: DeviceInfo clDeviceMaxWorkItemSizes :: DeviceInfo clDevicePreferredVectorWidthChar :: DeviceInfo clDevicePreferredVectorWidthShort :: DeviceInfo clDevicePreferredVectorWidthInt :: DeviceInfo clDevicePreferredVectorWidthLong :: DeviceInfo clDevicePreferredVectorWidthFloat :: DeviceInfo clDevicePreferredVectorWidthDouble :: DeviceInfo clDeviceMaxClockFrequency :: DeviceInfo clDeviceAddressBits :: DeviceInfo clDeviceMaxReadImageArgs :: DeviceInfo clDeviceMaxWriteImageArgs :: DeviceInfo clDeviceMaxMemAllocSize :: DeviceInfo clDeviceImage2DMaxWidth :: DeviceInfo clDeviceImage2DMaxHeight :: DeviceInfo clDeviceImage3DMaxWidth :: DeviceInfo clDeviceImage3DMaxHeight :: DeviceInfo clDeviceImage3DMaxDepth :: DeviceInfo clDeviceImageSupport :: DeviceInfo clDeviceMaxParameterSize :: DeviceInfo clDeviceMaxSamplers :: DeviceInfo clDeviceMemBaseAddrAlign :: DeviceInfo clDeviceMinDataTypeAlignSize :: DeviceInfo clDeviceSingleFPConfig :: DeviceInfo clDeviceGlobalMemCacheType :: DeviceInfo clDeviceGlobalMemCacheLineSize :: DeviceInfo clDeviceGlobalMemCacheSize :: DeviceInfo clDeviceGlobalMemSize :: DeviceInfo clDeviceMaxConstantBuffersize :: DeviceInfo clDeviceMaxConstantArgs :: DeviceInfo clDeviceMLocalMemType :: DeviceInfo clDeviceLocalMemSize :: DeviceInfo clDeviceErrorCorrectionSupport :: DeviceInfo clDeviceProfilingTimerResolution :: DeviceInfo clDeviceEndianLittle :: DeviceInfo clDeviceAvailable :: DeviceInfo clDeviceCompilerAvailable :: DeviceInfo clDeviceExecutionCapabilities :: DeviceInfo clDeviceQueueProperties :: DeviceInfo clDeviceName :: DeviceInfo clDeviceVendor :: DeviceInfo clDriverVersion :: DeviceInfo clDeviceProfile :: DeviceInfo clDeviceVersion :: DeviceInfo clDeviceExtensions :: DeviceInfo clDevicePlatform :: DeviceInfo clFPDenorm :: DeviceFPConfig clFPInfNan :: DeviceFPConfig clFPRoundToNearest :: DeviceFPConfig clFPRoundToZero :: DeviceFPConfig clFPRoundToInf :: DeviceFPConfig clFPFMA :: DeviceFPConfig clEventCommandQueue :: EventInfo clEventCommandType :: EventInfo clEventReferenceCount :: EventInfo clEventCommandExecutionStatus :: EventInfo clProfilingCommandQueued :: ProfilingInfo clProfilingCommandSubmit :: ProfilingInfo clProfilingCommandStart :: ProfilingInfo clProfilingCommandEnd :: ProfilingInfo clDeviceTypeDefault :: DeviceType clDeviceTypeCPU :: DeviceType clDeviceTypeGPU :: DeviceType clDeviceTypeAccelerator :: DeviceType clDeviceTypeAll :: DeviceType clContextReferenceCount :: ContextInfo clContextDevices :: ContextInfo clContextProperties :: ContextInfo clKernelFunctionName :: KernelInfo clKernelNumFlags :: KernelInfo clKernelReferenceCount :: KernelInfo clKernelContext :: KernelInfo clKernelProgram :: KernelInfo clKernelWorkGroupSize :: KernelWorkGroupInfo clKernelCompileWorkGroupSize :: KernelWorkGroupInfo clKernelLocalMemSize :: KernelWorkGroupInfo clMemReadWrite :: MemFlags clMemWriteOnly :: MemFlags clMemReadOnly :: MemFlags clMemUseHostPtr :: MemFlags clMemAllocHostPtr :: MemFlags clMemCopyHostPtr :: MemFlags clR :: ChannelOrder clA :: ChannelOrder clRG :: ChannelOrder clRA :: ChannelOrder clRGB :: ChannelOrder clRGBA :: ChannelOrder clBGRA :: ChannelOrder clARGB :: ChannelOrder clIntensity :: ChannelOrder clLuminance :: ChannelOrder clSNormInt8 :: ChannelType clSNormInt16 :: ChannelType clUNormInt8 :: ChannelType clUNormInt16 :: ChannelType clUNormShort565 :: ChannelType clUNormShort555 :: ChannelType clUNormInt101010 :: ChannelType clSignedInt8 :: ChannelType clSignedInt16 :: ChannelType clSignedInt32 :: ChannelType clUnsignedInt8 :: ChannelType clUnsignedInt16 :: ChannelType clUnsignedInt32 :: ChannelType clHalfFloat :: ChannelType clFloat :: ChannelType clMemObjectBuffer :: MemObjectType clMemObjectImage2D :: MemObjectType clMemObjectImage3D :: MemObjectType clMemType :: MemInfo clMemFlags :: MemInfo clMemSize :: MemInfo clMemHostPtr :: MemInfo clMemMapCount :: MemInfo clMemReferenceCount :: MemInfo clMemContext :: MemInfo clImageFormat :: ImageInfo clImageElementSize :: ImageInfo clImageRowPitch :: ImageInfo clImageSlicePitch :: ImageInfo clImageWidth :: ImageInfo clImageHeight :: ImageInfo clImageDepth :: ImageInfo clMapRead :: MapFlags clMapWrite :: MapFlags clPlatformProfile :: PlatformInfo clPlatformVersion :: PlatformInfo clPlatformName :: PlatformInfo clPlatformVendor :: PlatformInfo clPlatformExtensions :: PlatformInfo clProgramReferenceCount :: ProgramInfo clProgramContext :: ProgramInfo clProgramNumDevices :: ProgramInfo clProgramDevices :: ProgramInfo clProgramSource :: ProgramInfo clProgramBinarySizes :: ProgramInfo clProgramBinaries :: ProgramInfo clProgramBuildStatus :: ProgramBuildInfo clProgramBuildOptions :: ProgramBuildInfo clProgramBuildLog :: ProgramBuildInfo clBuildSuccess :: BuildStatus clBuildNone :: BuildStatus clBuildError :: BuildStatus clBuildInProgress :: BuildStatus clAddressNone :: AddressingMode clAddressClampToEdge :: AddressingMode clAddressClamp :: AddressingMode clAddressRepeat :: AddressingMode clSamplerReferenceCount :: SamplerInfo clSamplerContext :: SamplerInfo clSamplerNormalizedCoords :: SamplerInfo clSamplerAddressingMode :: SamplerInfo clSamplerFilterMode :: SamplerInfo instance Eq ErrorCode instance Ord ErrorCode instance Show ErrorCode instance Read ErrorCode -- | A collection of all the error codes that OpenCL functions return module System.OpenCL.Raw.V10.Errors clSuccess :: ErrorCode clDeviceNotFound :: ErrorCode clDeviceNotAvailable :: ErrorCode clCompilerNotAvailable :: ErrorCode clMemObjectAllocationFailure :: ErrorCode clOutOfResources :: ErrorCode clOutOfHostMemory :: ErrorCode clProfilingInfoNotAvailable :: ErrorCode clMemCopyOverlap :: ErrorCode clImageFormatMismatch :: ErrorCode clImageFormatNotSupported :: ErrorCode clBuildProgramFailure :: ErrorCode clMapFailure :: ErrorCode clInvalidValue :: ErrorCode clInvalidDeviceType :: ErrorCode clInvalidPlatform :: ErrorCode clInvalidDevice :: ErrorCode clInvalidContext :: ErrorCode clInvalidQueueProperties :: ErrorCode clInvalidCommandQueue :: ErrorCode clInvalidHostPtr :: ErrorCode clInvalidMemObject :: ErrorCode clInvalidImageFormatDescriptor :: ErrorCode clInvalidImageSize :: ErrorCode clInvalidSampler :: ErrorCode clInvalidBinary :: ErrorCode clInvalidBuildOptions :: ErrorCode clInvalidProgram :: ErrorCode clInvalidProgramExecutable :: ErrorCode clInvalidKernelName :: ErrorCode clInvalidKernelDefinition :: ErrorCode clInvalidKernel :: ErrorCode clInvalidArgIndex :: ErrorCode clInvalidArgValue :: ErrorCode clInvalidArgSize :: ErrorCode clInvalidKernelArgs :: ErrorCode clInvalidWorkDimension :: ErrorCode clInvalidWorkGroupSize :: ErrorCode clInvalidWorkItemSize :: ErrorCode clInvalidGlobalOffset :: ErrorCode clInvalidEventWaitList :: ErrorCode clInvalidEvent :: ErrorCode clInvalidOperation :: ErrorCode clInvalidGLObject :: ErrorCode clInvalidBufferSize :: ErrorCode -- | Conforms to section 4.3 of the OpenCL 1.0 specification module System.OpenCL.Raw.V10.Context clCreateContext :: [ContextProperties] -> [DeviceID] -> ContextCallback -> Ptr () -> IO (Either ErrorCode Context) type ContextCallback = CString -> Ptr () -> CLsizei -> Ptr () -> IO () clCreateContextFromType :: [ContextProperties] -> DeviceType -> ContextCallback -> Ptr () -> IO (Either ErrorCode Context) clRetainContext :: Context -> IO (Maybe ErrorCode) clReleaseContext :: Context -> IO (Maybe ErrorCode) clGetContextInfo :: Context -> ContextInfo -> CLsizei -> IO (Either ErrorCode (ForeignPtr (), CLsizei)) -- | Conforms to section 4.2 of the OpenCL 1.0 specification module System.OpenCL.Raw.V10.DeviceInfo clGetDeviceIDs :: PlatformID -> DeviceType -> CLuint -> IO (Either ErrorCode [DeviceID]) clGetDeviceInfo :: DeviceID -> DeviceInfo -> CLsizei -> IO (Either ErrorCode (ForeignPtr (), CLsizei)) -- | Module for querying extensions module System.OpenCL.Raw.V10.Etc clGetExtensionFunctionAddress :: String -> IO (Ptr ()) -- | Conforms to section 5.7 of the OpenCL 1.0 specification module System.OpenCL.Raw.V10.EventObject clWaitForEvents :: [Event] -> IO (Maybe ErrorCode) clGetEventInfo :: Event -> EventInfo -> CLsizei -> IO (Either ErrorCode (ForeignPtr (), CLsizei)) clRetainEvent :: Event -> IO (Maybe ErrorCode) clReleaseEvent :: Event -> IO (Maybe ErrorCode) clGetEventProfilingInfo :: Event -> ProfilingInfo -> CLsizei -> IO (Either ErrorCode (ForeignPtr (), CLsizei)) -- | Conforms to section 5.10 of the OpenCL 1.0 specification module System.OpenCL.Raw.V10.FlushFinish clFlush :: CommandQueue -> IO (Maybe ErrorCode) clFinish :: CommandQueue -> IO (Maybe ErrorCode) -- | Conforms to section 5.5 of the OpenCL 1.0 specification module System.OpenCL.Raw.V10.Kernel clCreateKernel :: Program -> CString -> IO (Either ErrorCode Kernel) clCreateKernelsInProgram :: Program -> CLuint -> IO (Either ErrorCode [Kernel]) clRetainKernel :: Kernel -> IO (Maybe ErrorCode) clReleaseKernel :: Kernel -> IO (Maybe ErrorCode) clGetKernelInfo :: Kernel -> KernelInfo -> CLsizei -> IO (Either ErrorCode (ForeignPtr (), CLsizei)) clGetKernelWorkGroupInfo :: Kernel -> DeviceID -> KernelWorkGroupInfo -> CLsizei -> IO (Either ErrorCode (ForeignPtr (), CLsizei)) clEnqueueNDRangeKernel :: CommandQueue -> Kernel -> [CLsizei] -> [CLsizei] -> [Event] -> IO (Either ErrorCode Event) clEnqueueTask :: CommandQueue -> Kernel -> [Event] -> IO (Either ErrorCode Event) clEnqueueNativeKernel :: NKCallbackFunction -> Ptr () -> CLsizei -> [Mem] -> [Ptr ()] -> [Event] -> IO (Either ErrorCode Event) -- | Conforms to section 5.2 of the OpenCL 1.0 specification module System.OpenCL.Raw.V10.MemoryObject clCreateBuffer :: Context -> MemFlags -> CLsizei -> Ptr () -> IO (Either ErrorCode Mem) clCreateImage2D :: Context -> MemFlags -> ImageFormat -> CLsizei -> CLsizei -> CLsizei -> Ptr () -> IO (Either ErrorCode Mem) clCreateImage3D :: Context -> MemFlags -> ImageFormat -> CLsizei -> CLsizei -> CLsizei -> CLsizei -> CLsizei -> Ptr () -> IO (Either ErrorCode Mem) clRetainMemObject :: Mem -> IO (Maybe ErrorCode) clReleaseMemObject :: Mem -> IO (Maybe ErrorCode) clGetSupportedImageFormats :: Context -> MemFlags -> MemObjectType -> IO (Either ErrorCode [ImageFormat]) clGetMemObjectInfo :: Mem -> MemInfo -> CLsizei -> IO (Either ErrorCode (ForeignPtr (), CLsizei)) clGetImageInfo :: Mem -> MemInfo -> CLsizei -> IO (Either ErrorCode (ForeignPtr (), CLsizei)) clEnqueueReadBuffer :: Mem -> Bool -> CLsizei -> CLsizei -> Ptr () -> CommandQueue -> [Event] -> IO (Either ErrorCode Event) clEnqueueWriteBuffer :: Mem -> Bool -> CLsizei -> CLsizei -> Ptr () -> CommandQueue -> [Event] -> IO (Either ErrorCode Event) clEnqueueCopyBuffer :: Mem -> Mem -> CLsizei -> CLsizei -> CLsizei -> CommandQueue -> [Event] -> IO (Either ErrorCode Event) clEnqueueReadImage :: Mem -> Bool -> (CLsizei, CLsizei, CLsizei) -> (CLsizei, CLsizei, CLsizei) -> CLsizei -> CLsizei -> Ptr () -> CommandQueue -> [Event] -> IO (Either ErrorCode Event) clEnqueueWriteImage :: Mem -> Bool -> (CLsizei, CLsizei, CLsizei) -> (CLsizei, CLsizei, CLsizei) -> CLsizei -> CLsizei -> Ptr () -> CommandQueue -> [Event] -> IO (Either ErrorCode Event) clEnqueueCopyImage :: Mem -> Mem -> ImageDims -> ImageDims -> ImageDims -> CommandQueue -> [Event] -> IO (Either ErrorCode Event) clEnqueueCopyImageToBuffer :: Mem -> Mem -> ImageDims -> ImageDims -> CLsizei -> CommandQueue -> [Event] -> IO (Either ErrorCode Event) clEnqueueCopyBufferToImage :: Mem -> Mem -> CLsizei -> ImageDims -> ImageDims -> CommandQueue -> [Event] -> IO (Either ErrorCode Event) clEnqueueMapBuffer :: Mem -> Bool -> MapFlags -> CLsizei -> CLsizei -> CommandQueue -> [Event] -> IO (Either ErrorCode (Ptr (), Event)) clEnqueueMapImage :: Mem -> Bool -> MapFlags -> ImageDims -> ImageDims -> CommandQueue -> [Event] -> IO (Either ErrorCode (Ptr (), CLsizei, CLsizei, Event)) clEnqueueUnmapMemObject :: Mem -> Ptr () -> CommandQueue -> [Event] -> IO (Either ErrorCode Event) -- | Conforms to section 5.8 of the OpenCL 1.0 specification module System.OpenCL.Raw.V10.OutOfOrder clEnqueueMarker :: CommandQueue -> IO (Either ErrorCode Event) clEnqueueWaitForEvents :: CommandQueue -> [Event] -> IO (Maybe ErrorCode) clEnqueueBarrier :: CommandQueue -> IO (Maybe ErrorCode) -- | Conforms to section 4.1 of the OpenCL 1.0 specification module System.OpenCL.Raw.V10.PlatformInfo clGetPlatformIDs :: CLuint -> IO (Either ErrorCode [PlatformID]) clGetPlatformInfo :: PlatformID -> PlatformInfo -> CLsizei -> Ptr () -> IO (Either ErrorCode CLsizei) -- | Conforms to section 5.4 of the OpenCL 1.0 specification module System.OpenCL.Raw.V10.ProgramObject clCreateProgramWithSource :: Context -> String -> IO (Either ErrorCode Program) clCreateProgramWithBinary :: Context -> [(DeviceID, ByteString)] -> IO (Either ErrorCode Program) clRetainProgram :: Program -> IO (Maybe ErrorCode) clReleaseProgram :: Program -> IO (Maybe ErrorCode) clBuildProgram :: Program -> [DeviceID] -> String -> BuildProgramCallback -> Ptr () -> IO (Maybe ErrorCode) clUnloadCompiler :: IO (Maybe ErrorCode) clGetProgramInfo :: Program -> ProgramInfo -> CLsizei -> IO (Either ErrorCode (ForeignPtr (), CLsizei)) clGetProgramBuildInfo :: Program -> ProgramBuildInfo -> CLsizei -> IO (Either ErrorCode (ForeignPtr (), CLsizei)) -- | Conforms to section 5.3 of the OpenCL 1.0 specification module System.OpenCL.Raw.V10.Sampler clCreateSampler :: Context -> Bool -> AddressingMode -> FilterMode -> IO (Either ErrorCode Sampler) clRetainSampler :: Sampler -> IO (Maybe ErrorCode) clReleaseSampler :: Sampler -> IO (Maybe ErrorCode) clGetSamplerInfo :: Sampler -> SamplerInfo -> CLsizei -> Ptr () -> IO (Either ErrorCode CLsizei) -- | Corresponds to section 5.1, Command Queues of the OpenCL 1.0 -- specifications. module System.OpenCL.Raw.V10.CommandQueue clCreateCommandQueue :: Context -> DeviceID -> CommandQueueProperties -> IO (Either ErrorCode CommandQueue) clRetainCommandQueue :: CommandQueue -> IO (Maybe ErrorCode) clGetCommandQueueInfo :: CommandQueue -> CommandQueueInfo -> CLsizei -> IO (Either ErrorCode (ForeignPtr (), CLsizei)) clSetCommandQueueProperty :: CommandQueue -> CommandQueueProperties -> Bool -> IO (Either ErrorCode CommandQueueProperties) -- | The OpenCL system for open heterogenous data parallel supercomputing. -- -- Wrapper to the FFI written and maintained by Jeff Heard of the -- Renaissance Computing Institute mailto:jeff@renci.org -- -- From the introduction: -- -- OpenCL (Open Computing Language) is an open royalty-free standard for -- general purpose parallel programming across CPUs, GPUs and other -- processors, giving software developers portable and efficient access -- to the power of these heterogeneous processing platforms. -- -- OpenCL supports a wide range of applications, ranging from embedded -- and consumer software to HPC solutions, through a low-level, -- high-performance, portable abstraction. By creating an efficient, -- close-to-the-metal programming interface, OpenCL will form the -- foundation layer of a parallel computing ecosystem of -- platform-independent tools, middleware and applications. OpenCL is -- particularly suited to play an increasingly significant role in -- emerging interactive graphics applications that combine general -- parallel compute algorithms with graphics rendering pipelines. -- -- OpenCL consists of an API for coordinating parallel computation across -- heterogeneous processors; and a cross-platform programming language -- with a well- specified computation environment. The OpenCL standard: -- --