提交 272620f9 authored 作者: nouiz's avatar nouiz

Merge pull request #690 from nouiz/lock

small fix: load at the module level, not in the sub function. I merge it myself as this is a small fix that break the cuda code. Don't hesitate to review it.
...@@ -98,7 +98,7 @@ def try_import(): ...@@ -98,7 +98,7 @@ def try_import():
# be in sys.path. # be in sys.path.
if config.compiledir not in sys.path: if config.compiledir not in sys.path:
sys.path.append(config.compiledir) sys.path.append(config.compiledir)
from cuda_ndarray.cuda_ndarray import * import cuda_ndarray.cuda_ndarray
except ImportError: except ImportError:
return False return False
return True return True
...@@ -156,6 +156,9 @@ if compile_cuda_ndarray: ...@@ -156,6 +156,9 @@ if compile_cuda_ndarray:
del compile_cuda_ndarray del compile_cuda_ndarray
if cuda_available: if cuda_available:
# The module should be compiled.
from cuda_ndarray.cuda_ndarray import *
# If necessary, # If necessary,
# create a symlink called libcuda_ndarray.so # create a symlink called libcuda_ndarray.so
# which nvcc_compiler.NVCC_compiler uses when linking # which nvcc_compiler.NVCC_compiler uses when linking
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论