all test ok
This commit is contained in:
@@ -312,9 +312,9 @@ int main()
|
||||
printCenteredTitle(" CUDNN inference ", '=', 30);
|
||||
{
|
||||
dim1.print();
|
||||
TIMER_START
|
||||
TKDNN_TSTART
|
||||
net.infer(dim1, data);
|
||||
TIMER_STOP
|
||||
TKDNN_TSTOP
|
||||
dim1.print();
|
||||
}
|
||||
cudnn_out = net.layers[net.num_layers-1]->dstData;
|
||||
@@ -326,9 +326,9 @@ int main()
|
||||
printCenteredTitle(" TENSORRT inference ", '=', 30);
|
||||
{
|
||||
dim2.print();
|
||||
TIMER_START
|
||||
TKDNN_TSTART
|
||||
netRT.infer(dim2, data);
|
||||
TIMER_STOP
|
||||
TKDNN_TSTOP
|
||||
dim2.print();
|
||||
}
|
||||
rt_out = (dnnType *)netRT.buffersRT[1];
|
||||
|
||||
@@ -301,9 +301,9 @@ int main()
|
||||
printCenteredTitle(" CUDNN inference ", '=', 30);
|
||||
{
|
||||
dim1.print();
|
||||
TIMER_START
|
||||
TKDNN_TSTART
|
||||
net.infer(dim1, data);
|
||||
TIMER_STOP
|
||||
TKDNN_TSTOP
|
||||
dim1.print();
|
||||
}
|
||||
cudnn_out = net.layers[net.num_layers-1]->dstData;
|
||||
@@ -314,9 +314,9 @@ int main()
|
||||
printCenteredTitle(" TENSORRT inference ", '=', 30);
|
||||
{
|
||||
dim2.print();
|
||||
TIMER_START
|
||||
TKDNN_TSTART
|
||||
netRT.infer(dim2, data);
|
||||
TIMER_STOP
|
||||
TKDNN_TSTOP
|
||||
dim2.print();
|
||||
}
|
||||
rt_out = (dnnType *)netRT.buffersRT[1];
|
||||
|
||||
@@ -486,9 +486,9 @@ int main()
|
||||
printCenteredTitle(" CUDNN inference ", '=', 30);
|
||||
{
|
||||
dim1.print();
|
||||
TIMER_START
|
||||
TKDNN_TSTART
|
||||
net.infer(dim1, data);
|
||||
TIMER_STOP
|
||||
TKDNN_TSTOP
|
||||
dim1.print();
|
||||
}
|
||||
|
||||
@@ -496,9 +496,9 @@ int main()
|
||||
printCenteredTitle(" TENSORRT inference ", '=', 30);
|
||||
{
|
||||
dim2.print();
|
||||
TIMER_START
|
||||
TKDNN_TSTART
|
||||
netRT.infer(dim2, data);
|
||||
TIMER_STOP
|
||||
TKDNN_TSTOP
|
||||
dim2.print();
|
||||
}
|
||||
|
||||
|
||||
@@ -361,9 +361,9 @@ int main()
|
||||
printCenteredTitle(" CUDNN inference ", '=', 30);
|
||||
{
|
||||
dim1.print();
|
||||
TIMER_START
|
||||
TKDNN_TSTART
|
||||
net.infer(dim1, data);
|
||||
TIMER_STOP
|
||||
TKDNN_TSTOP
|
||||
dim1.print();
|
||||
}
|
||||
|
||||
@@ -373,9 +373,9 @@ int main()
|
||||
printCenteredTitle(" TENSORRT inference ", '=', 30);
|
||||
{
|
||||
dim2.print();
|
||||
TIMER_START
|
||||
TKDNN_TSTART
|
||||
netRT.infer(dim2, data);
|
||||
TIMER_STOP
|
||||
TKDNN_TSTOP
|
||||
dim2.print();
|
||||
}
|
||||
|
||||
|
||||
@@ -46,10 +46,10 @@ int main() {
|
||||
int ret_cudnn = 0;
|
||||
for(int i=0; i<N; i++) {
|
||||
std::cout<<"i: "<<i<<"\n";
|
||||
//TIMER_START
|
||||
//TKDNN_TSTART
|
||||
// Inference
|
||||
ImuNet.update(i0_h, i1_h, i2_h);
|
||||
//TIMER_STOP
|
||||
//TKDNN_TSTOP
|
||||
|
||||
// log path
|
||||
path<<ImuNet.odomPOS(0)<<" "<<ImuNet.odomPOS(1)<<" "<< ImuNet.odomPOS(2)<<" ";
|
||||
|
||||
@@ -35,9 +35,9 @@ int main() {
|
||||
|
||||
std::cout<<"CUDNN inference:\n"; {
|
||||
dim.print(); //print initial dimension
|
||||
TIMER_START
|
||||
TKDNN_TSTART
|
||||
out_data = net.infer(dim, data);
|
||||
TIMER_STOP
|
||||
TKDNN_TSTOP
|
||||
dim.print();
|
||||
}
|
||||
|
||||
@@ -49,9 +49,9 @@ int main() {
|
||||
|
||||
std::cout<<"TENSORRT inference:\n"; {
|
||||
dim2.print();
|
||||
TIMER_START
|
||||
TKDNN_TSTART
|
||||
out_data2 = netRT.infer(dim2, data);
|
||||
TIMER_STOP
|
||||
TKDNN_TSTOP
|
||||
dim2.print();
|
||||
}
|
||||
|
||||
|
||||
@@ -49,9 +49,9 @@ int main() {
|
||||
|
||||
// Inference
|
||||
{
|
||||
TIMER_START
|
||||
TKDNN_TSTART
|
||||
data = net.infer(dim, data);
|
||||
TIMER_STOP
|
||||
TKDNN_TSTOP
|
||||
dim.print();
|
||||
}
|
||||
|
||||
@@ -157,9 +157,9 @@ int main() {
|
||||
{
|
||||
checkCuda(cudaMemcpyAsync(buffers[inputIndex], input_h, 1 * 28*28* sizeof(float), cudaMemcpyHostToDevice, stream));
|
||||
cudaStreamSynchronize(stream); //want to test only the inference time
|
||||
TIMER_START
|
||||
TKDNN_TSTART
|
||||
context->enqueue(1, buffers, stream, nullptr);
|
||||
TIMER_STOP
|
||||
TKDNN_TSTOP
|
||||
checkCuda(cudaMemcpyAsync(output, buffers[outputIndex],10*sizeof(float), cudaMemcpyDeviceToHost, stream));
|
||||
cudaStreamSynchronize(stream);
|
||||
}
|
||||
|
||||
@@ -477,9 +477,9 @@ int main()
|
||||
printCenteredTitle(" CUDNN inference ", '=', 30);
|
||||
{
|
||||
dim1.print();
|
||||
TIMER_START
|
||||
TKDNN_TSTART
|
||||
net.infer(dim1, data);
|
||||
TIMER_STOP
|
||||
TKDNN_TSTOP
|
||||
dim1.print();
|
||||
}
|
||||
|
||||
@@ -492,9 +492,9 @@ int main()
|
||||
printCenteredTitle(" TENSORRT inference ", '=', 30);
|
||||
{
|
||||
dim2.print();
|
||||
TIMER_START
|
||||
TKDNN_TSTART
|
||||
netRT.infer(dim2, data);
|
||||
TIMER_STOP
|
||||
TKDNN_TSTOP
|
||||
dim2.print();
|
||||
}
|
||||
|
||||
|
||||
@@ -477,9 +477,9 @@ int main()
|
||||
printCenteredTitle(" CUDNN inference ", '=', 30);
|
||||
{
|
||||
dim1.print();
|
||||
TIMER_START
|
||||
TKDNN_TSTART
|
||||
net.infer(dim1, data);
|
||||
TIMER_STOP
|
||||
TKDNN_TSTOP
|
||||
dim1.print();
|
||||
}
|
||||
|
||||
@@ -492,9 +492,9 @@ int main()
|
||||
printCenteredTitle(" TENSORRT inference ", '=', 30);
|
||||
{
|
||||
dim2.print();
|
||||
TIMER_START
|
||||
TKDNN_TSTART
|
||||
netRT.infer(dim2, data);
|
||||
TIMER_STOP
|
||||
TKDNN_TSTOP
|
||||
dim2.print();
|
||||
}
|
||||
|
||||
|
||||
@@ -476,9 +476,9 @@ int main()
|
||||
printCenteredTitle(" CUDNN inference ", '=', 30);
|
||||
{
|
||||
dim1.print();
|
||||
TIMER_START
|
||||
TKDNN_TSTART
|
||||
net.infer(dim1, data);
|
||||
TIMER_STOP
|
||||
TKDNN_TSTOP
|
||||
dim1.print();
|
||||
}
|
||||
|
||||
@@ -491,9 +491,9 @@ int main()
|
||||
printCenteredTitle(" TENSORRT inference ", '=', 30);
|
||||
{
|
||||
dim2.print();
|
||||
TIMER_START
|
||||
TKDNN_TSTART
|
||||
netRT.infer(dim2, data);
|
||||
TIMER_STOP
|
||||
TKDNN_TSTOP
|
||||
dim2.print();
|
||||
}
|
||||
|
||||
|
||||
@@ -38,18 +38,18 @@ int main() {
|
||||
tk::dnn::dataDim_t dim1 = dim; //input dim
|
||||
printCenteredTitle(" CUDNN inference ", '=', 30); {
|
||||
dim1.print();
|
||||
TIMER_START
|
||||
TKDNN_TSTART
|
||||
out_data = net.infer(dim1, data);
|
||||
TIMER_STOP
|
||||
TKDNN_TSTOP
|
||||
dim1.print();
|
||||
}
|
||||
|
||||
tk::dnn::dataDim_t dim2 = dim;
|
||||
printCenteredTitle(" TENSORRT inference ", '=', 30); {
|
||||
dim2.print();
|
||||
TIMER_START
|
||||
TKDNN_TSTART
|
||||
out_data2 = netRT.infer(dim2, data);
|
||||
TIMER_STOP
|
||||
TKDNN_TSTOP
|
||||
dim2.print();
|
||||
}
|
||||
|
||||
|
||||
@@ -42,9 +42,9 @@ int main(int argc, char *argv[]) {
|
||||
checkCuda(cudaMemcpy(input_d, input, idim.tot()*sizeof(dnnType), cudaMemcpyHostToDevice));
|
||||
|
||||
tk::dnn::dataDim_t dim = idim;
|
||||
TIMER_START
|
||||
TKDNN_TSTART
|
||||
netRT.infer(dim, input_d);
|
||||
TIMER_STOP
|
||||
TKDNN_TSTOP
|
||||
total_time+= t_ns;
|
||||
|
||||
// control output
|
||||
|
||||
Reference in New Issue
Block a user