|
|
@@ -201,7 +201,7 @@ TEST_F(UtestAicpuNodeExecutor, aicpu_memcopy_task) { |
|
|
|
ASSERT_EQ(aicpu_node_task.SetMemCopyTask(task_def), SUCCESS);
|
|
|
|
node_item->num_outputs = 1;
|
|
|
|
AicpuNodeTask aicpu_node_task2(node_item, task_def);
|
|
|
|
ASSERT_EQ(aicpu_node_task2.SetMemCopyTask(task_def), FAILED);
|
|
|
|
ASSERT_EQ(aicpu_node_task2.SetMemCopyTask(task_def), INTERNAL_ERROR);
|
|
|
|
kernel_def->set_args_size(0);
|
|
|
|
ASSERT_EQ(aicpu_node_task2.SetMemCopyTask(task_def), FAILED);
|
|
|
|
char* args2 = "123";
|
|
|
@@ -265,13 +265,22 @@ TEST_F(UtestAicpuNodeExecutor, aicpu_copy_data_to_hbm) { |
|
|
|
domi::KernelDef *kernel_def = task_def.mutable_kernel();
|
|
|
|
kernel_def->set_args(reinterpret_cast<const char *>(&args), args.head.length);
|
|
|
|
kernel_def->set_args_size(args.head.length);
|
|
|
|
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 = node_item->shape_inference_type;
|
|
|
|
memcpy_s(aicpu_ext_info.infoMsg, sizeof(int32_t), &type, sizeof(int32_t));
|
|
|
|
char *ext_mem = (char*)malloc(sizeof(AicpuExtInfo) + sizeof(int32_t));
|
|
|
|
memcpy_s(ext_mem, sizeof(AicpuExtInfo) + sizeof(int32_t), &aicpu_ext_info, sizeof(AicpuExtInfo) + sizeof(int32_t));
|
|
|
|
kernel_def->set_kernel_ext_info(ext_mem, sizeof(AicpuExtInfo) + sizeof(int32_t));
|
|
|
|
kernel_def->set_kernel_ext_info_size(sizeof(AicpuExtInfo) + sizeof(int32_t));
|
|
|
|
hybrid_model.task_defs_[node] = std::vector<domi::TaskDef>({task_def, task_def});
|
|
|
|
|
|
|
|
AicpuNodeTask aicpu_node_task(node_item, task_def);
|
|
|
|
std::vector<std::unique_ptr<TensorBuffer>> out_shape_hbm;
|
|
|
|
ASSERT_EQ(aicpu_node_task.Init(hybrid_model), SUCCESS);
|
|
|
|
for (int i = 0; i < node_item->num_outputs; i++) {
|
|
|
|
auto &summary = output_summary_host_[i];
|
|
|
|
auto &summary = aicpu_node_task.output_summary_host_[i];
|
|
|
|
summary.shape_data_ptr = 0;
|
|
|
|
summary.shape_data_size = 1;
|
|
|
|
summary.raw_data_ptr = 0;
|
|
|
@@ -279,7 +288,7 @@ TEST_F(UtestAicpuNodeExecutor, aicpu_copy_data_to_hbm) { |
|
|
|
}
|
|
|
|
for (int i = 0; i < node_item->num_outputs; i++) {
|
|
|
|
std::unique_ptr<TensorBuffer> shape_buffer;
|
|
|
|
AllocTensorBuffer(1, shape_buffer);
|
|
|
|
AicpuNodeTask::AllocTensorBuffer(1, shape_buffer);
|
|
|
|
out_shape_hbm.emplace_back(std::move(shape_buffer));
|
|
|
|
}
|
|
|
|
ASSERT_EQ(aicpu_node_task.CopyDataToHbm(*node_state->GetTaskContext(), out_shape_hbm), SUCCESS);
|
|
|
|