using namespace std;
{
cout <<
"Test of \"Matrix Operations\" function..." <<
flush;
VectorOfElements vec0(3);
VectorOfElements vec1(1);
copy(generateVEData<cl_float>(10u,3u),vec0);
copy(generateVEData<cl_float>(10u,1u),vec1);
Kernel k;
{
using namespace elementOperators;
}
k.setup();
k.compute();
vector<cl_float> output(10);
bool status(output[1] == 20.5);
return status;
}
{
cout <<
"Test of \"System Solve Cramer's rule\" function..." <<
flush;
VectorOfElements vecB(2);
VectorOfElements vecX(2);
copy(generateVEData<cl_float>(10u,2u),vecB);
copy(generateVEData<cl_float>(10u,2u),vecX);
Kernel k;
{
using namespace elementOperators;
}
k.setup();
k.compute();
vector<cl_float> output(10);
bool status(output[1] > 0.09 && output[1] < .1);
return status;
}
{
cout <<
"Test of \"System Solve congugate gradient method\" function..." <<
flush;
VectorOfElements vecB(2);
VectorOfElements vecX(2);
copy(generateVEData<cl_float>(10u,2u),vecB);
copy(generateVEData<cl_float>(10u,2u),vecX);
Kernel k;
{
using namespace elementOperators;
}
k.setup();
k.compute();
vector<cl_float> output(10);
bool status(output[1] > 0.09 && output[1] < .1);
return status;
}
{
bool allTestsPassed(true);
return allTestsPassed ? EXIT_SUCCESS : EXIT_FAILURE;
}
vector< Element > gcSolveSystem(const MatrixOfElements &a, const VectorOfElements &b, const VectorOfElements &x)
generates code for solving the solution of a system of linear equations
vector< Element > gcSolveSystemCG(const MatrixOfElements &a, const VectorOfElements &b, const VectorOfElements &x)
generates code for solving the solution of a system of linear equations
void errorMessage(cl_int status, const char *errorMessage)
Prints errorMessage and exits depending on the status.
MatrixOfElements generateMEConstant(const asl::AMatr< T > &a)
Generates VectorOfElements correspondinng to a.
VectorOfElements generateVEConstant(T a)
Generates VectorOfElements with 1 Element acl::Constant with value a.
Advanced Computational Language.
void copy(MemBlock &source, T *destination)
Advanced Simulation Library.
bool testMatrixOperations()