提交 eb04f03d authored 作者: Frederic Bastien's avatar Frederic Bastien

Correctly check which sync to call, in case both back-end are available, use the one used.

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