Skip to content

Commit 6844687

Browse files
authored
Merge pull request #91 from rafbiels/easywave-print-compute-time
[easywave] Print both total and compute-only times
2 parents 3ce0752 + 80abe87 commit 6844687

File tree

3 files changed

+30
-15
lines changed

3 files changed

+30
-15
lines changed

easywave/CUDA/src/EasyWave.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ int commandLineHelp(void);
8383

8484
int main(int argc, char **argv)
8585
{
86-
Timer tWallClock("WallClock");
87-
tWallClock.Start();
86+
Timer tWallClockTotal("WallClockTotal");
87+
tWallClockTotal.Start();
8888
LOG("Starting CUDA main program. Process ID: " << Utility::GetProcessID());
8989
Utility::QueryCUDADevice();
9090

@@ -149,6 +149,9 @@ int main(int argc, char **argv)
149149
ewStart2DOutput();
150150
}
151151

152+
Timer tWallClockCompute("WallClockCompute");
153+
tWallClockCompute.Start();
154+
152155
Node.copyToGPU();
153156

154157
// Main loop
@@ -236,9 +239,11 @@ int main(int argc, char **argv)
236239
delete gNode;
237240

238241
LOG("Program successfully completed");
239-
tWallClock.Stop();
240-
LOG("I/O Time : " << dAccumulatedIOWriteTime - dAccumulateIOReadTime << " s");
241-
LOG("Total Execution Time: " << tWallClock.GetTime() - dAccumulatedIOWriteTime - dAccumulateIOReadTime << " s");
242+
tWallClockTotal.Stop();
243+
tWallClockCompute.Stop();
244+
LOG("I/O Time : " << dAccumulatedIOWriteTime + dAccumulateIOReadTime << " s");
245+
LOG("Compute Time : " << tWallClockCompute.GetTime() << " s");
246+
LOG("Total Execution Time: " << tWallClockTotal.GetTime() - dAccumulatedIOWriteTime - dAccumulateIOReadTime << " s");
242247
return 0;
243248
}
244249

easywave/HIP/src/EasyWaveGen.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ int commandLineHelp(void);
8282

8383
int main(int argc, char **argv)
8484
{
85-
Timer tWallClock("WallClock");
86-
tWallClock.Start();
85+
Timer tWallClockTotal("WallClockTotal");
86+
tWallClockTotal.Start();
8787
LOG("Starting HIP main program. Process ID: " << Utility::GetProcessID());
8888
Utility::QueryHIPDevice();
8989

@@ -149,6 +149,9 @@ int main(int argc, char **argv)
149149
ewStart2DOutput();
150150
}
151151

152+
Timer tWallClockCompute("WallClockCompute");
153+
tWallClockCompute.Start();
154+
152155
Node.copyToGPU();
153156

154157
// Main loop
@@ -237,9 +240,11 @@ int main(int argc, char **argv)
237240
delete gNode;
238241

239242
LOG("Program successfully completed");
240-
tWallClock.Stop();
241-
LOG("I/O Time : " << dAccumulatedIOWriteTime - dAccumulateIOReadTime << " s");
242-
LOG("Total Execution Time: " << tWallClock.GetTime() - dAccumulatedIOWriteTime - dAccumulateIOReadTime << " s");
243+
tWallClockTotal.Stop();
244+
tWallClockCompute.Stop();
245+
LOG("I/O Time : " << dAccumulatedIOWriteTime + dAccumulateIOReadTime << " s");
246+
LOG("Compute Time : " << tWallClockCompute.GetTime() << " s");
247+
LOG("Total Execution Time: " << tWallClockTotal.GetTime() - dAccumulatedIOWriteTime - dAccumulateIOReadTime << " s");
243248
return 0;
244249
}
245250

easywave/SYCL/src/EasyWave.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ int commandLineHelp(void);
8383

8484
int main(int argc, char **argv)
8585
{
86-
Timer tWallClock("WallClock");
87-
tWallClock.Start();
86+
Timer tWallClockTotal("WallClockTotal");
87+
tWallClockTotal.Start();
8888
LOG("Starting SYCL main program"); ///. Process ID: " << Utility::GetProcessID());
8989

9090
std::vector<std::string> eWaveFiles(Utility::FileHandler::GetFilesFromDirectory(Utility::FileHandler::GetCurrentDirectory()));
@@ -148,6 +148,9 @@ int main(int argc, char **argv)
148148
if (Par.outPropagation)
149149
ewStart2DOutput();
150150

151+
Timer tWallClockCompute("WallClockCompute");
152+
tWallClockCompute.Start();
153+
151154
Node.copyToGPU();
152155

153156
// Main loop
@@ -237,9 +240,11 @@ int main(int argc, char **argv)
237240
delete gNode;
238241

239242
LOG("Program successfully completed");
240-
tWallClock.Stop();
241-
LOG("I/O Time : " << dAccumulatedIOWriteTime - dAccumulateIOReadTime << " s");
242-
LOG("Total Execution Time: " << tWallClock.GetTime() - dAccumulatedIOWriteTime - dAccumulateIOReadTime << " s");
243+
tWallClockTotal.Stop();
244+
tWallClockCompute.Stop();
245+
LOG("I/O Time : " << dAccumulatedIOWriteTime + dAccumulateIOReadTime << " s");
246+
LOG("Compute Time : " << tWallClockCompute.GetTime() << " s");
247+
LOG("Total Execution Time: " << tWallClockTotal.GetTime() - dAccumulatedIOWriteTime - dAccumulateIOReadTime << " s");
243248
return 0;
244249
}
245250

0 commit comments

Comments
 (0)