Skip to content

Commit

Permalink
changement pratique pour faire des tests de performance sur le benchm…
Browse files Browse the repository at this point in the history
…ark-quasisep
  • Loading branch information
Tom committed Jul 11, 2024
1 parent 97d6149 commit cb33732
Showing 1 changed file with 37 additions and 28 deletions.
65 changes: 37 additions & 28 deletions benchmarks/benchmark-quasisep.C
Original file line number Diff line number Diff line change
Expand Up @@ -49,37 +49,46 @@ void run_with_field(int q, size_t n, size_t m, size_t t, size_t r, size_t iter,
Element_ptr A, TS;

double time_gen = 0, time_cbxts =0;
//double time_RPMGen_Tom = 0, time_RPMGen = 0;
double time_RPMGen_Tom = 0, time_RPMGen = 0;
for (size_t i=0;i<iter;++i){

size_t * rows1 = FFLAS::fflas_new<size_t> (r);
size_t * cols1 = FFLAS::fflas_new<size_t> (r);

RandomLTQSRankProfileMatrix (n, r, t, rows1, cols1);
if ( r >= 1000 && r <= 1400){
size_t * rows1 = FFLAS::fflas_new<size_t> (r);
size_t * cols1 = FFLAS::fflas_new<size_t> (r);

std::cout << "rows :";
for ( size_t i = 0; i<r; i++){
std::cout << rows1[i] << ",";
}
std::cout << std::endl;
chrono.clear();
chrono.start();
RandomLTQSRankProfileMatrix (n, r, t, rows1, cols1);
chrono.stop();

std::cout << "cols :";
for ( size_t j = 0; j<r; j++){
std::cout << cols1[j] << ",";
time_RPMGen += chrono.usertime();
FFLAS::fflas_delete(rows1,cols1);
}
std::cout << std::endl;

//size_t * rows2 = FFLAS::fflas_new<size_t> (r);
//size_t * cols2 = FFLAS::fflas_new<size_t> (r);
//
//chrono.clear();
//chrono.start();
//RandomLTQSRankProfileMatrix_Tom (n, r, t, rows2, cols2);
//chrono.stop();
//
//time_RPMGen_Tom += chrono.usertime();

FFLAS::fflas_delete(rows1,cols1);
//std::cout << "rows :";
//for ( size_t i = 0; i<r; i++){
// std::cout << rows1[i] << ",";
//}
//std::cout << std::endl;

//std::cout << "cols :";
//for ( size_t j = 0; j<r; j++){
// std::cout << cols1[j] << ",";
//}
//std::cout << std::endl;

size_t * rows2 = FFLAS::fflas_new<size_t> (r);
size_t * cols2 = FFLAS::fflas_new<size_t> (r);

chrono.clear();
chrono.start();
RandomLTQSRankProfileMatrix_Tom (n, r, t, rows2, cols2);
chrono.stop();

time_RPMGen_Tom += chrono.usertime();

FFLAS::fflas_delete(rows2,cols2);

A = FFLAS::fflas_new (F, n, n);
size_t lda=n;
Expand Down Expand Up @@ -135,8 +144,8 @@ void run_with_field(int q, size_t n, size_t m, size_t t, size_t r, size_t iter,
// -----------
// Standard output for benchmark - Alexis Breust 2014/11/14
// std::cout << "Time: " << (time_gen + time_cbxts) / double(iter) << " Gfops: Irrelevant (Generator) Specific times: " << time_gen / double(iter)<<" (for construction)" << time_cbxts / double(iter)<<" (for CB x TS)" ;
//std::cout << "Time_stand : " << time_RPMGen / double(iter) << std::endl;
//std::cout << "Time_Tom : " << time_RPMGen_Tom / double(iter) << std::endl;
std::cout << "Time_stand : " << time_RPMGen / double(iter) << std::endl;
std::cout << "Time_Tom : " << time_RPMGen_Tom / double(iter) << std::endl;
}

int main(int argc, char** argv) {
Expand Down Expand Up @@ -168,8 +177,8 @@ int main(int argc, char** argv) {

run_with_field<Givaro::ModularBalanced<double> >(q, n, m, t, r, iter, seed);

//std::cout << "( ";
//FFLAS::writeCommandString(std::cout, as) << ")" << std::endl;
std::cout << "( ";
FFLAS::writeCommandString(std::cout, as) << ")" << std::endl;
return 0;
}

Expand Down

0 comments on commit cb33732

Please sign in to comment.