(self)
| 60 | |
| 61 | class SumElements(Benchmark): |
| 62 | def run(self): |
| 63 | op = core.CreateOperator( |
| 64 | "SumElements", |
| 65 | ["X"], |
| 66 | ["y"] |
| 67 | ) |
| 68 | |
| 69 | for n in itertools.imap(pow, itertools.cycle([10]), range(10)): |
| 70 | X = np.random.rand(n).astype(np.float32) |
| 71 | logger.info('Running benchmark for n = {}'.format(n)) |
| 72 | ret = runOpBenchmark(gpu_do, op, inputs=[X]) |
| 73 | self.results.append((n, ret[1])) |
| 74 | |
| 75 | |
| 76 | class SumSqrElements(Benchmark): |