rockchip-linux / rknn-toolkit2

BSD 3-Clause "New" or "Revised" License
828 stars 151 forks source link

自定义GPU算子测试时RKNN内部报错 #301

Open happyme531 opened 3 months ago

happyme531 commented 3 months ago

RT,报错日志如下:

firefly@zt-firefly ~/r/n/1.6.2b3> sudo cp ./librknnrt.so /usr/lib/;sudo ./rknn_server
start rknn server, version:1.6.0 (535b468 build@2023-12-11T17:05:07)
I NPUTransfer: Starting NPU Transfer Server, Transfer version 2.1.0 (b5861e7@2020-11-23T11:50:51)
arm_release_ver: g13p0-01eac0, rk_so_ver: 6
E RKNN: [23:27:44.655] OpenCL error with code CL_BUILD_PROGRAM_FAILURE. 
E RKNN: [23:27:44.655] Program build error: <source>:153:1: error: use of undeclared identifier 'To8'
E RKNN: [23:27:44.655] To8 val[4];
E RKNN: [23:27:44.655] ^
E RKNN: [23:27:44.655] <source>:156:1: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] val[i] = 0;
E RKNN: [23:27:44.655] ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:156:1: error: expecting lvalue here
E RKNN: [23:27:44.655] val[i] = 0;
E RKNN: [23:27:44.655] ^~~
E RKNN: [23:27:44.655] <source>:160:1: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] val[0] =
E RKNN: [23:27:44.655] ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:160:1: error: expecting lvalue here
E RKNN: [23:27:44.655] val[0] =
E RKNN: [23:27:44.655] ^~~
E RKNN: [23:27:44.655] <source>:161:2: error: use of undeclared identifier 'To8'
E RKNN: [23:27:44.655] (To8)((ival.lo.x - zp) * scale, (ival.lo.y - zp) * scale, (ival.lo.z - zp) * scale, (ival.lo.w - zp) * scale,
E RKNN: [23:27:44.655]  ^
E RKNN: [23:27:44.655] <source>:166:1: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] val[1] =
E RKNN: [23:27:44.655] ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:166:1: error: expecting lvalue here
E RKNN: [23:27:44.655] val[1] =
E RKNN: [23:27:44.655] ^~~
E RKNN: [23:27:44.655] <source>:167:2: error: use of undeclared identifier 'To8'
E RKNN: [23:27:44.655] (To8)((ival.lo.x - zp) * scale, (ival.lo.y - zp) * scale, (ival.lo.z - zp) * scale, (ival.lo.w - zp) * scale,
E RKNN: [23:27:44.655]  ^
E RKNN: [23:27:44.655] <source>:172:1: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] val[2] =
E RKNN: [23:27:44.655] ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:172:1: error: expecting lvalue here
E RKNN: [23:27:44.655] val[2] =
E RKNN: [23:27:44.655] ^~~
E RKNN: [23:27:44.655] <source>:173:2: error: use of undeclared identifier 'To8'
E RKNN: [23:27:44.655] (To8)((ival.lo.x - zp) * scale, (ival.lo.y - zp) * scale, (ival.lo.z - zp) * scale, (ival.lo.w - zp) * scale,
E RKNN: [23:27:44.655]  ^
E RKNN: [23:27:44.655] <source>:178:1: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] val[3] =
E RKNN: [23:27:44.655] ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:178:1: error: expecting lvalue here
E RKNN: [23:27:44.655] val[3] =
E RKNN: [23:27:44.655] ^~~
E RKNN: [23:27:44.655] <source>:179:2: error: use of undeclared identifier 'To8'
E RKNN: [23:27:44.655] (To8)((ival.lo.x - zp) * scale, (ival.lo.y - zp) * scale, (ival.lo.z - zp) * scale, (ival.lo.w - zp) * scale,
E RKNN: [23:27:44.655]  ^
E RKNN: [23:27:44.655] <source>:184:15: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] vstore4((To4)(val[0].lo.x, val[1].lo.x, val[2].lo.x, val[3].lo.x), 0, out + out_off);
E RKNN: [23:27:44.655]               ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:184:15: error: expecting lvalue here
E RKNN: [23:27:44.655] vstore4((To4)(val[0].lo.x, val[1].lo.x, val[2].lo.x, val[3].lo.x), 0, out + out_off);
E RKNN: [23:27:44.655]               ^~~
E RKNN: [23:27:44.655] <source>:186:15: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] vstore4((To4)(val[0].lo.y, val[1].lo.y, val[2].lo.y, val[3].lo.y), 0, out + out_off + owh_str);
E RKNN: [23:27:44.655]               ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:186:15: error: expecting lvalue here
E RKNN: [23:27:44.655] vstore4((To4)(val[0].lo.y, val[1].lo.y, val[2].lo.y, val[3].lo.y), 0, out + out_off + owh_str);
E RKNN: [23:27:44.655]               ^~~
E RKNN: [23:27:44.655] <source>:189:15: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] vstore4((To4)(val[0].lo.z, val[1].lo.z, val[2].lo.z, val[3].lo.z), 0, out + out_off + (owh_str << 1));
E RKNN: [23:27:44.655]               ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:189:15: error: expecting lvalue here
E RKNN: [23:27:44.655] vstore4((To4)(val[0].lo.z, val[1].lo.z, val[2].lo.z, val[3].lo.z), 0, out + out_off + (owh_str << 1));
E RKNN: [23:27:44.655]               ^~~
E RKNN: [23:27:44.655] <source>:192:15: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] vstore4((To4)(val[0].lo.w, val[1].lo.w, val[2].lo.w, val[3].lo.w), 0, out + out_off + owh_str * 3);
E RKNN: [23:27:44.655]               ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:192:15: error: expecting lvalue here
E RKNN: [23:27:44.655] vstore4((To4)(val[0].lo.w, val[1].lo.w, val[2].lo.w, val[3].lo.w), 0, out + out_off + owh_str * 3);
E RKNN: [23:27:44.655]               ^~~
E RKNN: [23:27:44.655] <source>:195:15: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] vstore4((To4)(val[0].hi.x, val[1].hi.x, val[2].hi.x, val[3].hi.x), 0, out + out_off + owh_str * 4);
E RKNN: [23:27:44.655]               ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:195:15: error: expecting lvalue here
E RKNN: [23:27:44.655] vstore4((To4)(val[0].hi.x, val[1].hi.x, val[2].hi.x, val[3].hi.x), 0, out + out_off + owh_str * 4);
E RKNN: [23:27:44.655]               ^~~
E RKNN: [23:27:44.655] <source>:198:15: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] vstore4((To4)(val[0].hi.y, val[1].hi.y, val[2].hi.y, val[3].hi.y), 0, out + out_off + owh_str * 5);
E RKNN: [23:27:44.655]               ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:198:15: error: expecting lvalue here
E RKNN: [23:27:44.655] vstore4((To4)(val[0].hi.y, val[1].hi.y, val[2].hi.y, val[3].hi.y), 0, out + out_off + owh_str * 5);
E RKNN: [23:27:44.655]               ^~~
E RKNN: [23:27:44.655] <source>:201:15: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] vstore4((To4)(val[0].hi.z, val[1].hi.z, val[2].hi.z, val[3].hi.z), 0, out + out_off + owh_str * 6);
E RKNN: [23:27:44.655]               ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:201:15: error: expecting lvalue here
E RKNN: [23:27:44.655] vstore4((To4)(val[0].hi.z, val[1].hi.z, val[2].hi.z, val[3].hi.z), 0, out + out_off + owh_str * 6);
E RKNN: [23:27:44.655]               ^~~
E RKNN: [23:27:44.655] <source>:204:15: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] vstore4((To4)(val[0].hi.w, val[1].hi.w, val[2].hi.w, val[3].hi.w), 0, out + out_off + owh_str * 7);
E RKNN: [23:27:44.655]               ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:204:15: error: expecting lvalue here
E RKNN: [23:27:44.655] vstore4((To4)(val[0].hi.w, val[1].hi.w, val[2].hi.w, val[3].hi.w), 0, out + out_off + owh_str * 7);
E RKNN: [23:27:44.655]               ^~~
E RKNN: [23:27:44.655] <source>:208:16: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] out[out_off] = val[0].lo.x;
E RKNN: [23:27:44.655]                ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:208:16: error: expecting lvalue here
E RKNN: [23:27:44.655] out[out_off] = val[0].lo.x;
E RKNN: [23:27:44.655]                ^~~
E RKNN: [23:27:44.655] <source>:210:26: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] out[out_off + owh_str] = val[0].lo.y;
E RKNN: [23:27:44.655]                          ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:210:26: error: expecting lvalue here
E RKNN: [23:27:44.655] out[out_off + owh_str] = val[0].lo.y;
E RKNN: [23:27:44.655]                          ^~~
E RKNN: [23:27:44.655] <source>:213:33: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] out[out_off + (owh_str << 1)] = val[0].lo.z;
E RKNN: [23:27:44.655]                                 ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:213:33: error: expecting lvalue here
E RKNN: [23:27:44.655] out[out_off + (owh_str << 1)] = val[0].lo.z;
E RKNN: [23:27:44.655]                                 ^~~
E RKNN: [23:27:44.655] <source>:216:30: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] out[out_off + owh_str * 3] = val[0].lo.w;
E RKNN: [23:27:44.655]                              ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:216:30: error: expecting lvalue here
E RKNN: [23:27:44.655] out[out_off + owh_str * 3] = val[0].lo.w;
E RKNN: [23:27:44.655]                              ^~~
E RKNN: [23:27:44.655] <source>:219:30: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] out[out_off + owh_str * 4] = val[0].hi.x;
E RKNN: [23:27:44.655]                              ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:219:30: error: expecting lvalue here
E RKNN: [23:27:44.655] out[out_off + owh_str * 4] = val[0].hi.x;
E RKNN: [23:27:44.655]                              ^~~
E RKNN: [23:27:44.655] <source>:222:30: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] out[out_off + owh_str * 5] = val[0].hi.y;
E RKNN: [23:27:44.655]                              ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:222:30: error: expecting lvalue here
E RKNN: [23:27:44.655] out[out_off + owh_str * 5] = val[0].hi.y;
E RKNN: [23:27:44.655]                              ^~~
E RKNN: [23:27:44.655] <source>:225:30: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] out[out_off + owh_str * 6] = val[0].hi.z;
E RKNN: [23:27:44.655]                              ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:225:30: error: expecting lvalue here
E RKNN: [23:27:44.655] out[out_off + owh_str * 6] = val[0].hi.z;
E RKNN: [23:27:44.655]                              ^~~
E RKNN: [23:27:44.655] <source>:228:30: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] out[out_off + owh_str * 7] = val[0].hi.w;
E RKNN: [23:27:44.655]                              ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:228:30: error: expecting lvalue here
E RKNN: [23:27:44.655] out[out_off + owh_str * 7] = val[0].hi.w;
E RKNN: [23:27:44.655]                              ^~~
E RKNN: [23:27:44.655] <source>:232:15: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] vstore2((To2)(val[0].lo.x, val[1].lo.x), 0, out + out_off);
E RKNN: [23:27:44.655]               ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:232:15: error: expecting lvalue here
E RKNN: [23:27:44.655] vstore2((To2)(val[0].lo.x, val[1].lo.x), 0, out + out_off);
E RKNN: [23:27:44.655]               ^~~
E RKNN: [23:27:44.655] <source>:234:15: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] vstore2((To2)(val[0].lo.y, val[1].lo.y), 0, out + out_off + owh_str);
E RKNN: [23:27:44.655]               ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:234:15: error: expecting lvalue here
E RKNN: [23:27:44.655] vstore2((To2)(val[0].lo.y, val[1].lo.y), 0, out + out_off + owh_str);
E RKNN: [23:27:44.655]               ^~~
E RKNN: [23:27:44.655] <source>:237:15: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] vstore2((To2)(val[0].lo.z, val[1].lo.z), 0, out + out_off + (owh_str << 1));
E RKNN: [23:27:44.655]               ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:237:15: error: expecting lvalue here
E RKNN: [23:27:44.655] vstore2((To2)(val[0].lo.z, val[1].lo.z), 0, out + out_off + (owh_str << 1));
E RKNN: [23:27:44.655]               ^~~
E RKNN: [23:27:44.655] <source>:240:15: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] vstore2((To2)(val[0].lo.w, val[1].lo.w), 0, out + out_off + owh_str * 3);
E RKNN: [23:27:44.655]               ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:240:15: error: expecting lvalue here
E RKNN: [23:27:44.655] vstore2((To2)(val[0].lo.w, val[1].lo.w), 0, out + out_off + owh_str * 3);
E RKNN: [23:27:44.655]               ^~~
E RKNN: [23:27:44.655] <source>:243:15: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] vstore2((To2)(val[0].hi.x, val[1].hi.x), 0, out + out_off + owh_str * 4);
E RKNN: [23:27:44.655]               ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:243:15: error: expecting lvalue here
E RKNN: [23:27:44.655] vstore2((To2)(val[0].hi.x, val[1].hi.x), 0, out + out_off + owh_str * 4);
E RKNN: [23:27:44.655]               ^~~
E RKNN: [23:27:44.655] <source>:246:15: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] vstore2((To2)(val[0].hi.y, val[1].hi.y), 0, out + out_off + owh_str * 5);
E RKNN: [23:27:44.655]               ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:246:15: error: expecting lvalue here
E RKNN: [23:27:44.655] vstore2((To2)(val[0].hi.y, val[1].hi.y), 0, out + out_off + owh_str * 5);
E RKNN: [23:27:44.655]               ^~~
E RKNN: [23:27:44.655] <source>:249:15: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] vstore2((To2)(val[0].hi.z, val[1].hi.z), 0, out + out_off + owh_str * 6);
E RKNN: [23:27:44.655]               ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:249:15: error: expecting lvalue here
E RKNN: [23:27:44.655] vstore2((To2)(val[0].hi.z, val[1].hi.z), 0, out + out_off + owh_str * 6);
E RKNN: [23:27:44.655]               ^~~
E RKNN: [23:27:44.655] <source>:252:15: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] vstore2((To2)(val[0].hi.w, val[1].hi.w), 0, out + out_off + owh_str * 7);
E RKNN: [23:27:44.655]               ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:252:15: error: expecting lvalue here
E RKNN: [23:27:44.655] vstore2((To2)(val[0].hi.w, val[1].hi.w), 0, out + out_off + owh_str * 7);
E RKNN: [23:27:44.655]               ^~~
E RKNN: [23:27:44.655] <source>:256:15: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] vstore3((To3)(val[0].lo.x, val[1].lo.x, val[2].lo.x), 0, out + out_off);
E RKNN: [23:27:44.655]               ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:256:15: error: expecting lvalue here
E RKNN: [23:27:44.655] vstore3((To3)(val[0].lo.x, val[1].lo.x, val[2].lo.x), 0, out + out_off);
E RKNN: [23:27:44.655]               ^~~
E RKNN: [23:27:44.655] <source>:258:15: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] vstore3((To3)(val[0].lo.y, val[1].lo.y, val[2].lo.y), 0, out + out_off + owh_str);
E RKNN: [23:27:44.655]               ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:258:15: error: expecting lvalue here
E RKNN: [23:27:44.655] vstore3((To3)(val[0].lo.y, val[1].lo.y, val[2].lo.y), 0, out + out_off + owh_str);
E RKNN: [23:27:44.655]               ^~~
E RKNN: [23:27:44.655] <source>:261:15: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] vstore3((To3)(val[0].lo.z, val[1].lo.z, val[2].lo.z), 0, out + out_off + (owh_str << 1));
E RKNN: [23:27:44.655]               ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:261:15: error: expecting lvalue here
E RKNN: [23:27:44.655] vstore3((To3)(val[0].lo.z, val[1].lo.z, val[2].lo.z), 0, out + out_off + (owh_str << 1));
E RKNN: [23:27:44.655]               ^~~
E RKNN: [23:27:44.655] <source>:264:15: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] vstore3((To3)(val[0].lo.w, val[1].lo.w, val[2].lo.w), 0, out + out_off + owh_str * 3);
E RKNN: [23:27:44.655]               ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:264:15: error: expecting lvalue here
E RKNN: [23:27:44.655] vstore3((To3)(val[0].lo.w, val[1].lo.w, val[2].lo.w), 0, out + out_off + owh_str * 3);
E RKNN: [23:27:44.655]               ^~~
E RKNN: [23:27:44.655] <source>:267:15: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] vstore3((To3)(val[0].hi.x, val[1].hi.x, val[2].hi.x), 0, out + out_off + owh_str * 4);
E RKNN: [23:27:44.655]               ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:267:15: error: expecting lvalue here
E RKNN: [23:27:44.655] vstore3((To3)(val[0].hi.x, val[1].hi.x, val[2].hi.x), 0, out + out_off + owh_str * 4);
E RKNN: [23:27:44.655]               ^~~
E RKNN: [23:27:44.655] <source>:270:15: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] vstore3((To3)(val[0].hi.y, val[1].hi.y, val[2].hi.y), 0, out + out_off + owh_str * 5);
E RKNN: [23:27:44.655]               ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:270:15: error: expecting lvalue here
E RKNN: [23:27:44.655] vstore3((To3)(val[0].hi.y, val[1].hi.y, val[2].hi.y), 0, out + out_off + owh_str * 5);
E RKNN: [23:27:44.655]               ^~~
E RKNN: [23:27:44.655] <source>:273:15: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] vstore3((To3)(val[0].hi.z, val[1].hi.z, val[2].hi.z), 0, out + out_off + owh_str * 6);
E RKNN: [23:27:44.655]               ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:273:15: error: expecting lvalue here
E RKNN: [23:27:44.655] vstore3((To3)(val[0].hi.z, val[1].hi.z, val[2].hi.z), 0, out + out_off + owh_str * 6);
E RKNN: [23:27:44.655]               ^~~
E RKNN: [23:27:44.655] <source>:276:15: error: use of undeclared identifier 'val'; did you mean 'ival'?
E RKNN: [23:27:44.655] vstore3((To3)(val[0].hi.w, val[1].hi.w, val[2].hi.w), 0, out + out_off + owh_str * 7);
E RKNN: [23:27:44.655]               ^
E RKNN: [23:27:44.655] <source>:152:7: note: 'ival' declared here
E RKNN: [23:27:44.655] Ti8   ival;
E RKNN: [23:27:44.655]       ^
E RKNN: [23:27:44.655] <source>:276:15: error: expecting lvalue here
E RKNN: [23:27:44.655] vstore3((To3)(val[0].hi.w, val[1].hi.w, val[2].hi.w), 0, out + out_off + owh_str * 7);
E RKNN: [23:27:44.655]               ^~~
E RKNN: [23:27:44.655] error: Compiler frontend failed (error code 63)
E RKNN: [23:27:44.656] OpenCL error with code CL_INVALID_PROGRAM_EXECUTABLE. 
E RKNN: [23:27:44.656] Add unpack gpu op kernel failed, file_name = buffer/unpack_nchwc8_to_nchw_buf.cl, kernel_name = unpack_nchwc8_to_nchw, build_options =  -D Ti=half -D Ti8=half8 -D To=float -D To2=float2 -D To3=float3 -D To4=float4
E RKNN: [23:27:44.656] layout convert failed
E RKNN: [23:27:44.656] Op: 'cstInstanceNormalization_1_256_64_64:/model/model.8/InstanceNormalization' init failed with a return value of -1
E RKNN: [23:27:44.657] Op type: 'cstInstanceNormalization_1_256_64_64' register custom op failed for gpu device !

这个OpenCL源码不是我写的,是librknnrt.so内部自带的一个源码,不知道是干什么用的。现在它编译失败,导致程序还没执行到我的算子逻辑就会报错。。。

源码如下:

#pragma OPENCL EXTENSION cl_khr_fp16 : enable
__kernel void unpack_nchwc8_to_nchw(__global Ti *in, __global To *out,
                                    const int align_wh, const int width,
                                    const int height, const int chanel,
                                    const int offset_in, const int offset_out,
                                    int zp, float scale, int batch,
                                    int in_batch_offset, int out_batch_offset) {
  const int idh = get_global_id(0);
  const int idw = get_global_id(1);
  const int idnc = get_global_id(2);
  int idc = idnc / batch;
  int batch_id = idnc % batch;
  if ((idw >= ((width + 3) >> 2)) || idh >= height ||
      (idc >= ((chanel + 7) >> 3))) {
    return;
  }
  int in_off =
      idc * align_wh + idh * width + (idw << 2) + batch_id * in_batch_offset;
  int out_off = ((idc << 3) * height + idh) * width + (idw << 2) + offset_out +
                batch_id * out_batch_offset;
  char iex = ((idw << 2) + 4 <= width) ? 4 : (width & 3);
  char oex = ((idw << 2) + 4 <= width) ? 4 : (width & 3);
  const int in_str = 1;
  short oec = ((idc << 3) + 8 <= chanel) ? 8 : (chanel & 7);
  Ti8 val[4];
  int i;
  for (i = 0; i < 4; ++i) {
    val[i] = 0;
  }
  if (iex > 0) {
    val[0] = vload8(in_off, in + offset_in);
  }
  if (iex > 1) {
    val[1] = vload8(in_off + in_str, in + offset_in);
  }
  if (iex > 2) {
    val[2] = vload8(in_off + (in_str << 1), in + offset_in);
  }
  if (iex > 3) {
    val[3] = vload8(in_off + in_str * 3, in + offset_in);
  }
  int owh_str = width * height;
  if (oex == 4) {
    vstore4((To4)(val[0].lo.x, val[1].lo.x, val[2].lo.x, val[3].lo.x), 0,
            out + out_off);
    if (oec > 1) {
      vstore4((To4)(val[0].lo.y, val[1].lo.y, val[2].lo.y, val[3].lo.y), 0,
              out + out_off + owh_str);
    }
    if (oec > 2) {
      vstore4((To4)(val[0].lo.z, val[1].lo.z, val[2].lo.z, val[3].lo.z), 0,
              out + out_off + (owh_str << 1));
    }
    if (oec > 3) {
      vstore4((To4)(val[0].lo.w, val[1].lo.w, val[2].lo.w, val[3].lo.w), 0,
              out + out_off + owh_str * 3);
    }
    if (oec > 4) {
      vstore4((To4)(val[0].hi.x, val[1].hi.x, val[2].hi.x, val[3].hi.x), 0,
              out + out_off + owh_str * 4);
    }
    if (oec > 5) {
      vstore4((To4)(val[0].hi.y, val[1].hi.y, val[2].hi.y, val[3].hi.y), 0,
              out + out_off + owh_str * 5);
    }
    if (oec > 6) {
      vstore4((To4)(val[0].hi.z, val[1].hi.z, val[2].hi.z, val[3].hi.z), 0,
              out + out_off + owh_str * 6);
    }
    if (oec > 7) {
      vstore4((To4)(val[0].hi.w, val[1].hi.w, val[2].hi.w, val[3].hi.w), 0,
              out + out_off + owh_str * 7);
    }
  } else {
    if (oex == 1) {
      out[out_off] = val[0].lo.x;
      if (oec > 1) {
        out[out_off + owh_str] = val[0].lo.y;
      }
      if (oec > 2) {
        out[out_off + (owh_str << 1)] = val[0].lo.z;
      }
      if (oec > 3) {
        out[out_off + owh_str * 3] = val[0].lo.w;
      }
      if (oec > 4) {
        out[out_off + owh_str * 4] = val[0].hi.x;
      }
      if (oec > 5) {
        out[out_off + owh_str * 5] = val[0].hi.y;
      }
      if (oec > 6) {
        out[out_off + owh_str * 6] = val[0].hi.z;
      }
      if (oec > 7) {
        out[out_off + owh_str * 7] = val[0].hi.w;
      }
    }
    if (oex == 2) {
      vstore2((To2)(val[0].lo.x, val[1].lo.x), 0, out + out_off);
      if (oec > 1) {
        vstore2((To2)(val[0].lo.y, val[1].lo.y), 0, out + out_off + owh_str);
      }
      if (oec > 2) {
        vstore2((To2)(val[0].lo.z, val[1].lo.z), 0,
                out + out_off + (owh_str << 1));
      }
      if (oec > 3) {
        vstore2((To2)(val[0].lo.w, val[1].lo.w), 0,
                out + out_off + owh_str * 3);
      }
      if (oec > 4) {
        vstore2((To2)(val[0].hi.x, val[1].hi.x), 0,
                out + out_off + owh_str * 4);
      }
      if (oec > 5) {
        vstore2((To2)(val[0].hi.y, val[1].hi.y), 0,
                out + out_off + owh_str * 5);
      }
      if (oec > 6) {
        vstore2((To2)(val[0].hi.z, val[1].hi.z), 0,
                out + out_off + owh_str * 6);
      }
      if (oec > 7) {
        vstore2((To2)(val[0].hi.w, val[1].hi.w), 0,
                out + out_off + owh_str * 7);
      }
    }
    if (oex == 3) {
      vstore3((To3)(val[0].lo.x, val[1].lo.x, val[2].lo.x), 0, out + out_off);
      if (oec > 1) {
        vstore3((To3)(val[0].lo.y, val[1].lo.y, val[2].lo.y), 0,
                out + out_off + owh_str);
      }
      if (oec > 2) {
        vstore3((To3)(val[0].lo.z, val[1].lo.z, val[2].lo.z), 0,
                out + out_off + (owh_str << 1));
      }
      if (oec > 3) {
        vstore3((To3)(val[0].lo.w, val[1].lo.w, val[2].lo.w), 0,
                out + out_off + owh_str * 3);
      }
      if (oec > 4) {
        vstore3((To3)(val[0].hi.x, val[1].hi.x, val[2].hi.x), 0,
                out + out_off + owh_str * 4);
      }
      if (oec > 5) {
        vstore3((To3)(val[0].hi.y, val[1].hi.y, val[2].hi.y), 0,
                out + out_off + owh_str * 5);
      }
      if (oec > 6) {
        vstore3((To3)(val[0].hi.z, val[1].hi.z, val[2].hi.z), 0,
                out + out_off + owh_str * 6);
      }
      if (oec > 7) {
        vstore3((To3)(val[0].hi.w, val[1].hi.w, val[2].hi.w), 0,
                out + out_off + owh_str * 7);
      }
    }
  }
}