acl::Kernel Class Reference
Advanced Computational Language » OpenCL Kernel Generation

OpenCl Kernel generator. More...

`#include <aclKernel.h>`

Inheritance diagram for acl::Kernel:
[legend]
Collaboration diagram for acl::Kernel:
[legend]

## Public Member Functions

| Kernel (const KernelConfiguration kernelConfig_=KERNEL_BASIC)
void | setup ()
void | compute ()
void | setGroupsNumber (unsigned int n)
unsigned int | getGroupsNumber ()
std::string | getKernelSource ()
unsigned int | getKernelID ()
const cl::Kernel & | getKernel () const
void | clear ()
| removes all expressions from the kernel More...
const KernelConfiguration & | getConfiguration () const
| Kernel (const KernelConfiguration kernelConfig_=KERNEL_BASIC)
void | setup ()
void | compute ()
void | setGroupsNumber (unsigned int n)
unsigned int | getGroupsNumber ()
std::string | getKernelSource ()
unsigned int | getKernelID ()
const cl::Kernel & | getKernel () const
void | clear ()
| removes all expressions from the kernel More...
const KernelConfiguration & | getConfiguration () const
Public Member Functions inherited from acl::ExpressionContainer
| ExpressionContainer ()
void | addExpression (Element expression_)
unsigned int | getSize ()
const CommandQueue | getQueue () const
| ExpressionContainer ()
void | addExpression (Element expression_)
unsigned int | getSize ()
const CommandQueue | getQueue () const

## Protected Member Functions

cl_uint | detectVectorWidth ()
| detects minimal vector width of all available types of Elements More...
void | generateExtensions ()
void | generateArguments ()
void | generateIndex ()
void | generateLocalDeclarations ()
void | generateExpressions ()
virtual void | generateKernelSource ()
void | updateKernelConfiguration ()
void | buildKernel ()
void | setKernelArguments ()
cl_uint | detectVectorWidth ()
| detects minimal vector width of all available types of Elements More...
void | generateExtensions ()
void | generateArguments ()
void | generateIndex ()
void | generateLocalDeclarations ()
void | generateExpressions ()
virtual void | generateKernelSource ()
void | updateKernelConfiguration ()
void | buildKernel ()
void | setKernelArguments ()
Protected Member Functions inherited from acl::ExpressionContainer
void | filterDeclarations ()
void | filterDeclarations ()

## Protected Attributes

unsigned int | id
unsigned int | groupsNumber
KernelConfiguration | kernelConfig
std::string | kernelSource
cl::Kernel | kernel
Protected Attributes inherited from acl::ExpressionContainer
unsigned int | size
CommandQueue | queue
bool | regenerateKernelSource
std::vector< Element > | arguments
std::vector< Element > | localDeclarations

## Static Protected Attributes

static unsigned int | kernelNum

## Friends

class | KernelMerger

## Related Functions

(Note that these are not member functions.)
typedef std::shared_ptr< Kernel > | SPKernel
typedef std::shared_ptr< KernelMerger > | SPKernelMerger
typedef std::shared_ptr< Kernel > | SPKernel
typedef std::shared_ptr< KernelMerger > | SPKernelMerger
void | createKernels (std::vector< SPKernel > &vk, unsigned int n, const KernelConfiguration &kernelConfig_=KERNEL_BASIC)
void | createKernels (std::vector< SPKernel > &vk, unsigned int n, const KernelConfiguration &kernelConfig_=KERNEL_BASIC)

## Additional Inherited Members

Public Attributes inherited from acl::ExpressionContainer
std::vector< Element > | expression

## Detailed Description

OpenCl Kernel generator.

Note:
  The kernel can be run without updating of parameters. This possibility can lead to some optimization. to realize this possibility the function `computeWithoutUpdate` can be added

Note:
  The kernel can be run without updating of parameters. This possibility can lead to some optimization. to realize this possibility the function `computeWithoutUpdate` can be added

Examples
  testPrivateVar.cc.

Definition at line 48 of file aclKernel.h.

## Constructor & Destructor Documentation

## Kernel() [1/2]

acl::Kernel::Kernel | ( | const KernelConfiguration | kernelConfig_ = `KERNEL_BASIC` | ) |

explicit

## Kernel() [2/2]

acl::Kernel::Kernel | ( | const KernelConfiguration | kernelConfig_ = `KERNEL_BASIC` | ) |

explicit

## Member Function Documentation

## buildKernel() [1/2]

void acl::Kernel::buildKernel | ( |  | ) |

protected

## buildKernel() [2/2]

void acl::Kernel::buildKernel | ( |  | ) |

protected

## clear() [1/2]

void acl::Kernel::clear | ( |  | ) |

removes all expressions from the kernel

## clear() [2/2]

void acl::Kernel::clear | ( |  | ) |

removes all expressions from the kernel

## compute() [1/2]

void acl::Kernel::compute | ( |  | ) |

## compute() [2/2]

void acl::Kernel::compute | ( |  | ) |

## detectVectorWidth() [1/2]

cl_uint acl::Kernel::detectVectorWidth | ( |  | ) |

protected

detects minimal vector width of all available types of Elements

## detectVectorWidth() [2/2]

cl_uint acl::Kernel::detectVectorWidth | ( |  | ) |

protected

detects minimal vector width of all available types of Elements

## generateArguments() [1/2]

void acl::Kernel::generateArguments | ( |  | ) |

protected

## generateArguments() [2/2]

void acl::Kernel::generateArguments | ( |  | ) |

protected

## generateExpressions() [1/2]

void acl::Kernel::generateExpressions | ( |  | ) |

protected

## generateExpressions() [2/2]

void acl::Kernel::generateExpressions | ( |  | ) |

protected

## generateExtensions() [1/2]

void acl::Kernel::generateExtensions | ( |  | ) |

protected

## generateExtensions() [2/2]

void acl::Kernel::generateExtensions | ( |  | ) |

protected

## generateIndex() [1/2]

void acl::Kernel::generateIndex | ( |  | ) |

protected

## generateIndex() [2/2]

void acl::Kernel::generateIndex | ( |  | ) |

protected

## generateKernelSource() [1/2]

virtual void acl::Kernel::generateKernelSource | ( |  | ) |

protected virtual

## generateKernelSource() [2/2]

virtual void acl::Kernel::generateKernelSource | ( |  | ) |

protected virtual

## generateLocalDeclarations() [1/2]

void acl::Kernel::generateLocalDeclarations | ( |  | ) |

protected

## generateLocalDeclarations() [2/2]

void acl::Kernel::generateLocalDeclarations | ( |  | ) |

protected

## getConfiguration() [1/2]

const KernelConfiguration & acl::Kernel::getConfiguration | ( |  | ) | const

inline

Definition at line 111 of file aclKernel.h.

## getConfiguration() [2/2]

const KernelConfiguration& acl::Kernel::getConfiguration | ( |  | ) | const

inline

## getGroupsNumber() [1/2]

unsigned int acl::Kernel::getGroupsNumber | ( |  | ) |

## getGroupsNumber() [2/2]

unsigned int acl::Kernel::getGroupsNumber | ( |  | ) |

## getKernel() [1/2]

const cl::Kernel& acl::Kernel::getKernel | ( |  | ) | const

## getKernel() [2/2]

const cl::Kernel& acl::Kernel::getKernel | ( |  | ) | const

## getKernelID() [1/2]

unsigned int acl::Kernel::getKernelID | ( |  | ) |

## getKernelID() [2/2]

unsigned int acl::Kernel::getKernelID | ( |  | ) |

## getKernelSource() [1/2]

std::string acl::Kernel::getKernelSource | ( |  | ) |

## getKernelSource() [2/2]

std::string acl::Kernel::getKernelSource | ( |  | ) |

## setGroupsNumber() [1/2]

void acl::Kernel::setGroupsNumber | ( | unsigned int | n | ) |

## setGroupsNumber() [2/2]

void acl::Kernel::setGroupsNumber | ( | unsigned int | n | ) |

## setKernelArguments() [1/2]

void acl::Kernel::setKernelArguments | ( |  | ) |

protected

## setKernelArguments() [2/2]

void acl::Kernel::setKernelArguments | ( |  | ) |

protected

## setup() [1/2]

void acl::Kernel::setup | ( |  | ) |

Prepares kernel for launch. Should always be called before compute() after all expressions are added. Generates kernel source, builds kernel and sets its arguments.

## setup() [2/2]

void acl::Kernel::setup | ( |  | ) |

Prepares kernel for launch. Should always be called before compute() after all expressions are added. Generates kernel source, builds kernel and sets its arguments.

## updateKernelConfiguration() [1/2]

void acl::Kernel::updateKernelConfiguration | ( |  | ) |

protected

## updateKernelConfiguration() [2/2]

void acl::Kernel::updateKernelConfiguration | ( |  | ) |

protected

## Friends And Related Function Documentation

## createKernels() [1/2]

void createKernels | ( | std::vector< SPKernel > & | vk,
|  | unsigned int | n,
|  | const KernelConfiguration & | kernelConfig_ = `KERNEL_BASIC`
| ) |  |

related

creates `n` kernels in `vk` with configuration `kernelConfig_`

Definition at line 100 of file aclKernel.h.

## createKernels() [2/2]

void createKernels | ( | std::vector< SPKernel > & | vk,
|  | unsigned int | n,
|  | const KernelConfiguration & | kernelConfig_ = `KERNEL_BASIC`
| ) |  |

related

creates `n` kernels in `vk` with configuration `kernelConfig_`

Definition at line 100 of file aclKernel.h.

## KernelMerger

KernelMerger

friend

Definition at line 85 of file aclKernel.h.

## SPKernel [1/2]

typedef std::shared_ptr<Kernel> SPKernel

related

Definition at line 89 of file aclKernel.h.

## SPKernel [2/2]

typedef std::shared_ptr<Kernel> SPKernel

related

Definition at line 89 of file aclKernel.h.

## SPKernelMerger [1/2]

typedef std::shared_ptr<KernelMerger> SPKernelMerger

related

Definition at line 70 of file aclKernelMerger.h.

## SPKernelMerger [2/2]

typedef std::shared_ptr<KernelMerger> SPKernelMerger

related

Definition at line 70 of file aclKernelMerger.h.

## Member Data Documentation

## groupsNumber

unsigned int acl::Kernel::groupsNumber

protected

Definition at line 53 of file aclKernel.h.

## id

unsigned int acl::Kernel::id

protected

Definition at line 52 of file aclKernel.h.

## kernel

cl::Kernel acl::Kernel::kernel

protected

Definition at line 56 of file aclKernel.h.

## kernelConfig

KernelConfiguration acl::Kernel::kernelConfig

protected

Definition at line 54 of file aclKernel.h.

## kernelNum

static unsigned int acl::Kernel::kernelNum

static protected

Definition at line 51 of file aclKernel.h.

## kernelSource

std::string acl::Kernel::kernelSource

protected

Definition at line 55 of file aclKernel.h.

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

- /build/asl-1Fw6fH/asl-0.1.7/debian/tmp/usr/include/ASL/acl/Kernels/aclKernel.h
- /build/asl-1Fw6fH/asl-0.1.7/debian/tmp/usr/include/ASL/acl/Kernels/aclKernelMerger.h