|
@@ -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; |
|
|