A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__TEXOBJECT.html below:

CUDA Driver API :: CUDA Toolkit Documentation

Creates a texture object.

Creates a texture object and returns it in pTexObject. pResDesc describes the data to texture from. pTexDesc describes how the data should be sampled. pResViewDesc is an optional argument that specifies an alternate format for the data described by pResDesc, and also describes the subresource region to restrict access to when texturing. pResViewDesc can only be specified if the type of resource is a CUDA array or a CUDA mipmapped array not in a block compressed format.

Texture objects are only supported on devices of compute capability 3.0 or higher. Additionally, a texture object is an opaque value, and, as such, should only be accessed through CUDA API calls.

The CUDA_RESOURCE_DESC structure is defined as:

‎        typedef struct CUDA_RESOURCE_DESC_st
              {
                  CUresourcetype resType;
      
                  union {
                      struct {
                          CUarray hArray;
                      } array;
                      struct {
                          CUmipmappedArray hMipmappedArray;
                      } mipmap;
                      struct {
                          CUdeviceptr devPtr;
                          CUarray_format format;
                          unsigned int numChannels;
                          size_t sizeInBytes;
                      } linear;
                      struct {
                          CUdeviceptr devPtr;
                          CUarray_format format;
                          unsigned int numChannels;
                          size_t width;
                          size_t height;
                          size_t pitchInBytes;
                      } pitch2D;
                  } res;
      
                  unsigned int flags;
              } CUDA_RESOURCE_DESC;

where:

If CUDA_RESOURCE_DESC::resType is set to CU_RESOURCE_TYPE_ARRAY, CUDA_RESOURCE_DESC::res::array::hArray must be set to a valid CUDA array handle.

If CUDA_RESOURCE_DESC::resType is set to CU_RESOURCE_TYPE_MIPMAPPED_ARRAY, CUDA_RESOURCE_DESC::res::mipmap::hMipmappedArray must be set to a valid CUDA mipmapped array handle.

If CUDA_RESOURCE_DESC::resType is set to CU_RESOURCE_TYPE_LINEAR, CUDA_RESOURCE_DESC::res::linear::devPtr must be set to a valid device pointer, that is aligned to CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT. CUDA_RESOURCE_DESC::res::linear::format and CUDA_RESOURCE_DESC::res::linear::numChannels describe the format of each component and the number of components per array element. CUDA_RESOURCE_DESC::res::linear::sizeInBytes specifies the size of the array in bytes. The total number of elements in the linear address range cannot exceed CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH. The number of elements is computed as (sizeInBytes / (sizeof(format) * numChannels)).

If CUDA_RESOURCE_DESC::resType is set to CU_RESOURCE_TYPE_PITCH2D, CUDA_RESOURCE_DESC::res::pitch2D::devPtr must be set to a valid device pointer, that is aligned to CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT. CUDA_RESOURCE_DESC::res::pitch2D::format and CUDA_RESOURCE_DESC::res::pitch2D::numChannels describe the format of each component and the number of components per array element. CUDA_RESOURCE_DESC::res::pitch2D::width and CUDA_RESOURCE_DESC::res::pitch2D::height specify the width and height of the array in elements, and cannot exceed CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH and CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT respectively. CUDA_RESOURCE_DESC::res::pitch2D::pitchInBytes specifies the pitch between two rows in bytes and has to be aligned to CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT. Pitch cannot exceed CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH.

The CUDA_TEXTURE_DESC struct is defined as

‎        typedef struct CUDA_TEXTURE_DESC_st {
                  CUaddress_mode addressMode[3];
                  CUfilter_mode filterMode;
                  unsigned int flags;
                  unsigned int maxAnisotropy;
                  CUfilter_mode mipmapFilterMode;
                  float mipmapLevelBias;
                  float minMipmapLevelClamp;
                  float maxMipmapLevelClamp;
              } CUDA_TEXTURE_DESC;

where

The CUDA_RESOURCE_VIEW_DESC struct is defined as

‎        typedef struct CUDA_RESOURCE_VIEW_DESC_st
              {
                  CUresourceViewFormat format;
                  size_t width;
                  size_t height;
                  size_t depth;
                  unsigned int firstMipmapLevel;
                  unsigned int lastMipmapLevel;
                  unsigned int firstLayer;
                  unsigned int lastLayer;
              } CUDA_RESOURCE_VIEW_DESC;

where:

See also:

cuTexObjectDestroy, cudaCreateTextureObject


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4