ASL
0.1.7
Advanced Simulation Library
|
Go to the documentation of this file.
24 #ifndef ACLLOCALARRAY_H
25 #define ACLLOCALARRAY_H
27 #include "../aclElementBase.h"
28 #include "../../aslUtilities.h"
29 #include "../aclUtilities.h"
41 template <
typename T>
class LocalArray:
public ElementBase
45 static const string prefix;
46 static unsigned int id;
55 vector<Element> & localDeclarations)
const;
68 template <
typename T>
string LocalArray<T>::str(
const KernelConfiguration & kernelConfig)
const
70 if (kernelConfig.unaligned && kernelConfig.vectorWidth > 1)
72 return "vload" +
numToStr(kernelConfig.vectorWidth) +
"(0, &" + name +
"[" +
INDEX +
"])";
76 return name +
"[" +
INDEX +
"]";
101 return "__local " + typeToStr<T>(kernelConfig.unaligned ? 1 : kernelConfig.vectorWidth)
107 vector<Element> & localDeclarations)
const
114 unsigned int argumentIndex)
const
121 #endif // ACLLOCALARRAY_H
virtual string getTypeSignature(const KernelConfiguration &kernelConfig) const
virtual void addToKernelSource(vector< Element > &arguments, vector< Element > &localDeclarations) const
virtual void setAsArgument(cl::Kernel &kernel, unsigned int argumentIndex) const
virtual string str(const KernelConfiguration &kernelConfig) const
virtual string getAddressSpaceQualifier() const
virtual string str(const KernelConfiguration &kernelConfig) const
virtual string getAddressSpaceQualifier() const
unsigned int paddingElements(unsigned int size, const KernelConfiguration &kernelConfig)
Adds padding in elements based on vector width.
Class interface for cl_kernel.
LocalArray(unsigned int size_)
virtual string getName() const
virtual string getLocalDeclaration(const KernelConfiguration &kernelConfig) const
virtual string getTypeSignature(const KernelConfiguration &kernelConfig) const
ACL Kernel configuration class.
virtual void addToKernelSource(vector< Element > &arguments, vector< Element > &localDeclarations) const
virtual string getLocalDeclaration(const KernelConfiguration &kernelConfig) const
virtual string getName() const
std::string numToStr(T i)
Converts numbers or another type to string.
virtual void setAsArgument(cl::Kernel &kernel, unsigned int argumentIndex) const
Advanced Simulation Library.
Advanced Computational Language.
constexpr const TypeID typeToTypeID()