dim3 ? What is the data type 'dim3' ?

Hi,

This is regarding the SDK code for matrix multiplication…

In the host multiplication function, the block and grid dimensions are declared using the following code:

dim3 dimBlock(BLOCK_SIZE,BLOCK_SIZE);

dim3 dimGrid(wB/dimBlock.x, hA/dimBlock.y);

Muld<<<dimGrid,dimBlock>>> (Ad,Bd,wA,wB,Cd);

What is the data type dim3 and also, what do the functions dimBlock() and dimGrid() do?

Are these functions part of the library and where are these declared?

Thanks…

dim3 is just a structure designed for storing block and grid dimensions. dimBlock() and dimGrid() are setting the initial values using constructors.

See the programming guide, section 4.3.1.2