Kernel Class Reference

A Kernel encapsulates a particular implementation of a calculation that can be performed on the data in a Context. More...

#include <Kernel.h>

List of all members.

Public Member Functions

 Kernel ()
 Kernel (const Kernel &copy)
 ~Kernel ()
Kerneloperator= (const Kernel &copy)
std::string getName () const
 Get the name of this Kernel.
const KernelImplgetImpl () const
 Get the object which implements this Kernel.
KernelImplgetImpl ()
 Get the object which implements this Kernel.

Friends

class Platform

Detailed Description

A Kernel encapsulates a particular implementation of a calculation that can be performed on the data in a Context.

Kernel objects are created by Platforms:

 Kernel kernel = platform.createKernel(kernelName);
 

The Kernel class itself does not specify any details of what calculation is to be performed or the API for calling it. Instead, subclasses of KernelImpl will define APIs which are appropriate to particular calculations. To execute a Kernel, you therefore request its implementation object and cast it to the correct type:

 dynamic_cast<AddStreamsImpl&>(kernel.getImpl()).execute(stream1, stream2);
 

Constructor & Destructor Documentation

Kernel (  ) 
Kernel ( const Kernel copy  ) 
~Kernel (  ) 

Member Function Documentation

KernelImpl& getImpl (  ) 

Get the object which implements this Kernel.

const KernelImpl& getImpl (  )  const

Get the object which implements this Kernel.

std::string getName (  )  const

Get the name of this Kernel.

Kernel& operator= ( const Kernel copy  ) 

Friends And Related Function Documentation

friend class Platform [friend]

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

Generated by  doxygen 1.6.2