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

Classes

struct  EventTest
 
struct  TimerExecutionSpaceTest
 
struct  TimerTest
 

Typedefs

using EventTypes
 
using TimerTypes
 

Functions

 TYPED_TEST_SUITE (EventTest, EventTypes)
 
 TYPED_TEST (EventTest, impl_event_type)
 
 TEST (Event, duration_instances)
 
 TYPED_TEST (EventTest, duration)
 
 TYPED_TEST (EventTest, destroyed_while_recording)
 
 TYPED_TEST (EventTest, movable)
 
 TYPED_TEST_SUITE (TimerTest, TimerTypes)
 
 TYPED_TEST (TimerTest, invalid_if_not_started_and_not_stopped)
 
 TYPED_TEST (TimerTest, invalid_if_not_stopped)
 
 TYPED_TEST (TimerTest, invalid_if_not_started)
 
 TYPED_TEST (TimerTest, valid_if_started_and_stopped)
 
 TEST_F (TimerExecutionSpaceTest, start_stop_elapsed)
 
 TYPED_TEST (TimerTest, duration)
 
 TEST_F (TimerExecutionSpaceTest, reuse)
 

Typedef Documentation

◆ EventTypes

Initial value:

Definition at line 32 of file test_Event.cpp.

◆ TimerTypes

Initial value:
::testing::Types<
>
Measure elapsed time between events.
Definition Timer.hpp:18

Definition at line 31 of file test_Timer.cpp.

Function Documentation

◆ TEST()

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 58 of file test_Event.cpp.

◆ TEST_F() [1/2]

Kokkos::utils::tests::timer::TEST_F ( TimerExecutionSpaceTest ,
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 "start -> stop -> start -> 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 203 of file test_Timer.cpp.

◆ TEST_F() [2/2]

Kokkos::utils::tests::timer::TEST_F ( TimerExecutionSpaceTest ,
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 112 of file test_Timer.cpp.

◆ TYPED_TEST() [1/9]

Kokkos::utils::tests::timer::TYPED_TEST ( EventTest ,
destroyed_while_recording  )
Test
Ensure that Kokkos::utils::timer::Event can be destroyed while recording.

Definition at line 93 of file test_Event.cpp.

◆ TYPED_TEST() [2/9]

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

Definition at line 74 of file test_Event.cpp.

◆ TYPED_TEST() [3/9]

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

Definition at line 40 of file test_Event.cpp.

◆ TYPED_TEST() [4/9]

Kokkos::utils::tests::timer::TYPED_TEST ( EventTest ,
movable  )
Test
Ensure that Kokkos::utils::timer::Event is properly movable.

This is particularly critical for specializations for Kokkos::Cuda and Kokkos::HIP that need to properly deal with the management of cudaEvent_t and hipEvent_t, respectively.

Definition at line 112 of file test_Event.cpp.

◆ TYPED_TEST() [5/9]

Kokkos::utils::tests::timer::TYPED_TEST ( 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 142 of file test_Timer.cpp.

◆ TYPED_TEST() [6/9]

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

Definition at line 69 of file test_Timer.cpp.

◆ TYPED_TEST() [7/9]

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

Definition at line 42 of file test_Timer.cpp.

◆ TYPED_TEST() [8/9]

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

Definition at line 52 of file test_Timer.cpp.

◆ TYPED_TEST() [9/9]

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

Definition at line 86 of file test_Timer.cpp.

◆ TYPED_TEST_SUITE() [1/2]

Kokkos::utils::tests::timer::TYPED_TEST_SUITE ( EventTest ,
EventTypes  )

◆ TYPED_TEST_SUITE() [2/2]

Kokkos::utils::tests::timer::TYPED_TEST_SUITE ( TimerTest ,
TimerTypes  )