سؤال

My understanding of memory bandwidth is that it is reported using the SI units, kilo=10^3, mega=10^6 etc (although memory size is obviously reported in 2^n format).

The CUDA bandwidthTest sample seems to flaunt this. The below sample is straight from the SDK sample, where memSize is an integer describing the size of the array and is 32*2^20 by default and MEMCOPY_ITERATIONS is an integer.

Let's say elapsed time is 1000ms and MEMCOPY_ITERATIONS=1, the results would be 64MB/s, but the MB is of the form 2^20. Is my assumption correct, and if so is the binary notation of bandwidth accepted?

I thought it wasn't.

//calculate bandwidth in MB/s
bandwidthInMBs = 2.0f * (1e3f * memSize * (float)MEMCOPY_ITERATIONS) /
                 (elapsedTimeInMs * (float)(1 << 20));

EDIT: On the off chance that anyone ever searches for this again, an altered bandwidthTest that reports in SI MB/s is here, adapted from the CUDA 5.5 SDK and including the Visual Studio Projects.

هل كانت مفيدة؟

المحلول

bandwidthTest gives results in binary MB/s?

Yes.

is the binary notation of bandwidth accepted?

Perhaps not.

(those were the only 2 questions I could find.)

Since the binary megabyte is larger than the SI megabyte, it would seem that the bandwidthTest sample code is under-reporting if you interpret the results according to SI units. As a sample code, it's primary purpose is to educate and instruct, not conform to some definition.

You have the source code -- you can make your version of it report any way that you want.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top