Function rcudnn::cudaBindTexture2D[][src]

pub unsafe extern "C" fn cudaBindTexture2D(
    offset: *mut usize,
    texref: *const textureReference,
    devPtr: *const c_void,
    desc: *const cudaChannelFormatDesc,
    width: usize,
    height: usize,
    pitch: usize
) -> cudaError
Expand description

\brief Binds a 2D memory area to a texture

\deprecated

Binds the 2D memory area pointed to by \p devPtr to the texture reference \p texref. The size of the area is constrained by \p width in texel units, \p height in texel units, and \p pitch in byte units. \p desc describes how the memory is interpreted when fetching values from the texture. Any memory previously bound to \p texref is unbound.

Since the hardware enforces an alignment requirement on texture base addresses, ::cudaBindTexture2D() returns in \p *offset a byte offset that must be applied to texture fetches in order to read from the desired memory. This offset must be divided by the texel size and passed to kernels that read from the texture so they can be applied to the ::tex2D() function. If the device memory pointer was returned from ::cudaMalloc(), the offset is guaranteed to be 0 and NULL may be passed as the \p offset parameter.

\p width and \p height, which are specified in elements (or texels), cannot exceed ::cudaDeviceProp::maxTexture2DLinear[0] and ::cudaDeviceProp::maxTexture2DLinear[1] respectively. \p pitch, which is specified in bytes, cannot exceed ::cudaDeviceProp::maxTexture2DLinear[2].

The driver returns ::cudaErrorInvalidValue if \p pitch is not a multiple of ::cudaDeviceProp::texturePitchAlignment.

\param offset - Offset in bytes \param texref - Texture reference to bind \param devPtr - 2D memory area on device \param desc - Channel format \param width - Width in texel units \param height - Height in texel units \param pitch - Pitch in bytes

\return ::cudaSuccess, ::cudaErrorInvalidValue, ::cudaErrorInvalidTexture \notefnerr \note_init_rt \note_callback

\sa \ref ::cudaCreateChannelDesc(int, int, int, int, cudaChannelFormatKind) “cudaCreateChannelDesc (C API)”, ::cudaGetChannelDesc, ::cudaGetTextureReference, \ref ::cudaBindTexture(size_t*, const struct textureReference*, const void*, const struct cudaChannelFormatDesc*, size_t) “cudaBindTexture (C API)”, \ref ::cudaBindTexture2D(size_t*, const struct texture< T, dim, readMode>&, const void*, const struct cudaChannelFormatDesc&, size_t, size_t, size_t) “cudaBindTexture2D (C++ API)”, \ref ::cudaBindTexture2D(size_t*, const struct texture<T, dim, readMode>&, const void*, size_t, size_t, size_t) “cudaBindTexture2D (C++ API, inherited channel descriptor)”, \ref ::cudaBindTextureToArray(const struct textureReference*, cudaArray_const_t, const struct cudaChannelFormatDesc*) “cudaBindTextureToArray (C API)”, \ref ::cudaUnbindTexture(const struct textureReference*) “cudaBindTextureToArray (C API)”, \ref ::cudaGetTextureAlignmentOffset(size_t*, const struct textureReference*) “cudaGetTextureAlignmentOffset (C API)”, ::cuTexRefSetAddress2D, ::cuTexRefSetFormat, ::cuTexRefSetFlags, ::cuTexRefSetAddressMode, ::cuTexRefSetBorderColor