|
|
@ -32,6 +32,8 @@
|
|
|
|
#include "super_kernel/super_kernel.h"
|
|
|
|
#include "super_kernel/super_kernel.h"
|
|
|
|
#include "super_kernel/super_kernel_factory.h"
|
|
|
|
#include "super_kernel/super_kernel_factory.h"
|
|
|
|
#include "cce/aicpu_engine_struct.h"
|
|
|
|
#include "cce/aicpu_engine_struct.h"
|
|
|
|
|
|
|
|
#include "hybrid/node_executor/aicpu/aicpu_ext_info.h"
|
|
|
|
|
|
|
|
#include "framework/common/debug/log.h"
|
|
|
|
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
namespace {
|
|
|
|
const uint8_t kL2LoadToDdr = 1;
|
|
|
|
const uint8_t kL2LoadToDdr = 1;
|
|
|
@ -965,20 +967,20 @@ Status KernelTaskInfo::InitAicpuTaskExtInfo(const std::string &ext_info) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t unknown_shape_type_val = 0;
|
|
|
|
int32_t unknown_shape_type_val = 0;
|
|
|
|
(void) AttrUtils::GetInt(op_desc, ::ge::ATTR_NAME_UNKNOWN_SHAPE_TYPE, unknown_shape_type_val);
|
|
|
|
(void) AttrUtils::GetInt(op_desc_, ::ge::ATTR_NAME_UNKNOWN_SHAPE_TYPE, unknown_shape_type_val);
|
|
|
|
UnknowShapeOpType unknown_type = static_cast<UnknowShapeOpType>(unknown_shape_type_val);
|
|
|
|
UnknowShapeOpType unknown_type = static_cast<UnknowShapeOpType>(unknown_shape_type_val);
|
|
|
|
uint32_t num_inputs = op_desc->GetInputsSize();
|
|
|
|
uint32_t num_inputs = op_desc_->GetInputsSize();
|
|
|
|
uint32_t num_outputs = op_desc->GetOutputsSize();
|
|
|
|
uint32_t num_outputs = op_desc_->GetOutputsSize();
|
|
|
|
std::unique_ptr<ge::hybrid::AicpuExtInfoHandler> ext_handle(
|
|
|
|
std::unique_ptr<ge::hybrid::AicpuExtInfoHandler> ext_handle(
|
|
|
|
new(std::nothrow) ::ge::hybrid::AicpuExtInfoHandler(op_desc->GetName(),
|
|
|
|
new(std::nothrow) ::ge::hybrid::AicpuExtInfoHandler(op_desc_->GetName(),
|
|
|
|
num_inputs,
|
|
|
|
num_inputs,
|
|
|
|
num_outputs,
|
|
|
|
num_outputs,
|
|
|
|
unknown_type));
|
|
|
|
unknown_type));
|
|
|
|
GE_CHK_BOOL_RET_STATUS(ext_handle != nullptr, FAILED, "Malloc aicpu_ext_handle mem failed!");
|
|
|
|
GE_CHK_BOOL_RET_STATUS(ext_handle != nullptr, FAILED, "Malloc aicpu_ext_handle mem failed!");
|
|
|
|
GE_CHK_STATUS_RET(ext_handle->Parse(ext_info)
|
|
|
|
GE_CHK_STATUS_RET(ext_handle->Parse(ext_info),
|
|
|
|
"Parse kernel ext info failed, kernel_ext_info_size=%zu.", ext_info.size());
|
|
|
|
"Parse kernel ext info failed, kernel_ext_info_size=%zu.", ext_info.size());
|
|
|
|
GE_CHK_STATUS_RET(aicpu_ext_handle_->UpdateSessionInfo(davinci_model_->GetSessionId()),
|
|
|
|
GE_CHK_STATUS_RET(ext_handle_->UpdateSessionInfo(davinci_model_->GetSessionId()),
|
|
|
|
"Update session info session id sfailed.");
|
|
|
|
"Update session info session id failed.");
|
|
|
|
GELOGD("Update aicpu_task ext_info session_info session_id is %lu", davinci_model_->GetSessionId());
|
|
|
|
GELOGD("Update aicpu_task ext_info session_info session_id is %lu", davinci_model_->GetSessionId());
|
|
|
|
GE_CHK_STATUS_RET(ext_handle->UpdateExecuteMode(true), "UpdateExecuteMode failed.");
|
|
|
|
GE_CHK_STATUS_RET(ext_handle->UpdateExecuteMode(true), "UpdateExecuteMode failed.");
|
|
|
|
GELOGD("Update aicpu_task ext_info bit_map execute mode to 1.");
|
|
|
|
GELOGD("Update aicpu_task ext_info bit_map execute mode to 1.");
|
|
|
@ -988,7 +990,7 @@ Status KernelTaskInfo::InitAicpuTaskExtInfo(const std::string &ext_info) {
|
|
|
|
GELOGE(RT_FAILED, "rtMalloc ext_info error: 0x%X, size=%zu", rt_ret, ext_info.size());
|
|
|
|
GELOGE(RT_FAILED, "rtMalloc ext_info error: 0x%X, size=%zu", rt_ret, ext_info.size());
|
|
|
|
return RT_ERROR_TO_GE_STATUS(rt_ret);
|
|
|
|
return RT_ERROR_TO_GE_STATUS(rt_ret);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
rt_ret = rtMemcpy(aicpu_ext_info_addr_, ext_handle->GetExtInfoLen(), ext_handle_->GetExtInfo(),
|
|
|
|
rt_ret = rtMemcpy(aicpu_ext_info_addr_, ext_handle->GetExtInfoLen(), ext_handle->GetExtInfo(),
|
|
|
|
ext_handle->GetExtInfoLen(), RT_MEMCPY_HOST_TO_DEVICE);
|
|
|
|
ext_handle->GetExtInfoLen(), RT_MEMCPY_HOST_TO_DEVICE);
|
|
|
|
if (rt_ret != RT_ERROR_NONE) {
|
|
|
|
if (rt_ret != RT_ERROR_NONE) {
|
|
|
|
GELOGE(RT_FAILED, "rtMemcpy ext_info error: 0x%X, size=%zu", rt_ret, ext_info.size());
|
|
|
|
GELOGE(RT_FAILED, "rtMemcpy ext_info error: 0x%X, size=%zu", rt_ret, ext_info.size());
|
|
|
|