Browse Source

Fix ut.

tags/v1.5.1
zhaozhixuan 3 years ago
parent
commit
f2022b92cc
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      tests/ut/ge/single_op/single_op_task_unittest.cc

+ 7
- 2
tests/ut/ge/single_op/single_op_task_unittest.cc View File

@@ -158,16 +158,21 @@ TEST_F(UtestSingleOpTask, test_atomic_exec) {
auto graph = make_shared<ComputeGraph>("graph"); auto graph = make_shared<ComputeGraph>("graph");
auto op_desc = make_shared<OpDesc>("Add", "Add"); auto op_desc = make_shared<OpDesc>("Add", "Add");
auto node = graph->AddNode(op_desc); auto node = graph->AddNode(op_desc);

AtomicOpTask task; AtomicOpTask task;
task.op_desc_ = op_desc; task.op_desc_ = op_desc;
task.node_ = node; task.node_ = node;


vector<DataBuffer> inputs; vector<DataBuffer> inputs;
vector<DataBuffer> outputs; vector<DataBuffer> outputs;
task.atomic_output_indices_ = { 0 };
std::vector<int64_t> atomic_output_indices;
ge::AttrUtils::SetListInt(op_desc, ATOMIC_ATTR_OUTPUT_INDEX, atomic_output_indices);
ASSERT_EQ(task.InitAtomicAddrCleanIndices(), INTERNAL_ERROR);
atomic_output_indices = { 0 };
ge::AttrUtils::SetListInt(op_desc, ATOMIC_ATTR_OUTPUT_INDEX, atomic_output_indices);
ASSERT_EQ(task.InitAtomicAddrCleanIndices(), INTERNAL_ERROR);
task.arg_size_ = sizeof(void *) * 2; task.arg_size_ = sizeof(void *) * 2;
task.args_.reset(new (std::nothrow) uint8_t[task.arg_size_]); task.args_.reset(new (std::nothrow) uint8_t[task.arg_size_]);
ASSERT_EQ(task.InitAtomicAddrCleanIndices(), SUCCESS);
ASSERT_EQ(task.UpdateIoAddr(inputs, outputs), ACL_ERROR_GE_PARAM_INVALID); ASSERT_EQ(task.UpdateIoAddr(inputs, outputs), ACL_ERROR_GE_PARAM_INVALID);


ge::DataBuffer data_buffer; ge::DataBuffer data_buffer;


Loading…
Cancel
Save