|
|
@@ -248,17 +248,24 @@ TEST_F(UtestSingleOpTask, test_aicpu_task_launch_kernel) { |
|
|
|
uint32_t* addrs[total_addr] = {nullptr, nullptr, nullptr}; |
|
|
|
task.io_addr_ = reinterpret_cast<uintptr_t*>(addrs); |
|
|
|
task.io_addr_num_ = total_addr; |
|
|
|
|
|
|
|
{ |
|
|
|
vector<DataBuffer> inputs(2, DataBuffer()); |
|
|
|
vector<DataBuffer> outputs(1, DataBuffer()); |
|
|
|
vector<GeTensorDesc> inputs_desc(2, GeTensorDesc(GeShape(), FORMAT_NCHW, DT_FLOAT)); |
|
|
|
vector<GeTensorDesc> outputs_desc(1, GeTensorDesc(GeShape(), FORMAT_NCHW, DT_FLOAT)); |
|
|
|
task.unknown_type_ = ge::DEPEND_COMPUTE; |
|
|
|
task.num_outputs_ = 1; |
|
|
|
ASSERT_EQ(task.InitForSummaryAndCopy(), SUCCESS); |
|
|
|
ASSERT_EQ(task.LaunchKernel(inputs_desc, inputs, outputs_desc, outputs, stream), SUCCESS); |
|
|
|
} |
|
|
|
ge::hybrid::AicpuExtInfo aicpu_ext_info; |
|
|
|
aicpu_ext_info.infoType = aicpu::FWKAdapter::FWK_ADPT_EXT_SHAPE_TYPE; |
|
|
|
aicpu_ext_info.infoLen = sizeof(int32_t); |
|
|
|
int32_t type = ge::DEPEND_COMPUTE; |
|
|
|
memcpy_s(aicpu_ext_info.infoMsg, sizeof(int32_t), &type, sizeof(int32_t)); |
|
|
|
char *ext_mem = (char*)malloc(sizeof(ge::hybrid::AicpuExtInfo) + sizeof(int32_t)); |
|
|
|
memcpy_s(ext_mem, sizeof(ge::hybrid::AicpuExtInfo) + sizeof(int32_t), &aicpu_ext_info, |
|
|
|
sizeof(ge::hybrid::AicpuExtInfo) + sizeof(int32_t)); |
|
|
|
std::string ext_info_str(ext_mem, sizeof(ge::hybrid::AicpuExtInfo) + sizeof(int32_t)); |
|
|
|
vector<DataBuffer> inputs(2, DataBuffer()); |
|
|
|
vector<DataBuffer> outputs(1, DataBuffer()); |
|
|
|
vector<GeTensorDesc> inputs_desc(2, GeTensorDesc(GeShape(), FORMAT_NCHW, DT_FLOAT)); |
|
|
|
vector<GeTensorDesc> outputs_desc(1, GeTensorDesc(GeShape(), FORMAT_NCHW, DT_FLOAT)); |
|
|
|
ASSERT_EQ(task.SetExtInfoAndType(ext_info_str, 0), SUCCESS); |
|
|
|
task.unknown_type_ = ge::DEPEND_COMPUTE; |
|
|
|
task.num_outputs_ = 1; |
|
|
|
ASSERT_EQ(task.InitForSummaryAndCopy(), SUCCESS); |
|
|
|
ASSERT_EQ(task.LaunchKernel(inputs_desc, inputs, outputs_desc, outputs, stream), SUCCESS); |
|
|
|
} |
|
|
|
TEST_F(UtestSingleOpTask, test_dynamic_support) { |
|
|
|
auto graph = make_shared<ComputeGraph>("graph"); |
|
|
|