# CUDA Help

**URL:** <https://forums.developer.nvidia.com/t/cuda-help/20815>\
**Category:** CUDA Programming and Performance\
**Created:** [February 1, 2011, 7:27pm UTC](https://forums.developer.nvidia.com/t/cuda-help/20815 "2011-02-01T19:27:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![shadi](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@shadi](https://forums.developer.nvidia.com/u/shadi)\
**Post date:** [February 1, 2011, 7:27pm UTC](https://forums.developer.nvidia.com/t/cuda-help/20815/1 "2011-02-01T19:27:36Z")

</div>

Hi All,

I am wondring if there is any way to decalre dynamic arrays in CUDA?

Thanks,  
Shadi

---

<div class="post-metadata">

**Author:** ![tera](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@tera](https://forums.developer.nvidia.com/u/tera)\
**Post date:** [February 2, 2011, 2:09am UTC](https://forums.developer.nvidia.com/t/cuda-help/20815/2 "2011-02-02T02:09:08Z")

</div>

cudaMalloc()?

---

<div class="post-metadata">

**Author:** ![shadi](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@shadi](https://forums.developer.nvidia.com/u/shadi)\
**Post date:** [February 2, 2011, 12:08pm UTC](https://forums.developer.nvidia.com/t/cuda-help/20815/3 "2011-02-02T12:08:47Z")

</div>

I mean decalre arrays withouts specifying the size.

> [@](#):
>
> cudaMalloc()?

---

<div class="post-metadata">

**Author:** ![tera](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@tera](https://forums.developer.nvidia.com/u/tera)\
**Post date:** [February 2, 2011, 12:26pm UTC](https://forums.developer.nvidia.com/t/cuda-help/20815/4 "2011-02-02T12:26:05Z")

</div>

Never specifying the size? Certainly doable with C++, but definitely a performance killer.

I guess you are asking about device side memory allocation, which are possible on compute capability 2.x devices.

---

<div class="post-metadata">

**Author:** ![shadi](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@shadi](https://forums.developer.nvidia.com/u/shadi)\
**Post date:** [February 2, 2011, 12:55pm UTC](https://forums.developer.nvidia.com/t/cuda-help/20815/5 "2011-02-02T12:55:19Z")

</div>

Yes. I am wondering if i can allocate array without specifying the size on the device side to store the resuls that computed by the kernel?

The reason I need that:

I am trying to implement a kernel that finds the intersection between two polygons. So, I dont know how many points in the calculated ploygon before excuting the kernel?

> [@](#):
>
> Never specifying the size? Certainly doable with C++, but definitely a performance killer.
> 
> I guess you are asking about device side memory allocation, which are possible on compute capability 2.x devices.
