提交 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', ...@@ -338,7 +338,7 @@ AddConfigVar('dnn.include_path',
AddConfigVar('dnn.library_path', AddConfigVar('dnn.library_path',
"Location of the cudnn header (defaults to the cuda root)", "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', AddConfigVar('dnn.enabled',
"'auto', use CuDNN if available, but silently fall back" "'auto', use CuDNN if available, but silently fall back"
......
...@@ -362,6 +362,9 @@ class DnnVersion(GpuOp): ...@@ -362,6 +362,9 @@ class DnnVersion(GpuOp):
def c_lib_dirs(self): def c_lib_dirs(self):
return [config.dnn.library_path] return [config.dnn.library_path]
def c_compile_args(self):
return ['-rpath', config.dnn.library_path]
def c_support_code(self): def c_support_code(self):
return """ return """
#if PY_MAJOR_VERSION >= 3 #if PY_MAJOR_VERSION >= 3
......
...@@ -94,6 +94,9 @@ class DnnBase(GpuOp, COp): ...@@ -94,6 +94,9 @@ class DnnBase(GpuOp, COp):
def c_lib_dirs(self): def c_lib_dirs(self):
return [config.dnn.library_path] return [config.dnn.library_path]
def c_compile_args(self):
return ['-rpath', config.dnn.library_path]
class GpuDnnConvDesc(GpuOp): class GpuDnnConvDesc(GpuOp):
""" """
......
...@@ -224,12 +224,13 @@ class NVCC_compiler(Compiler): ...@@ -224,12 +224,13 @@ class NVCC_compiler(Compiler):
lib_dirs = lib_dirs + std_lib_dirs() lib_dirs = lib_dirs + std_lib_dirs()
# config.dnn.include_path add this by default for cudnn in the if sys.platform != 'darwin':
# new back-end. This should not be used in this back-end. So # config.dnn.include_path add this by default for cudnn in the
# just remove them. # new back-end. This should not be used in this back-end. So
lib_dirs = [ld for ld in lib_dirs if # just remove them.
not(ld == os.path.join(cuda_root, 'lib') or lib_dirs = [ld for ld in lib_dirs if
ld == os.path.join(cuda_root, 'lib64'))] not(ld == os.path.join(cuda_root, 'lib') or
ld == os.path.join(cuda_root, 'lib64'))]
if sys.platform != 'darwin': if sys.platform != 'darwin':
# sometimes, the linker cannot find -lpython so we need to tell it # sometimes, the linker cannot find -lpython so we need to tell it
......
...@@ -171,6 +171,9 @@ class DnnBase(COp): ...@@ -171,6 +171,9 @@ class DnnBase(COp):
def c_lib_dirs(self): def c_lib_dirs(self):
return [config.dnn.library_path] return [config.dnn.library_path]
def c_compile_args(self):
return ['-rpath', config.dnn.library_path]
def c_code_cache_version(self): def c_code_cache_version(self):
return (super(DnnBase, self).c_code_cache_version(), version()) return (super(DnnBase, self).c_code_cache_version(), version())
...@@ -190,6 +193,9 @@ class DnnVersion(Op): ...@@ -190,6 +193,9 @@ class DnnVersion(Op):
def c_lib_dirs(self): def c_lib_dirs(self):
return [config.dnn.library_path] return [config.dnn.library_path]
def c_compile_args(self):
return ['-rpath', config.dnn.library_path]
def c_support_code(self): def c_support_code(self):
return """ return """
#if PY_MAJOR_VERSION >= 3 #if PY_MAJOR_VERSION >= 3
......
...@@ -9,6 +9,7 @@ except ImportError: ...@@ -9,6 +9,7 @@ except ImportError:
import theano import theano
from theano import sparse, config, tensor from theano import sparse, config, tensor
from theano.sparse import enable_sparse from theano.sparse import enable_sparse
from theano.tests import unittest_tools as utt
if not enable_sparse: if not enable_sparse:
raise SkipTest('Optional package sparse disabled') raise SkipTest('Optional package sparse disabled')
...@@ -167,5 +168,5 @@ def test_sd_csc(): ...@@ -167,5 +168,5 @@ def test_sd_csc():
res = theano.sparse.opt.sd_csc(a_val, a_ind, a_ptr, nrows, b).eval() 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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论