|
|
@ -2924,6 +2924,14 @@ Status DavinciModel::InitTaskInfo(domi::ModelTaskDef &model_task_def) {
|
|
|
|
return SUCCESS;
|
|
|
|
return SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Status DavinciModel::CheckCapability(rtFeatureType_t featureType, int32_t featureInfo, bool &is_support) const {
|
|
|
|
|
|
|
|
int64_t value = RT_CAPABILITY_SUPPORT;
|
|
|
|
|
|
|
|
auto rt_ret = rtGetRtCapability(featureType, featureInfo, &value);
|
|
|
|
|
|
|
|
GE_CHK_BOOL_RET_STATUS(rt_ret == RT_ERROR_NONE, FAILED, "call rtGetRtCapability failed!");
|
|
|
|
|
|
|
|
is_support = (value == RT_CAPABILITY_SUPPORT) ? true : false;
|
|
|
|
|
|
|
|
return SUCCESS;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Status DavinciModel::MallocKnownArgs() {
|
|
|
|
Status DavinciModel::MallocKnownArgs() {
|
|
|
|
GELOGI("DavinciModel::MallocKnownArgs in");
|
|
|
|
GELOGI("DavinciModel::MallocKnownArgs in");
|
|
|
|
const auto &model_task_def = ge_model_->GetModelTaskDefPtr();
|
|
|
|
const auto &model_task_def = ge_model_->GetModelTaskDefPtr();
|
|
|
@ -2944,8 +2952,12 @@ Status DavinciModel::MallocKnownArgs() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
rtError_t rt_ret;
|
|
|
|
rtError_t rt_ret;
|
|
|
|
// malloc args memory
|
|
|
|
// malloc args memory
|
|
|
|
|
|
|
|
bool is_support = false;
|
|
|
|
|
|
|
|
GE_CHK_STATUS_RET_NOLOG(CheckCapability(FEATURE_TYPE_MEMORY, MEMORY_INFO_TS_4G_LIMITED, is_support));
|
|
|
|
|
|
|
|
auto mem_type = is_support ? RT_MEMORY_TS_4G : RT_MEMORY_HBM;
|
|
|
|
|
|
|
|
|
|
|
|
if (total_args_size_ != 0) {
|
|
|
|
if (total_args_size_ != 0) {
|
|
|
|
rt_ret = rtMalloc(&args_, total_args_size_, RT_MEMORY_HBM);
|
|
|
|
rt_ret = rtMalloc(&args_, total_args_size_, mem_type);
|
|
|
|
if (rt_ret != RT_ERROR_NONE) {
|
|
|
|
if (rt_ret != RT_ERROR_NONE) {
|
|
|
|
GELOGE(RT_FAILED, "Call rtMalloc failed, ret: 0x%X", rt_ret);
|
|
|
|
GELOGE(RT_FAILED, "Call rtMalloc failed, ret: 0x%X", rt_ret);
|
|
|
|
return RT_ERROR_TO_GE_STATUS(rt_ret);
|
|
|
|
return RT_ERROR_TO_GE_STATUS(rt_ret);
|
|
|
@ -2953,7 +2965,7 @@ Status DavinciModel::MallocKnownArgs() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// malloc dynamic and static hybrid memory
|
|
|
|
// malloc dynamic and static hybrid memory
|
|
|
|
if (total_hybrid_args_size_ != 0) {
|
|
|
|
if (total_hybrid_args_size_ != 0) {
|
|
|
|
rt_ret = rtMalloc(&hybrid_addrs_, total_hybrid_args_size_, RT_MEMORY_HBM);
|
|
|
|
rt_ret = rtMalloc(&hybrid_addrs_, total_hybrid_args_size_, mem_type);
|
|
|
|
if (rt_ret != RT_ERROR_NONE) {
|
|
|
|
if (rt_ret != RT_ERROR_NONE) {
|
|
|
|
GELOGE(RT_FAILED, "Call rtMalloc failed, ret: 0x%X", rt_ret);
|
|
|
|
GELOGE(RT_FAILED, "Call rtMalloc failed, ret: 0x%X", rt_ret);
|
|
|
|
return RT_ERROR_TO_GE_STATUS(rt_ret);
|
|
|
|
return RT_ERROR_TO_GE_STATUS(rt_ret);
|
|
|
@ -2962,7 +2974,7 @@ Status DavinciModel::MallocKnownArgs() {
|
|
|
|
// malloc fixed addr memory, eg: rts op
|
|
|
|
// malloc fixed addr memory, eg: rts op
|
|
|
|
if (total_fixed_addr_size_ != 0) {
|
|
|
|
if (total_fixed_addr_size_ != 0) {
|
|
|
|
GELOGI("Begin to allocate fixed addr.");
|
|
|
|
GELOGI("Begin to allocate fixed addr.");
|
|
|
|
rt_ret = rtMalloc(&fixed_addrs_, total_fixed_addr_size_, RT_MEMORY_HBM);
|
|
|
|
rt_ret = rtMalloc(&fixed_addrs_, total_fixed_addr_size_, mem_type);
|
|
|
|
if (rt_ret != RT_ERROR_NONE) {
|
|
|
|
if (rt_ret != RT_ERROR_NONE) {
|
|
|
|
GELOGE(RT_FAILED, "Call rtMalloc failed, ret: 0x%X", rt_ret);
|
|
|
|
GELOGE(RT_FAILED, "Call rtMalloc failed, ret: 0x%X", rt_ret);
|
|
|
|
return RT_ERROR_TO_GE_STATUS(rt_ret);
|
|
|
|
return RT_ERROR_TO_GE_STATUS(rt_ret);
|
|
|
|