| Capability | SM 1.x | SM 2.x |
|---|---|---|
| Maximum width – 1D CUDA array | 8192 | 32768 |
| Maximum width – 1D device memory | 227 | |
| Maximum width and number of layers – 1D layered texture | 8192×512 | 16384×2048 |
| Maximum extents for 2D texture | 65536×32768 | |
| Maximum extents and number of layers – 2D layered texture | 8192× 8192× 512 |
16384× 16384× 2048 |
| Maximum extents – 3D CUDA array | 2048×2048×2048 | |
| Maximum extents for a 2D surface | n/a | 8192×8192 |
Most of the hardware limits listed above can be queried by calling
cuDeviceGetAttribute() with the following values.
| Attribute | CUdevice_attribute value |
|---|---|
| Maximum width – 1D CUDA array | CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH |
| Maximum width of 1D layered texture | CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_WIDTH |
| Maximum number of layers of 1D layered texture | CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_LAYERS |
| Maximum width of 2D texture | CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH |
| Maximum height of 2D texture | CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT |
| Maximum width of 2D layered texture | CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH |
| Maximum height of 2D layered texture | CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT |
| Maximum number of layers of 2D layered texture | CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS |
| Maximum width – 3D CUDA array | CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH |
| Maximum height – 3D CUDA array | CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT |
| Maximum depth – 3D CUDA array | CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH |
The following members of cudaDeviceProp contain hardware
limits as listed below.
| Capability | cudaDeviceProp member |
|---|---|
| Maximum width – 1D CUDA array | int maxTexture1D; |
| Maximum width and number of layers – 1D layered texture | int maxTextureLayered[2]; |
| Maximum extents for 2D texture | int maxTexture2D[2]; |
| Maximum extents and number of layers – 2D layered texture | int maxTextureLayered[2]; |
| Maximum extents – 3D CUDA array | int maxTexture3D[3]; |
A texture object is created with cudaCreateTextureObject() from a
cudaResourceDesc whose resType is given below,
together with a cudaTextureDesc; it is released with
cudaDestroyTextureObject().
| Operation | Device Memory | CUDA Arrays |
|---|---|---|
| Allocate with… | cudaMalloc() |
cudaMallocArray() |
| Free with… | cudaFree() |
cudaFreeArray() |
| Resource type… | cudaResourceTypeLinear |
cudaResourceTypeArray |
| Texture with… | tex1Dfetch()<T>() |
tex1D()<T>() |
| Operation | Device Memory | CUDA Arrays |
|---|---|---|
| Allocate with… | cudaMallocPitch() |
cudaMalloc2DArray()* |
| Free with… | cudaFree() |
cudaFreeArray() |
| Resource type… | cudaResourceTypePitch2D |
cudaResourceTypeArray |
| Texture with… | tex2D()<T>() |
tex2D()<T>() |
* if surface load/store is desired, specify the
cudaArraySurfaceLoadStore flag.
| Operation | Device Memory | CUDA Arrays |
|---|---|---|
| Allocate with… | (not supported) | cudaMalloc3DArray() |
| Free with… | cudaFreeArray() |
|
| Resource type… | cudaResourceTypeArray |
|
| Texture with… | tex3D()<T>() |
| Operation | Device Memory | CUDA Arrays |
|---|---|---|
| Allocate with… | (not supported) | cudaMalloc2DArray()- specify
cudaArrayLayered. |
| Free with… | cudaFreeArray() |
|
| Resource type… | cudaResourceTypeArray |
|
| Texture with… | tex1DLayered<T>() |
| Operation | Device Memory | CUDA Arrays |
|---|---|---|
| Allocate with… | (not supported) | cudaMalloc3DArray()- specify
cudaArrayLayered. |
| Free with… | cudaFreeArray() |
|
| Resource type… | cudaResourceTypeArray |
|
| Texture with… | tex2DLayered<T>() |