提交 0e66c380 authored 作者: Frédéric Bastien's avatar Frédéric Bastien

Merge pull request #4208 from abergeron/fix_cudnn_mac

Fix problems for release
......@@ -338,7 +338,7 @@ AddConfigVar('dnn.include_path',
AddConfigVar('dnn.library_path',
"Location of the cudnn header (defaults to the cuda root)",
StrParam(default_dnn_path('lib64')))
StrParam(default_dnn_path('lib' if sys.platform == 'darwin' else 'lib64')))
AddConfigVar('dnn.enabled',
"'auto', use CuDNN if available, but silently fall back"
......
......@@ -362,6 +362,9 @@ class DnnVersion(GpuOp):
def c_lib_dirs(self):
return [config.dnn.library_path]
def c_compile_args(self):
return ['-rpath', config.dnn.library_path]
def c_support_code(self):
return """
#if PY_MAJOR_VERSION >= 3
......
......@@ -94,6 +94,9 @@ class DnnBase(GpuOp, COp):
def c_lib_dirs(self):
return [config.dnn.library_path]
def c_compile_args(self):
return ['-rpath', config.dnn.library_path]
class GpuDnnConvDesc(GpuOp):
"""
......
......@@ -224,6 +224,7 @@ class NVCC_compiler(Compiler):
lib_dirs = lib_dirs + std_lib_dirs()
if sys.platform != 'darwin':
# config.dnn.include_path add this by default for cudnn in the
# new back-end. This should not be used in this back-end. So
# just remove them.
......
......@@ -171,6 +171,9 @@ class DnnBase(COp):
def c_lib_dirs(self):
return [config.dnn.library_path]
def c_compile_args(self):
return ['-rpath', config.dnn.library_path]
def c_code_cache_version(self):
return (super(DnnBase, self).c_code_cache_version(), version())
......@@ -190,6 +193,9 @@ class DnnVersion(Op):
def c_lib_dirs(self):
return [config.dnn.library_path]
def c_compile_args(self):
return ['-rpath', config.dnn.library_path]
def c_support_code(self):
return """
#if PY_MAJOR_VERSION >= 3
......
......@@ -9,6 +9,7 @@ except ImportError:
import theano
from theano import sparse, config, tensor
from theano.sparse import enable_sparse
from theano.tests import unittest_tools as utt
if not enable_sparse:
raise SkipTest('Optional package sparse disabled')
......@@ -167,5 +168,5 @@ def test_sd_csc():
res = theano.sparse.opt.sd_csc(a_val, a_ind, a_ptr, nrows, b).eval()
assert (res==target).all()
utt.assert_allclose(res, target)
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论