Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
418c8d8e
提交
418c8d8e
authored
5月 05, 2017
作者:
Alexander Matyasko
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Init magma once per gpu context
上级
e40ad6b7
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
12 行增加
和
9 行删除
+12
-9
linalg.py
theano/gpuarray/linalg.py
+12
-1
magma_cholesky.c
theano/gpuarray/magma_cholesky.c
+0
-2
magma_eigh.c
theano/gpuarray/magma_eigh.c
+0
-2
magma_inv.c
theano/gpuarray/magma_inv.c
+0
-1
magma_qr.c
theano/gpuarray/magma_qr.c
+0
-2
magma_svd.c
theano/gpuarray/magma_svd.c
+0
-1
没有找到文件。
theano/gpuarray/linalg.py
浏览文件 @
418c8d8e
...
...
@@ -375,8 +375,18 @@ class GpuMagmaBase(COp):
return
[
config
.
magma
.
library_path
]
return
[]
def
prepare_node
(
self
,
node
,
storage_map
,
compute_map
,
impl
):
from
skcuda.magma
import
magma_init
ctx
=
node
.
inputs
[
0
]
.
type
.
context
if
not
getattr
(
ctx
,
'is_magma_initialized'
,
False
):
magma_init
()
ctx
.
is_magma_initialized
=
True
def
get_params
(
self
,
node
):
return
node
.
inputs
[
0
]
.
type
.
context
class
GpuMagmaSVD
(
COp
):
class
GpuMagmaSVD
(
GpuMagmaBase
):
"""Computes the svd of a matrix :math:`A` using magma library.
.. warning::
...
...
@@ -418,6 +428,7 @@ class GpuMagmaSVD(COp):
context_name
=
ctx_name
)()])
def
prepare_node
(
self
,
node
,
storage_map
,
compute_map
,
impl
):
super
(
GpuMagmaSVD
,
self
)
.
prepare_node
(
node
,
storage_map
,
compute_map
,
impl
)
# Check node to prevent eventual errors with old pickled nodes.
if
self
.
compute_uv
:
A
,
B
,
C
=
node
.
outputs
...
...
theano/gpuarray/magma_cholesky.c
浏览文件 @
418c8d8e
...
...
@@ -65,7 +65,6 @@ int APPLY_SPECIFIC(magma_cholesky)(PyGpuArrayObject *A, PyGpuArrayObject **L,
// This is early to match the exit() in the fail label.
cuda_enter
(
c
->
ctx
);
magma_init
();
#ifdef INPLACE
Py_XDECREF
(
*
L
);
...
...
@@ -125,7 +124,6 @@ int APPLY_SPECIFIC(magma_cholesky)(PyGpuArrayObject *A, PyGpuArrayObject **L,
#endif
res
=
0
;
fail:
magma_finalize
();
cuda_exit
(
c
->
ctx
);
return
res
;
}
theano/gpuarray/magma_eigh.c
浏览文件 @
418c8d8e
...
...
@@ -47,7 +47,6 @@ int APPLY_SPECIFIC(magma_eigh)(PyGpuArrayObject *A_,
// This is early to match the exit() in the fail label.
cuda_enter
(
c
->
ctx
);
magma_init
();
// magma matrix eigen decomposition of a symmetric matrix
N
=
PyGpuArray_DIM
(
A
,
0
);
...
...
@@ -133,7 +132,6 @@ fail:
magma_free_pinned
(
work_data
);
if
(
iwork_data
!=
NULL
)
magma_free_cpu
(
iwork_data
);
magma_finalize
();
cuda_exit
(
c
->
ctx
);
return
res
;
}
theano/gpuarray/magma_inv.c
浏览文件 @
418c8d8e
...
...
@@ -93,7 +93,6 @@ fail:
magma_free
(
piv
);
if
(
dwork
!=
NULL
)
gpudata_release
(
dwork
);
magma_finalize
();
cuda_exit
(
params
->
context
->
ctx
);
return
res
;
}
theano/gpuarray/magma_qr.c
浏览文件 @
418c8d8e
...
...
@@ -67,7 +67,6 @@ int APPLY_SPECIFIC(magma_qr)(PyGpuArrayObject *A_,
// This is early to match the exit() in the fail label.
cuda_enter
(
c
->
ctx
);
magma_init
();
// magma matrix qr
M
=
PyGpuArray_DIM
(
A
,
0
);
...
...
@@ -148,7 +147,6 @@ fail:
magma_free_pinned
(
tau_data
);
if
(
work_data
!=
NULL
)
gpudata_release
(
work_data
);
magma_finalize
();
cuda_exit
(
c
->
ctx
);
return
res
;
}
theano/gpuarray/magma_svd.c
浏览文件 @
418c8d8e
...
...
@@ -166,7 +166,6 @@ fail:
magma_free_pinned
(
work
);
if
(
iwork
!=
NULL
)
magma_free_cpu
(
iwork
);
magma_finalize
();
cuda_exit
(
params
->
context
->
ctx
);
return
res
;
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论