Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
486f4931
提交
486f4931
authored
2月 07, 2013
作者:
Pascal Lamblin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use nvcc_compiler.compile_str to compile something that is not a python module
上级
ace3920c
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
5 行增加
和
1 行删除
+5
-1
nvcc_compiler.py
theano/sandbox/cuda/nvcc_compiler.py
+5
-1
没有找到文件。
theano/sandbox/cuda/nvcc_compiler.py
浏览文件 @
486f4931
...
@@ -164,7 +164,7 @@ class NVCC_compiler(object):
...
@@ -164,7 +164,7 @@ class NVCC_compiler(object):
def
compile_str
(
def
compile_str
(
module_name
,
src_code
,
module_name
,
src_code
,
location
=
None
,
include_dirs
=
[],
lib_dirs
=
[],
libs
=
[],
preargs
=
[],
location
=
None
,
include_dirs
=
[],
lib_dirs
=
[],
libs
=
[],
preargs
=
[],
rpaths
=
rpath_defaults
):
rpaths
=
rpath_defaults
,
py_module
=
True
):
""":param module_name: string (this has been embedded in the src_code
""":param module_name: string (this has been embedded in the src_code
:param src_code: a complete c or c++ source listing for the module
:param src_code: a complete c or c++ source listing for the module
:param location: a pre-existing filesystem directory where the
:param location: a pre-existing filesystem directory where the
...
@@ -178,8 +178,11 @@ class NVCC_compiler(object):
...
@@ -178,8 +178,11 @@ class NVCC_compiler(object):
:param preargs: a list of extra compiler arguments
:param preargs: a list of extra compiler arguments
:param rpaths: list of rpaths to use with Xlinker.
:param rpaths: list of rpaths to use with Xlinker.
Defaults to `rpath_defaults`.
Defaults to `rpath_defaults`.
:param py_module: if False, compile to a shared library, but
do not import as a Python module.
:returns: dynamically-imported python module of the compiled code.
:returns: dynamically-imported python module of the compiled code.
(unless py_module is False, in that case returns None.)
:note 1: On Windows 7 with nvcc 3.1 we need to compile in the
:note 1: On Windows 7 with nvcc 3.1 we need to compile in the
real directory Otherwise nvcc never finish.
real directory Otherwise nvcc never finish.
...
@@ -393,6 +396,7 @@ class NVCC_compiler(object):
...
@@ -393,6 +396,7 @@ class NVCC_compiler(object):
# this doesn't happen to my knowledge
# this doesn't happen to my knowledge
print
>>
sys
.
stderr
,
"DEBUG: nvcc STDOUT"
,
nvcc_stdout
print
>>
sys
.
stderr
,
"DEBUG: nvcc STDOUT"
,
nvcc_stdout
if
py_module
:
#touch the __init__ file
#touch the __init__ file
file
(
os
.
path
.
join
(
location
,
"__init__.py"
),
'w'
)
.
close
()
file
(
os
.
path
.
join
(
location
,
"__init__.py"
),
'w'
)
.
close
()
return
dlimport
(
lib_filename
)
return
dlimport
(
lib_filename
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论