Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
76d1bba8
提交
76d1bba8
authored
3月 24, 2015
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use size_t for shape
上级
544849a2
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
22 行增加
和
6 行删除
+22
-6
basic_ops.py
theano/sandbox/cuda/basic_ops.py
+8
-6
cuda_ndarray.cu
theano/sandbox/cuda/cuda_ndarray.cu
+11
-0
cuda_ndarray.cuh
theano/sandbox/cuda/cuda_ndarray.cuh
+3
-0
没有找到文件。
theano/sandbox/cuda/basic_ops.py
浏览文件 @
76d1bba8
...
@@ -3342,13 +3342,15 @@ class GpuAlloc(GpuOp):
...
@@ -3342,13 +3342,15 @@ class GpuAlloc(GpuOp):
}
}
if (
%(memset_0)
s && CudaNdarray_is_c_contiguous(
%(out)
s))
if (
%(memset_0)
s && CudaNdarray_is_c_contiguous(
%(out)
s))
{
{
if (cudaSuccess != cudaMemset(
%(out)
s->devdata, 0,
cudaError_t err = cudaMemset(
%(out)
s->devdata, 0,
CudaNdarray_SIZE(
%(out)
s) * 4))
CudaNdarray_SIZEt(
%(out)
s) * 4);
if (cudaSuccess != err)
{
{
PyErr_Format(PyExc_MemoryError,
PyErr_Format(PyExc_MemoryError,
"GpuAlloc: Error memsetting
%%
d"
"GpuAlloc: Error memsetting
%%
ld"
" bytes of device memory.",
" bytes of device memory.
%%
s",
CudaNdarray_SIZE(
%(out)
s) * 4);
(long)(CudaNdarray_SIZEt(
%(out)
s) * 4),
cudaGetErrorString(err));
Py_XDECREF(
%(out)
s);
Py_XDECREF(
%(out)
s);
%(out)
s = NULL;
%(out)
s = NULL;
%(fail)
s;
%(fail)
s;
...
@@ -3372,7 +3374,7 @@ class GpuAlloc(GpuOp):
...
@@ -3372,7 +3374,7 @@ class GpuAlloc(GpuOp):
return
[
None
for
i
in
inputs
]
return
[
None
for
i
in
inputs
]
def
c_code_cache_version
(
self
):
def
c_code_cache_version
(
self
):
return
(
7
,)
return
(
9
,)
def
do_constant_folding
(
self
,
node
):
def
do_constant_folding
(
self
,
node
):
for
client
in
node
.
outputs
[
0
]
.
clients
:
for
client
in
node
.
outputs
[
0
]
.
clients
:
...
...
theano/sandbox/cuda/cuda_ndarray.cu
浏览文件 @
76d1bba8
...
@@ -5117,6 +5117,17 @@ CudaNdarray_SIZE(const CudaNdarray *self)
...
@@ -5117,6 +5117,17 @@ CudaNdarray_SIZE(const CudaNdarray *self)
}
}
return
size
;
return
size
;
}
}
size_t
CudaNdarray_SIZEt
(
const
CudaNdarray
*
self
)
{
if
(
self
->
nd
==
-
1
)
return
0
;
size_t
size
=
1
;
for
(
int
i
=
0
;
i
<
self
->
nd
;
++
i
)
{
size
*=
CudaNdarray_HOST_DIMS
(
self
)[
i
];
}
return
size
;
}
PyObject
*
PyObject
*
CudaNdarray_SIZE_Object
(
const
CudaNdarray
*
self
,
void
*
closure
)
CudaNdarray_SIZE_Object
(
const
CudaNdarray
*
self
,
void
*
closure
)
...
...
theano/sandbox/cuda/cuda_ndarray.cuh
浏览文件 @
76d1bba8
...
@@ -286,6 +286,9 @@ DllExport float *CudaNdarray_DEV_DATA(const CudaNdarray * self);
...
@@ -286,6 +286,9 @@ DllExport float *CudaNdarray_DEV_DATA(const CudaNdarray * self);
* Return the number of elements in the ndarray (product of the dimensions)
* Return the number of elements in the ndarray (product of the dimensions)
*/
*/
DllExport
int
CudaNdarray_SIZE
(
const
CudaNdarray
*
self
);
DllExport
int
CudaNdarray_SIZE
(
const
CudaNdarray
*
self
);
// Useful as many cuda function use size_t as input. This make sure we use the
// most precission and not int.
DllExport
size_t
CudaNdarray_SIZEt
(
const
CudaNdarray
*
self
);
static
PyObject
*
CudaNdarray_SIZE_Object
(
const
CudaNdarray
*
self
,
void
*
closure
);
static
PyObject
*
CudaNdarray_SIZE_Object
(
const
CudaNdarray
*
self
,
void
*
closure
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论