Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
tools.skpbench._hardware.Hardware Class Reference
Inheritance diagram for tools.skpbench._hardware.Hardware:
tools.skpbench._hardware_android.HardwareAndroid tools.skpbench._hardware_nexus_6p.HardwareNexus6P tools.skpbench._hardware_pixel2.HardwarePixel2 tools.skpbench._hardware_pixel.HardwarePixel tools.skpbench._hardware_pixel_c.HardwarePixelC

Public Member Functions

 __init__ (self)
 
 __enter__ (self)
 
 __exit__ (self, exception_type, exception_value, traceback)
 
 filter_line (self, line)
 
 sanity_check (self)
 
 print_debug_diagnostics (self)
 

Public Attributes

 warmup_time
 

Detailed Description

Locks down and monitors hardware for benchmarking.

This is a common base for classes that can control the specific hardware
we are running on. Its purpose is to lock the hardware into a constant
benchmarking mode for the duration of a 'with' block. e.g.:

  with hardware:
    run_benchmark()

While benchmarking, the caller must call sanity_check() frequently to verify
the hardware state has not changed.

Definition at line 8 of file _hardware.py.

Constructor & Destructor Documentation

◆ __init__()

tools.skpbench._hardware.Hardware.__init__ (   self)

Member Function Documentation

◆ __enter__()

tools.skpbench._hardware.Hardware.__enter__ (   self)

◆ __exit__()

tools.skpbench._hardware.Hardware.__exit__ (   self,
  exception_type,
  exception_value,
  traceback 
)

Reimplemented in tools.skpbench._hardware_android.HardwareAndroid.

Definition at line 29 of file _hardware.py.

29 def __exit__(self, exception_type, exception_value, traceback):
30 pass
31

◆ filter_line()

tools.skpbench._hardware.Hardware.filter_line (   self,
  line 
)
Returns False if the provided output line can be suppressed.

Reimplemented in tools.skpbench._hardware_pixel_c.HardwarePixelC.

Definition at line 32 of file _hardware.py.

32 def filter_line(self, line):
33 """Returns False if the provided output line can be suppressed."""
34 return True
35

◆ print_debug_diagnostics()

tools.skpbench._hardware.Hardware.print_debug_diagnostics (   self)
Prints any info that may help improve or debug hardware monitoring.

Reimplemented in tools.skpbench._hardware_android.HardwareAndroid.

Definition at line 40 of file _hardware.py.

40 def print_debug_diagnostics(self):
41 """Prints any info that may help improve or debug hardware monitoring."""
42 pass
43
44

◆ sanity_check()

tools.skpbench._hardware.Hardware.sanity_check (   self)
Raises a HardwareException if any hardware state is not as expected.

Reimplemented in tools.skpbench._hardware_android.HardwareAndroid, tools.skpbench._hardware_nexus_6p.HardwareNexus6P, tools.skpbench._hardware_pixel.HardwarePixel, tools.skpbench._hardware_pixel2.HardwarePixel2, and tools.skpbench._hardware_pixel_c.HardwarePixelC.

Definition at line 36 of file _hardware.py.

36 def sanity_check(self):
37 """Raises a HardwareException if any hardware state is not as expected."""
38 pass
39

Member Data Documentation

◆ warmup_time

tools.skpbench._hardware.Hardware.warmup_time

Definition at line 24 of file _hardware.py.


The documentation for this class was generated from the following file: