|Portability||non-portable (GHC extensions)|
|Maintainer||Martin Dybdal <email@example.com>|
OpenCL kernel creation, invocation and scheduling.
- createKernel :: Program -> String -> IO Kernel
- kernelContext :: Kernel -> IO Context
- kernelFunctionName :: Kernel -> IO String
- kernelNumArgs :: Kernel -> IO Int
- kernelWorkGroupSize :: Kernel -> DeviceID -> IO CSize
- kernelCompileWorkGroupSize :: Kernel -> DeviceID -> IO CSize
- kernelLocalMemSize :: Kernel -> DeviceID -> IO Word64
- kernelPreferredWorkGroupSizeMultiple :: Kernel -> DeviceID -> IO CSize
- kernelPrivateMemSize :: Kernel -> DeviceID -> IO Word64
- enqueueNDRangeKernel :: CommandQueue -> Kernel -> [ClSize] -> [ClSize] -> [ClSize] -> [Event] -> IO Event
- enqueueTask :: CommandQueue -> Kernel -> [Event] -> IO Event
- data KernelArg where
- setKernelArg :: Kernel -> Int -> KernelArg -> IO ()
- setKernelArgs :: Kernel -> [KernelArg] -> IO ()
The program that contains the kernel code
The name of the kernel (as written in the program source)
|-> IO Kernel|
The newly created kernel
Create a program from a string containing the source code
The function name (in the OpenCL C source code) of a
The number of arguments that needs to be set before invoking a
The maximum work-group size that can be used to execute a kernel on a specific device given by device. The OpenCL implementation uses the resource requirements of the kernel (register usage etc.) to determine what this work group size should be.
Returns the work-group size specified by the
__attribute__((reqd_work_group_size(X, Y, Z))) qualifier.
Refer to section 6.8.2 of the OpenCL 1.1 specification
If undefined, this function returns (0,0,0)
Returns the amount of local memory in bytes being used by a
kernel. This includes local memory that may be needed by an
implementation to execute the kernel, variables declared inside the
kernel with the __local address qualifier and local memory to be
allocated for arguments to the kernel declared as pointers with the
__local address qualifier and whose size is specified with
If the local memory size, for any pointer argument to the kernel declared with the __local address qualifier, is not specified, its size is assumed to be 0.
Returns the preferred multiple of work-group size for
launch. This is a performance hint. Specifying a work-group size
that is not a multiple of the value returned by this query as the
value of the local work size argument to
will not fail to enqueue the kernel for execution unless the
work-group size specified is larger than the device maximum.
Returns the minimum amount of private memory, in bytes, used by each work-item in the kernel. This value may include any private memory needed by an implementation to execute the kernel, including that used by the language built-ins and variable declared inside the kernel with the __private qualifier.
Global work offsets
Global work sizes
Local work sizes
|-> IO Event|
Enqueues a command to execute a given kernel on a device. See section 5.8 in the OpenCL 1.1 specification
Enqueue a command to execute a kernel using a single work-item.
data KernelArg where
setKernelArg krn n arg sets argument
n of the kernel