46#include <initializer_list>
56 cout <<
"Test of \"copy\" function..." << flush;
59 vector<cl_float>
input(10, 3);
60 vector<cl_float>
output(10, 1);
74 cout <<
"Test of Kernel with double..." << flush;
85 using namespace elementOperators;
106 cout <<
"Test of KernelSIMD..." << flush;
111 vector<cl_float>
input0(11, 3);
112 vector<cl_float>
input1(11, 5);
113 vector<cl_float>
output(11, 0);
114 vector<cl_float>
expected({8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8});
120 using namespace elementOperators;
138 cout <<
"Test of KernelSIMDUA..." << flush;
143 vector<cl_float>
input0(11, 3);
144 vector<cl_float>
input1(11, 5);
145 vector<cl_float>
output(11, 0);
146 vector<cl_float>
expected({8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8});
154 using namespace elementOperators;
173 cout <<
"Test of kernel with PrivateVariable..." << flush;
179 vector<cl_float>
input1(10, 3);
180 vector<cl_float>
input2(10, 5);
181 vector<cl_float>
output(10, 1);
188 using namespace elementOperators;
208 cout <<
"Test of kernel with PrivateArray..." << flush;
212 vector<cl_float>
inputPa({-9, 2, 0, 15, 1, 3});
213 vector<cl_float>
output(3);
214 vector<cl_float>
expected({-9, 1, 3});
226 using namespace elementOperators;
244 cout <<
"Test of Variable functionality..." << flush;
249 vector<cl_float>
output(10, 1);
269 cout <<
"Test of VariableReference functionality..." << flush;
275 vector<cl_float>
output(10, 1);
296 cout <<
"Test of select function..." << flush;
301 vector<cl_double>
input(10, 3.);
302 vector<cl_double>
output(10, 1.);
308 using namespace elementOperators;
330 cout <<
"Test of Subvector..." << flush;
331 cl_float init[] = {16, 2, 77, 29, 23, 16, 2, 77, 29, 23};
334 vector<cl_float>
input(init, init +
sizeof(init) /
sizeof(
cl_float) );
335 vector<cl_float>
output(2);
350 cout <<
"Test of Swap functionality..." << flush;
354 vector<cl_float>
input0(10, 1);
355 vector<cl_float>
input1(10, 2);
356 vector<cl_float>
output(10, 10);
372 cout <<
"Test of LocalArray and syncCopy with barrier()..." << flush;
377 unsigned int groupsNumber = 5;
391 vector<cl_float>
expected({2, 2, 2, 2, 2, 2, 2, 2, 2, 2});
398 using namespace elementOperators;
403 k.
addExpression(barrier(
"CLK_LOCAL_MEM_FENCE | CLK_GLOBAL_MEM_FENCE"));
void addExpression(Element expression_)
ACL Kernel configuration class.
void setGroupsNumber(unsigned int n)
Element operatorAssignment(Element e1, Element e2)
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.
const KernelConfiguration KERNEL_BASIC
const KernelConfiguration KERNEL_SIMD
const KernelConfiguration KERNEL_SIMDUA
Advanced Computational Language.
void copy(MemBlock &source, T *destination)
const std::vector< TypeID > TYPE_SELECT
contains trasnlation of types necessery for use in the function select
void swapBuffers(std::shared_ptr< Array< T > >a, std::shared_ptr< Array< T > > b)
std::shared_ptr< ElementBase > Element
bool testPrivateVariable()
bool testVariableReference()
const acl::KernelConfiguration & kConf(acl::KERNEL_BASIC)