Compute Library
 21.11
Measurement Class Reference
Collaboration diagram for Measurement:
[legend]

Public Member Functions

def get_total_ms (self)
 
def is_close_to (self, other, tol)
 
def is_better_than (self, other, tol)
 
def __add__ (self, other)
 
def __sub__ (self, other)
 
def __mul__ (self, other)
 
def __floordiv__ (self, other)
 
def __truediv__ (self, other)
 
def __pow__ (self, power)
 
def __str__ (self)
 

Detailed Description

Definition at line 134 of file GemmTuner.py.

Member Function Documentation

◆ __add__()

def __add__ (   self,
  other 
)

Definition at line 149 of file GemmTuner.py.

149  def __add__(self, other):
150  return Measurement(
151  self.opencl_timer_ms_reshape + other.opencl_timer_ms_reshape,
152  self.opencl_timer_ms_kernel + other.opencl_timer_ms_kernel,
153  )
154 

◆ __floordiv__()

def __floordiv__ (   self,
  other 
)

Definition at line 167 of file GemmTuner.py.

167  def __floordiv__(self, other):
168  return Measurement(
169  self.opencl_timer_ms_reshape // other.opencl_timer_ms_reshape,
170  self.opencl_timer_ms_kernel // other.opencl_timer_ms_kernel,
171  )
172 

◆ __mul__()

def __mul__ (   self,
  other 
)

Definition at line 161 of file GemmTuner.py.

161  def __mul__(self, other):
162  return Measurement(
163  self.opencl_timer_ms_reshape * other.opencl_timer_ms_reshape,
164  self.opencl_timer_ms_kernel * other.opencl_timer_ms_kernel,
165  )
166 

◆ __pow__()

def __pow__ (   self,
  power 
)

Definition at line 179 of file GemmTuner.py.

179  def __pow__(self, power):
180  return Measurement(
181  self.opencl_timer_ms_reshape ** power, self.opencl_timer_ms_kernel ** power
182  )
183 

◆ __str__()

def __str__ (   self)

Definition at line 184 of file GemmTuner.py.

References arm_compute::test.join(), and arm_compute::utils.map().

184  def __str__(self):
185  return ",".join(map(str, self))
186 
187 
188 # GEMMConfig Type
std::string join(T first, T last, const std::string &separator)
Helper function to concatenate multiple strings.
Definition: Utils.h:93
void map(T &tensor, bool blocking)
Maps a tensor if needed.
Definition: Utils.h:212

◆ __sub__()

def __sub__ (   self,
  other 
)

Definition at line 155 of file GemmTuner.py.

155  def __sub__(self, other):
156  return Measurement(
157  self.opencl_timer_ms_reshape - other.opencl_timer_ms_reshape,
158  self.opencl_timer_ms_kernel - other.opencl_timer_ms_kernel,
159  )
160 

◆ __truediv__()

def __truediv__ (   self,
  other 
)

Definition at line 173 of file GemmTuner.py.

173  def __truediv__(self, other):
174  return Measurement(
175  self.opencl_timer_ms_reshape / other.opencl_timer_ms_reshape,
176  self.opencl_timer_ms_kernel / other.opencl_timer_ms_kernel,
177  )
178 

◆ get_total_ms()

def get_total_ms (   self)

Definition at line 138 of file GemmTuner.py.

Referenced by Measurement.is_better_than(), and Measurement.is_close_to().

138  def get_total_ms(self):
139  return self.opencl_timer_ms_reshape + self.opencl_timer_ms_kernel
140 

◆ is_better_than()

def is_better_than (   self,
  other,
  tol 
)

Definition at line 144 of file GemmTuner.py.

References Measurement.get_total_ms(), and Measurement.is_close_to().

144  def is_better_than(self, other, tol):
145  return self.get_total_ms() < other.get_total_ms() and not self.is_close_to(
146  other
147  )
148 

◆ is_close_to()

def is_close_to (   self,
  other,
  tol 
)

Definition at line 141 of file GemmTuner.py.

References Measurement.get_total_ms().

Referenced by Measurement.is_better_than().

141  def is_close_to(self, other, tol):
142  return math.fabs(self.get_total_ms() - other.get_total_ms()) < tol
143 

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