From 00b368966c8c3e003d2a7ddf3c36165185ed0079 Mon Sep 17 00:00:00 2001 From: Max Galkin Date: Tue, 10 Oct 2017 20:22:50 -0700 Subject: Minor code cleanup in grappler cost estimation. PiperOrigin-RevId: 171772766 --- tensorflow/core/grappler/costs/op_level_cost_estimator.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'tensorflow/core/grappler/costs/op_level_cost_estimator.h') diff --git a/tensorflow/core/grappler/costs/op_level_cost_estimator.h b/tensorflow/core/grappler/costs/op_level_cost_estimator.h index 0e63299bcb..3a8385dd73 100644 --- a/tensorflow/core/grappler/costs/op_level_cost_estimator.h +++ b/tensorflow/core/grappler/costs/op_level_cost_estimator.h @@ -36,11 +36,14 @@ class OpLevelCostEstimator { virtual Costs PredictCosts(const OpContext& op_context) const; protected: - // Returns an estimate of device performance (in billions of operations - // executed per second) and memory bandwidth (in GigaBytes/second) for the - // specified device. - virtual std::pair GetDeviceInfo( - const DeviceProperties& device) const; + // Basic device performance info, sufficient for roofline estimate. + struct DeviceInfo { + double gigaops; // Billions of operations executed per second. + double gb_per_sec; // Bandwidth to main memory in GB per second. + }; + + // Returns basic device performance info. + virtual DeviceInfo GetDeviceInfo(const DeviceProperties& device) const; // For operations for which we haven't yet built estimates, returns a dummy // value based on input size. -- cgit v1.2.3