27#include "../aclStdIncludes.h"
40 static const string prefix;
41 static unsigned int id;
51 vector<Element> & localDeclarations)
const;
86 template <
typename T>
string Array<T>::str(
const KernelConfiguration & kernelConfig)
const
88 if (kernelConfig.unaligned && kernelConfig.vectorWidth > 1)
90 return "vload" +
numToStr(kernelConfig.vectorWidth) +
"(0, &" + name +
"[" +
INDEX +
"])";
94 return name +
"[" +
INDEX +
"]";
101 return "__global " +
typeToStr<T>(kernelConfig.unaligned ? 1 : kernelConfig.vectorWidth) +
" *" + name;
118 template <
typename T>
124 template <
typename T>
Array(unsigned int size, T *initArray, CommandQueue queue_=hardware.defaultQueue)
virtual string getAddressSpaceQualifier() const
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 getAddressSpaceQualifier() const
virtual void addToKernelSource(vector< Element > &arguments, vector< Element > &localDeclarations) const
virtual string str(const KernelConfiguration &kernelConfig) const
static const string prefix
virtual string getLocalDeclaration(const KernelConfiguration &kernelConfig) const
virtual void setAsArgument(cl::Kernel &kernel, unsigned int argumentIndex) const
virtual string getName() const
virtual string getName() const
virtual string str(const KernelConfiguration &kernelConfig) const
virtual string getLocalDeclaration(const KernelConfiguration &kernelConfig) const
virtual string getTypeSignature(const KernelConfiguration &kernelConfig) const
Array(unsigned int size, CommandQueue queue_=hardware.defaultQueue)
CommandQueue defaultQueue
ACL Kernel configuration class.
Class interface for cl_kernel.
cl_int setArg(cl_uint index, const T &value)
SPDataWrapperACLData generateDataContainerACL_SP(const Block &b, unsigned int n=1)
generates pointer to ACL Data field with n components
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.
Advanced Computational Language.
std::shared_ptr< cl::CommandQueue > CommandQueue
constexpr const TypeID typeToTypeID()
shared_ptr< Array< cl_double > > ElementArrayDouble
shared_ptr< Array< cl_float > > ElementArrayFloat
shared_ptr< Array< cl_int > > ElementArrayInt
shared_ptr< Array< cl_long > > ElementArrayLong
Advanced Simulation Library.