CUDA 比较数组
尝试制作一个可以比较一对多位图的应用程序。有一个参考位图和多个其他位图。每次比较的结果应该是具有差异的新位图。也许比较位图而不是纹理而不是数组?我最大的问题是让内核接受多个输入指针,以及如何比较数据..
extern "C" __global__ void compare(float *odata, float *idata, int width, int height)
有效,但以下无效(我使用足够的参数调用该函数)
extern "C" __global__ void compare(float *odata, float *idata, float *idata2, int width, int height)
Trying to make an app that will compare 1-to-multiple bitmaps. there is one reference bitmap and multiple other bitmaps. Result from each compare should be new bitmap with diffs. Maybe comparing bitmaps rather as textures than arrays? My biggest problem is making kernel accept more than one input pointer, and how to compare the data..
extern "C" __global__ void compare(float *odata, float *idata, int width, int height)
works and following does not (i call the function with enough params)
extern "C" __global__ void compare(float *odata, float *idata, float *idata2, int width, int height)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的函数原型没问题。问题出在别处。一般来说,请确保为所有输入和输出阵列正确分配设备内存,并确保正确地将数据复制到设备阵列或从设备阵列复制数据。
Your function prototypes are OK. The problem lies elsewhere. In general, make sure that you are properly allocating device memory for all input and output arrays, and make sure that you're correctly copying data to and from your device arrays.