To avoid doing a XY Problem.
I have a kernel that needs some memory to work. But the size of this memory depends on parameters determined during running time. My grids are 3D and my blocks are 2D.
How can I do it? What is the best solution?
I simply thought to make a dynamic allocation in the kernel. But doing memory allocation (malloc) and memory free requires a lot of time.
To do a memory allocation of all the memory that will be required by every core.
But with this solution, I have no idea on how to know the physical core id in the kernel.
Does someone have any other (or better) idea?
Thank in avance