之前采用的是:

在Doc.cpp里,定义,并调用函数得到Gauskernel数组

float Gauskernel[(2*f+1)*(2*f+1)]={0.0};
make_Gauskernel(f,Gauskernel,2*f+1,2*f+1);

然后

NlmDenoise(pGpuData,pResult,PicWidth,PicHeight,Gauskernel);//此函数在host.cu里定义

然后

host.cu里调用kernel.cu。

调试了超过2天,各种怀疑,最后终于认定是这个错误。不能这么传值。

cudaMalloc((void **)&kernel, sizeof(float)*(2*f+1)*(2*f+1)); 然后拷贝到显存里的kernel

cudaMemcpy(kernel,Gauskernel,sizeof(float)*(2*f+1)*(2*f+1),cudaMemcpyHostToDevice);

以后的函数就调用kernel

NlmDenoise(pGpuData,pResult,PicWidth,PicHeight,kernel);//此函数在host.cu里定义

相关文章:

  • 2022-01-10
  • 2021-07-29
  • 2021-12-31
  • 2021-04-19
  • 2022-12-23
  • 2021-05-27
  • 2021-09-03
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-07
  • 2021-05-16
  • 2021-11-26
  • 2021-09-26
  • 2022-12-23
相关资源
相似解决方案