| 282 | } |
| 283 | |
| 284 | OptimizerOptions::GlobalJitLevel GetGlobalJitLevelForGraph( |
| 285 | const GraphOptimizationPassOptions& options) { |
| 286 | OptimizerOptions::GlobalJitLevel jit_level_in_session_opts = |
| 287 | options.session_options->config.graph_options() |
| 288 | .optimizer_options() |
| 289 | .global_jit_level(); |
| 290 | XlaGlobalJitLevel xla_global_jit_level = |
| 291 | GetXlaGlobalJitLevel(jit_level_in_session_opts); |
| 292 | if (xla_global_jit_level.single_gpu == xla_global_jit_level.general) { |
| 293 | VLOG(4) << "GetGlobalJitLevelForGraph returning " |
| 294 | << xla_global_jit_level.single_gpu; |
| 295 | return xla_global_jit_level.single_gpu; |
| 296 | } |
| 297 | OptimizerOptions::GlobalJitLevel result = |
| 298 | IsSingleGpuGraph(**options.graph) ? xla_global_jit_level.single_gpu |
| 299 | : xla_global_jit_level.general; |
| 300 | VLOG(4) << "GetGlobalJitLevelForGraph returning " << result; |
| 301 | return result; |
| 302 | } |
| 303 | |
| 304 | bool MayCallFunction(const Node& n, const FunctionLibraryDefinition* flib_def) { |
| 305 | if (flib_def->Contains(n.type_string())) { |
no test coverage detected