28#include "acl/Kernels/aclKernel.h"
29#include "acl/aclUtilities.h"
30#include "acl/aclMath/aclReductionAlgGenerator.h"
31#include "acl/aclGenerators.h"
32#include "aslUtilities.h"
33#include "acl/aclMath/aclVectorOfElements.h"
39 cout <<
"testSum..." << flush;
44 summator->generateAlg();
55 cout <<
"testSum1..." << flush;
56 unsigned int n(100001);
62 summator->generateAlg();
73 cout <<
"testMin..." << flush;
78 minimizer->generateAlg();
89 cout <<
"testMax..." << flush;
94 maximizer->generateAlg();
104 cout <<
"testProduct..." << flush;
111 vI >=1000 && vI <= 1007,
124 bool allTestsPassed(
true);
132 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_.