Skip to content

Commit

Permalink
Fix overflow issue flagged by asan.
Browse files Browse the repository at this point in the history
Apparently `memoryClockRate * 2` overflowing int.

PiperOrigin-RevId: 670143739
  • Loading branch information
mooskagh authored and tensorflower-gardener committed Sep 2, 2024
1 parent c0d155d commit 733dc8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tensorflow/core/grappler/clusters/utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ DeviceProperties GetLocalGPUInfo(PlatformDeviceId platform_device_id) {
// 8 is the number of bits per byte. 2 is accounted for
// double data rate (DDR).
device.set_bandwidth(properties.memoryBusWidth / 8 *
properties.memoryClockRate * 2);
properties.memoryClockRate * 2ULL);

(*device.mutable_environment())["architecture"] =
strings::StrCat(properties.major, ".", properties.minor);
Expand Down Expand Up @@ -132,7 +132,7 @@ DeviceProperties GetLocalGPUInfo(PlatformDeviceId platform_device_id) {
// 8 is the number of bits per byte. 2 is accounted for
// double data rate (DDR).
device.set_bandwidth(properties.memoryBusWidth / 8 *
properties.memoryClockRate * 2);
properties.memoryClockRate * 2ULL);

(*device.mutable_environment())["architecture"] =
strings::StrCat("gfx", properties.gcnArchName);
Expand Down

0 comments on commit 733dc8d

Please sign in to comment.