# problem of declaration of Grid and Block Grid and block declaration

hello,

i posted my problem of general code of multiplication of no square matrix

but i don’t receive any solution , i think that the origine of problem is the declaration of

Grid and Block

so my question is : if we have matrix A[n][m] x B[m][k] (general multiplication of matrix )

how can declarate Grid and block ??

dim3 dimGrid(1, 1); ??
dim3 dimBlock(4,4); ??

please any body can help me .

You can’t arbitrarily define the grid and block size. The sizes you need will be defined by the work per thread that the kernel performs and the total amount of work done. Have a look at the SDK matrix multiplication sample for a good example of how to do this. It is also discussed in quite a lot of detail in the programming guide.

You can’t arbitrarily define the grid and block size. The sizes you need will be defined by the work per thread that the kernel performs and the total amount of work done. Have a look at the SDK matrix multiplication sample for a good example of how to do this. It is also discussed in quite a lot of detail in the programming guide.