Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
c38e7ba3
提交
c38e7ba3
authored
12月 01, 2023
作者:
lucianopaz
提交者:
Thomas Wiecki
12月 01, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add _logger.debug statements to cmodule default blas ldflags
上级
af7ed248
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
29 行增加
和
11 行删除
+29
-11
cmodule.py
pytensor/link/c/cmodule.py
+29
-11
没有找到文件。
pytensor/link/c/cmodule.py
浏览文件 @
c38e7ba3
...
...
@@ -2718,6 +2718,7 @@ def default_blas_ldflags():
found
=
True
break
if
not
found
:
_logger
.
debug
(
"Required file '
%
s' not found"
,
req
)
raise
RuntimeError
(
f
"Required file {req} not found"
)
return
libs
...
...
@@ -2779,9 +2780,15 @@ def default_blas_ldflags():
res
=
try_blas_flag
(
flags
)
if
res
:
if
any
(
"mkl"
in
flag
for
flag
in
flags
):
check_mkl_openmp
()
try
:
check_mkl_openmp
()
except
Exception
as
e
:
_logger
.
debug
(
e
)
_logger
.
debug
(
"The following blas flags will be used: '
%
s'"
,
res
)
return
res
else
:
_logger
.
debug
(
f
"Supplied flags {res} failed to compile"
)
_logger
.
debug
(
"Supplied flags '
%
s' failed to compile"
,
res
)
raise
RuntimeError
(
f
"Supplied flags {flags} failed to compile"
)
# If no compiler is available we default to empty ldflags
...
...
@@ -2802,6 +2809,11 @@ def default_blas_ldflags():
# directory. We will include both in our searched library dirs
searched_library_dirs
.
append
(
os
.
path
.
join
(
sys
.
prefix
,
"Library"
,
"bin"
))
searched_library_dirs
.
append
(
os
.
path
.
join
(
sys
.
prefix
,
"Library"
,
"lib"
))
search_dirs
=
"
\n
"
.
join
(
searched_library_dirs
)
_logger
.
debug
(
"Will search for BLAS libraries in the following directories:
\n
%
s"
,
search_dirs
,
)
all_libs
=
[
l
for
path
in
[
...
...
@@ -2817,6 +2829,7 @@ def default_blas_ldflags():
maybe_add_to_os_environ_pathlist
(
"PATH"
,
rpath
)
try
:
# 1. Try to use MKL with INTEL OpenMP threading
_logger
.
debug
(
"Checking MKL flags with intel threading"
)
return
check_libs
(
all_libs
,
required_libs
=
[
...
...
@@ -2829,19 +2842,21 @@ def default_blas_ldflags():
extra_compile_flags
=
[
f
"-Wl,-rpath,{rpath}"
]
if
rpath
is
not
None
else
[],
cxx_library_dirs
=
cxx_library_dirs
,
)
except
Exception
:
pass
except
Exception
as
e
:
_logger
.
debug
(
e
)
try
:
# 2. Try to use MKL with GNU OpenMP threading
_logger
.
debug
(
"Checking MKL flags with GNU OpenMP threading"
)
return
check_libs
(
all_libs
,
required_libs
=
[
"mkl_core"
,
"mkl_rt"
,
"mkl_gnu_thread"
,
"gomp"
,
"pthread"
],
extra_compile_flags
=
[
f
"-Wl,-rpath,{rpath}"
]
if
rpath
is
not
None
else
[],
cxx_library_dirs
=
cxx_library_dirs
,
)
except
Exception
:
pass
except
Exception
as
e
:
_logger
.
debug
(
e
)
try
:
_logger
.
debug
(
"Checking Lapack + blas"
)
# 3. Try to use LAPACK + BLAS
return
check_libs
(
all_libs
,
...
...
@@ -2849,20 +2864,22 @@ def default_blas_ldflags():
extra_compile_flags
=
[
f
"-Wl,-rpath,{rpath}"
]
if
rpath
is
not
None
else
[],
cxx_library_dirs
=
cxx_library_dirs
,
)
except
Exception
:
pass
except
Exception
as
e
:
_logger
.
debug
(
e
)
try
:
# 4. Try to use BLAS alone
_logger
.
debug
(
"Checking blas alone"
)
return
check_libs
(
all_libs
,
required_libs
=
[
"blas"
,
"cblas"
],
extra_compile_flags
=
[
f
"-Wl,-rpath,{rpath}"
]
if
rpath
is
not
None
else
[],
cxx_library_dirs
=
cxx_library_dirs
,
)
except
Exception
:
pass
except
Exception
as
e
:
_logger
.
debug
(
e
)
try
:
# 5. Try to use openblas
_logger
.
debug
(
"Checking openblas"
)
return
check_libs
(
all_libs
,
required_libs
=
[
"openblas"
,
"gfortran"
,
"gomp"
,
"m"
],
...
...
@@ -2871,8 +2888,9 @@ def default_blas_ldflags():
else
[
"-fopenmp"
],
cxx_library_dirs
=
cxx_library_dirs
,
)
except
Exception
:
pass
except
Exception
as
e
:
_logger
.
debug
(
e
)
_logger
.
debug
(
"Failed to identify blas ldflags. Will leave them empty."
)
return
""
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论