Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
f1b10057
提交
f1b10057
authored
2月 27, 2013
作者:
Pascal Lamblin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add logging statements to help debug if needed
上级
1e9ad459
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
13 行增加
和
0 行删除
+13
-0
blas_headers.py
theano/tensor/blas_headers.py
+13
-0
没有找到文件。
theano/tensor/blas_headers.py
浏览文件 @
f1b10057
...
...
@@ -3,12 +3,16 @@
There is no standard name or location for this header, so we just insert it
ourselves into the C code
"""
import
logging
import
textwrap
import
sys
from
theano
import
config
from
theano.gof.cmodule
import
GCC_compiler
_logger
=
logging
.
getLogger
(
'theano.tensor.blas'
)
#_logger.setLevel(logging.INFO)
def
detect_macos_sdot_bug
():
"""
...
...
@@ -29,10 +33,12 @@ def detect_macos_sdot_bug():
- detect_macos_sdot_bug.fix_works will be set to True if the fix was
attempted, and succeeded.
"""
_logger
.
debug
(
'Starting detection of bug in Mac OS BLAS sdot_ routine'
)
if
detect_macos_sdot_bug
.
tested
:
return
detect_macos_sdot_bug
.
present
if
sys
.
platform
!=
'darwin'
or
not
config
.
blas
.
ldflags
:
_logger
.
info
(
'Not Mac OS, no sdot_ bug'
)
detect_macos_sdot_bug
.
tested
=
True
return
False
...
...
@@ -63,6 +69,7 @@ def detect_macos_sdot_bug():
}
"""
)
_logger
.
debug
(
'Trying to compile and run test case.'
)
compilation_ok
,
run_ok
=
GCC_compiler
.
try_compile_tmp
(
test_code
,
tmp_prefix
=
'detect_macos_sdot_bug_'
,
flags
=
flags
,
try_run
=
True
)
detect_macos_sdot_bug
.
tested
=
True
...
...
@@ -70,14 +77,17 @@ def detect_macos_sdot_bug():
# If compilation failed, we consider there is a bug,
# and the fix does not work
if
not
compilation_ok
:
_logger
.
info
(
'Could not compile test case for sdot_.'
)
detect_macos_sdot_bug
.
present
=
True
return
True
if
run_ok
:
_logger
.
info
(
'The sdot_ bug is not present on this system.'
)
detect_macos_sdot_bug
.
present
=
False
return
False
# Else, the bug is detected.
_logger
.
info
(
'The sdot_ bug is present on this system.'
)
detect_macos_sdot_bug
.
present
=
True
# Then, try a simple fix
...
...
@@ -104,12 +114,15 @@ def detect_macos_sdot_bug():
}
"""
)
_logger
.
debug
(
'Trying to compile and run tentative workaround.'
)
compilation_fix_ok
,
run_fix_ok
=
GCC_compiler
.
try_compile_tmp
(
test_fix_code
,
tmp_prefix
=
'detect_macos_sdot_bug_testfix_'
,
flags
=
flags
,
try_run
=
True
)
_logger
.
info
(
"Status of tentative fix -- compilation OK:
%
s, works:
%
s"
,
compilation_fix_ok
,
run_fix_ok
)
detect_macos_sdot_bug
.
fix_works
=
run_fix_ok
return
detect_macos_sdot_bug
.
present
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论