(self, callable, *args, n_runs=1, warmup_runs=1)
| 1384 | return "CPU" |
| 1385 | |
| 1386 | def _bench(self, callable, *args, n_runs=1, warmup_runs=1): |
| 1387 | results = dict() |
| 1388 | for type_as in self.__type_list__: |
| 1389 | inputs = [self.from_numpy(arg, type_as=type_as) for arg in args] |
| 1390 | for _ in range(warmup_runs): |
| 1391 | callable(*inputs) |
| 1392 | t0 = time.perf_counter() |
| 1393 | for _ in range(n_runs): |
| 1394 | callable(*inputs) |
| 1395 | t1 = time.perf_counter() |
| 1396 | key = ("Numpy", self.device_type(type_as), self.bitsize(type_as)) |
| 1397 | results[key] = (t1 - t0) / n_runs |
| 1398 | return results |
| 1399 | |
| 1400 | def solve(self, a, b): |
| 1401 | return np.linalg.solve(a, b) |
nothing calls this directly
no test coverage detected