Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: tcojean <terry.cojean@kit.edu>
  • Loading branch information
yhmtsai and tcojean committed Dec 11, 2020
1 parent 7e88236 commit cc4321c
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions benchmark/utils/timer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@ class Timer {
}

/**
* Get the vector containing the each time results in nanoseconds.
* Get the vector containing the time of each repetition in nanoseconds.
*
* @return the vector of each time results in nanoseconds
* @return the vector of time for each repetition in nanoseconds
*/
std::vector<std::int64_t> get_time_detail() const { return duration_ns_; }

/**
* Get the latest result in nanoseconds. If there is not result yet, return
* Get the latest result in nanoseconds. If there is no result yet, return
* 0.
*
* @return the latest result in nanoseconds
Expand Down Expand Up @@ -162,6 +162,8 @@ class Timer {
protected:
/**
* Put the nanosecond result into vector
*
* @param ns the nanosecond result to insert
*/
void add_record(std::int64_t ns)
{
Expand Down Expand Up @@ -190,7 +192,7 @@ class Timer {


/**
* CpuTimer use synchronize of executor and std::chrono to measure the
* CpuTimer use the synchronize of the executor and std::chrono to measure the
* timing.
*/
class CpuTimer : public Timer {
Expand Down Expand Up @@ -237,7 +239,7 @@ class CudaTimer : public Timer {
/**
* Create a CudaTimer.
*
* @param exec Executor which is CudaExecutor indeed
* @param exec Executor which should be a CudaExecutor
*/
CudaTimer(std::shared_ptr<const gko::Executor> exec)
: CudaTimer(std::dynamic_pointer_cast<const gko::CudaExecutor>(exec))
Expand All @@ -246,7 +248,7 @@ class CudaTimer : public Timer {
/**
* Create a CudaTimer.
*
* @param exec CudaExecutor associated to the timer
* @param exec CudaExecutor associated to the timer
*/
CudaTimer(std::shared_ptr<const gko::CudaExecutor> exec) : Timer()
{
Expand Down Expand Up @@ -302,7 +304,7 @@ class HipTimer : public Timer {
/**
* Create a HipTimer.
*
* @param exec Executor which is HipExecutor indeed
* @param exec Executor which should be a HipExecutor
*/
HipTimer(std::shared_ptr<const gko::Executor> exec)
: HipTimer(std::dynamic_pointer_cast<const gko::HipExecutor>(exec))
Expand All @@ -311,7 +313,7 @@ class HipTimer : public Timer {
/**
* Create a HipTimer.
*
* @param exec HipExecutor associated to the timer
* @param exec HipExecutor associated to the timer
*/
HipTimer(std::shared_ptr<const gko::HipExecutor> exec) : Timer()
{
Expand Down

0 comments on commit cc4321c

Please sign in to comment.