24 #ifndef ACLVARIABLEREFERENCE_H 25 #define ACLVARIABLEREFERENCE_H 27 #include "../aclElementBase.h" 28 #include "../../aslUtilities.h" 29 #include "../aclUtilities.h" 36 template <
typename T>
class VariableReference:
public ElementBase
41 static const string prefix;
42 static unsigned int id;
44 explicit VariableReference(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;
55 template <
typename T> VariableReference<T>::VariableReference(T & v):
83 vector<Element> & localDeclarations)
const 90 status = kernel.
setArg(argumentIndex, value);
97 #endif // ACLVARIABLE_H virtual string getName() const
virtual void setAsArgument(cl::Kernel &kernel, unsigned int argumentIndex) const
Advanced Simulation Library.
Advanced Computational Language.
virtual void addToKernelSource(vector< Element > &arguments, vector< Element > &localDeclarations) 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 getLocalDeclaration(const KernelConfiguration &kernelConfig) const
virtual string str(const KernelConfiguration &kernelConfig) const
constexpr const TypeID typeToTypeID()
Class interface for cl_kernel.
cl_int setArg(cl_uint index, const T &value)