Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
916f3b55
提交
916f3b55
authored
2月 03, 2014
作者:
Frédéric Bastien
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1714 from abergeron/fix_slow_mac
Hide symbols in compiled modules
上级
2f8a4deb
89fc075a
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
13 行增加
和
11 行删除
+13
-11
cc.py
theano/gof/cc.py
+6
-4
cutils.py
theano/gof/cutils.py
+2
-2
lazylinker_c.c
theano/gof/lazylinker_c.c
+2
-1
blas_headers.py
theano/tensor/blas_headers.py
+3
-4
没有找到文件。
theano/gof/cc.py
浏览文件 @
916f3b55
...
...
@@ -255,6 +255,7 @@ def struct_gen(args, struct_builders, blocks, sub):
# TODO: add some error checking to make sure storage_<x> are
# 1-element lists and __ERROR is a 3-elements list.
struct_code
=
"""
namespace {
struct
%(name)
s {
PyObject* __ERROR;
...
...
@@ -287,6 +288,7 @@ def struct_gen(args, struct_builders, blocks, sub):
%(do_return)
s
}
};
}
"""
%
sub
return
struct_code
...
...
@@ -1285,22 +1287,22 @@ class CLinker(link.Linker):
# instantiate.
if
PY3
:
static
=
"""
int {struct_name}_executor({struct_name} *self) {{
static
int {struct_name}_executor({struct_name} *self) {{
return self->run();
}}
void {struct_name}_destructor(PyObject *capsule) {{
static
void {struct_name}_destructor(PyObject *capsule) {{
{struct_name} *self = ({struct_name} *)PyCapsule_GetContext(capsule);
delete self;
}}
"""
.
format
(
struct_name
=
self
.
struct_name
)
else
:
static
=
"""
int
%(struct_name)
s_executor(
%(struct_name)
s* self) {
static
int
%(struct_name)
s_executor(
%(struct_name)
s* self) {
return self->run();
}
void
%(struct_name)
s_destructor(void* executor, void* self) {
static
void
%(struct_name)
s_destructor(void* executor, void* self) {
delete ((
%(struct_name)
s*)self);
}
"""
%
dict
(
struct_name
=
self
.
struct_name
)
...
...
theano/gof/cutils.py
浏览文件 @
916f3b55
...
...
@@ -51,7 +51,7 @@ def compile_cutils():
'op'
:
complexadd
%
{
'type'
:
t
}}
for
t
in
complex_types
])
fn_array
=
(
"inplace_map_binop addition_funcs[] = {"
+
fn_array
=
(
"
static
inplace_map_binop addition_funcs[] = {"
+
''
.
join
([
"""
#if defined(
%(typen)
s)
%(type)
s_inplace_add,
...
...
@@ -61,7 +61,7 @@ def compile_cutils():
"""NULL};
"""
)
type_number_array
=
(
"int type_numbers[] = {"
+
type_number_array
=
(
"
static
int type_numbers[] = {"
+
''
.
join
([
"""
#if defined(
%(typen)
s)
%(typen)
s,
...
...
theano/gof/lazylinker_c.c
浏览文件 @
916f3b55
...
...
@@ -793,7 +793,8 @@ int lazy_rec_eval(CLazyLinker * self, Py_ssize_t var_idx, PyObject*one, PyObject
set_position_of_error
(
self
,
owner_idx
);
return
err
;
}
PyObject
*
static
PyObject
*
CLazyLinker_call
(
PyObject
*
_self
,
PyObject
*
args
,
PyObject
*
kwds
)
{
CLazyLinker
*
self
=
(
CLazyLinker
*
)
_self
;
...
...
theano/tensor/blas_headers.py
浏览文件 @
916f3b55
...
...
@@ -92,9 +92,8 @@ def detect_macos_sdot_bug():
# Then, try a simple fix
test_fix_code
=
textwrap
.
dedent
(
"""
\
extern "C" float sdot_(int*, float*, int*, float*, int*);
extern "C" float cblas_sdot(int, float*, int, float*, int);
float sdot_(int* Nx, float* x, int* Sx, float* y, int* Sy)
static
float sdot_(int* Nx, float* x, int* Sx, float* y, int* Sy)
{
return cblas_sdot(*Nx, x, *Sx, y, *Sy);
}
...
...
@@ -924,7 +923,7 @@ def blas_header_text():
if
detect_macos_sdot_bug
.
fix_works
:
header
+=
textwrap
.
dedent
(
"""
\
extern "C" float cblas_sdot(int, float*, int, float*, int);
float sdot_(int* Nx, float* x, int* Sx, float* y, int* Sy)
static
float sdot_(int* Nx, float* x, int* Sx, float* y, int* Sy)
{
return cblas_sdot(*Nx, x, *Sx, y, *Sy);
}
...
...
@@ -932,7 +931,7 @@ def blas_header_text():
else
:
# Make sure the buggy version of sdot_ is never used
header
+=
textwrap
.
dedent
(
"""
\
float sdot_(int* Nx, float* x, int* Sx, float* y, int* Sy)
static
float sdot_(int* Nx, float* x, int* Sx, float* y, int* Sy)
{
fprintf(stderr,
"FATAL: The implementation of BLAS SDOT "
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论