libSCALE  0.2.0
A modern C++ CUDA API
Texture Intrinsics

Plugging some holes in the NVIDIA® texture fetch API, and making it less annoying to use in template code. More...

Functions

__device__ int sp::getTexWidth (cudaTextureObject_t tex)
 Query the width of a texture object. More...
 
__device__ int sp::getTexHeight (cudaTextureObject_t tex)
 Query the height of a texture object. More...
 
__device__ int sp::getTexDepth (cudaTextureObject_t tex)
 Query the depth of a texture object. More...
 
template<>
__device__ float4 sp::tex1Dfetch (cudaTextureObject_t tex, int x)
 
template<>
__device__ float4 sp::tex1DOffsetfetch (cudaTextureObject_t tex, int x, int xO)
 Read from a 1D texture at an integer offset with offset addressing (API extension) More...
 
template<>
__device__ float4 sp::tex2Dfetch (cudaTextureObject_t tex, int x, int y)
 Read from a 2D texture using integer coordinates. (API extension) More...
 
template<>
__device__ float4 sp::tex2DOffsetfetch (cudaTextureObject_t tex, int x, int y, int xO, int yO)
 Read from a 2D texture using integer coordinates with offset addressing. (API extension) More...
 
template<>
__device__ float4 sp::tex3Dfetch (cudaTextureObject_t tex, int x, int y, int z)
 Read from a 3D texture using integer coordinates. (API extension) More...
 
template<>
__device__ float4 sp::tex3DOffsetfetch (cudaTextureObject_t tex, int x, int y, int z, int xO, int yO, int zO)
 Read from a 3D texture using integer coordinates. with offset addressing (API extension) More...
 
template<>
__device__ float4 sp::tex1D (cudaTextureObject_t tex, float x)
 Read from a 1D texture at a floating-point offset. More...
 
template<>
__device__ float4 sp::tex2D (cudaTextureObject_t tex, float x, float y)
 Read from a 2D texture using floating-point coordinates. More...
 
template<>
__device__ float4 sp::tex3D (cudaTextureObject_t tex, float x, float y, float z)
 Read from a 3D texture using floating-point coordinates. More...
 

Detailed Description

Plugging some holes in the NVIDIA® texture fetch API, and making it less annoying to use in template code.

The NVIDIA APIs don't expose non-interpolating accessors for 2 or 3 dimensions, among other things. This additional flexibility is needed to implement speclib's TexTensor (which, unless you're porting legacy code, is probably the only sensible way to use these functions).

Function Documentation

◆ getTexDepth()

__device__ int sp::getTexDepth ( cudaTextureObject_t  tex)

Query the depth of a texture object.

◆ getTexHeight()

__device__ int sp::getTexHeight ( cudaTextureObject_t  tex)

Query the height of a texture object.

◆ getTexWidth()

__device__ int sp::getTexWidth ( cudaTextureObject_t  tex)

Query the width of a texture object.

◆ tex1D()

template<>
__device__ float4 sp::tex1D ( cudaTextureObject_t  tex,
float  x 
)

Read from a 1D texture at a floating-point offset.

◆ tex1Dfetch()

template<>
__device__ float4 sp::tex1Dfetch ( cudaTextureObject_t  tex,
int  x 
)

Read from a 1D texture at an integer offset.

◆ tex1DOffsetfetch()

template<>
__device__ float4 sp::tex1DOffsetfetch ( cudaTextureObject_t  tex,
int  x,
int  xO 
)

Read from a 1D texture at an integer offset with offset addressing (API extension)

◆ tex2D()

template<>
__device__ float4 sp::tex2D ( cudaTextureObject_t  tex,
float  x,
float  y 
)

Read from a 2D texture using floating-point coordinates.

◆ tex2Dfetch()

template<>
__device__ float4 sp::tex2Dfetch ( cudaTextureObject_t  tex,
int  x,
int  y 
)

Read from a 2D texture using integer coordinates. (API extension)

◆ tex2DOffsetfetch()

template<>
__device__ float4 sp::tex2DOffsetfetch ( cudaTextureObject_t  tex,
int  x,
int  y,
int  xO,
int  yO 
)

Read from a 2D texture using integer coordinates with offset addressing. (API extension)

◆ tex3D()

template<>
__device__ float4 sp::tex3D ( cudaTextureObject_t  tex,
float  x,
float  y,
float  z 
)

Read from a 3D texture using floating-point coordinates.

◆ tex3Dfetch()

template<>
__device__ float4 sp::tex3Dfetch ( cudaTextureObject_t  tex,
int  x,
int  y,
int  z 
)

Read from a 3D texture using integer coordinates. (API extension)

◆ tex3DOffsetfetch()

template<>
__device__ float4 sp::tex3DOffsetfetch ( cudaTextureObject_t  tex,
int  x,
int  y,
int  z,
int  xO,
int  yO,
int  zO 
)

Read from a 3D texture using integer coordinates. with offset addressing (API extension)