24 #ifndef ACLVARIABLESP_H 25 #define ACLVARIABLESP_H 27 #include "../aclElementBase.h" 28 #include "../../aslUtilities.h" 29 #include "../aclUtilities.h" 35 template <
typename T>
class VariableSP:
public ElementBase
40 static const string prefix;
41 static unsigned int id;
44 virtual string str(
const KernelConfiguration & kernelConfig)
const;
46 virtual string getTypeSignature(
const KernelConfiguration & kernelConfig)
const;
49 vector<Element> & localDeclarations)
const;
69 template <
typename T>
string VariableSP<T>::str(
const KernelConfiguration & kernelConfig)
const 81 vector<Element> & localDeclarations)
const 86 unsigned int argumentIndex)
const 89 status = kernel.
setArg(argumentIndex, *value);
96 #endif // ACLVARIABLE_H ElementBase(bool isWritable_, unsigned int size_, TypeID typeID_)
Advanced Computational Language.
void errorMessage(cl_int status, const char *errorMessage)
Prints errorMessage and exits depending on the status.
virtual void setAsArgument(cl::Kernel &kernel, unsigned int argumentIndex) const
virtual string getName() const
std::string numToStr(T i)
Converts numbers or another type to string.
virtual void addToKernelSource(vector< Element > &arguments, vector< Element > &localDeclarations) const
VariableSP(std::shared_ptr< T > v)
virtual string getLocalDeclaration(const KernelConfiguration &kernelConfig) const
constexpr const TypeID typeToTypeID()
Class interface for cl_kernel.
cl_int setArg(cl_uint index, const T &value)
virtual string getTypeSignature(const KernelConfiguration &kernelConfig) const
virtual string str(const KernelConfiguration &kernelConfig) const