From aa39573ee152de0e8182719042f14c41f07d4557 Mon Sep 17 00:00:00 2001 From: Deven Desai Date: Wed, 8 Apr 2020 22:44:41 +0000 Subject: [PATCH] Populating memory bandwidth information in the DeviceDescription, using information from the call to hipGetDeviceProperties --- tensorflow/stream_executor/rocm/rocm_gpu_executor.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tensorflow/stream_executor/rocm/rocm_gpu_executor.cc b/tensorflow/stream_executor/rocm/rocm_gpu_executor.cc index 2a85cb820ed..dbab0304d82 100644 --- a/tensorflow/stream_executor/rocm/rocm_gpu_executor.cc +++ b/tensorflow/stream_executor/rocm/rocm_gpu_executor.cc @@ -856,6 +856,11 @@ GpuExecutor::CreateDeviceDescription(int device_ordinal) { float clock_rate_ghz = static_cast(prop.clockRate) / 1e6; builder.set_clock_rate_ghz(clock_rate_ghz); + + // mem_bandwidth = 2 * mem_bus_width_in_bytes * mem_clock_rate_in_hz + int64 memory_bandwidth = 2 * (int64(prop.memoryBusWidth) / 8) * + (int64(prop.memoryClockRate) * 1000); + builder.set_memory_bandwidth(memory_bandwidth); } {