使用纹理内存在 CUDA 中进行过滤
我在 CUDA 中使用纹理内存进行图像过滤:
texture<unsigned char> texMem; //deceleration
cudaBindTexture( NULL, texMem,d_inputImage,imageSize); //binding
但是我对边界的结果不满意。针对 2D 过滤定制的纹理内存是否还有其他注意事项或设置?
我见过人们以这种方式清除纹理:
texture<float> texMem(0,cudaFilterModeLinear);
// what does this do?
此外,如果有人可以建议一些在线指南来解释如何在 CUDA 中正确设置设置纹理内存抽象,那将会很有帮助。谢谢
I'm using texture memory for image filtering in CUDA as:
texture<unsigned char> texMem; //deceleration
cudaBindTexture( NULL, texMem,d_inputImage,imageSize); //binding
However I'm not satisfied with the results at the boundary. Is there any other considerations or settings for texture memory tailored for 2D filtering?
I've seen people declear texture this way:
texture<float> texMem(0,cudaFilterModeLinear);
// what does this do?
Moreover, if anyone can suggest some online guide explaining how to properly set setup texture memory abstraction in CUDA, that'll be helpful. Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 cudaFilterMode 指定所需的采样类型(可以是线性或三次)。
您可以从 CUDA_C_Programming_Guide.pdf 在 path/to/cudatoolkit/doc 中提供,以查看详细解释
You can specify what kind of sampling you want using
cudaFilterMode
(could be linear or cubic).You could look at Appendix G from the CUDA_C_Programming_Guide.pdf provided in path/to/cudatoolkit/doc to see this explained in detail