bug fixes for dla networks and ported optimization from different pull request

This commit is contained in:
perseusdg
2021-11-13 02:00:49 +05:30
parent 9e328c0daa
commit ee5000ccca
7 changed files with 122 additions and 192 deletions
+4 -4
View File
@@ -492,7 +492,7 @@ int main()
// }
//convert network to tensorRT
tk::dnn::NetworkRT *netRT = new tk::dnn::NetworkRT(&net, net.getNetworkRTName("dla34_cnet"));
tk::dnn::NetworkRT netRT(&net, net.getNetworkRTName("dla34_cnet"));
tk::dnn::dataDim_t dim1 = dim; //input dim
printCenteredTitle(" CUDNN inference ", '=', 30);
@@ -509,7 +509,7 @@ int main()
{
dim2.print();
TKDNN_TSTART
netRT->infer(dim2, data);
netRT.infer(dim2, data);
TKDNN_TSTOP
dim2.print();
}
@@ -528,7 +528,7 @@ int main()
dnnType *cudnn_out, *rt_out;
cudnn_out = outs[i]->dstData;
rt_out = (dnnType *)netRT->buffersRT[i+out_count];
rt_out = (dnnType *)netRT.buffersRT[i+out_count];
// there is the maxpool. It isn't an output but it is necessary for the process section
if(i==0)
out_count ++;
@@ -540,6 +540,6 @@ int main()
std::cout<<"CUDNN vs TRT ";
ret_cudnn_tensorrt |= checkResult(odim, cudnn_out, rt_out) == 0 ? 0 : ERROR_CUDNNvsTENSORRT;
}
netRT->destroy();
netRT.destroy();
return ret_cudnn | ret_tensorrt | ret_cudnn_tensorrt;
}