项目文件夹

文件
Hongzhi (Steve), Chen 33a2d9e1b6 [Misc] clang-format auto fix. (#4812)
* [Misc] clang-format auto fix.

* manual

Co-authored-by: Steve <ubuntu@ip-172-31-34-29.ap-northeast-1.compute.internal>
2022-11-04 14:24:20 +08:00

30 行
838 B
C++

#ifndef DIST_TEST_RPC_BASE_H_
#define DIST_TEST_RPC_BASE_H_
#include <iostream>
#include <string>
#include "../../../src/rpc/rpc_msg.h"
#include "../../../src/rpc/tensorpipe/tp_communicator.h"
#include "../../cpp/common.h"
namespace {
const int kNumSender = 30;
const int kNumReceiver = 10;
const int kNumMessage = 1024;
const int kPort = 50090;
const int kSizeTensor = 10 * 1024;
const int kNumTensor = 30;
std::shared_ptr<tensorpipe::Context> InitTPContext() {
auto context = std::make_shared<tensorpipe::Context>();
auto transportContext = tensorpipe::transport::uv::create();
context->registerTransport(0 /* priority */, "tcp", transportContext);
auto basicChannel = tensorpipe::channel::basic::create();
context->registerChannel(0 /* low priority */, "basic", basicChannel);
return context;
}
} // namespace
#endif