本文介绍了[CUDA]两个任意大小的矩阵相乘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
将两个矩阵A [4x3]和B [3x4]相乘.
结果矩阵C [4x4].
每个块的并行操作数为4.
因此,
THREADS_PER_BLOCK = 4
Multiplying two Matrices A[4x3] and B[3x4].
Resultant Matrix C[4x4].
no of parallel operations per block is 4.
Therefore,
THREADS_PER_BLOCK = 4
dim3 dimBlock(THREADS_PER_BLOCK, THREADS_PER_BLOCK);
dim3 dimGrid(B.width/dimBlock.x, A.height/dimBlock.y);
MatrixMultKernel<<<dimGrid, dimBlock>>>(d_A, d_B, d_C);
CUDA报告无效的配置错误".在这方面需要帮助.
CUDA reports "invalid configuration error". need help in this regard.
推荐答案
这篇关于[CUDA]两个任意大小的矩阵相乘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!