Quick Idiot Question

Can I use the “Func<<<dim3, dim3>>>(params);” style grid launch with the driver API?

No.

Here is an example:

dim3 numBlocks(3,2,1);

dim3 numThreadsPerBlock( 2,2,1);

GlobalFun<<< numBlocks, numThreadsPerBlock >>> ( params );

So, for this config, the global function has totally ( 32122*1 = ) 24 threads.

global void GlobalFun( params )

{

int idx = blockIdx.x * blockDim.x + thraedIdx.x;

int idy = blockIdx.y * blockDim.y + thraedIdx.y;

// Do your code here…

}

Remeber Here numBlocks and numThreadsPerBlock variables are 2D.

He said “with the driver API”.

I think you have to use “cuParamSetSize”, “cuParamSetv” or “cuParamSeti” / “cuParamSetf” to set the parameters, “cuFuncSetBlockShape” to set the block shape, and “cuLaunchGrid” to execute.

I was afraid of that. Ok thanks.