ParallelME Runtime Environment
Public Member Functions | List of all members
Kernel Class Reference

#include <Kernel.hpp>

Public Member Functions

 Kernel (const Kernel &)=delete
 
Kerneloperator= (const Kernel &)=delete
 
KernelsetWorkRange (int xDim, int yDim=1, int zDim=1)
 
KernelsetInputBuffer (std::shared_ptr< Buffer > buffer)
 
KernelsetOutputBuffer (std::shared_ptr< Buffer > buffer)
 
KernelsetArg (const std::string &name, std::shared_ptr< Buffer > buffer)
 
KernelsetArg (const std::string &name, jchar primitive)
 Sets a primitive char to the kernel.
 
KernelsetArg (const std::string &name, jbyte primitive)
 Sets a primitive byte to the kernel.
 
KernelsetArg (const std::string &name, jshort primitive)
 Sets a primitive short to the kernel.
 
KernelsetArg (const std::string &name, jint primitive)
 Sets a primitive int to the kernel.
 
KernelsetArg (const std::string &name, jfloat primitive)
 Sets a primitive float to the kernel.
 
BufferinputBuffer ()
 
BufferoutputBuffer ()
 
size_t xDim ()
 Returns the x dimension of the kernel work range.
 
size_t yDim ()
 Returns the y dimension of the kernel work range.
 
size_t zDim ()
 Returns the z dimension of the kernel work range.
 
 Kernel (const std::string &name, const ProgramObjectMap &programObjects)
 
KernelObjectMap & objects ()
 Returns the map of kernel objects.
 

Detailed Description

This class represents a Task's kernel.

Constructor & Destructor Documentation

Kernel::Kernel ( const std::string &  name,
const ProgramObjectMap &  programObjects 
)

Constructs the Kernel object. Only the Task class should do it. The proper way of creating a kernel is through Task::addKernel().

Parameters
nameThe kernel's name.
programObjectsThe program objects that the Task supports.
See also
Task::addKernel

Member Function Documentation

Buffer* Kernel::inputBuffer ( )
inline

Returns the input buffer or nullptr if it wasn't set.

Buffer* Kernel::outputBuffer ( )
inline

Returns the output buffer or nullptr if it wasn't set.

Kernel* Kernel::setArg ( const std::string &  name,
std::shared_ptr< Buffer buffer 
)

Sets an arbitrary buffer as a parameter, except for the first two, only to the device of the buffer.

Kernel* Kernel::setInputBuffer ( std::shared_ptr< Buffer buffer)

Sets the input buffer to the kernel, only to the device of the buffer. The input buffer on OpenCL is always the first parameter of the kernel. Note that you can make this buffer readwrite on RenderScript by using the old prototype format and using pointers to access it. If the xDim, yDim and zDim weren't set previously, the dimensions of this buffer are used as the dimensions of the kernel.

Kernel* Kernel::setOutputBuffer ( std::shared_ptr< Buffer buffer)

Sets the output buffer to the kernel, only to the device of the buffer. The output buffer on OpenCL is always the second parameter of the kernel. Note that you can make this buffer readwrite on RenderScript by using the old prototype format and using pointers to access it.

Kernel* Kernel::setWorkRange ( int  xDim,
int  yDim = 1,
int  zDim = 1 
)
inline

Sets the range of execution.

Parameters
xDimNumber of elements in the x dimension.
yDimNumber of elements in the y dimension.
zDimNumber of elements in the z dimension.

The documentation for this class was generated from the following file: