提交 a9286c50 authored 作者: Frederic's avatar Frederic

Sync the timming when using the GPU. Otherwise, we end up with 0s!

上级 5de2bd22
......@@ -90,9 +90,14 @@ def execute(execute=True, verbose=True, M=2000, N=2000, K=2000,
t1 = -1
if execute:
sync = (hasattr(theano, "sandbox") and
hasattr(theano.sandbox, "cuda") and
theano.sandbox.cuda.cuda_available)
t0 = time.time()
for i in range(iters):
f()
if sync:
theano.sandbox.cuda.synchronize()
t1 = time.time()
return t1 - t0, impl
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论