Dynamic memory allocation in a device function?

Hi, Is it possible to allocate memory in a device function? I need some temporary array spaces in a device function to do computations. Any suggestion of the best strategy?

Thank you.

good question,

i tried it yesterday and malloc/free wont work.
would love to know this too.

nope … with shared memory might be possible but as far as i know even that has to be known at launch time so that the occupancy can be calculated. Still seems you should be able to pre allocate enough memory before hand. just calculate how much you will need before the launch.