Răsfoiți Sursa

test fix bug

leon 1 lună în urmă
părinte
comite
ab5387ed27
2 a modificat fișierele cu 3 adăugiri și 0 ștergeri
  1. 2 0
      src/infer/trt/depth/depth.cu
  2. 1 0
      src/main.cpp

+ 2 - 0
src/infer/trt/depth/depth.cu

@@ -64,6 +64,7 @@ void DepthModelImpl::preprocess(const tensor::Image &image, affine::LetterBoxMat
                                             image.height, input_device, network_input_width_,
                                             network_input_height_, affine_matrix_device, 114,
                                             normalize_, stream_);
+    checkRuntime(cudaStreamSynchronize(stream_));
 }
 
 
@@ -81,6 +82,7 @@ void DepthModelImpl::postprocess(int width, int height, void *stream)
         image_device, network_input_width_, network_input_width_, network_input_height_,
         dst_device, width, height, invert_affine_matrix_device, 0,
         stream_);
+    checkRuntime(cudaStreamSynchronize(stream_));
 }
 
 Result DepthModelImpl::forward(const tensor::Image &image, int slice_width, int slice_height, float overlap_width_ratio, float overlap_height_ratio, void *stream)

+ 1 - 0
src/main.cpp

@@ -73,6 +73,7 @@ void test_multi()
 
     std::shared_ptr<Node::DrawNode> draw_node     = std::make_shared<Node::DrawNode>("draw");
     std::shared_ptr<Node::HttpPushNode> push_node = std::make_shared<Node::HttpPushNode>("push", "172.16.20.168", 8080, "/push");
+    
     Node::LinkNode(src_node0, infer_node2);
     Node::LinkNode(src_node1, infer_node2);
     Node::LinkNode(src_node2, infer_node2);