Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)

Constant Caching Query

Altera_Forum
Honored Contributor II
1,446 Views

Hi 

 

I am currently dealing with optimizing Multikernel opencl app targetted to Altera FPGA. 

I have two arguments acroos two kernels of type const _constant roughly taking 20 Kbytes each 

I also have arguments of type const __global. 

I did refer the documentation regarding this in the form of Optimization guide. 

 

Is the constant cache optimization only for __constant type arguments or is it also for const __global type arguments ? 

With my case should the value specified for the --const-cache-bytes be 40 or should it be more. 

How should I decide on the value to be specified for ? 

Is there any limit on it ? 

 

 

Thanks
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
542 Views

--const-cache-bytes is only for __constant arguments of a kernel. Since cache misses have a large performance penalty you want to size the constant cache to be at least as large as the data set you want it to hold. In this case I would set it to be 64kB so that it can hold those two 20kB buffers using --const-cache-bytes 65536. 

 

The only limit on the size is hardware resources. Constant caches are built of on-chip RAM inside the FPGA so if you request too large of a cache the hardware will not compile because the FPGA will run out of memory resources. 

 

What type of data is this that you want to store in constant memory? There might be better alternatives depending on what you are doing.
0 Kudos
Reply