# How to access cudaArray in kernel?

**URL:** <https://forums.developer.nvidia.com/t/how-to-access-cudaarray-in-kernel/6048>\
**Category:** CUDA Programming and Performance\
**Created:** [October 23, 2008, 3:50pm UTC](https://forums.developer.nvidia.com/t/how-to-access-cudaarray-in-kernel/6048 "2008-10-23T15:50:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yzhao](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@yzhao](https://forums.developer.nvidia.com/u/yzhao)\
**Post date:** [October 23, 2008, 3:50pm UTC](https://forums.developer.nvidia.com/t/how-to-access-cudaarray-in-kernel/6048/1 "2008-10-23T15:50:55Z")

</div>

I wonder is there a way to access cudaArray in kernel function?

For example, I need to copy my data from host to a cudaArray on GPU, and bind it with texture so that I can read those data with tex2D() in my kernel function.

What if I want to modify those data as well? I understand that once binded with texture those data is read-only. If I unbind it, can I then somehow access them inside a kernel? Is there some function to get the address and pitch of this 2D array?

Thanks!
