I’m starting off with CUDA by looking at the Scalar Product example in the SDK in:
C:\Program Files\NVIDIA Corporation\NVIDIA CUDA SDK\projects\scalarprod
Within the file scalarProc.cu file, there is a line like this:
It looks like a method is being called with 5 parameters, but what do the numbers 128 and 256 mean within the < and >'s? I can see the scalarProdGPU method within the file scalarProd_kernel.cu, but I don’t see where the numbers would be passed to.
I’m familiar with C and Java syntax; if this is something special within C++, I haven’t seen it before. Or is this type of method call a part of CUDA?
As an aside, I measured 2.24GB/sec data transfer (about 400MB) from the CPU to the GPU, which has 512MB of memory. Though the card is running on PCIe 2.0 x16 (which has a theoretical bandwidth of 5.0GB/sec) is the fact that it’s roughly 45% of theoretical bandwidth attributed to the fact the card’s being used as the primary display driver as well, with 2 monitors connected to it?
It’s CUDA’s kernel launch syntax for specifying the number of blocks and the number of threads per block. Read the programmer’s guide; it’s a pretty major topic in there.
Are you doing pinned or paged memory transfers? Run again with --memory=pinned if you didn’t specify any options before.
Ok, thanks! There’s a lot of documentation and sample files for CUDA, and it’s kinda tricky to figure out where to start reading and/or programming. :)
I’ll look into the memory copy speeds a bit later.
It looks like a method is being called with 5 parameters, but what do the numbers 128 and 256 mean within the < and >'s? I can see the scalarProdGPU method within the file scalarProd_kernel.cu, but I don’t see where the numbers would be passed to.
Look on page 5 of the CUDA programming guide. It explains the <<<>>> notation. Or is your question more complex?