Skip to content
Snippets Groups Projects
Commit 53e2c5ca authored by Bram Veenboer's avatar Bram Veenboer
Browse files

Create a plan only once in benchmarking

This prevents duplicate memory initialization and more closely resembles
how the library is used in practice.
parent 0bd56ff2
Branches
Tags
No related merge requests found
...@@ -346,17 +346,17 @@ int run(BenchParameters & benchParameter) ...@@ -346,17 +346,17 @@ int run(BenchParameters & benchParameter)
} }
tinit->Pause(); tinit->Pause();
for(int iPlan = 0; iPlan < benchParameter.niterations; iPlan++) if(benchParameter.verbose) printf("Create plan and init GPU\n");
{ // Create a dedispersion plan
tplan->Start(); tplan->Start();
PlanType plan(nchans, dt, f0, df, device_idx);
tplan->Pause();
for(int iPlan = 0; iPlan < benchParameter.niterations; iPlan++)
{
printf("\n"); printf("\n");
printf("------------------------- ITERATION %d out of %d -------------------------\n", iPlan+1, benchParameter.niterations); printf("------------------------- ITERATION %d out of %d -------------------------\n", iPlan+1, benchParameter.niterations);
if(benchParameter.verbose) printf("Create plan and init GPU\n");
// Create a dedispersion plan
PlanType plan(nchans, dt, f0, df, device_idx);
if(benchParameter.verbose) printf("Gen DM list\n"); if(benchParameter.verbose) printf("Gen DM list\n");
// Generate a list of dispersion measures for the plan // Generate a list of dispersion measures for the plan
if (dm_count==0) if (dm_count==0)
...@@ -391,7 +391,6 @@ int run(BenchParameters & benchParameter) ...@@ -391,7 +391,6 @@ int run(BenchParameters & benchParameter)
printf("\n"); printf("\n");
} }
tplan->Pause();
texecute->Start(); texecute->Start();
printf("\n"); printf("\n");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment