29#include "acl/aclGenerators.h"
30#include "acl/DataTypes/aclGroupID.h"
31#include "acl/DataTypes/aclConstant.h"
32#include "aslGenerators.h"
33#include "aslUtilities.h"
34#include "acl/Kernels/aclKernel.h"
35#include "data/aslDataUtilities.h"
36#include <acl/aclMath/aclVectorOfElements.h>
37#include <data/aslDataWithGhostNodes.h>
74 cout <<
"Test of UploadToLocalMem()..." << flush;
76 unsigned int componentsNum = 2;
77 unsigned int groupSize = 27;
109 unsigned int groupsNumber = totalSize / portionSize;
117 kernel.
addExpression(barrier(
"CLK_LOCAL_MEM_FENCE | CLK_GLOBAL_MEM_FENCE"));
119 for (
unsigned int i = 0; i < componentsNum; ++i)
120 kernel.
addExpression(syncCopy(localSource[i], destination->getEContainer()[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 addExpression(Element expression_)
ACL Kernel configuration class.
std::string getKernelSource()
void setGroupsNumber(unsigned int n)
The class represents several Element.
SPDataWrapperACLData generateDataContainerACL_SP(const Block &b, unsigned int n=1)
generates pointer to ACL Data field with n components
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)
VectorOfElements generateVEConstantN(unsigned int n, T a)
Generates VectorOfElements with n Elements acl::Constant with values a.
VectorOfElements generateVEConstant(T a)
Generates VectorOfElements with 1 Element acl::Constant with value a.
definitions of mathematical operators and functions for class Element
Advanced Computational Language.
void copy(MemBlock &source, T *destination)
std::shared_ptr< ElementBase > Element
Advanced Simulation Library.
T productOfElements(const AVec< T > &a)
bool testUploadToLocalMem()
const acl::KernelConfiguration & kConf(acl::KERNEL_BASIC)