Browse Source

meaningless shit

pull/648/head
yanghaoran 5 years ago
parent
commit
4d43906848
3 changed files with 15 additions and 15 deletions
  1. +1
    -1
      tests/depends/runtime/src/runtime_stub.cc
  2. +7
    -7
      tests/ut/ge/graph/build/logical_stream_allocator_unittest.cc
  3. +7
    -7
      tests/ut/ge/graph/load/new_op_test_utils.h

+ 1
- 1
tests/depends/runtime/src/runtime_stub.cc View File

@@ -325,7 +325,7 @@ rtError_t rtSetTaskFailCallback(rtTaskFailCallback callback)
}

rtError_t rtMallocHostSharedMemory(rtMallocHostSharedMemoryIn *in,
rtMallocHostSharedMemoryOut *out)
rtMallocHostSharedMemoryOut *out)
{
out->ptr = new uint8_t[in->size];
out->devPtr = new uint8_t[in->size];


+ 7
- 7
tests/ut/ge/graph/build/logical_stream_allocator_unittest.cc View File

@@ -194,7 +194,7 @@ class UtestLogicalStreamAllocator : public testing::Test {
SchedulerConf scheduler_conf;
if (confs.empty()) {
for (const auto &subgraph_pair : subgraph_map) {
for (const auto &sub_graph : subgraph_pair.second) {
for (const auto &sub_graph : subgraph_pair.second) {
EngineConfPtr conf = make_shared<EngineConf>();
conf->id = sub_graph->GetEngineName();
if (conf->id == "ge_local") {
@@ -202,7 +202,7 @@ class UtestLogicalStreamAllocator : public testing::Test {
conf->attach = true;
}
scheduler_conf.cal_engines[conf->id] = conf;
}
}
}
} else {
for (auto &conf : confs) {
@@ -223,17 +223,17 @@ class UtestLogicalStreamAllocator : public testing::Test {
}

Status AssignLogicalStreams(vector<SubGraphInfoPtr> subgraphs,
vector<EngineConfPtr> &confs,
std::map<std::string, int> &max_parallel_num,
ComputeGraphPtr &whole_graph) {
vector<EngineConfPtr> &confs,
std::map<std::string, int> &max_parallel_num,
ComputeGraphPtr &whole_graph) {
Graph2SubGraphInfoList subgraph_map;
subgraph_map[whole_graph] = subgraphs;
return AssignLogicalStreams(subgraph_map, confs, max_parallel_num, whole_graph);
}

Status AssignLogicalStreams(vector<SubGraphInfoPtr> subgraphs,
vector<EngineConfPtr>& confs,
std::map<std::string, int> &max_parallel_num) {
vector<EngineConfPtr>& confs,
std::map<std::string, int> &max_parallel_num) {
ComputeGraphPtr whole_graph = make_shared<ComputeGraph>("whole_graph");
return AssignLogicalStreams(subgraphs, confs, max_parallel_num, whole_graph);
}


+ 7
- 7
tests/ut/ge/graph/load/new_op_test_utils.h View File

@@ -154,13 +154,13 @@ class OmeTestOpUtils {
if (model->HasAttr(MODEL_ATTR_TASKS)) {
ge::Buffer task_buffer;
GE_CHK_BOOL_RET_STATUS(ge::AttrUtils::GetZeroCopyBytes(model, MODEL_ATTR_TASKS, task_buffer), FAILED,
"Get bytes failed.");
"Get bytes failed.");
std::shared_ptr<ModelTaskDef> task = ge::MakeShared<ModelTaskDef>();
GE_CHECK_NOTNULL(task);
GE_IF_BOOL_EXEC(task_buffer.GetData() == nullptr, GELOGE(FAILED, "Get data fail"); return FAILED);
GE_IF_BOOL_EXEC(task_buffer.GetSize() == 0, GELOGE(FAILED, "Get size fail"); return FAILED);
GE_CHK_BOOL_EXEC(ReadProtoFromArray(task_buffer.GetData(), static_cast<int>(task_buffer.GetSize()), task.get()),
return INTERNAL_ERROR, "ReadProtoFromArray failed.");
return INTERNAL_ERROR, "ReadProtoFromArray failed.");
ge_model->SetModelTaskDef(task);
}

@@ -168,11 +168,11 @@ class OmeTestOpUtils {
if (compute_graph != nullptr && compute_graph->GetDirectNodesSize() != 0) {
for (const ge::NodePtr &n : compute_graph->GetDirectNode()) {
auto node_op_desc = n->GetOpDesc();
GE_IF_BOOL_EXEC(node_op_desc == nullptr, continue);
TBEKernelPtr tbe_kernel = node_op_desc->TryGetExtAttr(ge::OP_EXTATTR_NAME_TBE_KERNEL, TBEKernelPtr());
GE_IF_BOOL_EXEC(tbe_kernel == nullptr, continue);
kernel_store.AddTBEKernel(tbe_kernel);
GELOGI("Add tbe kernel bin %s", tbe_kernel->GetName().c_str());
GE_IF_BOOL_EXEC(node_op_desc == nullptr, continue);
TBEKernelPtr tbe_kernel = node_op_desc->TryGetExtAttr(ge::OP_EXTATTR_NAME_TBE_KERNEL, TBEKernelPtr());
GE_IF_BOOL_EXEC(tbe_kernel == nullptr, continue);
kernel_store.AddTBEKernel(tbe_kernel);
GELOGI("Add tbe kernel bin %s", tbe_kernel->GetName().c_str());
}
}
if (!kernel_store.Build()) {


Loading…
Cancel
Save