13 template<
class T, enum cudaTextureReadMode readMode>
16 cudaChannelFormatDesc desc = cudaCreateChannelDesc<T>();
20 template<
class T, enum cudaTextureReadMode readMode>
23 cudaChannelFormatDesc desc = cudaCreateChannelDesc<T>();
27 template<
class T, enum cudaTextureReadMode readMode>
30 cudaChannelFormatDesc desc = cudaCreateChannelDesc<T>();
34 template<
class A,
class T, enum cudaTextureReadMode readMode>
35 TextureBinder(
const A& arr,
const struct texture<T, 2, readMode>& tex,
const cudaChannelFormatDesc& desc) :
texref(&tex)
37 cudaSafeCall( cudaBindTexture2D(0, tex, arr.data, desc, arr.cols, arr.rows, arr.step) );
40 template<
class T, enum cudaTextureReadMode readMode>
43 cudaChannelFormatDesc desc = cudaCreateChannelDesc<T>();
52 const struct textureReference *
texref;
size_t step
stride between two consecutive rows in bytes. Step is stored always and everywhere in bytes!!! ...
TextureBinder(const DeviceArray< T > &arr, const struct texture< T, 1, readMode > &tex)
size_t step() const
Returns stride between two consecutive rows in bytes for internal buffer. Step is stored always and e...
T * ptr(int y=0)
Returns pointer to given row in internal buffer.
int rows() const
Returns number of rows.
TextureBinder(const A &arr, const struct texture< T, 2, readMode > &tex, const cudaChannelFormatDesc &desc)
#define cudaSafeCall(expr)
T * ptr()
Returns pointer for internal buffer in GPU memory.
TextureBinder(const PtrStepSz< T > &arr, const struct texture< T, 2, readMode > &tex)
TextureBinder(const PtrSz< T > &arr, const struct texture< T, 1, readMode > &tex)
__kf_hdevice__ size_t elemSize() const
const struct textureReference * texref
int cols() const
Returns number of elements in each row.
TextureBinder(const DeviceArray2D< T > &arr, const struct texture< T, 2, readMode > &tex)