element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
FPGA
  • Technologies
  • More
FPGA
Forum in L3 Corner Track example. Why the flow buffer needs to be created everytime in loop?
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join FPGA to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 1 reply
  • Subscribers 532 subscribers
  • Views 233 views
  • Users 0 members are here
  • zynq
  • xilinx
  • zcu102
  • vitis
Related

in L3 Corner Track example. Why the flow buffer needs to be created everytime in loop?

bugtech
bugtech 9 months ago

How can i reduce the execution time of "L3 Corner Track example" using my own video. I have observed in Vitis Analyzer that optical flow buffers are created in a loop which are adding more time to the execution process. I already managed to move other buffers of (pyr_down) to the beginning of the code so that they must not be created in a loop. But i am unable to move "Optical Flow" buffers out of the loop, if i do so, it does not give the correct optical flow. How this buffer can be managed?

I am executing a hardware build on "ZCU102"

Any leads?

 

Vitis Analyzer

Summary (API CALLS)

for (int l = NUM_LEVELS - 1; l >= 0; l--)

{

// compute current level height

int curr_height = pyr_h[l];

int curr_width = pyr_w[l];

 

////////////////MOVED THESE BUFFERS OUT OF THE LOOP/////////////////WORKS FINE//////////////

 

in_img_py1_buf = cl::Buffer(context, CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE,

(pyr_h[l] * pyr_w[l] * CH_TYPE), (ap_uint<INPUT_PTR_WIDTH> *)imagepyr1[l].data);

in_img_py2_buf = cl::Buffer(context, CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE,

(pyr_h[l] * pyr_w[l] * CH_TYPE), (ap_uint<INPUT_PTR_WIDTH> *)imagepyr2[l].data);

 

/////////////////////////////////////////////////////////////////////////////////////////

 

in_img_py1_Vec.push_back(in_img_py1_buf);

in_img_py2_Vec.push_back(in_img_py2_buf);

 

q.enqueueMigrateMemObjects(in_img_py1_Vec, 0 /* 0 means from host*/);

q.enqueueMigrateMemObjects(in_img_py2_Vec, 0 /* 0 means from host*/);

 

/////////////////////////////UNABLE TO MOVE THIS////////////////////////////////////////

flow_buf = cl::Buffer(context, CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE, (pyr_h[l] * pyr_w[l] * 4),

(ap_uint<OUTPUT_PTR_WIDTH> *)flow.data);

////////////////////////////////////////////////////////////////////////////////////////////////////////

std::cout << "\n Buffers created" << std::endl;

// compute the flow vectors for the current pyramid level iteratively

std::cout << "\n *********OF Computation Level =" << l << "*********" << std::endl;

q.finish();

 

std::cout << "\n OF done" << std::endl;flow.init(pyr_h[l], pyr_w[l], 0);

flow_in.init(pyr_h[l], pyr_w[l], 0);

  • Sign in to reply
  • Cancel
  • phoenixcomm
    phoenixcomm 9 months ago

     bugtech we, all have to start before you can run..  Also you have a buffer in_img_py1_buffer what is that? Do you know in a year (or less) you will forget what it is. that goes for your other cryptic things lick pyr_h[1], pyr_w[1]  ok, you declared them as int and are set in lines 7 & 9  why?? but where are you getting the values from space?? and why don't you just use a static or what I like in #define curr_width  [to some value] (no equal sign) now some soup why do you need an array of 1 when a int variable would do??   ~~ that my two cents.. Cris H. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube