36 const unsigned int nLength(1000000);
38 const unsigned int nCycles(10000);
44 cout <<
"Test of \"Simple kernel\" function..." <<
flush;
46 auto vec1(acl::generateVEData<float>(
nLength,1u));
55 k << (res+=tempRes*tempRes+
rsqrt(.2*tempRes)+ 1./tempRes);
62 for(
unsigned int i(0); i<
nCycles; ++i)
65 std::cout<<
"Unoptimized: "<<timer.
realTime()<<endl;
73 cout <<
"Test of \"Simple kernel\" function..." <<
flush;
75 auto vec1(acl::generateVEData<float>(
nLength,1u));
87 k << (res+=tempRes[i]*tempRes[i]+
rsqrt(.2*tempRes[i])+ 1./tempRes[i]);
93 for(
unsigned int i(0); i<
nCycles; ++i)
96 std::cout<<
"UnoptimizedPlus: "<<timer.
realTime()<<endl;
104 cout <<
"Test of \"Simple kernel\" function..." <<
flush;
106 auto vec1(acl::generateVEData<float>(
nLength,1u));
115 k << (res+=tempRes*tempRes+
rsqrt(.2*tempRes)+ 1./tempRes);
123 for(
unsigned int i(0); i<
nCycles; ++i)
126 std::cout<<
"Optimized: "<<timer.
realTime()<<endl;
bool testKernelUnoptimizedPlus()
const double realTime() const
const unsigned int nOperations(10)
VectorOfElements rsqrt(const VectorOfElements &a)
bool testKernelOptimized()
const unsigned int nCycles(10000)
const unsigned int nLength(1000000)
bool testKernelUnoptimized()
void copy(const ComplexNumOfElements &source, ComplexNumOfElements &destination)
function copies the ComplexNumOfElements class.
ACL Kernel configuration class.
VectorOfElements generateVEConstant(T a)
Generates VectorOfElements with 1 Element acl::Constant with value a.
const acl::KernelConfiguration & kConf(acl::KERNEL_BASIC)
VectorOfElements generateVEPrivateVariable(unsigned int n)
Generates VectorOfElements with n Element of acl::PrivateVariable.
const KernelConfiguration KERNEL_BASIC
VectorOfElements generateVEIndex(unsigned int size=0)