Forum Discussion
Altera_Forum
Honored Contributor
12 years agoYes this is expected; however, you should only see this occur when the kernel image is not already present in the FPGA. So if you have a host application that continuously runs the same kernel over and over you should see the FPGA become configured for the first kernel enqueue operation and not for the rest of the subsequent kernel enqueue operations. If there are buffers allocated in the FPGA when the CvP operation occurs then they are copied back, the hardware is configured, and then the buffers are restored that way you don't loose any data stored in global memory while the FPGA is being reconfigured.
Since these extra buffer movements factor into overhead (much lower than the overhead of configuring the FPGA) here are some tips to minize it: 1) If you have multiple kernels try to squeeze them into a single FPGA image by compiling them all from a single .cl file. This will avoid having to reconfigure the FPGA when switching between kernels. 2) If# 1 is not possible and you need to have seperate kernels in seperate FPGA images then if possible try to run multiple NDRanges across one kernel followed by multiple NDRanges across the second kernel, etc.... This way you get more work done before having to swap out the hardware 3) Any time you are done with a buffer, delete it. That way if an FPGA reconfiguration occurs you'll limit the number of buffers live in the FPGA that need to be temporarily copied to the host and restored back to the FPGA have the configuration is complete.