| @@ -569,6 +569,7 @@ Status ModelManager::DataInputTensor(uint32_t model_id, const std::vector<ge::Te | |||||
| uint32_t length = static_cast<uint32_t>(cur_dynamic_dims.size() * sizeof(int32_t)); | uint32_t length = static_cast<uint32_t>(cur_dynamic_dims.size() * sizeof(int32_t)); | ||||
| GE_CHK_BOOL_EXEC(memcpy_s(data.data, length, cur_dynamic_dims.data(), length) == EOK, | GE_CHK_BOOL_EXEC(memcpy_s(data.data, length, cur_dynamic_dims.data(), length) == EOK, | ||||
| REPORT_CALL_ERROR("E19999", "memcpy data failed, size:%u", length); | REPORT_CALL_ERROR("E19999", "memcpy data failed, size:%u", length); | ||||
| delete[] reinterpret_cast<int32_t *>(data.data); | |||||
| return INTERNAL_ERROR, "[Memcpy][Data] failed, size:%u.", length); | return INTERNAL_ERROR, "[Memcpy][Data] failed, size:%u.", length); | ||||
| data.length = length; | data.length = length; | ||||
| input_data.blobs.push_back(data); | input_data.blobs.push_back(data); | ||||
| @@ -1790,7 +1791,8 @@ Status ModelManager::LaunchKernelCheckAicpuOp(std::vector<std::string> &aicpu_op | |||||
| std::vector<char> op_name; | std::vector<char> op_name; | ||||
| op_name.clear(); | op_name.clear(); | ||||
| op_name.resize(kOpNameMaxSize); | op_name.resize(kOpNameMaxSize); | ||||
| GE_CHK_RT(rtMemcpy(op_name.data(), aicpu_info.opLen, reinterpret_cast<void *>(aicpu_info.opType), | |||||
| GE_CHK_RT(rtMemcpy(op_name.data(), aicpu_info.opLen, | |||||
| reinterpret_cast<void *>(static_cast<uintptr_t>(aicpu_info.opType)), | |||||
| aicpu_info.opLen, RT_MEMCPY_DEVICE_TO_HOST)); | aicpu_info.opLen, RT_MEMCPY_DEVICE_TO_HOST)); | ||||
| std::string kernel_type = | std::string kernel_type = | ||||
| (static_cast<OpKernelType>(aicpu_info.kernelsType) == TF_KERNEL) ? "TF_KERNEL" : "CPU_KERNEL"; | (static_cast<OpKernelType>(aicpu_info.kernelsType) == TF_KERNEL) ? "TF_KERNEL" : "CPU_KERNEL"; | ||||
| @@ -329,7 +329,7 @@ void HcclTaskInfo::GetPrivateDefByTaskDef(const domi::TaskDef &task) { | |||||
| // Get privateDef and opsKernelStorePtr from taskDef and save them in taskInfo | // Get privateDef and opsKernelStorePtr from taskDef and save them in taskInfo | ||||
| GELOGI("get custom info in modelTaskDef."); | GELOGI("get custom info in modelTaskDef."); | ||||
| ops_kernel_store_ = nullptr; | ops_kernel_store_ = nullptr; | ||||
| void *ops_kernel_store_name_temp = reinterpret_cast<void *>(task.ops_kernel_store_ptr()); | |||||
| void *ops_kernel_store_name_temp = reinterpret_cast<void *>(static_cast<uintptr_t>(task.ops_kernel_store_ptr())); | |||||
| if (ops_kernel_store_name_temp != nullptr) { | if (ops_kernel_store_name_temp != nullptr) { | ||||
| ops_kernel_store_ = std::move(ops_kernel_store_name_temp); | ops_kernel_store_ = std::move(ops_kernel_store_name_temp); | ||||
| std::string private_def_temp = task.private_def(); | std::string private_def_temp = task.private_def(); | ||||
| @@ -420,7 +420,7 @@ Status KernelExTaskInfo::Distribute() { | |||||
| // xxxxxxxx xxxxxxxx xxxxxxxx xx10xxxx: HOST_ONLY | // xxxxxxxx xxxxxxxx xxxxxxxx xx10xxxx: HOST_ONLY | ||||
| // xxxxxxxx xxxxxxxx xxxxxxxx xx11xxxx: HOST_FIRST | // xxxxxxxx xxxxxxxx xxxxxxxx xx11xxxx: HOST_FIRST | ||||
| if (topic_type_flag_ > 0) { | if (topic_type_flag_ > 0) { | ||||
| dump_flag_ = dump_flag_ | topic_type_flag_; | |||||
| dump_flag_ = dump_flag_ | static_cast<uint32_t>(topic_type_flag_); | |||||
| } | } | ||||
| rtError_t rt_ret = rtKernelLaunchEx(kernel_buf_, kernel_buf_size_, dump_flag_, stream_); | rtError_t rt_ret = rtKernelLaunchEx(kernel_buf_, kernel_buf_size_, dump_flag_, stream_); | ||||
| if (rt_ret != RT_ERROR_NONE) { | if (rt_ret != RT_ERROR_NONE) { | ||||
| @@ -436,7 +436,7 @@ Status KernelTaskInfo::Distribute() { | |||||
| // xxxxxxxx xxxxxxxx xxxxxxxx xx01xxxx: DEVICE_FIRST | // xxxxxxxx xxxxxxxx xxxxxxxx xx01xxxx: DEVICE_FIRST | ||||
| // xxxxxxxx xxxxxxxx xxxxxxxx xx10xxxx: HOST_ONLY | // xxxxxxxx xxxxxxxx xxxxxxxx xx10xxxx: HOST_ONLY | ||||
| // xxxxxxxx xxxxxxxx xxxxxxxx xx11xxxx: HOST_FIRST | // xxxxxxxx xxxxxxxx xxxxxxxx xx11xxxx: HOST_FIRST | ||||
| dump_flag_ = dump_flag_ | topic_type_flag_; | |||||
| dump_flag_ = dump_flag_ | static_cast<uint32_t>(topic_type_flag_); | |||||
| } | } | ||||
| GELOGI("distribute task info kernel_type %d, flag %d", kernel_type_, dump_flag_); | GELOGI("distribute task info kernel_type %d, flag %d", kernel_type_, dump_flag_); | ||||
| // blockDim is reserved parameter, set to 1 | // blockDim is reserved parameter, set to 1 | ||||
| @@ -62,7 +62,8 @@ Status ZeroCopyOffset::InitInputDataInfo(int64_t output_size, void *virtual_addr | |||||
| for (size_t index = 0; index < zero_copy_basic_offset_.size(); ++index) { | for (size_t index = 0; index < zero_copy_basic_offset_.size(); ++index) { | ||||
| if (zero_copy_basic_offset_.at(index) == virtual_addr_offset) { | if (zero_copy_basic_offset_.at(index) == virtual_addr_offset) { | ||||
| out_count++; | out_count++; | ||||
| uint64_t out_offset = reinterpret_cast<uint64_t>(virtual_addr) + zero_copy_relative_offset_.at(index); | |||||
| uint64_t out_offset = static_cast<uint64_t>(reinterpret_cast<uintptr_t>(virtual_addr)) + | |||||
| zero_copy_relative_offset_.at(index); | |||||
| data_info_.emplace_back(output_size, reinterpret_cast<void *>(static_cast<uintptr_t>(out_offset))); | data_info_.emplace_back(output_size, reinterpret_cast<void *>(static_cast<uintptr_t>(out_offset))); | ||||
| relative_offset_.emplace_back(zero_copy_relative_offset_.at(index)); | relative_offset_.emplace_back(zero_copy_relative_offset_.at(index)); | ||||
| GELOGI("[ZCPY] virtual_addr: %p has been l2-fusion to %lu, need copy data_size is %ld.", basic_addr_, | GELOGI("[ZCPY] virtual_addr: %p has been l2-fusion to %lu, need copy data_size is %ld.", basic_addr_, | ||||
| @@ -117,7 +118,8 @@ Status ZeroCopyOffset::InitOutputDataInfo(const vector<int64_t> &input_size_list | |||||
| for (size_t index = 0; index < zero_copy_basic_offset_.size(); ++index) { | for (size_t index = 0; index < zero_copy_basic_offset_.size(); ++index) { | ||||
| if (zero_copy_basic_offset_.at(index) == virtual_addr_offset) { | if (zero_copy_basic_offset_.at(index) == virtual_addr_offset) { | ||||
| in_count++; | in_count++; | ||||
| uint64_t in_offset = reinterpret_cast<uint64_t>(virtual_addr_list[idx]) + zero_copy_relative_offset_.at(index); | |||||
| uint64_t in_offset = static_cast<uint64_t>(reinterpret_cast<uintptr_t>(virtual_addr_list[idx])) + | |||||
| zero_copy_relative_offset_.at(index); | |||||
| int64_t real_data_size = ModelUtils::GetInputSize(op_desc).at(idx); | int64_t real_data_size = ModelUtils::GetInputSize(op_desc).at(idx); | ||||
| data_info_.emplace_back(real_data_size, reinterpret_cast<void *>(static_cast<uintptr_t>(in_offset))); | data_info_.emplace_back(real_data_size, reinterpret_cast<void *>(static_cast<uintptr_t>(in_offset))); | ||||
| relative_offset_.emplace_back(zero_copy_relative_offset_.at(index)); | relative_offset_.emplace_back(zero_copy_relative_offset_.at(index)); | ||||
| @@ -945,7 +945,7 @@ Status HybridModelBuilder::VarNodeToTensor(const NodePtr &var_node, std::unique_ | |||||
| } | } | ||||
| int64_t var_size = CalcVarSizeInBytes(*tensor_desc); | int64_t var_size = CalcVarSizeInBytes(*tensor_desc); | ||||
| // var size is only for checking, will not allocate any memory by it | |||||
| GE_CHECK_GE(var_size, 0); | |||||
| tensor.reset(new(std::nothrow)TensorValue(dev_mem, static_cast<size_t>(var_size))); | tensor.reset(new(std::nothrow)TensorValue(dev_mem, static_cast<size_t>(var_size))); | ||||
| GE_CHECK_NOTNULL(tensor); | GE_CHECK_NOTNULL(tensor); | ||||
| GELOGI("Get var memory addr %p for node %s, size = %ld, mem_type=%u", dev_mem, var_name.c_str(), var_size, mem_type); | GELOGI("Get var memory addr %p for node %s, size = %ld, mem_type=%u", dev_mem, var_name.c_str(), var_size, mem_type); | ||||