37 #ifndef PCL_GPU_UTILS_TEXTURE_BINDER_HPP_
38 #define PCL_GPU_UTILS_TEXTURE_BINDER_HPP_
40 #include <pcl/gpu/utils/safe_call.hpp>
41 #include <pcl/gpu/containers/device_array.h>
50 template<
class T, enum cudaTextureReadMode readMode>
53 cudaChannelFormatDesc desc = cudaCreateChannelDesc<T>();
54 cudaSafeCall( cudaBindTexture2D(0, tex, arr.
ptr(), desc, arr.
cols(), arr.
rows(), arr.
step()) );
57 template<
class T, enum cudaTextureReadMode readMode>
60 cudaChannelFormatDesc desc = cudaCreateChannelDesc<T>();
61 cudaSafeCall( cudaBindTexture(0, tex, arr.
ptr(), desc, arr.
sizeBytes()) );
64 template<
class T, enum cudaTextureReadMode readMode>
67 cudaChannelFormatDesc desc = cudaCreateChannelDesc<T>();
68 cudaSafeCall( cudaBindTexture2D(0, tex, arr.
data, desc, arr.
cols, arr.
rows, arr.
step) );
71 template<
class T, enum cudaTextureReadMode readMode>
74 cudaChannelFormatDesc desc = cudaCreateChannelDesc<T>();
75 cudaSafeCall( cudaBindTexture(0, tex, arr.
data, desc, arr.
size * arr.
elemSize()) );
80 cudaSafeCall( cudaUnbindTexture(texref) );
83 const struct textureReference *texref;