Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
f5d3dfad
提交
f5d3dfad
authored
2月 07, 2013
作者:
nouiz
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1206 from lamblin/nvcc_compiler_not_pymodule
Make compile_str able to compile a lib that is not a Python module
上级
f0549499
3ba4b4cc
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
17 行增加
和
8 行删除
+17
-8
cmodule.py
theano/gof/cmodule.py
+9
-4
nvcc_compiler.py
theano/sandbox/cuda/nvcc_compiler.py
+8
-4
没有找到文件。
theano/gof/cmodule.py
浏览文件 @
f5d3dfad
...
...
@@ -1486,7 +1486,7 @@ class GCC_compiler(object):
@staticmethod
def
compile_str
(
module_name
,
src_code
,
location
=
None
,
include_dirs
=
None
,
lib_dirs
=
None
,
libs
=
None
,
preargs
=
None
):
preargs
=
None
,
py_module
=
True
):
"""
:param module_name: string (this has been embedded in the src_code
...
...
@@ -1506,7 +1506,11 @@ class GCC_compiler(object):
:param preargs: a list of extra compiler arguments
:param py_module: if False, compile to a shared library, but do not
import it as a Python module.
:returns: dynamically-imported python module of the compiled code.
(unless py_module is False, in that case returns None.)
"""
#TODO: Do not do the dlimport in this function
...
...
@@ -1631,9 +1635,10 @@ class GCC_compiler(object):
# Print errors just below the command line.
print
compile_stderr
#touch the __init__ file
file
(
os
.
path
.
join
(
location
,
"__init__.py"
),
'w'
)
.
close
()
return
dlimport
(
lib_filename
)
if
py_module
:
#touch the __init__ file
file
(
os
.
path
.
join
(
location
,
"__init__.py"
),
'w'
)
.
close
()
return
dlimport
(
lib_filename
)
def
icc_module_compile_str
(
*
args
):
...
...
theano/sandbox/cuda/nvcc_compiler.py
浏览文件 @
f5d3dfad
...
...
@@ -164,7 +164,7 @@ class NVCC_compiler(object):
def
compile_str
(
module_name
,
src_code
,
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 src_code: a complete c or c++ source listing for the module
:param location: a pre-existing filesystem directory where the
...
...
@@ -178,8 +178,11 @@ class NVCC_compiler(object):
:param preargs: a list of extra compiler arguments
:param rpaths: list of rpaths to use with Xlinker.
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.
(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
real directory Otherwise nvcc never finish.
...
...
@@ -393,9 +396,10 @@ class NVCC_compiler(object):
# this doesn't happen to my knowledge
print
>>
sys
.
stderr
,
"DEBUG: nvcc STDOUT"
,
nvcc_stdout
#touch the __init__ file
file
(
os
.
path
.
join
(
location
,
"__init__.py"
),
'w'
)
.
close
()
return
dlimport
(
lib_filename
)
if
py_module
:
#touch the __init__ file
file
(
os
.
path
.
join
(
location
,
"__init__.py"
),
'w'
)
.
close
()
return
dlimport
(
lib_filename
)
def
remove_python_framework_dir
(
cmd
):
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论