#include <math.h>
#include <initializer_list>
using namespace std;
{
cout <<
"Test of If-Else..." <<
flush;
using namespace elementOperators;
vector<cl_float> input(11, 2);
vector<cl_float> output(11, 0);
vector<cl_float> expected({8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8});
bool status(output == expected);
return status;
}
{
cout <<
"Test of Parser..." <<
flush;
using namespace elementOperators;
vector<cl_float> input(11, 2);
vector<cl_float> output(11, 0);
vector<cl_float> expected({35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35});
string statement("a + c0 + c1 + vec");
parser->addElementNamePair(a, "a");
parser->addElementNamePair(c0, "c0");
parser->addElementNamePair(c1, "c1");
parser->addElementNamePair(vec, "vec");
parser->setStatement(statement);
bool status(output == expected);
return status;
}
{
cout <<
"Test of Atomic Sum..." <<
flush;
using namespace elementOperators;
vector<cl_int> input(11, 2);
vector<cl_int> output(11, 0);
vector<cl_int> expected({8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8});
bool status(output == expected);
return status;
}
{
bool allTestsPassed(true);
return allTestsPassed ? EXIT_SUCCESS : EXIT_FAILURE;
}