44 #include <initializer_list> 52 cout <<
"Test of If-Else..." <<
flush;
54 using namespace elementOperators;
59 vector<cl_float> input(11, 2);
60 vector<cl_float> output(11, 0);
61 vector<cl_float> expected({8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8});
83 bool status(output == expected);
92 cout <<
"Test of Parser..." <<
flush;
94 using namespace elementOperators;
99 vector<cl_float> input(11, 2);
100 vector<cl_float> output(11, 0);
101 vector<cl_float> expected({35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35});
105 string statement(
"a + c0 + c1 + vec");
107 parser->addElementNamePair(a,
"a");
108 parser->addElementNamePair(c0,
"c0");
109 parser->addElementNamePair(c1,
"c1");
110 parser->addElementNamePair(vec,
"vec");
111 parser->setStatement(statement);
121 bool status(output == expected);
129 cout <<
"Test of Atomic Sum..." <<
flush;
131 using namespace elementOperators;
134 vector<cl_int> input(11, 2);
135 vector<cl_int> output(11, 0);
136 vector<cl_int> expected({8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8});
148 bool status(output == expected);
156 bool allTestsPassed(
true);
162 return allTestsPassed ? EXIT_SUCCESS : EXIT_FAILURE;
If-Else conditional structure.
Advanced Computational Language.
void errorMessage(cl_int status, const char *errorMessage)
Prints errorMessage and exits depending on the status.
void addExpression(Element expression_)
Element operatorAssignment(Element e1, Element e2)
Element atomic_add(Element e1, Element e2)
ACL Kernel configuration class.
const acl::KernelConfiguration & kConf(acl::KERNEL_BASIC)
Element isEqual(Element e1, Element e2)
void copy(MemBlock &source, T *destination)
const KernelConfiguration KERNEL_BASIC
std::vector< std::string > extensions