# Texture memory and NPP

**URL:** <https://forums.developer.nvidia.com/t/texture-memory-and-npp/233381>\
**Category:** GPU-Accelerated Libraries\
**Tags:** npp, cuda\
**Created:** [November 10, 2022, 7:07am UTC](https://forums.developer.nvidia.com/t/texture-memory-and-npp/233381 "2022-11-10T07:07:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Avram\_Levitter](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Avram\_Levitter](https://forums.developer.nvidia.com/u/Avram_Levitter)\
**Post date:** [November 10, 2022, 7:07am UTC](https://forums.developer.nvidia.com/t/texture-memory-and-npp/233381/1 "2022-11-10T07:07:07Z")

</div>

Do NPP functions benefit from passing memory allocated with cudaMallocArray or other specialized allocation functions? I know that there are some functions such as the Compress Label Markers function that requires allocation with cudaMalloc instead of cudaMallocPitched, however on the page regarding NPP-related memory allocation functions it says that (unless otherwise specified) all NPP functions will work with any valid device-allocated memory pointers. If that’s the case, then it would make sense that for functions where locality of the memory is important (e.g. bilinear resize functions) there could be some performance benefit.

---

<div class="post-metadata">

**Author:** ![Robert\_Crovella](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/robert_crovella/32/14043_2.png) [@Robert\_Crovella](https://forums.developer.nvidia.com/u/Robert_Crovella)\
**Post date:** [November 10, 2022, 4:18pm UTC](https://forums.developer.nvidia.com/t/texture-memory-and-npp/233381/2 "2022-11-10T16:18:13Z")

</div>

A cudaArray is an opaque type. It will not work correctly with most NPP functions I am familiar with. Some NPP functions can accept pitched pointers, these are usually evident because they have an input step parameter (somewhere/somehow).

Most NPP functions I am familiar with, that require a device memory pointer, should be provided a pointer allocated by `cudaMalloc` or `cudaMallocPitch` or `cudaMallocManaged`, or similar. `cudaHostAlloc` should also work, but I don’t recommend that for performance reasons.
