27 #include "../aclElementBase.h" 28 #include "../../aslUtilities.h" 29 #include "../aclUtilities.h" 36 template <
typename T>
class Variable:
public ElementBase
41 static const string prefix;
42 static unsigned int id;
44 explicit Variable(T v);
45 virtual string str(
const KernelConfiguration & kernelConfig)
const;
46 virtual string getName()
const;
47 virtual string getTypeSignature(
const KernelConfiguration & kernelConfig)
const;
48 virtual string getLocalDeclaration(
const KernelConfiguration & kernelConfig)
const;
49 virtual void addToKernelSource(vector<Element> & arguments,
50 vector<Element> & localDeclarations)
const;
51 virtual void setAsArgument(
cl::Kernel & kernel,
unsigned int argumentIndex)
const;
52 virtual const T getValue()
const;
53 void setValue(
const T & a);
57 template <
typename T> Variable<T>::Variable(T v):
72 template <
typename T>
string Variable<T>::str(
const KernelConfiguration & kernelConfig)
const 84 vector<Element> & localDeclarations)
const 92 status = kernel.
setArg(argumentIndex, value);
111 #endif // ACLVARIABLE_H Advanced Simulation Library.
Advanced Computational Language.
virtual string getName() const
virtual void setAsArgument(cl::Kernel &kernel, unsigned int argumentIndex) const
void errorMessage(cl_int status, const char *errorMessage)
Prints errorMessage and exits depending on the status.
std::string numToStr(T i)
Converts numbers or another type to string.
virtual string str(const KernelConfiguration &kernelConfig) const
virtual const T getValue() const
virtual void addToKernelSource(vector< Element > &arguments, vector< Element > &localDeclarations) const
constexpr const TypeID typeToTypeID()
Class interface for cl_kernel.
void setValue(const T &a)
cl_int setArg(cl_uint index, const T &value)
virtual string getLocalDeclaration(const KernelConfiguration &kernelConfig) const