提交 a762b617 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Add comments explaining the difference between offset_im and data_im_offset.

上级 8691b31a
...@@ -37,6 +37,8 @@ KERNEL void dilated_im3d2col_kernel(const ga_size n, ...@@ -37,6 +37,8 @@ KERNEL void dilated_im3d2col_kernel(const ga_size n,
GLOBAL_MEM const DTYPE_INPUT_0 * data_im, GLOBAL_MEM const DTYPE_INPUT_0 * data_im,
const ga_size offset_im, const ga_size offset_im,
const ga_size data_im_offset, const ga_size data_im_offset,
// offset_im is the pointer offset for data_im.
// data_im_offset is an offset of elements in the array
const ga_size height, const ga_size width, const ga_size depth, const ga_size height, const ga_size width, const ga_size depth,
const ga_size kernel_h, const ga_size kernel_w, const ga_size kernel_d, const ga_size kernel_h, const ga_size kernel_w, const ga_size kernel_d,
const ga_size dilation_h, const ga_size dilation_w, const ga_size dilation_d, const ga_size dilation_h, const ga_size dilation_w, const ga_size dilation_d,
...@@ -89,6 +91,8 @@ KERNEL void im3d2col_kernel(const ga_size n, ...@@ -89,6 +91,8 @@ KERNEL void im3d2col_kernel(const ga_size n,
GLOBAL_MEM const DTYPE_INPUT_0 * data_im, GLOBAL_MEM const DTYPE_INPUT_0 * data_im,
const ga_size offset_im, const ga_size offset_im,
const ga_size data_im_offset, const ga_size data_im_offset,
// offset_im is the pointer offset for data_im.
// data_im_offset is an offset of elements in the array
const ga_size height, const ga_size width, const ga_size depth, const ga_size height, const ga_size width, const ga_size depth,
const ga_size kernel_h, const ga_size kernel_w, const ga_size kernel_d, const ga_size kernel_h, const ga_size kernel_w, const ga_size kernel_d,
const ga_size pad_h, const ga_size pad_w, const ga_size pad_d, const ga_size pad_h, const ga_size pad_w, const ga_size pad_d,
...@@ -148,6 +152,8 @@ KERNEL void dilated_col2im3d_kernel(const ga_size n, ...@@ -148,6 +152,8 @@ KERNEL void dilated_col2im3d_kernel(const ga_size n,
GLOBAL_MEM DTYPE_INPUT_0 * data_im, GLOBAL_MEM DTYPE_INPUT_0 * data_im,
const ga_size offset_im, const ga_size offset_im,
const ga_size data_im_offset) { const ga_size data_im_offset) {
// offset_im is the pointer offset for data_im.
// data_im_offset is an offset of elements in the array
data_im = (GLOBAL_MEM DTYPE_INPUT_0 *)(((char *)data_im) + offset_im); data_im = (GLOBAL_MEM DTYPE_INPUT_0 *)(((char *)data_im) + offset_im);
data_col = (GLOBAL_MEM DTYPE_INPUT_0 *)(((char *)data_col) + offset_col); data_col = (GLOBAL_MEM DTYPE_INPUT_0 *)(((char *)data_col) + offset_col);
// grid stride looping // grid stride looping
...@@ -201,6 +207,7 @@ KERNEL void dilated_col2im3d_kernel(const ga_size n, ...@@ -201,6 +207,7 @@ KERNEL void dilated_col2im3d_kernel(const ga_size n,
} }
#kernel col2im3d_kernel : size, *, size, size, size, size, size, size, size, size, size, size, size, size, size, size, size, size, size, *, size, size : #kernel col2im3d_kernel : size, *, size, size, size, size, size, size, size, size, size, size, size, size, size, size, size, size, size, *, size, size :
KERNEL void col2im3d_kernel(const ga_size n, KERNEL void col2im3d_kernel(const ga_size n,
GLOBAL_MEM const DTYPE_INPUT_0 * data_col, GLOBAL_MEM const DTYPE_INPUT_0 * data_col,
const ga_size offset_col, const ga_size offset_col,
...@@ -213,6 +220,8 @@ KERNEL void col2im3d_kernel(const ga_size n, ...@@ -213,6 +220,8 @@ KERNEL void col2im3d_kernel(const ga_size n,
GLOBAL_MEM DTYPE_INPUT_0 * data_im, GLOBAL_MEM DTYPE_INPUT_0 * data_im,
const ga_size offset_im, const ga_size offset_im,
const ga_size data_im_offset) { const ga_size data_im_offset) {
// offset_im is the pointer offset for data_im.
// data_im_offset is an offset of elements in the array
data_im = (GLOBAL_MEM DTYPE_INPUT_0 *)(((char *)data_im) + offset_im); data_im = (GLOBAL_MEM DTYPE_INPUT_0 *)(((char *)data_im) + offset_im);
data_col = (GLOBAL_MEM DTYPE_INPUT_0 *)(((char *)data_col) + offset_col); data_col = (GLOBAL_MEM DTYPE_INPUT_0 *)(((char *)data_col) + offset_col);
// grid stride looping // grid stride looping
......
...@@ -37,6 +37,8 @@ KERNEL void dilated_im2col_kernel(const ga_size n, ...@@ -37,6 +37,8 @@ KERNEL void dilated_im2col_kernel(const ga_size n,
GLOBAL_MEM const DTYPE_INPUT_0 * data_im, GLOBAL_MEM const DTYPE_INPUT_0 * data_im,
const ga_size offset_im, const ga_size offset_im,
const ga_size data_im_offset, const ga_size data_im_offset,
// offset_im is the pointer offset for data_im.
// data_im_offset is an offset of elements in the array
const ga_size height, const ga_size width, const ga_size height, const ga_size width,
const ga_size kernel_h, const ga_size kernel_w, const ga_size kernel_h, const ga_size kernel_w,
const ga_size dilation_h, const ga_size dilation_w, const ga_size dilation_h, const ga_size dilation_w,
...@@ -75,10 +77,13 @@ KERNEL void dilated_im2col_kernel(const ga_size n, ...@@ -75,10 +77,13 @@ KERNEL void dilated_im2col_kernel(const ga_size n,
} }
#kernel im2col_kernel : size, *, size, size, size, size, size, size, size, size, size, size, size, size, *, size : #kernel im2col_kernel : size, *, size, size, size, size, size, size, size, size, size, size, size, size, *, size :
KERNEL void im2col_kernel(const ga_size n, KERNEL void im2col_kernel(const ga_size n,
GLOBAL_MEM const DTYPE_INPUT_0 * data_im, GLOBAL_MEM const DTYPE_INPUT_0 * data_im,
const ga_size offset_im, const ga_size offset_im,
const ga_size data_im_offset, const ga_size data_im_offset,
// offset_im is the pointer offset for data_im.
// data_im_offset is an offset of elements in the array
const ga_size height, const ga_size width, const ga_size height, const ga_size width,
const ga_size kernel_h, const ga_size kernel_w, const ga_size kernel_h, const ga_size kernel_w,
const ga_size pad_h, const ga_size pad_w, const ga_size pad_h, const ga_size pad_w,
...@@ -128,6 +133,8 @@ KERNEL void dilated_col2im_kernel(const ga_size n, ...@@ -128,6 +133,8 @@ KERNEL void dilated_col2im_kernel(const ga_size n,
GLOBAL_MEM DTYPE_INPUT_0 * data_im, GLOBAL_MEM DTYPE_INPUT_0 * data_im,
const ga_size offset_im, const ga_size offset_im,
const ga_size data_im_offset) { const ga_size data_im_offset) {
// offset_im is the pointer offset for data_im.
// data_im_offset is an offset of elements in the array
data_col = (GLOBAL_MEM DTYPE_INPUT_0 *)(((char *)data_col) + offset_col); data_col = (GLOBAL_MEM DTYPE_INPUT_0 *)(((char *)data_col) + offset_col);
data_im = (GLOBAL_MEM DTYPE_INPUT_0 *)(((char *)data_im) + offset_im); data_im = (GLOBAL_MEM DTYPE_INPUT_0 *)(((char *)data_im) + offset_im);
// grid stride looping // grid stride looping
...@@ -165,6 +172,7 @@ KERNEL void dilated_col2im_kernel(const ga_size n, ...@@ -165,6 +172,7 @@ KERNEL void dilated_col2im_kernel(const ga_size n,
} }
#kernel col2im_kernel : size, *, size, size, size, size, size, size, size, size, size, size, size, size, *, size, size : #kernel col2im_kernel : size, *, size, size, size, size, size, size, size, size, size, size, size, size, *, size, size :
KERNEL void col2im_kernel(const ga_size n, KERNEL void col2im_kernel(const ga_size n,
GLOBAL_MEM const DTYPE_INPUT_0 * data_col, const ga_size offset_col, GLOBAL_MEM const DTYPE_INPUT_0 * data_col, const ga_size offset_col,
const ga_size height, const ga_size width, const ga_size channels, const ga_size height, const ga_size width, const ga_size channels,
...@@ -175,6 +183,8 @@ KERNEL void col2im_kernel(const ga_size n, ...@@ -175,6 +183,8 @@ KERNEL void col2im_kernel(const ga_size n,
GLOBAL_MEM DTYPE_INPUT_0 * data_im, GLOBAL_MEM DTYPE_INPUT_0 * data_im,
const ga_size offset_im, const ga_size offset_im,
const ga_size data_im_offset) { const ga_size data_im_offset) {
// offset_im is the pointer offset for data_im.
// data_im_offset is an offset of elements in the array
data_col = (GLOBAL_MEM DTYPE_INPUT_0 *)(((char *)data_col) + offset_col); data_col = (GLOBAL_MEM DTYPE_INPUT_0 *)(((char *)data_col) + offset_col);
data_im = (GLOBAL_MEM DTYPE_INPUT_0 *)(((char *)data_im) + offset_im); data_im = (GLOBAL_MEM DTYPE_INPUT_0 *)(((char *)data_im) + offset_im);
// grid stride looping // grid stride looping
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论