ASL  0.1.7
Advanced Simulation Library
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | Related Functions | List of all members

OpenCl Kernel generator. More...

#include <aclKernel.h>

Inheritance diagram for acl::Kernel:
Inheritance graph
[legend]
Collaboration diagram for acl::Kernel:
Collaboration graph
[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::KernelgetKernel () const
 
void clear ()
 removes all expressions from the kernel More...
 
const KernelConfigurationgetConfiguration () const
 
- Public Member Functions inherited from acl::ExpressionContainer
 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 ()
 
- Protected Member Functions inherited from acl::ExpressionContainer
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< Elementarguments
 
std::vector< ElementlocalDeclarations
 

Static Protected Attributes

static unsigned int kernelNum
 

Friends

class KernelMerger
 

Related Functions

(Note that these are not member functions.)

typedef std::shared_ptr< KernelSPKernel
 
typedef std::shared_ptr< KernelMergerSPKernelMerger
 
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< Elementexpression
 

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
Examples
testASLData.cc, testKernel.cc, testKernelMerger.cc, testMatrixOfElements.cc, testOperators.cc, testPrivateVar.cc, and testVectorOfElements.cc.

Definition at line 48 of file aclKernel.h.

Constructor & Destructor Documentation

◆ Kernel()

acl::Kernel::Kernel ( const KernelConfiguration  kernelConfig_ = KERNEL_BASIC)
explicit

Member Function Documentation

◆ buildKernel()

void acl::Kernel::buildKernel ( )
protected

◆ clear()

void acl::Kernel::clear ( )

removes all expressions from the kernel

◆ compute()

void acl::Kernel::compute ( )

◆ detectVectorWidth()

cl_uint acl::Kernel::detectVectorWidth ( )
protected

detects minimal vector width of all available types of Elements

◆ generateArguments()

void acl::Kernel::generateArguments ( )
protected

◆ generateExpressions()

void acl::Kernel::generateExpressions ( )
protected

◆ generateExtensions()

void acl::Kernel::generateExtensions ( )
protected

◆ generateIndex()

void acl::Kernel::generateIndex ( )
protected

◆ generateKernelSource()

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

◆ generateLocalDeclarations()

void acl::Kernel::generateLocalDeclarations ( )
protected

◆ getConfiguration()

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

Definition at line 111 of file aclKernel.h.

◆ getGroupsNumber()

unsigned int acl::Kernel::getGroupsNumber ( )

◆ getKernel()

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

◆ getKernelID()

unsigned int acl::Kernel::getKernelID ( )

◆ getKernelSource()

std::string acl::Kernel::getKernelSource ( )
Examples
testASLData.cc.

◆ setGroupsNumber()

void acl::Kernel::setGroupsNumber ( unsigned int  n)
Examples
testKernel.cc.

◆ setKernelArguments()

void acl::Kernel::setKernelArguments ( )
protected

◆ setup()

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.

Examples
testASLData.cc, testKernel.cc, testMatrixOfElements.cc, testOperators.cc, and testVectorOfElements.cc.

◆ updateKernelConfiguration()

void acl::Kernel::updateKernelConfiguration ( )
protected

Friends And Related Function Documentation

◆ createKernels()

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

friend class KernelMerger
friend

Definition at line 85 of file aclKernel.h.

◆ SPKernel

typedef std::shared_ptr<Kernel> SPKernel
related

Definition at line 89 of file aclKernel.h.

◆ SPKernelMerger

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

unsigned int acl::Kernel::kernelNum
staticprotected

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: