arguments of <<<...>>>

i can’t understand the differencess (i mean aadvantages ) when calling global function, arguments of <<<…>>> .

for example if i have an array such that int arr[3][3];

calling my kernel–> mykernel<<<3,3>>>(arr) or

in these invocation result is same only threadIdx.x and threadIdx.y become different. in my opinion first of them is better for program readebility but i don’t understand what are other advantages of this. it must have a purpose but i can’t understand this. my question is simply that: how i form grid dim size or thread dimension etc. (i think i coulnt’t tell my problem so i apologize to everybody)

The programming guide has all the answers, you really should read it, it is very informative. The first number is for how many blocks there are in the grid. The other for how many threads there are in each block.

Threads within a block can synchronize with each other and exchange information.

A block can run on not more than 1 multiprocessor.

So <<<1,9>>> will mean 1 block of 9 threads running in 1 multiprocessor (of e.g. 30 in GTX280)

Two general remarks: You want many, many, more blocks than 30 to make sure your software scales and to fully utilize the hardware. You want N * 32 threads per block.

thanks your answer. i m using programing guide and i have understood first and second parameter. now i can ask my quesiton easily. you said <<<1,9>>> means 9 threads in one block. and does it mean one processor for these threads. so do they execute as sequential? if it is <<<3,3>>> it means 3 threads in a block and 3 blocks. in this manner do a block execute on separete processor? so <<<1,9>>> and <<<3,3>>> effect parallelism?

thanks again…

Yes, they do affect parallelism. But as said before, you will want to have something in the order of <<<100’s, 64 till 512>>>

A multiprocessor processes threads in warps (32 threads grouped together). They are processed in a parallel and sequential fashion.