fix up bandwidth calculation

This commit is contained in:
Erik Schultheis 2024-04-30 23:52:08 +03:00
parent c3515cfe47
commit 603d862830

View file

@ -182,7 +182,7 @@ int main(int argc, const char **argv) {
// napkin math: estimate the memory bandwidth achieved
// for each (B,T,C) output element, we do 1 read and 1 write, 4 bytes each
// and e.g. A100 40GB PCIe is advertised at 1,555GB/s
long memory_ops = B * T * C * 2 * 4;
long memory_ops = B * T * C * 2 * (int)sizeof(floatX);
float memory_bandwidth = memory_ops / elapsed_time / 1e6;
printf("block_size %4d | time %.4f ms | bandwidth %.2f GB/s\n", block_size, elapsed_time, memory_bandwidth);