const unsigned int nLength(1000000);
{
cout << "Test of \"Simple kernel\" function..." << flush;
auto vec1(acl::generateVEData<float>(
nLength,1u));
{
k << (res+=tempRes*tempRes+rsqrt(.2*tempRes)+ 1./tempRes);
}
k << (vec1=res);
k.setup();
for(
unsigned int i(0); i<
nCycles; ++i)
k.compute();
std::cout<<
"Unoptimized: "<<timer.
realTime()<<endl;
return true;
}
{
cout <<
"Test of \"Simple kernel\" function..." <<
flush;
auto vec1(acl::generateVEData<float>(
nLength,1u));
{
}
k << (res+=tempRes[i]*tempRes[i]+
rsqrt(.2*tempRes[i])+ 1./tempRes[i]);
k << (vec1=res);
k.setup();
for(
unsigned int i(0); i<
nCycles; ++i)
k.compute();
std::cout<<
"UnoptimizedPlus: "<<timer.
realTime()<<endl;
return true;
}
{
cout <<
"Test of \"Simple kernel\" function..." <<
flush;
auto vec1(acl::generateVEData<float>(
nLength,1u));
{
k << (res+=tempRes*tempRes+
rsqrt(.2*tempRes)+ 1./tempRes);
}
k << (vec1=res);
k.setup();
for(
unsigned int i(0); i<
nCycles; ++i)
k.compute();
std::cout<<
"Optimized: "<<timer.
realTime()<<endl;
return true;
}
{
return 0;
}
ACL Kernel configuration class.
const double realTime() const
const KernelConfiguration KERNEL_BASIC
VectorOfElements generateVEConstant(T a)
Generates VectorOfElements with 1 Element acl::Constant with value a.
VectorOfElements generateVEPrivateVariable(unsigned int n)
Generates VectorOfElements with n Element of acl::PrivateVariable.
VectorOfElements generateVEIndex(unsigned int size=0)
void copy(MemBlock &source, T *destination)
bool testKernelOptimized()
const unsigned int nOperations(10)
bool testKernelUnoptimized()
const acl::KernelConfiguration & kConf(acl::KERNEL_BASIC)
bool testKernelUnoptimizedPlus()
const unsigned int nLength(1000000)
const unsigned int nCycles(10000)