46 auto a(generateDataContainerACL_SP<double>(bl,1,1));
47 auto b(generateDataContainerACL_SP<double>(bl,1,1));
51 k<<(a->getEContainer()=acl::generateVEConstant<double>(0));
52 k<<(b->getEContainer()=acl::generateVEConstant<double>(0));
64 auto a(generateDataContainerACL_SP<double>(bl, 1, 1));
66 initData(a->getEContainer(),acl::generateVEConstant<double>(0));
74 cout <<
"Test of UploadToLocalMem()..." <<
flush;
76 unsigned int componentsNum = 2;
77 unsigned int groupSize = 27;
89 auto source(asl::generateDataContainerACL_SP<float>(block,
97 auto destination(asl::generateDataContainerACL_SP<float>(block,
109 unsigned int groupsNumber = totalSize / portionSize;
116 using namespace elementOperators;
119 for (
unsigned int i = 0; i < componentsNum; ++i)
121 c0, cPortionSize * groupID, cPortionSize));
128 vector<cl_float> src(totalSize);
129 vector<cl_float> dst(totalSize);
130 for (
unsigned int i = 0; i < componentsNum; ++i)
132 copy(source->getEContainer()[i], src);
133 copy(destination->getEContainer()[i], dst);
135 cout << src << endl << endl << dst << endl;
137 status &= (src == dst);
147 bool allTestsPassed(
true);
153 return allTestsPassed ? EXIT_SUCCESS : EXIT_FAILURE;
void copy(const ComplexNumOfElements &source, ComplexNumOfElements &destination)
function copies the ComplexNumOfElements class.
void addExpression(Element expression_)
ACL Kernel configuration class.
std::string getKernelSource()
void setGroupsNumber(unsigned int n)
The class represents several Element.
void initData(VectorOfElements a, VectorOfElements initializationValue, const KernelConfiguration &kernelConfig)
acl::VectorOfElements uploadToLocalMem(AbstractData &source, const AVec< int > &size, unsigned int groupSize, acl::Kernel &kernel)
void errorMessage(cl_int status, const char *errorMessage)
Prints errorMessage and exits depending on the status.
const KernelConfiguration KERNEL_BASIC
void initData(Element a, Element initializationValue, const KernelConfiguration &kernelConfig=KERNEL_BASIC)
Element syncCopy(Element source, Element destination, Element srcOffset, Element dstOffset, Element length)
Element barrier(std::string flags="CLK_LOCAL_MEM_FENCE")
VectorOfElements productOfElements(const VectorOfElements &a, const VectorOfElements &b)
VectorOfElements generateVEConstantN(unsigned int n, T a)
Generates VectorOfElements with n Elements acl::Constant with values a.
Advanced Computational Language.
std::shared_ptr< ElementBase > Element
Advanced Simulation Library.
bool testUploadToLocalMem()
const acl::KernelConfiguration & kConf(acl::KERNEL_BASIC)