kokkos-utils 0.0.1
 
Loading...
Searching...
No Matches
Kokkos::utils::tests::timer Namespace Reference

Classes

class  TimerTest
 

Typedefs

using event_t = Event<execution_space>
 
using timer_t = Timer<execution_space>
 

Functions

 TEST (Event, impl_event_type)
 
 TEST (Event, duration_instances)
 
 TEST (Event, duration)
 
 TEST_F (TimerTest, invalid_if_not_reset_and_not_stopped)
 
 TEST_F (TimerTest, invalid_if_not_stopped)
 
 TEST_F (TimerTest, invalid_if_not_reset)
 
 TEST_F (TimerTest, valid_if_reset_and_stopped)
 
 TEST_F (TimerTest, start_stop_elapsed)
 
 TEST_F (TimerTest, duration)
 
 TEST_F (TimerTest, reuse)
 

Typedef Documentation

◆ event_t

◆ timer_t

Function Documentation

◆ TEST() [1/3]

Kokkos::utils::tests::timer::TEST ( Event ,
duration  )
Test
Basic test of Kokkos::utils::timer::Event::duration.

Definition at line 60 of file test_Event.cpp.

◆ TEST() [2/3]

Kokkos::utils::tests::timer::TEST ( Event ,
duration_instances  )
Test
Check the traits of the helper types Kokkos::utils::timer::milliseconds and Kokkos::utils::timer::seconds.

Definition at line 44 of file test_Event.cpp.

◆ TEST() [3/3]

Kokkos::utils::tests::timer::TEST ( Event ,
impl_event_type  )
Test
Check the type of the event used by the primary template and the device specializations.

Definition at line 29 of file test_Event.cpp.

◆ TEST_F() [1/7]

Kokkos::utils::tests::timer::TEST_F ( TimerTest ,
duration  )
Test
Check Kokkos::utils::timer::Timer::duration.

Check that the elapsed time is greater than the waiting time of 100 ms.

Check the elapsed time in milliseconds.

Check the elapsed time in microseconds.

Check the elapsed time in seconds.

Check consistency.

Ensure the timer is effectively stopped.

Definition at line 116 of file test_Timer.cpp.

◆ TEST_F() [2/7]

Kokkos::utils::tests::timer::TEST_F ( TimerTest ,
invalid_if_not_reset  )
Test
Check that Kokkos::utils::timer::Timer reports it's invalid when Kokkos::utils::timer::Timer::reset has not been called, but Kokkos::utils::timer::Timer::stop has.

Definition at line 63 of file test_Timer.cpp.

◆ TEST_F() [3/7]

Kokkos::utils::tests::timer::TEST_F ( TimerTest ,
invalid_if_not_reset_and_not_stopped  )
Test
Check that Kokkos::utils::timer::Timer reports it's invalid when neither Kokkos::utils::timer::Timer::reset nor Kokkos::utils::timer::Timer::stop has been called.

Definition at line 42 of file test_Timer.cpp.

◆ TEST_F() [4/7]

Kokkos::utils::tests::timer::TEST_F ( TimerTest ,
invalid_if_not_stopped  )
Test
Check that Kokkos::utils::timer::Timer reports it's invalid when Kokkos::utils::timer::Timer::reset has been called, but Kokkos::utils::timer::Timer::stop has not.

Definition at line 52 of file test_Timer.cpp.

◆ TEST_F() [5/7]

Kokkos::utils::tests::timer::TEST_F ( TimerTest ,
reuse  )
Test
Check that the same instance of Kokkos::utils::timer::Timer can be reused multiple times.

The following page on the Cuda event API https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__EVENT.html#group__CUDART__EVENT_1gf4fcb74343aa689f4159791967868446 mentions that: cudaEventRecord can be called multiple times on the same event and will overwrite the previously captured state.

The following page on the HIP even API https://rocm.docs.amd.com/projects/HIP/en/docs-6.0.2/doxygen/html/group___event.html#ga553b6f7a8e7b7dd9536d8a64c24d7e29 mentions that: If hipEventRecord has been previously called on this event, then this call will overwrite any existing state in event.

It also warns that: If this function is called on an event that is currently being recorded, results are undefined.

This test helps us ensure that for a "reset -> stop -> reset -> stop -> ..." sequence, our timer is fine.

Check that the elapsed time is greater than the waiting time, but smaller than our "external" timer. This ensures that the timer restarted from zero in the loop iteration.

Definition at line 169 of file test_Timer.cpp.

◆ TEST_F() [6/7]

Kokkos::utils::tests::timer::TEST_F ( TimerTest ,
start_stop_elapsed  )
Test
Check Kokkos::utils::timer::Timer by verifying that the elapsed time is less than the time measured by a Kokkos::Timer wrapped outside of it.

Fencing is not required if the elapsed time for the external timer is retrieved after the one for the timer. Because retrieving the elapsed time from the timer synchronizes the stop event.

Definition at line 86 of file test_Timer.cpp.

◆ TEST_F() [7/7]

Kokkos::utils::tests::timer::TEST_F ( TimerTest ,
valid_if_reset_and_stopped  )
Test
Check that Kokkos::utils::timer::Timer reports it's valid when Kokkos::utils::timer::Timer::reset and Kokkos::utils::timer::Timer::stop have been called.

Definition at line 74 of file test_Timer.cpp.