9
9
10
10
extern map<cl_program, string> g_program_source;
11
11
12
- /* static int is_same_size_image(cl_mem a, cl_mem b) {
12
+ static int is_same_size_image (cl_mem a, cl_mem b) {
13
13
size_t a_width, a_height, a_depth, a_array_size, a_row_pitch, a_slice_pitch;
14
14
clGetImageInfo (a, CL_IMAGE_WIDTH, sizeof (a_width), &a_width, NULL );
15
15
clGetImageInfo (a, CL_IMAGE_HEIGHT, sizeof (a_height), &a_height, NULL );
@@ -29,7 +29,7 @@ extern map<cl_program, string> g_program_source;
29
29
return (a_width == b_width) && (a_height == b_height) &&
30
30
(a_depth == b_depth) && (a_array_size == b_array_size) &&
31
31
(a_row_pitch == b_row_pitch) && (a_slice_pitch == b_slice_pitch);
32
- }*/
32
+ }
33
33
34
34
static cl_mem make_image_like (cl_context context, cl_mem val) {
35
35
cl_image_format format;
@@ -138,7 +138,7 @@ int Thneed::optimize() {
138
138
139
139
// delete useless copy layers
140
140
// saves ~0.7 ms
141
- /* if (kq[i]->name == "concatenation" || kq[i]->name == "flatten") {
141
+ if (kq[i]->name == " concatenation" || kq[i]->name == " flatten" ) {
142
142
string in = kq[i]->args [kq[i]->get_arg_num (" input" )];
143
143
string out = kq[i]->args [kq[i]->get_arg_num (" output" )];
144
144
if (is_same_size_image (*(cl_mem*)in.data (), *(cl_mem*)out.data ())) {
@@ -148,7 +148,7 @@ int Thneed::optimize() {
148
148
149
149
kq.erase (kq.begin ()+i); --i;
150
150
}
151
- }*/
151
+ }
152
152
153
153
// NOTE: if activations/accumulation are done in the wrong order, this will be wrong
154
154
0 commit comments