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

Repair the OpenCL init code

上级 be857f27
...@@ -65,19 +65,20 @@ def init_dev(dev, name=None): ...@@ -65,19 +65,20 @@ 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
try: cudnn_version = ""
cudnn_version = dnn.version() if dev.startswith('cuda'):
# 4100 should not print warning with cudnn 4 final. try:
if cudnn_version > 4100: cudnn_version = dnn.version()
warn = ("Your CuDNN version is more recent then Theano." # 4100 should not print warning with cudnn 4 final.
" If you see problems, try updating Theano or" if cudnn_version > 4100:
" downgrading CuDNN to version 4.") warn = ("Your CuDNN version is more recent then Theano."
" If you see problems, try updating Theano or"
except Exception: " downgrading CuDNN to version 4.")
raise RuntimeError("CuDNN is mandatory with the GpuArray back-end.") cudnn_version = " (CuDNN version %s)" % cudnn_version
print("Mapped name %s to device %s: %s (CuDNN version %s)" % ( except Exception:
raise RuntimeError("CuDNN is mandatory with the GpuArray back-end.")
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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论