diff --git a/dev/cuda/gelu_forward.cu b/dev/cuda/gelu_forward.cu index a8edf31..464f034 100644 --- a/dev/cuda/gelu_forward.cu +++ b/dev/cuda/gelu_forward.cu @@ -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);