#include "acl/Kernels/aclKernel.h"
#include "acl/aclUtilities.h"
#include "acl/aclMath/aclReductionAlgGenerator.h"
#include "acl/aclGenerators.h"
#include "aslUtilities.h"
#include "acl/aclMath/aclVectorOfElements.h"
{
cout << "testSum..." << flush;
unsigned int n(101);
summator->generateAlg();
summator->compute();
return status;
}
{
cout << "testSum1..." << flush;
unsigned int n(100001);
summator->generateAlg();
summator->compute();
return status;
}
{
cout <<
"testMin..." <<
flush;
minimizer->generateAlg();
minimizer->compute();
return status;
}
{
cout <<
"testMax..." <<
flush;
maximizer->generateAlg();
maximizer->compute();
return status;
}
{
cout <<
"testProduct..." <<
flush;
typedef double FT;
v1,
vI >=1000 && vI <= 1007,
alg->generateAlg();
alg->compute();
return status;
}
{
bool allTestsPassed(true);
return allTestsPassed ? EXIT_SUCCESS : EXIT_FAILURE;
}
The class represents several Element.
void errorMessage(cl_int status, const char *errorMessage)
Prints errorMessage and exits depending on the status.
void initData(Element a, Element initializationValue, const KernelConfiguration &kernelConfig=KERNEL_BASIC)
VectorOfElements select(const VectorOfElements &a, const VectorOfElements &b, const VectorOfElements &c)
VectorOfElementsData generateVEData(unsigned int length, unsigned int nComponents, CommandQueue queue)
Generates VectorOfElements with nComponents Elements acl::Vector with size length.
VectorOfElements generateVEConstant(T a)
Generates VectorOfElements with 1 Element acl::Constant with value a.
VectorOfElements generateVEIndex(unsigned int size=0)
Advanced Computational Language.
std::shared_ptr< ReductionAlgGenerator< ResType, ROT_SUM > > generateSumAlg(VectorOfElements v)
std::shared_ptr< ReductionAlgGenerator< ResType, ROT_PRODUCT > > generateProductAlg(VectorOfElements v)
constexpr const TypeID typeToTypeID()
std::shared_ptr< ReductionAlgGenerator< ResType, ROT_MAXIMUM > > generateMaxAlg(VectorOfElements v)
std::shared_ptr< ReductionAlgGenerator< ResType, ROT_MINIMUM > > generateMinAlg(VectorOfElements v)
const bool approxEqual(const double &a, const double &b, const double p_=1e-6)
Approximately equal; the precision is defined as p_.