Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
d19a4777
提交
d19a4777
authored
1月 07, 2014
作者:
Arnaud Bergeron
提交者:
Frederic
1月 07, 2014
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
First pass at type safety in printfs.
上级
a35f07e3
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
43 行增加
和
29 行删除
+43
-29
conv.cu
theano/sandbox/gpuarray/conv.cu
+43
-29
没有找到文件。
theano/sandbox/gpuarray/conv.cu
浏览文件 @
d19a4777
...
...
@@ -4,8 +4,11 @@
#define SHARED_SIZE (16*1024)
enum
{
ConvMode_FULL
,
ConvMode_VALID
};
PyObject
*
PyGpuArray_Conv
(
PyGpuArrayObject
*
img
,
PyGpuArrayObject
*
kern
,
PyGpuArrayObject
*
out
,
const
int
mode
,
const
size_t
subsample_rows
,
const
size_t
subsample_cols
,
const
int
version
,
const
int
verbose
);
PyObject
*
PyGpuArray_Conv
(
PyGpuArrayObject
*
img
,
PyGpuArrayObject
*
kern
,
PyGpuArrayObject
*
out
,
const
int
mode
,
const
size_t
subsample_rows
,
const
size_t
subsample_cols
,
const
int
version
,
const
int
verbose
);
template
<
typename
T
>
static
T
ceil_intdiv
(
T
a
,
T
b
)
...
...
@@ -18,11 +21,12 @@ static T ceil_intdiv(T a, T b)
* If it can't be executed, we revert to the reference implementation
*/
int
PyGpuArray_conv_valid
(
const
PyGpuArrayObject
*
img
,
const
PyGpuArrayObject
*
kern
,
PyGpuArrayObject
*
out
,
size_t
subsample_rows
,
size_t
subsample_cols
,
PyGpuArray_conv_valid
(
const
PyGpuArrayObject
*
img
,
const
PyGpuArrayObject
*
kern
,
PyGpuArrayObject
*
out
,
size_t
subsample_rows
,
size_t
subsample_cols
,
int
version
=
-
1
,
int
verbose
=
0
,
int
max_threads_dim0
=
512
)
int
max_threads_dim0
=
512
)
{
int
work_complete
=
0
;
const
int
shared_avail
=
SHARED_SIZE
-
150
;
//144 is the biggest static shared size used with compiling this file.
...
...
@@ -49,32 +53,42 @@ PyGpuArray_conv_valid(const PyGpuArrayObject *img, const PyGpuArrayObject * kern
" MACRO kern_width=%d with inputs:
\n
"
,
version
,
THEANO_KERN_WID
);
fprintf
(
stderr
,
"INFO: img dim: %i %i %i %i img stride: %i %i %i %i
\n
"
,
PyGpuArray_DIMS
(
img
)[
0
],
PyGpuArray_DIMS
(
img
)[
1
],
PyGpuArray_DIMS
(
img
)[
2
],
PyGpuArray_DIMS
(
img
)[
3
],
PyGpuArray_STRIDES
(
img
)[
0
]
/
4
,
PyGpuArray_STRIDES
(
img
)[
1
]
/
4
,
PyGpuArray_STRIDES
(
img
)[
2
]
/
4
,
PyGpuArray_STRIDES
(
img
)[
3
]
/
4
);
"INFO: img dim: %llu %llu %llu %llu "
"img stride: %lld %lld %lld %lld
\n
"
,
(
unsigned
long
long
)
PyGpuArray_DIMS
(
img
)[
0
],
(
unsigned
long
long
)
PyGpuArray_DIMS
(
img
)[
1
],
(
unsigned
long
long
)
PyGpuArray_DIMS
(
img
)[
2
],
(
unsigned
long
long
)
PyGpuArray_DIMS
(
img
)[
3
],
(
long
long
)
PyGpuArray_STRIDES
(
img
)[
0
]
/
4
,
(
long
long
)
PyGpuArray_STRIDES
(
img
)[
1
]
/
4
,
(
long
long
)
PyGpuArray_STRIDES
(
img
)[
2
]
/
4
,
(
long
long
)
PyGpuArray_STRIDES
(
img
)[
3
]
/
4
);
fprintf
(
stderr
,
"INFO: kern dim: %i %i %i %i kern stride: %i %i %i %i
\n
"
,
PyGpuArray_DIMS
(
kern
)[
0
],
PyGpuArray_DIMS
(
kern
)[
1
],
PyGpuArray_DIMS
(
kern
)[
2
],
PyGpuArray_DIMS
(
kern
)[
3
],
PyGpuArray_STRIDES
(
kern
)[
0
]
/
4
,
PyGpuArray_STRIDES
(
kern
)[
1
]
/
4
,
PyGpuArray_STRIDES
(
kern
)[
2
]
/
4
,
PyGpuArray_STRIDES
(
kern
)[
3
]
/
4
);
"INFO: kern dim: %llu %llu %llu %llu "
"kern stride: %lld %lld %lld %lld
\n
"
,
(
unsigned
long
long
)
PyGpuArray_DIMS
(
kern
)[
0
],
(
unsigned
long
long
)
PyGpuArray_DIMS
(
kern
)[
1
],
(
unsigned
long
long
)
PyGpuArray_DIMS
(
kern
)[
2
],
(
unsigned
long
long
)
PyGpuArray_DIMS
(
kern
)[
3
],
(
long
long
)
PyGpuArray_STRIDES
(
kern
)[
0
]
/
4
,
(
long
long
)
PyGpuArray_STRIDES
(
kern
)[
1
]
/
4
,
(
long
long
)
PyGpuArray_STRIDES
(
kern
)[
2
]
/
4
,
(
long
long
)
PyGpuArray_STRIDES
(
kern
)[
3
]
/
4
);
fprintf
(
stderr
,
"INFO: out dim: %i %i %i %i out stride: %i %i %i %i
\n
"
,
PyGpuArray_DIMS
(
out
)[
0
],
PyGpuArray_DIMS
(
out
)[
1
],
PyGpuArray_DIMS
(
out
)[
2
],
PyGpuArray_DIMS
(
out
)[
3
],
PyGpuArray_STRIDES
(
out
)[
0
]
/
4
,
PyGpuArray_STRIDES
(
out
)[
1
]
/
4
,
PyGpuArray_STRIDES
(
out
)[
2
]
/
4
,
PyGpuArray_STRIDES
(
out
)[
3
]
/
4
);
"INFO: out dim: %llu %llu %llu %llu "
"out stride: %lld %lld %lld %lld
\n
"
,
(
unsigned
long
long
)
PyGpuArray_DIMS
(
out
)[
0
],
(
unsigned
long
long
)
PyGpuArray_DIMS
(
out
)[
1
],
(
unsigned
long
long
)
PyGpuArray_DIMS
(
out
)[
2
],
(
unsigned
long
long
)
PyGpuArray_DIMS
(
out
)[
3
],
(
long
long
)
PyGpuArray_STRIDES
(
out
)[
0
]
/
4
,
(
long
long
)
PyGpuArray_STRIDES
(
out
)[
1
]
/
4
,
(
long
long
)
PyGpuArray_STRIDES
(
out
)[
2
]
/
4
,
(
long
long
)
PyGpuArray_STRIDES
(
out
)[
3
]
/
4
);
fprintf
(
stderr
,
"INFO: subsample_rows=%d, subsample_cols=%d
\n
"
,
subsample_rows
,
subsample_cols
);
"INFO: subsample_rows=%llu, subsample_cols=%llu
\n
"
,
(
unsigned
long
long
)
subsample_rows
,
(
unsigned
long
long
)
subsample_cols
);
}
//Check the output size is valid
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论