@@ -19,19 +19,19 @@ KERNEL(border_gpu_ref)(
19
19
__global OUTPUT_TYPE * output )
20
20
{
21
21
#ifdef BEGIN_TYPE
22
- const uint begin_b = begin [0 ];
23
- const uint begin_f = begin [1 ];
22
+ const int begin_b = begin [0 ];
23
+ const int begin_f = begin [1 ];
24
24
uint begin_offset = 2 ;
25
25
#if INPUT0_DIMS == 6
26
- const uint begin_w = begin [begin_offset ];
26
+ const int begin_w = begin [begin_offset ];
27
27
begin_offset += 1 ;
28
28
#endif
29
29
#if INPUT0_DIMS >= 5
30
- const uint begin_z = begin [begin_offset ];
30
+ const int begin_z = begin [begin_offset ];
31
31
begin_offset += 1 ;
32
32
#endif
33
- const uint begin_y = begin [begin_offset ];
34
- const uint begin_x = begin [begin_offset + 1 ];
33
+ const int begin_y = begin [begin_offset ];
34
+ const int begin_x = begin [begin_offset + 1 ];
35
35
#else
36
36
const uint begin_b = LT_SIZES_BATCH_NUM ;
37
37
const uint begin_f = LT_SIZES_FEATURE_NUM ;
@@ -46,19 +46,19 @@ KERNEL(border_gpu_ref)(
46
46
#endif
47
47
48
48
#ifdef END_TYPE
49
- const uint end_b = end [0 ];
50
- const uint end_f = end [1 ];
49
+ const int end_b = end [0 ];
50
+ const int end_f = end [1 ];
51
51
uint end_offset = 2 ;
52
52
#if INPUT0_DIMS == 6
53
- const uint end_w = end [end_offset ];
53
+ const int end_w = end [end_offset ];
54
54
end_offset += 1 ;
55
55
#endif
56
56
#if INPUT0_DIMS >= 5
57
- const uint end_z = end [end_offset ];
57
+ const int end_z = end [end_offset ];
58
58
end_offset += 1 ;
59
59
#endif
60
- const uint end_y = end [end_offset ];
61
- const uint end_x = end [end_offset + 1 ];
60
+ const int end_y = end [end_offset ];
61
+ const int end_x = end [end_offset + 1 ];
62
62
#else
63
63
const uint end_b = RB_SIZES_BATCH_NUM ;
64
64
const uint end_f = RB_SIZES_FEATURE_NUM ;
@@ -74,65 +74,65 @@ KERNEL(border_gpu_ref)(
74
74
75
75
// [CONSTEXPR]
76
76
// Border sizes(left-top):
77
- const uint blt_sb = begin_b ;
78
- const uint blt_sf = begin_f ;
79
- const uint blt_sy = begin_y ;
80
- const uint blt_sx = begin_x ;
77
+ const int blt_sb = begin_b ;
78
+ const int blt_sf = begin_f ;
79
+ const int blt_sy = begin_y ;
80
+ const int blt_sx = begin_x ;
81
81
#if INPUT0_DIMS == 6
82
- const uint blt_sw = begin_w ;
82
+ const int blt_sw = begin_w ;
83
83
#else
84
- const uint blt_sw = 0 ;
84
+ const int blt_sw = 0 ;
85
85
#endif
86
86
#if INPUT0_DIMS >= 5
87
- const uint blt_sz = begin_z ;
87
+ const int blt_sz = begin_z ;
88
88
#else
89
- const uint blt_sz = 0 ;
89
+ const int blt_sz = 0 ;
90
90
#endif
91
91
92
92
// Border sizes(right-bottom):
93
- const uint brb_sb = end_b ;
94
- const uint brb_sf = end_f ;
95
- const uint brb_sy = end_y ;
96
- const uint brb_sx = end_x ;
93
+ const int brb_sb = end_b ;
94
+ const int brb_sf = end_f ;
95
+ const int brb_sy = end_y ;
96
+ const int brb_sx = end_x ;
97
97
#if INPUT0_DIMS == 6
98
- const uint brb_sw = end_w ;
98
+ const int brb_sw = end_w ;
99
99
#else
100
- const uint brb_sw = 0 ;
100
+ const int brb_sw = 0 ;
101
101
#endif
102
102
#if INPUT0_DIMS >= 5
103
- const uint brb_sz = end_z ;
103
+ const int brb_sz = end_z ;
104
104
#else
105
- const uint brb_sz = 0 ;
105
+ const int brb_sz = 0 ;
106
106
#endif
107
107
108
108
// Input sizes:
109
- const uint in_sx = INPUT0_SIZE_X ;
110
- const uint in_sy = INPUT0_SIZE_Y ;
111
- const uint in_sz = INPUT0_SIZE_Z ;
112
- const uint in_sw = INPUT0_SIZE_W ;
113
- const uint in_sf = INPUT0_FEATURE_NUM ;
114
- const uint in_sb = INPUT0_BATCH_NUM ;
109
+ const int in_sx = INPUT0_SIZE_X ;
110
+ const int in_sy = INPUT0_SIZE_Y ;
111
+ const int in_sz = INPUT0_SIZE_Z ;
112
+ const int in_sw = INPUT0_SIZE_W ;
113
+ const int in_sf = INPUT0_FEATURE_NUM ;
114
+ const int in_sb = INPUT0_BATCH_NUM ;
115
115
116
116
// Input limits (exclusive; tested on output position):
117
- const uint in_lx = in_sx + blt_sx ;
118
- const uint in_ly = in_sy + blt_sy ;
119
- const uint in_lz = in_sz + blt_sz ;
120
- const uint in_lw = in_sw + blt_sw ;
121
- const uint in_lf = in_sf + blt_sf ;
122
- const uint in_lb = in_sb + blt_sb ;
117
+ const int in_lx = in_sx + blt_sx ;
118
+ const int in_ly = in_sy + blt_sy ;
119
+ const int in_lz = in_sz + blt_sz ;
120
+ const int in_lw = in_sw + blt_sw ;
121
+ const int in_lf = in_sf + blt_sf ;
122
+ const int in_lb = in_sb + blt_sb ;
123
123
124
- const uint out_xz = ( uint ) get_global_id (0 );
125
- const uint out_yw = ( uint ) get_global_id (1 );
126
- const uint out_fb = ( uint ) get_global_id (2 );
124
+ const int out_xz = get_global_id (0 );
125
+ const int out_yw = get_global_id (1 );
126
+ const int out_fb = get_global_id (2 );
127
127
128
- const uint out_f = out_fb % OUTPUT_FEATURE_NUM ;
129
- const uint out_b = out_fb / OUTPUT_FEATURE_NUM ;
128
+ const int out_f = out_fb % OUTPUT_FEATURE_NUM ;
129
+ const int out_b = out_fb / OUTPUT_FEATURE_NUM ;
130
130
131
- const uint out_x = out_xz % OUTPUT_SIZE_X ;
132
- const uint out_z = out_xz / OUTPUT_SIZE_X ;
131
+ const int out_x = out_xz % OUTPUT_SIZE_X ;
132
+ const int out_z = out_xz / OUTPUT_SIZE_X ;
133
133
134
- const uint out_y = out_yw % OUTPUT_SIZE_Y ;
135
- const uint out_w = out_yw / OUTPUT_SIZE_Y ;
134
+ const int out_y = out_yw % OUTPUT_SIZE_Y ;
135
+ const int out_w = out_yw / OUTPUT_SIZE_Y ;
136
136
137
137
#ifdef BORDER_TYPE_CONSTANT
138
138
#ifdef BORDER_VALUE_TYPE
@@ -148,14 +148,14 @@ KERNEL(border_gpu_ref)(
148
148
out_f >= blt_sf & out_f < in_lf &
149
149
out_b >= blt_sb & out_b < in_lb )
150
150
{
151
- const uint in_x = out_x - blt_sx ;
152
- const uint in_y = out_y - blt_sy ;
153
- const uint in_z = out_z - blt_sz ;
154
- const uint in_w = out_w - blt_sw ;
155
- const uint in_f = out_f - blt_sf ;
156
- const uint in_b = out_b - blt_sb ;
157
-
158
- const uint in_pos = FUNC_CALL (get_input_index )(OPTIONAL_SHAPE_INFO_TENSOR in_b , in_f , in_w , in_z , in_y , in_x );
151
+ const int in_x = out_x - blt_sx ;
152
+ const int in_y = out_y - blt_sy ;
153
+ const int in_z = out_z - blt_sz ;
154
+ const int in_w = out_w - blt_sw ;
155
+ const int in_f = out_f - blt_sf ;
156
+ const int in_b = out_b - blt_sb ;
157
+
158
+ const int in_pos = FUNC_CALL (get_input_index )(OPTIONAL_SHAPE_INFO_TENSOR in_b , in_f , in_w , in_z , in_y , in_x );
159
159
in_val = input [in_pos ];
160
160
}
161
161
#elif defined BORDER_TYPE_EDGE
@@ -192,6 +192,6 @@ KERNEL(border_gpu_ref)(
192
192
#error Unsupported border type.
193
193
#endif
194
194
195
- const uint out_pos = FUNC_CALL (get_output_index )(OPTIONAL_SHAPE_INFO_TENSOR out_b , out_f , out_w , out_z , out_y , out_x );
195
+ const int out_pos = FUNC_CALL (get_output_index )(OPTIONAL_SHAPE_INFO_TENSOR out_b , out_f , out_w , out_z , out_y , out_x );
196
196
output [out_pos ] = in_val ;
197
197
}
0 commit comments