def _run(self, func, num_iters, execution_mode=None):
    ctx = context.context()
    with ctx.execution_mode(execution_mode):
        func()
        if (execution_mode == context.ASYNC):
            ctx.async_wait()
        start = time.time()
        for _ in xrange(num_iters):
            func()
        if (execution_mode == context.ASYNC):
            ctx.async_wait()
        end = time.time()
        mean_us = (((end - start) * 1000000.0) / num_iters)
        self.report_benchmark(iters=num_iters, wall_time=mean_us, extras={'examples_per_sec': (num_iters / (end - start))})
def _run(self, func, num_iters, execution_mode=None):
    ctx = context.context()
    with ctx.execution_mode(execution_mode):
        func()
        if (execution_mode == context.ASYNC):
            ctx.async_wait()
        start = time.time()
        for _ in xrange(num_iters):
            func()
        if (execution_mode == context.ASYNC):
            ctx.async_wait()
        end = time.time()
        mean_us = (((end - start) * 1000000.0) / num_iters)
        self.report_benchmark(iters=num_iters, wall_time=mean_us, extras={'examples_per_sec': (num_iters / (end - start))})