Forum Discussion
Altera_Forum
Honored Contributor
8 years agoHi, HRZ, you are correct. The code can be compiled (both host and kernel), and got error message during runtime.
The error message for large cl_mem is: Error: Requested memory object size exceeds device limits. I didn't save error message when comes with too many parameters. I can remember when the parameters a litter too many(about 100), it reports parameter overflowed, and arguments are not correctly passed to the kernel. However when the parameter is too many (more than 256), there is no implicit error message, but runtime stack error, which costs me sometime to figure out what is happening. Since each FPGA on the board has 4 DDR channel, each channel is 4GB size, why cannot I declare a 2GB buffer? maybe the only solution is sstrell's solution, to divided the data set. --- Quote Start --- Would you please post your compilation log or whatever error you get? Are you talking about kernel compilation or host compilation here? The size of your cl_mem buffer has nothing to do with kernel compilation, because the kernel compiler only sees the pointer to the buffer and does not know or care about the actual size of the buffer. The host compiler does not care about the size of the buffer either, you will just get an out of memory error from the OpenCL runtime during execution if your buffer is larger than the physically-available on-board memory. The only case your compilation will fail is when you try to create a very large "local" buffer on the FPGA. --- Quote End ---