| 409 | } |
| 410 | |
| 411 | Node* RecvAtHost(ops::NodeOut key_input, const string& cluster, |
| 412 | const string& new_func_name, const string& oc_cluster, |
| 413 | absl::Span<const DataType> dtypes, |
| 414 | const GraphDefBuilder::Options& opts) { |
| 415 | if (opts.HaveError()) return nullptr; |
| 416 | string key = absl::StrCat("host_compute_channel_", cluster, "_", |
| 417 | new_func_name, "_", oc_cluster); |
| 418 | string name = absl::StrCat("outside_compilation_", cluster, "_", |
| 419 | new_func_name, "_", oc_cluster, "_recv"); |
| 420 | NodeBuilder node_builder(opts.WithName(name).GetNameForOp("_XlaRecvAtHost"), |
| 421 | "_XlaRecvAtHost", opts.op_registry()); |
| 422 | node_builder.Input(std::move(key_input)); |
| 423 | return opts.WithAttr("Toutputs", dtypes) |
| 424 | .WithAttr("key", key) |
| 425 | .WithAttr("device_ordinal", 0) |
| 426 | .WithAttr("_encapsulate", cluster) |
| 427 | .WithAttr("_outside", oc_cluster) |
| 428 | .FinalizeBuilder(&node_builder); |
| 429 | } |
| 430 | |
| 431 | Node* SendFromHost(ops::NodeOut key_input, const string& cluster, |
| 432 | const string& new_func_name, const string& oc_cluster, |
no test coverage detected