aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/c/c_test_util.cc
diff options
context:
space:
mode:
authorGravatar Mingsheng Hong <hongm@google.com>2018-02-16 22:05:07 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-02-16 22:09:20 -0800
commitfa8c4d16288e3bee4a014b4d51d22dd361721ff4 (patch)
treef42d8b707cc5c7d9cb478fb36065d1b22fe95253 /tensorflow/c/c_test_util.cc
parent02bbb131b78fb0924675809ed5b549e594a51ac1 (diff)
Added an experimental C API TF_EnableXLACompilation() to enable XLA compilation.
Also ran "buildozer warn //third_party/tensorflow/c/BUILD" and removed an unused symbol. PiperOrigin-RevId: 186081948
Diffstat (limited to 'tensorflow/c/c_test_util.cc')
-rw-r--r--tensorflow/c/c_test_util.cc16
1 files changed, 2 insertions, 14 deletions
diff --git a/tensorflow/c/c_test_util.cc b/tensorflow/c/c_test_util.cc
index a55af46ae2..3db2852ce6 100644
--- a/tensorflow/c/c_test_util.cc
+++ b/tensorflow/c/c_test_util.cc
@@ -15,7 +15,7 @@ limitations under the License.
#include "tensorflow/c/c_test_util.h"
-#include "tensorflow/compiler/jit/legacy_flags/mark_for_compilation_pass_flags.h"
+#include "tensorflow/c/c_api_experimental.h"
#include "tensorflow/core/framework/function.pb.h"
#include "tensorflow/core/framework/op_def.pb.h"
#include "tensorflow/core/framework/tensor.pb.h"
@@ -404,19 +404,7 @@ std::vector<string> GetFuncNames(const tensorflow::GraphDef& graph_def) {
CSession::CSession(TF_Graph* graph, TF_Status* s, bool use_XLA) {
TF_SessionOptions* opts = TF_NewSessionOptions();
- tensorflow::legacy_flags::MarkForCompilationPassFlags* flags =
- tensorflow::legacy_flags::GetMarkForCompilationPassFlags();
- flags->tf_xla_cpu_global_jit = use_XLA;
- if (use_XLA) {
- tensorflow::ConfigProto config;
- config.mutable_graph_options()
- ->mutable_optimizer_options()
- ->set_global_jit_level(tensorflow::OptimizerOptions::ON_1);
- std::string contents;
- contents.resize(config.ByteSizeLong());
- config.SerializeToArray(&contents[0], contents.size());
- TF_SetConfig(opts, contents.data(), contents.size(), s);
- }
+ TF_EnableXLACompilation(opts, use_XLA);
session_ = TF_NewSession(graph, opts, s);
TF_DeleteSessionOptions(opts);
}