12.07.2015 Views

NVIDIA CUDA

NVIDIA CUDA

NVIDIA CUDA

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3.26 Texture Reference Management 167When using a tex2D() function inside a kernel, we have to either call cuTexRefSetArray() to bind the correspondingtexture reference to an array, or cuTexRefSetAddress2D() to bind the texture reference to linear memory.Function calls to cuTexRefSetFormat() cannot follow calls to cuTexRefSetAddress2D() for the same texture reference.Parameters:hTexRef - Texture reference to binddesc - Descriptor of <strong>CUDA</strong> arraydptr - Device pointer to bindPitchInBytes - Line pitch in bytesReturns:<strong>CUDA</strong>_SUCCESS, <strong>CUDA</strong>_ERROR_DEINITIALIZED, <strong>CUDA</strong>_ERROR_NOT_INITIALIZED, <strong>CUDA</strong>_-ERROR_INVALID_CONTEXT, <strong>CUDA</strong>_ERROR_INVALID_VALUESee also:cuTexRefCreate, cuTexRefDestroy, cuTexRefSetAddress, cuTexRefSetAddressMode, cuTexRefSetArray, cu-TexRefSetFilterMode, cuTexRefSetFlags, cuTexRefSetFormat, cuTexRefGetAddress, cuTexRefGetAddress-Mode, cuTexRefGetArray, cuTexRefGetFilterMode, cuTexRefGetFlags, cuTexRefGetFormat3.26.2.11 CUresult cuTexRefSetAddressMode (CUtexref hTexRef, int Dim, CUaddress_mode am)Specifies the addressing mode am for the given dimension Dim of the texture reference hTexRef. If Dim is zero,the addressing mode is applied to the first parameter of the functions used to fetch from the texture; if Dim is 1, thesecond, and so on. CUaddress_mode is defined as:typedef enum CUaddress_mode_enum {CU_TR_ADDRESS_MODE_WRAP = 0,CU_TR_ADDRESS_MODE_CLAMP = 1,CU_TR_ADDRESS_MODE_MIRROR = 2,} CUaddress_mode;Note that this call has no effect if hTexRef is bound to linear memory.Parameters:hTexRef - Texture referenceDim - Dimensionam - Addressing mode to setReturns:<strong>CUDA</strong>_SUCCESS, <strong>CUDA</strong>_ERROR_DEINITIALIZED, <strong>CUDA</strong>_ERROR_NOT_INITIALIZED, <strong>CUDA</strong>_-ERROR_INVALID_CONTEXT, <strong>CUDA</strong>_ERROR_INVALID_VALUESee also:cuTexRefCreate, cuTexRefDestroy, cuTexRefSetAddress, cuTexRefSetAddress2D, cuTexRefSetArray, cu-TexRefSetFilterMode, cuTexRefSetFlags, cuTexRefSetFormat, cuTexRefGetAddress, cuTexRefGetAddress-Mode, cuTexRefGetArray, cuTexRefGetFilterMode, cuTexRefGetFlags, cuTexRefGetFormatGenerated on Wed Apr 1 16:11:42 2009 for <strong>NVIDIA</strong> <strong>CUDA</strong> Library by Doxygen

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!