Mentions légales du service

Skip to content
Snippets Groups Projects
Commit bd243957 authored by hhakim's avatar hhakim
Browse files

Add ButterflyMat::Display function in butterfly opt test.

parent 1a646960
No related branches found
No related tags found
No related merge requests found
...@@ -245,6 +245,16 @@ class ButterflyMat ...@@ -245,6 +245,16 @@ class ButterflyMat
return z; return z;
} }
void Display() const
{
cout << "d1: " << d1.transpose() << std::endl;
cout << "d2: " << d2.transpose()<< std::endl;
cout << "subdiag_ids: ";
for(int i=0;i < subdiag_ids.size();i++)
cout << subdiag_ids[i] << " ";
cout << std::endl;
}
}; };
#ifdef USE_AVX #ifdef USE_AVX
...@@ -304,6 +314,8 @@ class ButterflyPermFaust ...@@ -304,6 +314,8 @@ class ButterflyPermFaust
{ {
int i = 0; int i = 0;
assert(!avx || !eigen); assert(!avx || !eigen);
assert(!avx || !omp);
assert(!eigen || !omp);
for(auto csr_fac: csr_faust) for(auto csr_fac: csr_faust)
{ {
if(i < csr_faust.size()-1) if(i < csr_faust.size()-1)
...@@ -348,11 +360,9 @@ class ButterflyPermFaust ...@@ -348,11 +360,9 @@ class ButterflyPermFaust
for(int i=0;i < x.rows(); i++) for(int i=0;i < x.rows(); i++)
y[i] = x[bitrev_perm[i]]; y[i] = x[bitrev_perm[i]];
y = perm_d.array() * y.array(); y = perm_d.array() * y.array();
int i = csr_faust.size()-2;
for(auto fac: opt_factors) for(auto fac: opt_factors)
{ {
y = std::move(fac.multiply(y)); y = std::move(fac.multiply(y));
i--;
} }
return y; return y;
} }
...@@ -372,7 +382,7 @@ int main(int argc, char** argv) ...@@ -372,7 +382,7 @@ int main(int argc, char** argv)
cout << "nsamples: " << nsamples << endl; cout << "nsamples: " << nsamples << endl;
cout << "log2size: " << log2size << endl; cout << "log2size: " << log2size << endl;
srand(time(NULL)); srand(time(NULL));
auto DFT = TransformHelper<FPP, Cpu>::fourierFaust(log2size); auto DFT = TransformHelper<FPP, Cpu>::fourierFaust(log2size, false);
// DFT->display(); // DFT->display();
auto size = DFT->getNbRow(); auto size = DFT->getNbRow();
ButterflyPermFaust opt_DFT(*DFT); ButterflyPermFaust opt_DFT(*DFT);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment