aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/util/env_var.h
diff options
context:
space:
mode:
authorGravatar Yangzihao Wang <yangzihao@google.com>2017-11-03 12:14:01 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-11-03 12:17:46 -0700
commit832ffc71a2d4182a49a2353ff125f2624bd52f0f (patch)
tree89b2bd421e10025f760f6c682f93a2fe83adbe94 /tensorflow/core/util/env_var.h
parent509d0f2ca7f988d294d7234d31fac6a1cedcc39b (diff)
Add new env-var TF_FP16_CONV_MODE.
The env-var is used to decide how to do internal computation for cudnn convolution when input data type is float16. For ACCURATE mode, we always use float32 as the internal compute type; For FAST mode, we include both float16 and float32 internal compute type into auto-tune to pick whichever runs faster. PiperOrigin-RevId: 174495814
Diffstat (limited to 'tensorflow/core/util/env_var.h')
-rw-r--r--tensorflow/core/util/env_var.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/tensorflow/core/util/env_var.h b/tensorflow/core/util/env_var.h
index ec661f1d81..47f9ff3a3b 100644
--- a/tensorflow/core/util/env_var.h
+++ b/tensorflow/core/util/env_var.h
@@ -21,20 +21,25 @@ limitations under the License.
namespace tensorflow {
-// Return a boolean into "value" from the environmental variable "env_var_name".
-// If it is unset, the default value is used.
-// A string "0" or a case insensitive "false" is interpreted as false.
-// A string "1" or a case insensitive "true" is interpreted as true.
-// Otherwise, an error status is returned.
+// Returns a boolean into "value" from the environmental variable
+// "env_var_name". If it is unset, the default value is used. A string "0" or a
+// case insensitive "false" is interpreted as false. A string "1" or a case
+// insensitive "true" is interpreted as true. Otherwise, an error status is
+// returned.
Status ReadBoolFromEnvVar(StringPiece env_var_name, bool default_val,
bool* value);
-// Return an int64 into "value" from the environmental variable "env_var_name".
+// Returns an int64 into "value" from the environmental variable "env_var_name".
// If it is unset, the default value is used.
// If the string cannot be parsed into int64, an error status is returned.
Status ReadInt64FromEnvVar(StringPiece env_var_name, int64 default_val,
int64* value);
+// Returns a string into "value" from the environmental variable "env_var_name".
+// If it is unset, the default value is used.
+Status ReadStringFromEnvVar(StringPiece env_var_name, StringPiece default_val,
+ string* value);
+
} // namespace tensorflow
#endif // TENSORFLOW_UTIL_ENV_VAR_H_