Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
e9235e29
提交
e9235e29
authored
8月 10, 2015
作者:
Iban Harlouchet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
numpydoc for theano/sandbox/cuda/nvcc_compiler.py
上级
1ca77e11
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
39 行增加
和
22 行删除
+39
-22
nvcc_compiler.py
theano/sandbox/cuda/nvcc_compiler.py
+39
-22
没有找到文件。
theano/sandbox/cuda/nvcc_compiler.py
浏览文件 @
e9235e29
...
...
@@ -85,7 +85,10 @@ nvcc_version = None
def
is_nvcc_available
():
"""Return True iff the nvcc compiler is found."""
"""
Return True iff the nvcc compiler is found.
"""
def
set_version
():
p_out
=
output_subprocess_Popen
([
nvcc_path
,
'--version'
])
ver_line
=
decode
(
p_out
[
0
])
.
strip
()
.
split
(
'
\n
'
)[
-
1
]
...
...
@@ -150,6 +153,7 @@ class NVCC_compiler(Compiler):
"""
This args will be received by compile_str() in the preargs paramter.
They will also be included in the "hard" part of the key module.
"""
flags
=
[
flag
for
flag
in
config
.
nvcc
.
flags
.
split
(
' '
)
if
flag
]
if
config
.
nvcc
.
fastmath
:
...
...
@@ -209,33 +213,46 @@ class NVCC_compiler(Compiler):
module_name
,
src_code
,
location
=
None
,
include_dirs
=
[],
lib_dirs
=
[],
libs
=
[],
preargs
=
[],
rpaths
=
rpath_defaults
,
py_module
=
True
,
hide_symbols
=
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
cpp file and .so will be written
:param include_dirs: a list of include directory names
(each gets prefixed with -I)
:param lib_dirs: a list of library search path directory names
(each gets prefixed with -L)
:param libs: a list of libraries to link with
(each gets prefixed with -l)
: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.
"""
:param hide_symbols: if True (the default), hide all symbols
from the library symbol table unless explicitely exported.
Parameters
----------
module_name: str
This has been embedded in the src_code.
src_code
A complete c or c++ source listing for the module.
location
A pre-existing filesystem directory where the
cpp file and .so will be written.
include_dirs
A list of include directory names (each gets prefixed with -I).
lib_dirs
A list of library search path directory names (each gets
prefixed with -L).
libs
A list of libraries to link with (each gets prefixed with -l).
preargs
A list of extra compiler arguments.
rpaths
List of rpaths to use with Xlinker. Defaults to `rpath_defaults`.
py_module
If False, compile to a shared library, but
do not import as a Python module.
hide_symbols
If True (the default), hide all symbols from the library symbol
table unless explicitely exported.
: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
real directory Otherwise nvcc never finish.
Notes
-----
On Windows 7 with nvcc 3.1 we need to compile in the real directory
Otherwise nvcc never finish.
"""
rpaths
=
list
(
rpaths
)
if
sys
.
platform
==
"win32"
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论