提交 5df7cb2f authored 作者: Frederic Bastien's avatar Frederic Bastien

Repair the OpenCL init code

上级 be857f27
...@@ -65,8 +65,9 @@ def init_dev(dev, name=None): ...@@ -65,8 +65,9 @@ def init_dev(dev, name=None):
reg_context(name, context) reg_context(name, context)
pygpu_activated = True pygpu_activated = True
if config.print_active_device: if config.print_active_device:
cudnn_version = "not available"
warn = None warn = None
cudnn_version = ""
if dev.startswith('cuda'):
try: try:
cudnn_version = dnn.version() cudnn_version = dnn.version()
# 4100 should not print warning with cudnn 4 final. # 4100 should not print warning with cudnn 4 final.
...@@ -74,10 +75,10 @@ def init_dev(dev, name=None): ...@@ -74,10 +75,10 @@ def init_dev(dev, name=None):
warn = ("Your CuDNN version is more recent then Theano." warn = ("Your CuDNN version is more recent then Theano."
" If you see problems, try updating Theano or" " If you see problems, try updating Theano or"
" downgrading CuDNN to version 4.") " downgrading CuDNN to version 4.")
cudnn_version = " (CuDNN version %s)" % cudnn_version
except Exception: except Exception:
raise RuntimeError("CuDNN is mandatory with the GpuArray back-end.") raise RuntimeError("CuDNN is mandatory with the GpuArray back-end.")
print("Mapped name %s to device %s: %s (CuDNN version %s)" % ( print("Mapped name %s to device %s: %s%s" % (
name, dev, context.devname, cudnn_version), name, dev, context.devname, cudnn_version),
file=sys.stderr) file=sys.stderr)
if warn: if warn:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论