Re: [eigen] When to mark EIGEN_DEVICE_FUNC

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Heap allocation from device kernels is ok when only one thread of a block performs a memory allocation, but if all threads calls malloc, then this is gonna be a performance killer. So I would really try to make sure no heap allocation occurs within kernels.

gael

On Mon, Feb 2, 2015 at 11:19 AM, Chen-Pang He <jdh8@xxxxxxxxxxxxxx> wrote:
On Tue, Jan 13, 2015 at 23:02:38, Gael Guennebaud wrote:
> > By "dynamic memory allocation", do you mean something like
> > dynamic matrix multiplication which produces temp?
> >
>
> I mean functions which when being compiled will hit a malloc! Matrix
> products are safe as long as the sizes are known at compile-time. We
> already took care at bypassing the heavy matrix product implementation code
> when CUDA is enabled.

Dynamic memory allocation are supported by devices of compute
capability 2.x and higher.  Can we mark malloc'ing functions as
EIGEN_DEVICE_FUNC now?

http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#dynamic-global-memory-allocation-and-operations
http://stackoverflow.com/questions/4715238/cuda-allocate-memory-in-device-function

Thanks,
Chen-Pang





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/