2

I am a little bit confused about the limitations of texture memory. Is it 65536 or am i able to handle also arrays way larger.

At the Moment I'm using 2D-Textures. Bringing the problem to a 1D-Texture would make it easier.

Thx in advance

dreamcrash
  • 47,137
  • 25
  • 94
  • 117
Silve2611
  • 2,198
  • 2
  • 34
  • 55

1 Answers1

6

There are two types of 1D textures in CUDA. Textures bound to arrays are read through tex1d() and are limited to a size of 65536 elements as you suspected in your question. Textures bound to linear memory are accessed through tex1dfetch() and have a much larger limit of 227 = 134,217,728 elements. Check table 14 of the Programming Manual.

tera
  • 7,080
  • 1
  • 21
  • 32
  • This answer was exceedingly helpful when I tried to change my call like; cudaMallocArray( &cuArray, &channelDesc, 2048, 500 )// works cudaMallocArray( &cuArray, &channelDesc, 2048*500, 1 )// cudaError – Tyson Hilmer Sep 24 '17 at 15:06
  • Glad you found my answer helpful. While here, I've also updated the second link. – tera Sep 24 '17 at 15:20