Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
c79ebd11
提交
c79ebd11
authored
7月 01, 2011
作者:
James Bergstra
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
nvcc_compile now links against cuda_ndarray.so using -lcuda_ndarray
上级
580367c1
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
21 行增加
和
3 行删除
+21
-3
__init__.py
theano/sandbox/cuda/__init__.py
+19
-1
nvcc_compiler.py
theano/sandbox/cuda/nvcc_compiler.py
+2
-2
没有找到文件。
theano/sandbox/cuda/__init__.py
浏览文件 @
c79ebd11
...
@@ -71,6 +71,17 @@ date = max(stat_times)
...
@@ -71,6 +71,17 @@ date = max(stat_times)
cuda_ndarray_loc
=
os
.
path
.
join
(
config
.
compiledir
,
'cuda_ndarray'
)
cuda_ndarray_loc
=
os
.
path
.
join
(
config
.
compiledir
,
'cuda_ndarray'
)
cuda_ndarray_so
=
os
.
path
.
join
(
cuda_ndarray_loc
,
cuda_ndarray_so
=
os
.
path
.
join
(
cuda_ndarray_loc
,
'cuda_ndarray.'
+
get_lib_extension
())
'cuda_ndarray.'
+
get_lib_extension
())
libcuda_ndarray_so
=
os
.
path
.
join
(
cuda_ndarray_loc
,
'libcuda_ndarray.'
+
get_lib_extension
())
# Add the theano cache directory's cuda_ndarray subdirectory to the list of
# places that are hard-coded into compiled modules' runtime library search
# list. This works in conjunction with nvcc_compiler.nvcc_module_compile_str
# which adds this folder during compilation with -L and also adds -lcuda_ndarray
# when compiling modules.
nvcc_compiler
.
add_standard_rpath
(
cuda_ndarray_loc
)
compile_cuda_ndarray
=
True
compile_cuda_ndarray
=
True
if
os
.
path
.
exists
(
cuda_ndarray_so
):
if
os
.
path
.
exists
(
cuda_ndarray_so
):
...
@@ -106,7 +117,14 @@ try:
...
@@ -106,7 +117,14 @@ try:
code
,
code
,
location
=
cuda_ndarray_loc
,
location
=
cuda_ndarray_loc
,
include_dirs
=
[
cuda_path
],
libs
=
[
'cublas'
])
include_dirs
=
[
cuda_path
],
libs
=
[
'cublas'
])
# If necessary,
# create a symlink called libcuda_ndarray.so
# which nvcc_module_compile_str uses when linking
# any module except "cuda_ndarray" itself.
try
:
open
(
libcuda_ndarray_so
)
.
close
()
except
IOError
:
os
.
symlink
(
cuda_ndarray_so
,
libcuda_ndarray_so
)
from
cuda_ndarray.cuda_ndarray
import
*
from
cuda_ndarray.cuda_ndarray
import
*
except
Exception
,
e
:
except
Exception
,
e
:
error
(
"Failed to compile cuda_ndarray.cu:
%
s"
%
str
(
e
))
error
(
"Failed to compile cuda_ndarray.cu:
%
s"
%
str
(
e
))
...
...
theano/sandbox/cuda/nvcc_compiler.py
浏览文件 @
c79ebd11
...
@@ -191,10 +191,10 @@ def nvcc_module_compile_str(
...
@@ -191,10 +191,10 @@ def nvcc_module_compile_str(
cmd
.
extend
(
'-I
%
s'
%
idir
for
idir
in
include_dirs
)
cmd
.
extend
(
'-I
%
s'
%
idir
for
idir
in
include_dirs
)
cmd
.
extend
([
'-o'
,
lib_filename
])
cmd
.
extend
([
'-o'
,
lib_filename
])
cmd
.
append
(
os
.
path
.
split
(
cppfilename
)[
-
1
])
cmd
.
append
(
os
.
path
.
split
(
cppfilename
)[
-
1
])
if
module_name
!=
'cuda_ndarray'
:
cmd
.
append
(
os
.
path
.
join
(
os
.
path
.
split
(
cppfilename
)[
0
],
'..'
,
'cuda_ndarray'
,
'cuda_ndarray.'
+
get_lib_extension
()))
cmd
.
extend
([
'-L
%
s'
%
ldir
for
ldir
in
lib_dirs
])
cmd
.
extend
([
'-L
%
s'
%
ldir
for
ldir
in
lib_dirs
])
cmd
.
extend
([
'-l
%
s'
%
l
for
l
in
libs
])
cmd
.
extend
([
'-l
%
s'
%
l
for
l
in
libs
])
if
module_name
!=
'cuda_ndarray'
:
cmd
.
append
(
"-lcuda_ndarray"
)
if
sys
.
platform
==
'darwin'
:
if
sys
.
platform
==
'darwin'
:
cmd
.
extend
(
darwin_python_lib
.
split
())
cmd
.
extend
(
darwin_python_lib
.
split
())
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论