Forum Discussion
Altera_Forum
Honored Contributor
12 years agoIf it's a different kernel within the same .aocx file then the switch should be fairly quick since the hardware that implements the kernel is already present. In that case it's not really a context switch since each kernel gets it's own compute unit (or multiple units if you use the num_compute_units attribute) so there isn't a generic compute unit being used to execute multiple kernels one at a time. You can also operate multiple kernels concurrently within the same hardware (.aocx file).
If you mean kernel switches between multiple .aocx files then the configuration time and buffer movement times can be significant if you don't ammortize it over the compute time (so if the kernel run times are quick then the overhead will be significant). Due to this, choosing which kernels to combine into a single .aocx file can be important, depending on how you group them you can decrease the amount of overhead. When the OpenCL runtime has to swap out .aocx files all global buffers live in the FPGA have to be pulled back to the host before reconfiguration then restored after.