[FPGA] Fix the memcpy size of fpga workaround
authorDongju Chae <dongju.chae@samsung.com>
Tue, 27 Jul 2021 06:14:35 +0000 (15:14 +0900)
committer채동주/On-Device Lab(SR)/Staff Engineer/삼성전자 <dongju.chae@samsung.com>
Tue, 27 Jul 2021 07:56:27 +0000 (16:56 +0900)
This patch fixes the memcpy size of fpga workaround.

Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
src/core/ne-handler.cc

index fbefe16..2278c20 100644 (file)
@@ -1198,14 +1198,14 @@ TrinityVision2::callback (Request *req, npuOutputNotify cb, void *cb_data) {
     void *dst;
 #ifdef __FPGA__
     /* this is fpga workaround codes for syncing output data */
-    dst = calloc (1, output_tensor_size);
+    dst = calloc (1, output_segment->getSize ());
     if (dst == NULL) {
       logerr (TAG, "Unable to allocate FPGA temp buffer\n");
       break;
     }
     api_->fpga_memcpy (output_segment->getDmabuf (),
                        segt->getOutputSegmentOffset (idx), dst,
-                       output_tensor_size);
+                       output_segment->getSize ());
 #else
     dst = output_segment->getData () + segt->getOutputSegmentOffset (idx);
 #endif