GPGPU矩阵加法问题

发布于 2024-09-28 12:07:49 字数 94 浏览 1 评论 0原文

我有巨大的矩阵,我希望矩阵的输出与输入矩阵的大小相同,只是每个单元格从相邻单元格获取数字之和。

您能指导我如何使用 CUDA 在 GPGPU 平台上实现它吗?

I have huge huge matrices and I want the output of the matrix to be of the same size as input matrix, just with each cell getting sum of numbers from adjacent cell.

Can you guide me how to approach it on a GPGPU platform using CUDA?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

可遇━不可求 2024-10-05 12:07:49

您必须将所有相邻单元格的值传递给内核(作为参数),以便您能够进行求和。
参数列表和后面的代码是这样的:
( int 实际单元值, int adj1, int adj2, int adj3...)

{
实际细胞值 = 实际细胞值 + adj1 + adj2 + adj3....;
这可能是错误的,但这

就是我从您的非常简短的描述中得出的结论。

问候,
彼得

You have to pass all the adjacent cells' values to your kernel (as parameters) so you ll be able to do the sum.
Something like this in the parameterlist and the code right after:
( int actualCellvalue, int adj1, int adj2, int adj3...)

{
actualCellvalue = actualCellvalue + adj1 + adj2 + adj3....;
}

This might be wrong, but thats what i figured out from your really short description.

Regards,
Peter

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文