CARLA
Loading...
Searching...
No Matches
test_multigpu_frame_gate.cpp File Reference
#include "test.h"
#include <carla/multigpu/frameGate.h>
#include <limits>

Go to the source code of this file.

Classes

struct  BeginFrameState

Enumerations

enum class  BeginFrameAction
 What a secondary does at the start of an engine frame, before the engine computes the frame's time step. More...
enum class  PreTickAction
 What a secondary does when its world starts ticking. More...

Functions

BeginFrameAction DecideBeginFrame (const BeginFrameState &state)
PreTickAction DecidePreTick (bool load_map_pending, bool has_episode, bool frame_prepared, bool episode_world)
bool IsConsecutive (std::optional< uint64_t > last_played, uint64_t frame)
 Whether frame directly follows the last frame this secondary played.
bool IsUsableDelta (float delta_seconds)
 Whether a primary's delta can be this engine frame's time step.
bool NeedsResync (std::optional< uint64_t > last_played, uint64_t frame, bool full_resync)
 Whether playing frame shows that this secondary missed primary state (a frame went missing) that only a full resync gives back.
 TEST (MultiGpuFrameGate, a_connected_secondary_with_an_episode_waits_for_the_primary)
 TEST (MultiGpuFrameGate, a_disconnected_secondary_runs_on_its_own_clock_whatever_else_holds)
 TEST (MultiGpuFrameGate, a_gap_asks_for_a_resync_unless_the_frame_is_one)
 TEST (MultiGpuFrameGate, a_pending_load_map_takes_precedence_over_a_prepared_frame)
 TEST (MultiGpuFrameGate, consecutive_frames)
 TEST (MultiGpuFrameGate, never_waits_while_the_primary_waits_for_this_server)
 TEST (MultiGpuFrameGate, only_a_prepared_frame_on_the_episode_world_is_played)
 TEST (MultiGpuFrameGate, only_finite_non_negative_deltas_become_the_time_step)

Enumeration Type Documentation

◆ BeginFrameAction

What a secondary does at the start of an engine frame, before the engine computes the frame's time step.

Definition at line 16 of file frameGate.h.

◆ PreTickAction

enum class carla::multigpu::PreTickAction
strong

What a secondary does when its world starts ticking.

Definition at line 45 of file frameGate.h.

Function Documentation

◆ DecideBeginFrame()

Definition at line 34 of file frameGate.h.

Referenced by TEST(), TEST(), and TEST().

◆ DecidePreTick()

PreTickAction carla::multigpu::DecidePreTick ( bool load_map_pending,
bool has_episode,
bool frame_prepared,
bool episode_world )
inline

Definition at line 54 of file frameGate.h.

Referenced by TEST(), and TEST().

◆ IsConsecutive()

bool carla::multigpu::IsConsecutive ( std::optional< uint64_t > last_played,
uint64_t frame )
inline

Whether frame directly follows the last frame this secondary played.

Definition at line 69 of file frameGate.h.

Referenced by TEST().

◆ IsUsableDelta()

bool carla::multigpu::IsUsableDelta ( float delta_seconds)
inline

Whether a primary's delta can be this engine frame's time step.

Definition at line 80 of file frameGate.h.

Referenced by TEST().

◆ NeedsResync()

bool carla::multigpu::NeedsResync ( std::optional< uint64_t > last_played,
uint64_t frame,
bool full_resync )
inline

Whether playing frame shows that this secondary missed primary state (a frame went missing) that only a full resync gives back.

Definition at line 75 of file frameGate.h.

Referenced by TEST().

◆ TEST() [1/8]

TEST ( MultiGpuFrameGate ,
a_connected_secondary_with_an_episode_waits_for_the_primary  )

Definition at line 31 of file test_multigpu_frame_gate.cpp.

References DecideBeginFrame(), and TEST().

◆ TEST() [2/8]

TEST ( MultiGpuFrameGate ,
a_disconnected_secondary_runs_on_its_own_clock_whatever_else_holds  )

◆ TEST() [3/8]

TEST ( MultiGpuFrameGate ,
a_gap_asks_for_a_resync_unless_the_frame_is_one  )

Definition at line 84 of file test_multigpu_frame_gate.cpp.

References NeedsResync(), and TEST().

◆ TEST() [4/8]

TEST ( MultiGpuFrameGate ,
a_pending_load_map_takes_precedence_over_a_prepared_frame  )

Definition at line 64 of file test_multigpu_frame_gate.cpp.

References DecidePreTick(), and TEST().

◆ TEST() [5/8]

TEST ( MultiGpuFrameGate ,
consecutive_frames  )

Definition at line 77 of file test_multigpu_frame_gate.cpp.

References IsConsecutive(), and TEST().

◆ TEST() [6/8]

◆ TEST() [7/8]

TEST ( MultiGpuFrameGate ,
only_a_prepared_frame_on_the_episode_world_is_played  )

Definition at line 70 of file test_multigpu_frame_gate.cpp.

References DecidePreTick(), and TEST().

◆ TEST() [8/8]

TEST ( MultiGpuFrameGate ,
only_finite_non_negative_deltas_become_the_time_step  )

Definition at line 92 of file test_multigpu_frame_gate.cpp.

References IsUsableDelta(), and TEST().