已合并
refactor: 替换 rt 内部接口为 rt包间接口和aclrt 对外接口 #3313
tangqunzhang创建于 6月2日
refactor: 替换 rt 内部接口为 rt包间接口和aclrt 对外接口 #3313
已合并
共 592 个文件变更+3144-2660
| @@ -24,7 +24,7 @@ | |||
| 24 | 24 | ||
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | -#include "runtime/base.h" | 27 | +#include "rt_external_base.h" |
| 28 | 28 | ||
| 29 | 29 | ||
| 30 | namespace { | 30 | namespace { |
| @@ -8,7 +8,7 @@ | |||
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | -#include <base.h> | 11 | +#include "rt_external_base.h" |
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| @@ -20,7 +20,7 @@ | |||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | -#include "runtime/base.h" | 23 | +#include "rt_external_base.h" |
| 24 | 24 | ||
| 25 | 25 | ||
| 26 | 26 | ||
| @@ -10,10 +10,11 @@ | |||
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | + | ||
| 13 | 14 | ||
| 14 | 15 | ||
| 15 | 16 | ||
| 16 | -#include "runtime/rt.h" | 17 | +#include "rt_external_stream.h" |
| 17 | 18 | ||
| 18 | 19 | ||
| 19 | static void SetPartFromHandle(const aclmdlConfigHandle *handle, ModelData *data) { | 20 | static void SetPartFromHandle(const aclmdlConfigHandle *handle, ModelData *data) { |
| @@ -226,7 +227,7 @@ aclError aclmdlDestroyDataset(const aclmdlDataset *dataset) { | |||
| 226 | DataSet *geDataSet = (DataSet *)dataset; | 227 | DataSet *geDataSet = (DataSet *)dataset; |
| 227 | DeInitVector(&geDataSet->blobs); | 228 | DeInitVector(&geDataSet->blobs); |
| 228 | if (geDataSet->io_addr != NULL) { | 229 | if (geDataSet->io_addr != NULL) { |
| 229 | - (void)rtFree(geDataSet->io_addr); | 230 | + (void)aclrtFree(geDataSet->io_addr); |
| 230 | } | 231 | } |
| 231 | if (geDataSet->io_addr_host != NULL) { | 232 | if (geDataSet->io_addr_host != NULL) { |
| 232 | (void)mmFree(geDataSet->io_addr_host); | 233 | (void)mmFree(geDataSet->io_addr_host); |
| @@ -176,12 +176,13 @@ static aclError SetMdlLoadDynamicTaskSize(aclmdlConfigHandle *const handle, cons | |||
| 176 | static aclError SetMdlLoadMemType(aclmdlConfigHandle *const handle, const void *const attrValue) { | 176 | static aclError SetMdlLoadMemType(aclmdlConfigHandle *const handle, const void *const attrValue) { |
| 177 | const size_t memPolicy = *((const size_t *)attrValue); | 177 | const size_t memPolicy = *((const size_t *)attrValue); |
| 178 | rtMemType_t type = RT_MEMORY_DEFAULT; | 178 | rtMemType_t type = RT_MEMORY_DEFAULT; |
| 179 | - aclError ret = GetMemTypeFromPolicy(memPolicy, &type); | 179 | + // 仅仅用于合法值校验 |
| 180 | + aclError ret = GetMemTypeFromPolicy((aclrtMemMallocPolicy)memPolicy, &type); | ||
| 180 | if (ret != ACL_SUCCESS) { | 181 | if (ret != ACL_SUCCESS) { |
| 181 | return ret; | 182 | return ret; |
| 182 | } | 183 | } |
| 183 | - handle->memType = type; | 184 | + handle->memType = memPolicy; |
| 184 | - ACL_LOG_INFO("set memType[%u] success.", type); | 185 | + ACL_LOG_INFO("set memType[%zu] success.", handle->memType); |
| 185 | return ACL_SUCCESS; | 186 | return ACL_SUCCESS; |
| 186 | } | 187 | } |
| 187 | 188 | ||
| @@ -315,7 +316,7 @@ aclmdlConfigHandle *aclmdlCreateConfigHandle() { | |||
| 315 | configHandle->mdlLoadType = 0UL; | 316 | configHandle->mdlLoadType = 0UL; |
| 316 | configHandle->mdlSize = 0UL; | 317 | configHandle->mdlSize = 0UL; |
| 317 | configHandle->attrState = 0UL; | 318 | configHandle->attrState = 0UL; |
| 318 | - configHandle->memType = RT_MEMORY_DEFAULT; | 319 | + configHandle->memType = (size_t)ACL_MEM_MALLOC_HUGE_FIRST; |
| 319 | aclmdlExeOMInfo info = {0}; | 320 | aclmdlExeOMInfo info = {0}; |
| 320 | configHandle->exeOMInfo = info; | 321 | configHandle->exeOMInfo = info; |
| 321 | aclmdlExeOMDesc desc = {0UL}; | 322 | aclmdlExeOMDesc desc = {0UL}; |
| @@ -12,7 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | -#include "runtime/mem.h" | 15 | +#include "rt_external_mem.h" |
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| @@ -31,7 +31,7 @@ | |||
| 31 | 31 | ||
| 32 | 32 | ||
| 33 | 33 | ||
| 34 | -#include "runtime/mem.h" | 34 | +#include "rt_external_mem.h" |
| 35 | 35 | ||
| 36 | 36 | ||
| 37 | 37 | ||
| @@ -47,7 +47,7 @@ Status SessionManager::Finalize() { | |||
| 47 | Status SessionManager::SetRtContext(SessionId session_id, aclrtContext rt_context) const { | 47 | Status SessionManager::SetRtContext(SessionId session_id, aclrtContext rt_context) const { |
| 48 | GELOGI("set rt_context RT_CTX_NORMAL_MODE, device id:%u.", GetContext().DeviceId()); | 48 | GELOGI("set rt_context RT_CTX_NORMAL_MODE, device id:%u.", GetContext().DeviceId()); |
| 49 | GE_CHK_STATUS_RET(aclrtCreateContext(&rt_context, static_cast<int32_t>(GetContext().DeviceId()))); | 49 | GE_CHK_STATUS_RET(aclrtCreateContext(&rt_context, static_cast<int32_t>(GetContext().DeviceId()))); |
| 50 | - GE_CHK_RT_RET(aclrtSetCurrentContext(rt_context)); | 50 | + GE_CHK_ACL_RET(aclrtSetCurrentContext(rt_context)); |
| 51 | RtContextUtil::GetInstance().AddRtContext(session_id, rt_context); | 51 | RtContextUtil::GetInstance().AddRtContext(session_id, rt_context); |
| 52 | return SUCCESS; | 52 | return SUCCESS; |
| 53 | } | 53 | } |
| @@ -22,7 +22,7 @@ | |||
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | -#include "runtime/base.h" | 25 | +#include "rt_external_base.h" |
| 26 | 26 | ||
| 27 | 27 | ||
| 28 | namespace ge { | 28 | namespace ge { |
| @@ -29,7 +29,7 @@ StreamAllocator::StreamAllocator(int32_t priority, uint32_t flags) | |||
| 29 | StreamAllocator::~StreamAllocator() { | 29 | StreamAllocator::~StreamAllocator() { |
| 30 | const auto streams = Streams(); | 30 | const auto streams = Streams(); |
| 31 | for (size_t i = 1U; i < streams->GetSize(); ++i) { | 31 | for (size_t i = 1U; i < streams->GetSize(); ++i) { |
| 32 | - (void)rtStreamDestroy(streams->MutableData()[i]); | 32 | + (void)aclrtDestroyStream(streams->MutableData()[i]); |
| 33 | } | 33 | } |
| 34 | (void)streams->SetSize(0U); | 34 | (void)streams->SetSize(0U); |
| 35 | } | 35 | } |
| @@ -24,9 +24,7 @@ | |||
| 24 | 24 | ||
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | -#include "runtime/rt.h" | 27 | +#include "rt_external.h" |
| 28 | -// 待rt.h删除后再替换 | ||
| 29 | - | ||
| 30 | 28 | ||
| 31 | 29 | ||
| 32 | 30 | ||
| @@ -357,8 +355,8 @@ Status DumpOp::ExecutorDumpOp(bool need_device_args) { | |||
| 357 | rtArgsEx_t args_for_launch = {}; | 355 | rtArgsEx_t args_for_launch = {}; |
| 358 | if (need_device_args) { | 356 | if (need_device_args) { |
| 359 | GE_ASSERT_TRUE(launch_kernel_args_dev_mem_ == nullptr); | 357 | GE_ASSERT_TRUE(launch_kernel_args_dev_mem_ == nullptr); |
| 360 | - GE_CHK_RT_RET(ge::AclrtMalloc(&launch_kernel_args_dev_mem_, args_size, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 358 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&launch_kernel_args_dev_mem_, args_size, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 361 | - GE_CHK_RT_RET(aclrtMemcpy(launch_kernel_args_dev_mem_, args_size, &args[0U], args_size, ACL_MEMCPY_HOST_TO_DEVICE)); | 359 | + GE_CHK_ACL_RET(aclrtMemcpy(launch_kernel_args_dev_mem_, args_size, &args[0U], args_size, ACL_MEMCPY_HOST_TO_DEVICE)); |
| 362 | args_for_launch.args = launch_kernel_args_dev_mem_; | 360 | args_for_launch.args = launch_kernel_args_dev_mem_; |
| 363 | args_for_launch.isNoNeedH2DCopy = 1U; | 361 | args_for_launch.isNoNeedH2DCopy = 1U; |
| 364 | } else { | 362 | } else { |
| @@ -556,7 +554,7 @@ Status DumpOp::BuildFftsSubOpTask(toolkit::aicpu::dump::OpMappingInfo &op_mappin | |||
| 556 | Status DumpOp::GenerateFftsDump(const DumpProperties &dump_properties, void *&load_dump_info, uint32_t &load_dump_len, | 554 | Status DumpOp::GenerateFftsDump(const DumpProperties &dump_properties, void *&load_dump_info, uint32_t &load_dump_len, |
| 557 | void *&unload_dump_info, uint32_t &unload_dump_len, const bool is_single_op_dump) { | 555 | void *&unload_dump_info, uint32_t &unload_dump_len, const bool is_single_op_dump) { |
| 558 | int32_t device_id = 0; | 556 | int32_t device_id = 0; |
| 559 | - GE_CHK_RT_RET(aclrtGetDevice(&device_id)); | 557 | + GE_CHK_ACL_RET(aclrtGetDevice(&device_id)); |
| 560 | GE_RETURN_WITH_LOG_IF_TRUE(device_id < 0, "Check device_id %d failed", device_id); | 558 | GE_RETURN_WITH_LOG_IF_TRUE(device_id < 0, "Check device_id %d failed", device_id); |
| 561 | dump_properties_ = dump_properties; | 559 | dump_properties_ = dump_properties; |
| 562 | 560 | ||
| @@ -590,8 +588,8 @@ Status DumpOp::GenerateFftsDump(const DumpProperties &dump_properties, void *&lo | |||
| 590 | GE_FREE_RT_LOG(proto_dev_mem_); | 588 | GE_FREE_RT_LOG(proto_dev_mem_); |
| 591 | } | 589 | } |
| 592 | 590 | ||
| 593 | - GE_CHK_RT_RET(ge::AclrtMalloc(&proto_dev_mem_, proto_size, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 591 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&proto_dev_mem_, proto_size, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 594 | - GE_CHK_RT_RET(aclrtMemcpy(proto_dev_mem_, proto_size, proto_msg.c_str(), proto_size, ACL_MEMCPY_HOST_TO_DEVICE)); | 592 | + GE_CHK_ACL_RET(aclrtMemcpy(proto_dev_mem_, proto_size, proto_msg.c_str(), proto_size, ACL_MEMCPY_HOST_TO_DEVICE)); |
| 595 | 593 | ||
| 596 | load_dump_info = proto_dev_mem_; | 594 | load_dump_info = proto_dev_mem_; |
| 597 | load_dump_len = static_cast<uint32_t>(proto_size); | 595 | load_dump_len = static_cast<uint32_t>(proto_size); |
| @@ -631,9 +629,9 @@ Status DumpOp::BuildUnLoadFftsDumpInfo(void *&unload_dump_info, uint32_t &unload | |||
| 631 | GE_FREE_RT_LOG(dev_mem_unload_); | 629 | GE_FREE_RT_LOG(dev_mem_unload_); |
| 632 | } | 630 | } |
| 633 | 631 | ||
| 634 | - GE_CHK_RT_RET(ge::AclrtMalloc(&dev_mem_unload_, proto_size, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 632 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&dev_mem_unload_, proto_size, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 635 | GE_PRINT_DYNAMIC_MEMORY(aclrtMalloc, "unload dump information.", proto_size); | 633 | GE_PRINT_DYNAMIC_MEMORY(aclrtMalloc, "unload dump information.", proto_size); |
| 636 | - GE_CHK_RT_RET(aclrtMemcpy(dev_mem_unload_, proto_size, proto_str.c_str(), proto_size, ACL_MEMCPY_HOST_TO_DEVICE)); | 634 | + GE_CHK_ACL_RET(aclrtMemcpy(dev_mem_unload_, proto_size, proto_str.c_str(), proto_size, ACL_MEMCPY_HOST_TO_DEVICE)); |
| 637 | 635 | ||
| 638 | unload_dump_info = dev_mem_unload_; | 636 | unload_dump_info = dev_mem_unload_; |
| 639 | unload_dump_len = static_cast<uint32_t>(proto_size); | 637 | unload_dump_len = static_cast<uint32_t>(proto_size); |
| @@ -647,7 +645,7 @@ Status DumpOp::LaunchDumpOp(const bool is_single_op_dump, bool need_device_args) | |||
| 647 | 645 | ||
| 648 | int32_t device_id = 0; | 646 | int32_t device_id = 0; |
| 649 | const aclError rt_ret = aclrtGetDevice(&device_id); | 647 | const aclError rt_ret = aclrtGetDevice(&device_id); |
| 650 | - if (rt_ret != ACL_SUCCESS) { | 648 | + if (rt_ret != ACL_ERROR_NONE) { |
| 651 | GELOGE(RT_ERROR_TO_GE_STATUS(rt_ret), "[Call][aclrtGetDevice]Failed, ret %d", rt_ret); | 649 | GELOGE(RT_ERROR_TO_GE_STATUS(rt_ret), "[Call][aclrtGetDevice]Failed, ret %d", rt_ret); |
| 652 | REPORT_INNER_ERR_MSG("E19999", "[Call][aclrtGetDevice]Failed, ret %d", rt_ret); | 650 | REPORT_INNER_ERR_MSG("E19999", "[Call][aclrtGetDevice]Failed, ret %d", rt_ret); |
| 653 | return RT_ERROR_TO_GE_STATUS(rt_ret); | 651 | return RT_ERROR_TO_GE_STATUS(rt_ret); |
| @@ -16,7 +16,7 @@ | |||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | -#include "runtime/mem.h" | 19 | +#include "rt_external_mem.h" |
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | namespace ge { | 22 | namespace ge { |
| @@ -30,7 +30,7 @@ | |||
| 30 | 30 | ||
| 31 | 31 | ||
| 32 | 32 | ||
| 33 | -#include "runtime/mem.h" | 33 | +#include "rt_external_mem.h" |
| 34 | 34 | ||
| 35 | 35 | ||
| 36 | 36 | ||
| @@ -20,6 +20,7 @@ | |||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | + | ||
| 23 | 24 | ||
| 24 | 25 | ||
| 25 | 26 | ||
| @@ -9,7 +9,7 @@ | |||
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | -#include "runtime/rt.h" | 12 | +#include "rt_external.h" |
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| @@ -13,7 +13,7 @@ | |||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | -#include "runtime/base.h" | 16 | +#include "rt_external_base.h" |
| 17 | 17 | ||
| 18 | namespace ge { | 18 | namespace ge { |
| 19 | struct ErrorTrackingOpInfo { | 19 | struct ErrorTrackingOpInfo { |
| @@ -31,7 +31,7 @@ | |||
| 31 | 31 | ||
| 32 | 32 | ||
| 33 | 33 | ||
| 34 | -#include "runtime/mem.h" | 34 | +#include "rt_external_mem.h" |
| 35 | 35 | ||
| 36 | 36 | ||
| 37 | 37 | ||
| @@ -1,59 +0,0 @@ | |||
| 1 | -/** | ||
| 2 | - * Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 3 | - * This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 4 | - * CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 5 | - * Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 6 | - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 7 | - * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 8 | - * See LICENSE in the root of the software repository for the full text of the License. | ||
| 9 | - */ | ||
| 10 | - | ||
| 11 | - | ||
| 12 | - | ||
| 13 | - | ||
| 14 | -// 这里的rt接口声明用于日落的GE代码使用,待GE代码日落时同时删除这些声明。 | ||
| 15 | - | ||
| 16 | - | ||
| 17 | - | ||
| 18 | -// 避免出现runtime内部头文件重复定义错误 | ||
| 19 | - | ||
| 20 | - | ||
| 21 | - | ||
| 22 | - | ||
| 23 | -typedef struct rtFunctionInfo { | ||
| 24 | - void *pcAddr; | ||
| 25 | - uint32_t prefetchCnt; | ||
| 26 | - uint8_t mixType; // 0:NO_MIX; 1:MIX_AIC; 2:MIX_AIV; 3:MIX_AIC_AIV | ||
| 27 | - uint8_t reserved[3]; | ||
| 28 | -} rtFunctionInfo_t; | ||
| 29 | - | ||
| 30 | -typedef struct tagRtKernelInfo { | ||
| 31 | - uint8_t functionInfoNum; | ||
| 32 | - uint8_t reserved[3]; | ||
| 33 | - rtFunctionInfo_t functionInfo[2]; | ||
| 34 | -} rtKernelDetailInfo_t; | ||
| 35 | - | ||
| 36 | - | ||
| 37 | - | ||
| 38 | - | ||
| 39 | - | ||
| 40 | - | ||
| 41 | - | ||
| 42 | -extern "C" { | ||
| 43 | - | ||
| 44 | - | ||
| 45 | - | ||
| 46 | -typedef enum tagRtMemRequestFeature { | ||
| 47 | - MEM_REQUEST_FEATURE_DEFAULT = 0, | ||
| 48 | - MEM_REQUEST_FEATURE_OPP, | ||
| 49 | - MEM_REQUEST_FEATURE_RESERVED | ||
| 50 | -} rtMemRequestFeature_t; | ||
| 51 | - | ||
| 52 | -RTS_API uint32_t rtGetTsMemType(rtMemRequestFeature_t featureType, uint32_t memSize); | ||
| 53 | - | ||
| 54 | - | ||
| 55 | - | ||
| 56 | -} | ||
| 57 | - | ||
| 58 | - | ||
| 59 | - | ||
| @@ -1606,7 +1606,7 @@ Status ModelHelper::GetHardwareInfo(std::map<std::string, std::string> &options) | |||
| 1606 | 1606 | ||
| 1607 | Status ModelHelper::InitRuntimePlatform() { | 1607 | Status ModelHelper::InitRuntimePlatform() { |
| 1608 | int32_t device_id = -1; | 1608 | int32_t device_id = -1; |
| 1609 | - GE_CHK_RT_RET(aclrtGetDevice(&device_id)); | 1609 | + GE_CHK_ACL_RET(aclrtGetDevice(&device_id)); |
| 1610 | // init platform info | 1610 | // init platform info |
| 1611 | const char *soc_version = aclrtGetSocName(); | 1611 | const char *soc_version = aclrtGetSocName(); |
| 1612 | GE_ASSERT_NOTNULL(soc_version); | 1612 | GE_ASSERT_NOTNULL(soc_version); |
| @@ -1656,7 +1656,7 @@ Status ModelHelper::HandleDeviceInfo(fe::PlatFormInfos &platform_infos) const { | |||
| 1656 | Status ModelHelper::HandleDeviceInfo(fe::PlatFormInfos &platform_infos, fe::PlatformInfo &origin_platform_info) const { | 1656 | Status ModelHelper::HandleDeviceInfo(fe::PlatFormInfos &platform_infos, fe::PlatformInfo &origin_platform_info) const { |
| 1657 | GELOGD("Begin to handle device info."); | 1657 | GELOGD("Begin to handle device info."); |
| 1658 | int32_t device_id = -1; | 1658 | int32_t device_id = -1; |
| 1659 | - GE_CHK_RT_RET(aclrtGetDevice(&device_id)); | 1659 | + GE_CHK_ACL_RET(aclrtGetDevice(&device_id)); |
| 1660 | 1660 | ||
| 1661 | const char *soc_version = aclrtGetSocName(); | 1661 | const char *soc_version = aclrtGetSocName(); |
| 1662 | GE_ASSERT_NOTNULL(soc_version); | 1662 | GE_ASSERT_NOTNULL(soc_version); |
| @@ -10,6 +10,7 @@ | |||
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | + | ||
| 13 | 14 | ||
| 14 | 15 | ||
| 15 | 16 | ||
| @@ -353,7 +354,7 @@ Status TensorTransUtils::TransRtTensorToTensor(const std::vector<gert::Tensor> & | |||
| 353 | GE_CHECK_NOTNULL(aligned_ptr); | 354 | GE_CHECK_NOTNULL(aligned_ptr); |
| 354 | auto data_buf = aligned_ptr->MutableGet(); | 355 | auto data_buf = aligned_ptr->MutableGet(); |
| 355 | GE_CHECK_NOTNULL(data_buf); | 356 | GE_CHECK_NOTNULL(data_buf); |
| 356 | - GE_CHK_RT_RET(aclrtMemcpy(data_buf, static_cast<uint64_t>(output_size), rt_tensor.GetAddr(), | 357 | + GE_CHK_ACL_RET(aclrtMemcpy(data_buf, static_cast<uint64_t>(output_size), rt_tensor.GetAddr(), |
| 357 | static_cast<uint64_t>(output_size), ACL_MEMCPY_DEVICE_TO_HOST)); | 358 | static_cast<uint64_t>(output_size), ACL_MEMCPY_DEVICE_TO_HOST)); |
| 358 | ge_tensor.SetData(aligned_ptr, static_cast<size_t>(output_size)); | 359 | ge_tensor.SetData(aligned_ptr, static_cast<size_t>(output_size)); |
| 359 | } else { | 360 | } else { |
| @@ -526,7 +527,7 @@ Status TensorTransUtils::TransGertTensorToHost(const gert::Tensor &src_tensor, g | |||
| 526 | GE_CHECK_NOTNULL(aligned_ptr); | 527 | GE_CHECK_NOTNULL(aligned_ptr); |
| 527 | auto data_buf = aligned_ptr->MutableGet(); | 528 | auto data_buf = aligned_ptr->MutableGet(); |
| 528 | GE_CHECK_NOTNULL(data_buf); | 529 | GE_CHECK_NOTNULL(data_buf); |
| 529 | - GE_CHK_RT_RET(aclrtMemcpy(data_buf, static_cast<uint64_t>(output_size), src_tensor.GetAddr(), | 530 | + GE_CHK_ACL_RET(aclrtMemcpy(data_buf, static_cast<uint64_t>(output_size), src_tensor.GetAddr(), |
| 530 | static_cast<uint64_t>(output_size), ACL_MEMCPY_DEVICE_TO_HOST)); | 531 | static_cast<uint64_t>(output_size), ACL_MEMCPY_DEVICE_TO_HOST)); |
| 531 | 532 | ||
| 532 | // 创建 GeTensor 来持有数据,并使用 TensorWrapper 管理生命周期 | 533 | // 创建 GeTensor 来持有数据,并使用 TensorWrapper 管理生命周期 |
| @@ -16,7 +16,7 @@ | |||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | -#include "runtime/rt.h" | 19 | +#include "rt_external.h" |
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | 22 | ||
| @@ -12,7 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | -#include "runtime/rt.h" | 15 | +#include "rt_external.h" |
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | namespace ge { | 18 | namespace ge { |
| @@ -16,8 +16,7 @@ | |||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | -#include "runtime/mem.h" | 19 | +#include "common/ge_rts_decl.h" |
| 20 | - | ||
| 21 | 20 | ||
| 22 | 21 | ||
| 23 | namespace ge { | 22 | namespace ge { |
| @@ -17,6 +17,7 @@ | |||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | + | ||
| 20 | 21 | ||
| 21 | namespace ge { | 22 | namespace ge { |
| 22 | const std::map<int32_t, int32_t> kTopicTypeToRtsFlagMap { | 23 | const std::map<int32_t, int32_t> kTopicTypeToRtsFlagMap { |
| @@ -20,7 +20,7 @@ | |||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | -#include "runtime/mem.h" | 23 | +#include "rt_external_mem.h" |
| 24 | 24 | ||
| 25 | namespace ge { | 25 | namespace ge { |
| 26 | constexpr int32_t kSessionNoReuse = 1; | 26 | constexpr int32_t kSessionNoReuse = 1; |
| @@ -12,7 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | -#include "runtime/rt.h" | 15 | +#include "rt_external.h" |
| 16 | 16 | ||
| 17 | namespace ge { | 17 | namespace ge { |
| 18 | class BarrierTaskCodeBuilder : public TaskCodeBuilder { | 18 | class BarrierTaskCodeBuilder : public TaskCodeBuilder { |
| @@ -12,7 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | -#include "runtime/rt.h" | 15 | +#include "rt_external.h" |
| 16 | 16 | ||
| 17 | namespace ge { | 17 | namespace ge { |
| 18 | class CmoTaskCodeBuilder : public TaskCodeBuilder { | 18 | class CmoTaskCodeBuilder : public TaskCodeBuilder { |
| @@ -12,6 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | + | ||
| 15 | 16 | ||
| 16 | 17 | ||
| 17 | 18 | ||
| @@ -36,7 +36,7 @@ | |||
| 36 | 36 | ||
| 37 | 37 | ||
| 38 | 38 | ||
| 39 | -#include "runtime/mem.h" | 39 | +#include "rt_external_mem.h" |
| 40 | 40 | ||
| 41 | 41 | ||
| 42 | 42 | ||
| @@ -46,7 +46,7 @@ | |||
| 46 | 46 | ||
| 47 | 47 | ||
| 48 | 48 | ||
| 49 | -#include "runtime/dev.h" | 49 | +#include "rt_external_device.h" |
| 50 | 50 | ||
| 51 | 51 | ||
| 52 | 52 | ||
| @@ -10,7 +10,7 @@ | |||
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | -#include "runtime/rt.h" | 13 | +#include "rt_external.h" |
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | 16 | ||
| @@ -13,7 +13,7 @@ | |||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | -#include "runtime/rt_preload_task.h" | 16 | +#include "rt_external_preload.h" |
| 17 | 17 | ||
| 18 | namespace ge { | 18 | namespace ge { |
| 19 | struct ArgOffset { | 19 | struct ArgOffset { |
| @@ -16,7 +16,7 @@ | |||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | -#include "runtime/dev.h" | 19 | +#include "rt_external_device.h" |
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | 22 | ||
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | -#include "runtime/dev.h" | 14 | +#include "rt_external_device.h" |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| @@ -9,8 +9,8 @@ | |||
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | - | 12 | +#include "rt_external.h" |
| 13 | -#include "runtime/rt.h" | 13 | +#include "common/ge_rts_decl.h" |
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | 16 | ||
| @@ -86,7 +86,7 @@ Status BinRegisterUtils::RegisterBin(const OpDesc &op_desc, const std::string &s | |||
| 86 | GE_IF_BOOL_EXEC(AttrUtils::GetStr(op_desc_ptr, key_for_kernel_name, attr_names.kKernelNameSuffix, kernel_name), | 86 | GE_IF_BOOL_EXEC(AttrUtils::GetStr(op_desc_ptr, key_for_kernel_name, attr_names.kKernelNameSuffix, kernel_name), |
| 87 | GELOGI("Get original type of kernel_name")); | 87 | GELOGI("Get original type of kernel_name")); |
| 88 | GELOGI("TBE: binfile_key=%s, kernel_name=%s", stub_name.c_str(), kernel_name.c_str()); | 88 | GELOGI("TBE: binfile_key=%s, kernel_name=%s", stub_name.c_str(), kernel_name.c_str()); |
| 89 | - GE_CHK_RT_RET(rtFunctionRegister(bin_handle, stub_name.c_str(), stub_name.c_str(), kernel_name.c_str(), 0U)); | 89 | + GE_CHK_RT_RET(rtFunctionRegister(bin_handle, stub_name.c_str(), stub_name.c_str(), kernel_name.c_str(), FUNC_MODE_NORMAL)); |
| 90 | } | 90 | } |
| 91 | (void)KernelBinRegistry::GetInstance().GetUnique(stub_name); | 91 | (void)KernelBinRegistry::GetInstance().GetUnique(stub_name); |
| 92 | GE_CHK_RT_RET(rtGetFunctionByName(stub_name.c_str(), &stub_func)); | 92 | GE_CHK_RT_RET(rtGetFunctionByName(stub_name.c_str(), &stub_func)); |
| @@ -9,11 +9,10 @@ | |||
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | - | ||
| 13 | 12 | ||
| 14 | 13 | ||
| 15 | 14 | ||
| 16 | -#include "runtime/kernel.h" | 15 | +#include "common/ge_rts_decl.h" |
| 17 | 16 | ||
| 18 | 17 | ||
| 19 | 18 | ||
| @@ -21,7 +21,7 @@ | |||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | -#include "runtime/dev.h" | 24 | +#include "rt_external_device.h" |
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | 27 | ||
| @@ -52,7 +52,7 @@ ge::Status InitVarIfHasInitValue(const VarDevAddrMgr *const var_mgr, void *var_d | |||
| 52 | const auto init_value_size = init_value->GetData().GetSize(); | 52 | const auto init_value_size = init_value->GetData().GetSize(); |
| 53 | GE_ASSERT_TRUE(init_value_size <= static_cast<size_t>(var_size), "_init_value size too big." | 53 | GE_ASSERT_TRUE(init_value_size <= static_cast<size_t>(var_size), "_init_value size too big." |
| 54 | " var_size: %" PRId64 ", init_value_size: %zu", var_size, init_value_size); | 54 | " var_size: %" PRId64 ", init_value_size: %zu", var_size, init_value_size); |
| 55 | - GE_CHK_RT_RET(aclrtMemcpy(var_dev_addr, static_cast<uint64_t>(var_size), | 55 | + GE_CHK_ACL_RET(aclrtMemcpy(var_dev_addr, static_cast<uint64_t>(var_size), |
| 56 | init_value->GetData().GetData(), init_value_size, ACL_MEMCPY_HOST_TO_DEVICE)); | 56 | init_value->GetData().GetData(), init_value_size, ACL_MEMCPY_HOST_TO_DEVICE)); |
| 57 | GELOGI("variable offset[%p] has _init_value attr, init value success, var_dev_addr: %p, tensor size: %" PRId64 "," | 57 | GELOGI("variable offset[%p] has _init_value attr, init value success, var_dev_addr: %p, tensor size: %" PRId64 "," |
| 58 | " value size: %zu, ", var_mgr->logic_addr, var_dev_addr, var_size, init_value_size); | 58 | " value size: %zu, ", var_mgr->logic_addr, var_dev_addr, var_size, init_value_size); |
| @@ -1184,7 +1184,7 @@ ge::Status VarManager::VarManagerToDeserial(const uint64_t session_id, const dep | |||
| 1184 | if (var_resource_ == nullptr) { | 1184 | if (var_resource_ == nullptr) { |
| 1185 | version_ = static_cast<SessionVersion>(info.version()); | 1185 | version_ = static_cast<SessionVersion>(info.version()); |
| 1186 | int32_t device_id = -1; | 1186 | int32_t device_id = -1; |
| 1187 | - GE_CHK_RT_RET(aclrtGetDevice(&device_id)); | 1187 | + GE_CHK_ACL_RET(aclrtGetDevice(&device_id)); |
| 1188 | device_id_ = static_cast<uint32_t>(device_id); | 1188 | device_id_ = static_cast<uint32_t>(device_id); |
| 1189 | GELOGD("[VarManager] Success to get device id = %u.", device_id_); | 1189 | GELOGD("[VarManager] Success to get device id = %u.", device_id_); |
| 1190 | session_id_ = info.session_id(); | 1190 | session_id_ = info.session_id(); |
| @@ -25,7 +25,7 @@ | |||
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | 27 | ||
| 28 | -#include "runtime/mem.h" | 28 | +#include "rt_external_mem.h" |
| 29 | 29 | ||
| 30 | 30 | ||
| 31 | 31 | ||
| @@ -14,6 +14,7 @@ | |||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | + | ||
| 17 | 18 | ||
| 18 | namespace ge { | 19 | namespace ge { |
| 19 | inline std::string ToMallocMemInfo(const std::string &purpose, const void *const ptr, const uint32_t device_id, | 20 | inline std::string ToMallocMemInfo(const std::string &purpose, const void *const ptr, const uint32_t device_id, |
| @@ -121,7 +121,7 @@ Status GELib::Initialize(const std::map<std::string, std::string> &options) { | |||
| 121 | GE_ASSERT_SUCCESS(ge::ConvertToInt32(wait_iter->second.c_str(), wait_timeout), "convert [%s] to int failed.", | 121 | GE_ASSERT_SUCCESS(ge::ConvertToInt32(wait_iter->second.c_str(), wait_timeout), "convert [%s] to int failed.", |
| 122 | wait_iter->second.c_str()); | 122 | wait_iter->second.c_str()); |
| 123 | if (wait_timeout >= 0) { | 123 | if (wait_timeout >= 0) { |
| 124 | - GE_CHK_RT_RET(aclrtSetOpWaitTimeout(static_cast<uint32_t>(wait_timeout))); | 124 | + GE_CHK_ACL_RET(aclrtSetOpWaitTimeout(static_cast<uint32_t>(wait_timeout))); |
| 125 | GELOGI("Succeeded in setting aclrtSetOpWaitTimeout[%s] to runtime.", wait_iter->second.c_str()); | 125 | GELOGI("Succeeded in setting aclrtSetOpWaitTimeout[%s] to runtime.", wait_iter->second.c_str()); |
| 126 | } | 126 | } |
| 127 | } | 127 | } |
| @@ -134,8 +134,8 @@ Status GELib::Initialize(const std::map<std::string, std::string> &options) { | |||
| 134 | GE_ASSERT_SUCCESS(ge::ConvertToInt32(op_execute_timeout.c_str(), execute_timeout), "convert [%s] to int failed.", | 134 | GE_ASSERT_SUCCESS(ge::ConvertToInt32(op_execute_timeout.c_str(), execute_timeout), "convert [%s] to int failed.", |
| 135 | op_execute_timeout.c_str()); | 135 | op_execute_timeout.c_str()); |
| 136 | if (execute_timeout >= 0) { | 136 | if (execute_timeout >= 0) { |
| 137 | - GE_CHK_RT_RET(rtSetOpExecuteTimeOut(static_cast<uint32_t>(execute_timeout))); | 137 | + GE_CHK_ACL_RET(aclrtSetOpExecuteTimeOut(static_cast<uint32_t>(execute_timeout))); |
| 138 | - GELOGI("Succeeded in setting rtSetOpExecuteTimeOut[%s] to runtime.", exe_iter->second.c_str()); | 138 | + GELOGI("Succeeded in setting aclrtSetOpExecuteTimeOut[%s] to runtime.", exe_iter->second.c_str()); |
| 139 | } | 139 | } |
| 140 | } | 140 | } |
| 141 | } | 141 | } |
| @@ -20,7 +20,7 @@ | |||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | -#include "runtime/dev.h" | 23 | +#include "rt_external_device.h" |
| 24 | 24 | ||
| 25 | 25 | ||
| 26 | 26 | ||
| @@ -8,6 +8,8 @@ | |||
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | + | ||
| 12 | + | ||
| 11 | 13 | ||
| 12 | 14 | ||
| 13 | 15 | ||
| @@ -232,7 +234,7 @@ ge::Status CpuKernelBuilder::GenerateMemCopyTask( | |||
| 232 | return state; | 234 | return state; |
| 233 | } | 235 | } |
| 234 | domi::TaskDef task_def; | 236 | domi::TaskDef task_def; |
| 235 | - task_def.set_type(RT_MODEL_TASK_KERNEL); | 237 | + task_def.set_type(ACL_RT_MODEL_TASK_KERNEL); |
| 236 | domi::KernelDef *kernel_def = task_def.mutable_kernel(); | 238 | domi::KernelDef *kernel_def = task_def.mutable_kernel(); |
| 237 | AICPU_CHECK_NOTNULL(kernel_def); | 239 | AICPU_CHECK_NOTNULL(kernel_def); |
| 238 | 240 | ||
| @@ -313,7 +315,7 @@ ge::Status CpuKernelBuilder::GenerateTask(const ge::Node &node, | |||
| 313 | } | 315 | } |
| 314 | g_op_index = op_desc_ptr->GetId(); | 316 | g_op_index = op_desc_ptr->GetId(); |
| 315 | domi::TaskDef task_def; | 317 | domi::TaskDef task_def; |
| 316 | - task_def.set_type(RT_MODEL_TASK_KERNEL); | 318 | + task_def.set_type(ACL_RT_MODEL_TASK_KERNEL); |
| 317 | task_def.set_sqe_num(kBasicAicpuOpSqeNumber); | 319 | task_def.set_sqe_num(kBasicAicpuOpSqeNumber); |
| 318 | bool is_blocking_aicpu_op = false; | 320 | bool is_blocking_aicpu_op = false; |
| 319 | (void)ge::AttrUtils::GetBool(op_desc_ptr, ge::ATTR_NAME_IS_BLOCKING_OP, is_blocking_aicpu_op); | 321 | (void)ge::AttrUtils::GetBool(op_desc_ptr, ge::ATTR_NAME_IS_BLOCKING_OP, is_blocking_aicpu_op); |
| @@ -16,7 +16,6 @@ | |||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | - | ||
| 20 | 19 | ||
| 21 | 20 | ||
| 22 | 21 | ||
| @@ -26,6 +25,8 @@ | |||
| 26 | 25 | ||
| 27 | 26 | ||
| 28 | 27 | ||
| 28 | + | ||
| 29 | + | ||
| 29 | 30 | ||
| 30 | using domi::tensorflow::NodeDef; | 31 | using domi::tensorflow::NodeDef; |
| 31 | 32 | ||
| @@ -244,7 +245,7 @@ ge::Status TfKernelBuilder::GenerateTask(const ge::Node &node, const ge::RunCont | |||
| 244 | GenMemCopyTask(data_info_size, task, mem_copy_task_info); | 245 | GenMemCopyTask(data_info_size, task, mem_copy_task_info); |
| 245 | 246 | ||
| 246 | domi::TaskDef task_def; | 247 | domi::TaskDef task_def; |
| 247 | - task_def.set_type(RT_MODEL_TASK_KERNEL_EX); | 248 | + task_def.set_type(ACL_RT_MODEL_TASK_KERNEL_EX); |
| 248 | domi::KernelExDef *kernel_def_ex = task_def.mutable_kernel_ex(); | 249 | domi::KernelExDef *kernel_def_ex = task_def.mutable_kernel_ex(); |
| 249 | AICPU_CHECK_NOTNULL_ERRCODE(kernel_def_ex, ErrorCode::INPUT_PARAM_NULL); | 250 | AICPU_CHECK_NOTNULL_ERRCODE(kernel_def_ex, ErrorCode::INPUT_PARAM_NULL); |
| 250 | kernel_def_ex->set_args(reinterpret_cast<void *>(&task), sizeof(STR_FWK_OP_KERNEL)); | 251 | kernel_def_ex->set_args(reinterpret_cast<void *>(&task), sizeof(STR_FWK_OP_KERNEL)); |
| @@ -611,7 +612,7 @@ ge::Status TfKernelBuilder::ConstructExtendInfoAndTaskdef(const ge::Node &node, | |||
| 611 | str_tf_kernel->extInfoLen, op_desc_ptr->GetName().c_str(), op_desc_ptr->GetType().c_str()); | 612 | str_tf_kernel->extInfoLen, op_desc_ptr->GetName().c_str(), op_desc_ptr->GetType().c_str()); |
| 612 | 613 | ||
| 613 | g_task_def.set_stream_id(op_desc_ptr->GetStreamId()); | 614 | g_task_def.set_stream_id(op_desc_ptr->GetStreamId()); |
| 614 | - g_task_def.set_type(RT_MODEL_TASK_KERNEL_EX); | 615 | + g_task_def.set_type(ACL_RT_MODEL_TASK_KERNEL_EX); |
| 615 | 616 | ||
| 616 | g_task_def.set_sqe_num(kBasicTfOpSqeNumber); | 617 | g_task_def.set_sqe_num(kBasicTfOpSqeNumber); |
| 617 | bool is_blocking_aicpu_op = false; | 618 | bool is_blocking_aicpu_op = false; |
| @@ -8,6 +8,7 @@ | |||
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | + | ||
| 11 | 12 | ||
| 12 | 13 | ||
| 13 | 14 | ||
| @@ -38,7 +39,7 @@ DvppErrorCode DvppBuilder910B::GenerateTask(const ge::Node& node, | |||
| 38 | return DvppErrorCode::kInputParamNull); | 39 | return DvppErrorCode::kInputParamNull); |
| 39 | 40 | ||
| 40 | domi::TaskDef task; | 41 | domi::TaskDef task; |
| 41 | - task.set_type(RT_MODEL_TASK_DVPP); | 42 | + task.set_type(ACL_RT_MODEL_TASK_DVPP); |
| 42 | // no need to set streamID for task, GE will reallocate stream | 43 | // no need to set streamID for task, GE will reallocate stream |
| 43 | domi::DvppTaskDef* dvpp_task = task.mutable_dvpp_task(); | 44 | domi::DvppTaskDef* dvpp_task = task.mutable_dvpp_task(); |
| 44 | DVPP_CHECK_IF_THEN_DO(dvpp_task == nullptr, | 45 | DVPP_CHECK_IF_THEN_DO(dvpp_task == nullptr, |
| @@ -8,6 +8,8 @@ | |||
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | + | ||
| 12 | + | ||
| 11 | 13 | ||
| 12 | 14 | ||
| 13 | 15 | ||
| @@ -1025,7 +1027,7 @@ Status FFTSPlusOpsKernelBuilder::GenerateTask(const ge::Node &node, ge::RunConte | |||
| 1025 | return FAILED; | 1027 | return FAILED; |
| 1026 | } | 1028 | } |
| 1027 | domi::FftsPlusTaskDef *ffts_plus_task_def = task_def_real->mutable_ffts_plus_task(); | 1029 | domi::FftsPlusTaskDef *ffts_plus_task_def = task_def_real->mutable_ffts_plus_task(); |
| 1028 | - task_def_real->set_type(RT_MODEL_TASK_FFTS_PLUS_TASK); | 1030 | + task_def_real->set_type(ACL_RT_MODEL_TASK_FFTS_PLUS_TASK); |
| 1029 | ffts_plus_task_def->set_op_index(op_desc->GetId()); | 1031 | ffts_plus_task_def->set_op_index(op_desc->GetId()); |
| 1030 | task_def_real->set_stream_id(op_desc->GetStreamId()); | 1032 | task_def_real->set_stream_id(op_desc->GetStreamId()); |
| 1031 | task_defs.push_back(*task_def_real); | 1033 | task_defs.push_back(*task_def_real); |
| @@ -16,8 +16,8 @@ | |||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | -#include "runtime/rt_model.h" | 19 | +#include "rt_external_model.h" |
| 20 | -#include "runtime/mem.h" | 20 | +#include "rt_external_mem.h" |
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | namespace ffts { | 23 | namespace ffts { |
| @@ -19,7 +19,7 @@ | |||
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | -#include "runtime/rt.h" | 22 | +#include "rt_external.h" |
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | 25 | ||
| @@ -20,8 +20,8 @@ | |||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | -#include "runtime/rt_model.h" | 23 | +#include "rt_external_model.h" |
| 24 | -#include "runtime/mem.h" | 24 | +#include "rt_external_mem.h" |
| 25 | 25 | ||
| 26 | namespace ffts { | 26 | namespace ffts { |
| 27 | MixL2TaskBuilder::MixL2TaskBuilder() {} | 27 | MixL2TaskBuilder::MixL2TaskBuilder() {} |
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | -#include <runtime/rt.h> | 14 | +#include "rt_external.h" |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| @@ -20,8 +20,8 @@ | |||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | -#include "runtime/rt_model.h" | 23 | +#include "rt_external_model.h" |
| 24 | -#include "runtime/mem.h" | 24 | +#include "rt_external_mem.h" |
| 25 | 25 | ||
| 26 | namespace ffts { | 26 | namespace ffts { |
| 27 | AICAIVDynamicTaskBuilder::AICAIVDynamicTaskBuilder() {} | 27 | AICAIVDynamicTaskBuilder::AICAIVDynamicTaskBuilder() {} |
| @@ -13,8 +13,8 @@ | |||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | -#include "runtime/rt_model.h" | 16 | +#include "rt_external_model.h" |
| 17 | -#include "runtime/mem.h" | 17 | +#include "rt_external_mem.h" |
| 18 | namespace ffts { | 18 | namespace ffts { |
| 19 | static const std::string kOpConstValueList = "_const_value_list"; | 19 | static const std::string kOpConstValueList = "_const_value_list"; |
| 20 | static const std::string kConstantOp = "Constant"; | 20 | static const std::string kConstantOp = "Constant"; |
| @@ -14,7 +14,7 @@ | |||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | -#include "runtime/rt.h" | 17 | +#include "rt_external.h" |
| 18 | 18 | ||
| 19 | namespace ffts { | 19 | namespace ffts { |
| 20 | enum class DistributionType { | 20 | enum class DistributionType { |
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | -#include "runtime/base.h" | 14 | +#include "rt_external_base.h" |
| 15 | 15 | ||
| 16 | namespace ffts { | 16 | namespace ffts { |
| 17 | RuntimeOpsAutoTaskBuilder::RuntimeOpsAutoTaskBuilder() {} | 17 | RuntimeOpsAutoTaskBuilder::RuntimeOpsAutoTaskBuilder() {} |
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | -#include "runtime/base.h" | 14 | +#include "rt_external_base.h" |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | namespace ffts { | 17 | namespace ffts { |
| @@ -22,7 +22,7 @@ | |||
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | -#include "runtime/rt.h" | 25 | +#include "rt_external.h" |
| 26 | 26 | ||
| 27 | 27 | ||
| 28 | 28 | ||
| @@ -15,6 +15,8 @@ | |||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | + | ||
| 19 | + | ||
| 18 | 20 | ||
| 19 | namespace hccl { | 21 | namespace hccl { |
| 20 | REGISTER_OPS_KERNEL_BUILDER(AUTOTUNE_HCCL_OPS_LIB_NAME, hccl::AutoTuningHcomOpsKernelBuilder); | 22 | REGISTER_OPS_KERNEL_BUILDER(AUTOTUNE_HCCL_OPS_LIB_NAME, hccl::AutoTuningHcomOpsKernelBuilder); |
| @@ -144,7 +146,7 @@ ge::Status AutoTuningHcomOpsKernelBuilder::GenerateTask(const ge::Node &node, [[ | |||
| 144 | CHK_PRT_RET((kernelDefHccl == nullptr), | 146 | CHK_PRT_RET((kernelDefHccl == nullptr), |
| 145 | HCCL_ERROR("[Generate][Task]errNo[0x%016llx] kernelDefHccl is null.", HCOM_ERROR_CODE(HCCL_E_PTR)), | 147 | HCCL_ERROR("[Generate][Task]errNo[0x%016llx] kernelDefHccl is null.", HCOM_ERROR_CODE(HCCL_E_PTR)), |
| 146 | ge::INTERNAL_ERROR); | 148 | ge::INTERNAL_ERROR); |
| 147 | - taskDef.set_type(RT_MODEL_TASK_HCCL); | 149 | + taskDef.set_type(ACL_RT_MODEL_TASK_HCCL); |
| 148 | taskDef.set_stream_id(node.GetOpDesc()->GetStreamId()); | 150 | taskDef.set_stream_id(node.GetOpDesc()->GetStreamId()); |
| 149 | std::string sCollectiveType = node.GetOpDesc()->GetType(); | 151 | std::string sCollectiveType = node.GetOpDesc()->GetType(); |
| 150 | HcclResult ret = CheckSupportedOP(sCollectiveType); | 152 | HcclResult ret = CheckSupportedOP(sCollectiveType); |
| @@ -23,6 +23,8 @@ | |||
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | 25 | ||
| 26 | + | ||
| 27 | + | ||
| 26 | 28 | ||
| 27 | using namespace std; | 29 | using namespace std; |
| 28 | 30 | ||
| @@ -411,7 +413,7 @@ ge::Status AutoTuningHcomOpsKernelInfoStore::LoadTask(ge::GETaskInfo &task) { | |||
| 411 | // 设定为算子信息库工作流程 | 413 | // 设定为算子信息库工作流程 |
| 412 | ge::GETaskKernelHcclInfo hcclInfo; | 414 | ge::GETaskKernelHcclInfo hcclInfo; |
| 413 | CHK_RET(GetHcclInfo(task, hcclInfo)); | 415 | CHK_RET(GetHcclInfo(task, hcclInfo)); |
| 414 | - CHK_PRT_RET((task.type != RT_MODEL_TASK_HCCL), | 416 | + CHK_PRT_RET((task.type != ACL_RT_MODEL_TASK_HCCL), |
| 415 | HCCL_ERROR("[Load][Task]errNo[0x%016llx] TaskType[%u] from" | 417 | HCCL_ERROR("[Load][Task]errNo[0x%016llx] TaskType[%u] from" |
| 416 | "taskinfo is invalid.", | 418 | "taskinfo is invalid.", |
| 417 | HCOM_ERROR_CODE(HCCL_E_PARA), task.type), | 419 | HCOM_ERROR_CODE(HCCL_E_PARA), task.type), |
| @@ -11,8 +11,9 @@ | |||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | -#include "runtime/rt.h" | 14 | +#include "rt_external.h" |
| 15 | 15 | ||
| 16 | + | ||
| 16 | 17 | ||
| 17 | 18 | ||
| 18 | enum class HcclRtMemcpyKind { | 19 | enum class HcclRtMemcpyKind { |
| @@ -59,7 +60,4 @@ HcclResult hrtEventDestroy(aclrtEvent event); | |||
| 59 | 60 | ||
| 60 | HcclResult hrtStreamCreateWithFlags(aclrtStream *stream, int32_t priority, uint32_t flags); | 61 | HcclResult hrtStreamCreateWithFlags(aclrtStream *stream, int32_t priority, uint32_t flags); |
| 61 | 62 | ||
| 62 | -extern rtError_t rtMemcpyAsync(void *dst, uint64_t dest_max, const void *src, uint64_t count, rtMemcpyKind_t kind, | ||
| 63 | - rtStream_t stream); | ||
| 64 | - | ||
| 65 | 63 | ||
| @@ -28,6 +28,8 @@ | |||
| 28 | 28 | ||
| 29 | 29 | ||
| 30 | 30 | ||
| 31 | + | ||
| 32 | + | ||
| 31 | 33 | ||
| 32 | 34 | ||
| 33 | 35 | ||
| @@ -1246,7 +1248,7 @@ HcclResult HcomOpsKernelBuilder::GenerateTaskDef(const ge::Node &node, HCCL_KERN | |||
| 1246 | HCCL_ERROR("[Generate][Task]node[%s]: kernelDefHccl is null.", node.GetOpDesc()->GetName().c_str()), | 1248 | HCCL_ERROR("[Generate][Task]node[%s]: kernelDefHccl is null.", node.GetOpDesc()->GetName().c_str()), |
| 1247 | HCCL_E_PTR); | 1249 | HCCL_E_PTR); |
| 1248 | 1250 | ||
| 1249 | - taskDef.set_type(RT_MODEL_TASK_HCCL); | 1251 | + taskDef.set_type(ACL_RT_MODEL_TASK_HCCL); |
| 1250 | taskDef.set_stream_id(node.GetOpDesc()->GetStreamId()); | 1252 | taskDef.set_stream_id(node.GetOpDesc()->GetStreamId()); |
| 1251 | 1253 | ||
| 1252 | kernelDefHccl->set_hccl_type(node.GetOpDesc()->GetType()); | 1254 | kernelDefHccl->set_hccl_type(node.GetOpDesc()->GetType()); |
| @@ -28,6 +28,8 @@ | |||
| 28 | 28 | ||
| 29 | 29 | ||
| 30 | 30 | ||
| 31 | + | ||
| 32 | + | ||
| 31 | 33 | ||
| 32 | 34 | ||
| 33 | 35 | ||
| @@ -3193,7 +3195,7 @@ ge::Status HcomOpsKernelInfoStore::LoadTask(ge::GETaskInfo &task) { | |||
| 3193 | HCCL_E_PARA); | 3195 | HCCL_E_PARA); |
| 3194 | 3196 | ||
| 3195 | ge::GETaskKernelHcclInfo hcclInfo = hcclInfos[0]; // HCOM场景下只会有一个 | 3197 | ge::GETaskKernelHcclInfo hcclInfo = hcclInfos[0]; // HCOM场景下只会有一个 |
| 3196 | - CHK_PRT_RET((task.type != RT_MODEL_TASK_HCCL), | 3198 | + CHK_PRT_RET((task.type != ACL_RT_MODEL_TASK_HCCL), |
| 3197 | HCCL_ERROR("[Load][Task]errNo[0x%016llx] TaskType[%u] from" | 3199 | HCCL_ERROR("[Load][Task]errNo[0x%016llx] TaskType[%u] from" |
| 3198 | "taskinfo is invalid.", | 3200 | "taskinfo is invalid.", |
| 3199 | HCOM_ERROR_CODE(HCCL_E_PARA), task.type), | 3201 | HCOM_ERROR_CODE(HCCL_E_PARA), task.type), |
| @@ -16,6 +16,7 @@ | |||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | + | ||
| 19 | 20 | ||
| 20 | HcclResult HcomExecInitialize() { | 21 | HcclResult HcomExecInitialize() { |
| 21 | HCCL_INFO("Hcom Excutor Initialize start."); | 22 | HCCL_INFO("Hcom Excutor Initialize start."); |
| @@ -142,7 +143,7 @@ HcclResult HcomExecutor::Initialize() { | |||
| 142 | } else { | 143 | } else { |
| 143 | REPORT_PREDEFINED_ERR_MSG("EI0007", std::vector<const char *>({"resource_type", "resource_info"}), | 144 | REPORT_PREDEFINED_ERR_MSG("EI0007", std::vector<const char *>({"resource_type", "resource_info"}), |
| 144 | std::vector<const char *>({"stream", "streamType: STREAM_TYPE_ONLINE"})); | 145 | std::vector<const char *>({"stream", "streamType: STREAM_TYPE_ONLINE"})); |
| 145 | - HCCL_ERROR("[Stream]Construct stream failed, errNo[0x%016llx] rtStreamCreate error", | 146 | + HCCL_ERROR("[Stream]Construct stream failed, errNo[0x%016llx] aclrtCreateStreamWithConfig error", |
| 146 | HCCL_ERROR_CODE(HCCL_E_RUNTIME)); | 147 | HCCL_ERROR_CODE(HCCL_E_RUNTIME)); |
| 147 | } | 148 | } |
| 148 | 149 | ||
| @@ -28,7 +28,7 @@ | |||
| 28 | 28 | ||
| 29 | 29 | ||
| 30 | 30 | ||
| 31 | -#include "runtime/base.h" | 31 | +#include "rt_external_base.h" |
| 32 | 32 | ||
| 33 | 33 | ||
| 34 | namespace ge { | 34 | namespace ge { |
| @@ -8,6 +8,7 @@ | |||
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | + | ||
| 11 | 12 | ||
| 12 | 13 | ||
| 13 | 14 | ||
| @@ -15,7 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | -#include "runtime/base.h" | 18 | +#include "rt_external_base.h" |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | namespace fe { | 21 | namespace fe { |
| @@ -13,7 +13,7 @@ | |||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | -#include "runtime/kernel.h" | 16 | +#include "common/ge_rts_decl.h" |
| 17 | 17 | ||
| 18 | namespace fe { | 18 | namespace fe { |
| 19 | struct L2Data { | 19 | struct L2Data { |
| @@ -16,7 +16,7 @@ | |||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | -#include "runtime/mem.h" | 19 | +#include "rt_external_mem.h" |
| 20 | 20 | ||
| 21 | using namespace ge; | 21 | using namespace ge; |
| 22 | namespace fe { | 22 | namespace fe { |
| @@ -16,7 +16,7 @@ | |||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | -#include "runtime/kernel.h" | 19 | +#include "common/ge_rts_decl.h" |
| 20 | 20 | ||
| 21 | namespace fe { | 21 | namespace fe { |
| 22 | const uint32_t L2_CTRL_REMAP_SIZE = 64; | 22 | const uint32_t L2_CTRL_REMAP_SIZE = 64; |
Mcompiler/engines/nn_engine/fusion/graph_optimizer/stream_graph_optimizer/l2_optimizer/l2_optimizer.h+1-1
| @@ -12,7 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | -#include "runtime/base.h" | 15 | +#include "rt_external_base.h" |
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | namespace fe { | 18 | namespace fe { |
| @@ -16,7 +16,7 @@ | |||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | -#include "runtime/kernel.h" | 19 | +#include "common/ge_rts_decl.h" |
| 20 | 20 | ||
| 21 | namespace fe { | 21 | namespace fe { |
| 22 | struct FusionOpSrc { | 22 | struct FusionOpSrc { |
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | -#include "runtime/rt.h" | 14 | +#include "rt_external.h" |
| 15 | 15 | ||
| 16 | namespace fe { | 16 | namespace fe { |
| 17 | /** | 17 | /** |
| @@ -9,12 +9,13 @@ | |||
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | + | ||
| 12 | 13 | ||
| 13 | 14 | ||
| 14 | 15 | ||
| 15 | 16 | ||
| 16 | 17 | ||
| 17 | -#include "runtime/mem.h" | 18 | +#include "rt_external_mem.h" |
| 18 | 19 | ||
| 19 | 20 | ||
| 20 | namespace fe { | 21 | namespace fe { |
| @@ -96,7 +97,7 @@ Status TbeKernelLaunch::AddAppendArgs(const ge::Node &node, void *all_args_buff, | |||
| 96 | 97 | ||
| 97 | bool TbeKernelLaunch::KernelLaunch(const std::string &stub_func, const uint32_t block_dim, const void *args, | 98 | bool TbeKernelLaunch::KernelLaunch(const std::string &stub_func, const uint32_t block_dim, const void *args, |
| 98 | uint32_t args_size, const rtSmDesc_t *sm_desc, domi::TaskDef &task_def) { | 99 | uint32_t args_size, const rtSmDesc_t *sm_desc, domi::TaskDef &task_def) { |
| 99 | - task_def.set_type(static_cast<uint32_t>(RT_MODEL_TASK_KERNEL)); | 100 | + task_def.set_type(static_cast<uint32_t>(ACL_RT_MODEL_TASK_KERNEL)); |
| 100 | domi::KernelDef *kernel_def = task_def.mutable_kernel(); | 101 | domi::KernelDef *kernel_def = task_def.mutable_kernel(); |
| 101 | if (kernel_def == nullptr) { | 102 | if (kernel_def == nullptr) { |
| 102 | FE_LOGE("[GenTask][KernelLaunch] kernel_def is nullptr."); | 103 | FE_LOGE("[GenTask][KernelLaunch] kernel_def is nullptr."); |
| @@ -128,7 +129,7 @@ bool TbeKernelLaunch::KernelLaunch(const std::string &stub_func, const uint32_t | |||
| 128 | 129 | ||
| 129 | bool TbeKernelLaunch::KernelLaunchWithHandle(const uint32_t block_dim, const void *args, uint32_t args_size, | 130 | bool TbeKernelLaunch::KernelLaunchWithHandle(const uint32_t block_dim, const void *args, uint32_t args_size, |
| 130 | const rtSmDesc_t *sm_desc, domi::TaskDef &task_def) { | 131 | const rtSmDesc_t *sm_desc, domi::TaskDef &task_def) { |
| 131 | - task_def.set_type(static_cast<uint32_t>(RT_MODEL_TASK_ALL_KERNEL)); | 132 | + task_def.set_type(static_cast<uint32_t>(ACL_RT_MODEL_TASK_ALL_KERNEL)); |
| 132 | domi::KernelDefWithHandle *kernel_def_with_handle = task_def.mutable_kernel_with_handle(); | 133 | domi::KernelDefWithHandle *kernel_def_with_handle = task_def.mutable_kernel_with_handle(); |
| 133 | if (kernel_def_with_handle == nullptr) { | 134 | if (kernel_def_with_handle == nullptr) { |
| 134 | FE_LOGE("[GenTask][KernelLaunchWithHandle] kernel_def_with_handle is nullptr."); | 135 | FE_LOGE("[GenTask][KernelLaunchWithHandle] kernel_def_with_handle is nullptr."); |
| @@ -19,7 +19,7 @@ | |||
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | -#include "runtime/base.h" | 22 | +#include "rt_external_base.h" |
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | namespace fe { | 25 | namespace fe { |
| @@ -9,6 +9,7 @@ | |||
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | + | ||
| 12 | 13 | ||
| 13 | 14 | ||
| 14 | 15 | ||
| @@ -849,7 +850,7 @@ Status TbeTaskBuilderAdapter::Run(domi::TaskDef &task_def) { | |||
| 849 | op_name.c_str(), op_type.c_str(), ret); | 850 | op_name.c_str(), op_type.c_str(), ret); |
| 850 | return FAILED; | 851 | return FAILED; |
| 851 | } | 852 | } |
| 852 | - if (task_def.type() == RT_MODEL_TASK_KERNEL) { | 853 | + if (task_def.type() == ACL_RT_MODEL_TASK_KERNEL) { |
| 853 | domi::KernelDef *kernel_def = task_def.mutable_kernel(); | 854 | domi::KernelDef *kernel_def = task_def.mutable_kernel(); |
| 854 | FE_CHECK_NOTNULL(kernel_def); | 855 | FE_CHECK_NOTNULL(kernel_def); |
| 855 | FE_LOGD("Node[%s, %s]:Task type[%u] append kernel.", op_type.c_str(), op_name.c_str(), task_def.type()); | 856 | FE_LOGD("Node[%s, %s]:Task type[%u] append kernel.", op_type.c_str(), op_name.c_str(), task_def.type()); |
| @@ -9,6 +9,7 @@ | |||
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | + | ||
| 12 | 13 | ||
| 13 | 14 | ||
| 14 | namespace fe { | 15 | namespace fe { |
| @@ -21,7 +22,7 @@ Status GenerateCMOBarrierTask::GenerateTask(std::vector<domi::TaskDef> &task_def | |||
| 21 | const std::vector<CmoAttr> &cmo_attrs) { | 22 | const std::vector<CmoAttr> &cmo_attrs) { |
| 22 | domi::TaskDef task_def; | 23 | domi::TaskDef task_def; |
| 23 | task_def.set_stream_id(stream_id); | 24 | task_def.set_stream_id(stream_id); |
| 24 | - task_def.set_type(RT_MODEL_TASK_BARRIER); | 25 | + task_def.set_type(ACL_RT_MODEL_TASK_BARRIER); |
| 25 | domi::CmoBarrierTaskDef *cmo_task_def = task_def.mutable_cmo_barrier_task(); | 26 | domi::CmoBarrierTaskDef *cmo_task_def = task_def.mutable_cmo_barrier_task(); |
| 26 | if (cmo_task_def == nullptr) { | 27 | if (cmo_task_def == nullptr) { |
| 27 | FE_LOGW("Create cmo task def for node[%s] failed.", node_.GetName().c_str()); | 28 | FE_LOGW("Create cmo task def for node[%s] failed.", node_.GetName().c_str()); |
| @@ -9,6 +9,7 @@ | |||
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | + | ||
| 12 | 13 | ||
| 13 | 14 | ||
| 14 | 15 | ||
| @@ -29,7 +30,7 @@ Status GenerateCMOInvalidTask::GenerateTask(std::vector<domi::TaskDef> &task_def | |||
| 29 | } | 30 | } |
| 30 | domi::TaskDef task_def; | 31 | domi::TaskDef task_def; |
| 31 | task_def.set_stream_id(stream_id); | 32 | task_def.set_stream_id(stream_id); |
| 32 | - task_def.set_type(RT_MODEL_TASK_CMO); | 33 | + task_def.set_type(ACL_RT_MODEL_TASK_CMO); |
| 33 | domi::CmoTaskDef *cmo_task_def = task_def.mutable_cmo_task(); | 34 | domi::CmoTaskDef *cmo_task_def = task_def.mutable_cmo_task(); |
| 34 | if (cmo_task_def == nullptr) { | 35 | if (cmo_task_def == nullptr) { |
| 35 | FE_LOGW("Failed to create cmo task definition for node [%s].", node_.GetName().c_str()); | 36 | FE_LOGW("Failed to create cmo task definition for node [%s].", node_.GetName().c_str()); |
| @@ -9,6 +9,7 @@ | |||
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | + | ||
| 12 | 13 | ||
| 13 | 14 | ||
| 14 | namespace fe { | 15 | namespace fe { |
| @@ -27,11 +28,11 @@ Status GenerateCMOPrefetchTask::GenerateTask(std::vector<domi::TaskDef> &task_de | |||
| 27 | } | 28 | } |
| 28 | domi::TaskDef task_def; | 29 | domi::TaskDef task_def; |
| 29 | task_def.set_stream_id(stream_id); | 30 | task_def.set_stream_id(stream_id); |
| 30 | - task_def.set_type(RT_MODEL_TASK_CMO); | 31 | + task_def.set_type(ACL_RT_MODEL_TASK_CMO); |
| 31 | - domi::CmoTaskDef *cmo_task_def = task_def.mutable_cmo_task(); | 32 | + domi::CmoTaskDef *pf_cmo_task_def = task_def.mutable_cmo_task(); |
| 32 | - FE_CHECK(cmo_task_def == nullptr, FE_LOGW("Failed to create cmo task definition for node [%s].", node_.GetName().c_str()), | 33 | + FE_CHECK(pf_cmo_task_def == nullptr, FE_LOGW("Failed to create cmo task definition for node [%s].", |
| 33 | - return FAILED); | 34 | + node_.GetName().c_str()), return FAILED); |
| 34 | - cmo_task_def->set_cmo_type(static_cast<uint32_t>(rtCMOType::rtCMOPrefetch)); | 35 | + pf_cmo_task_def->set_cmo_type(static_cast<uint32_t>(rtCMOType::rtCMOPrefetch)); |
| 35 | ge::DataType data_type = ge::DT_UNDEFINED; | 36 | ge::DataType data_type = ge::DT_UNDEFINED; |
| 36 | uint32_t length_inner = 0; | 37 | uint32_t length_inner = 0; |
| 37 | uint64_t source_addr; | 38 | uint64_t source_addr; |
| @@ -47,7 +48,7 @@ Status GenerateCMOPrefetchTask::GenerateTask(std::vector<domi::TaskDef> &task_de | |||
| 47 | return FAILED; | 48 | return FAILED; |
| 48 | } | 49 | } |
| 49 | FE_LOGD("Generate prefetch cmo task id[%u] for node[%s] success.", cmo_id, node_.GetName().c_str()); | 50 | FE_LOGD("Generate prefetch cmo task id[%u] for node[%s] success.", cmo_id, node_.GetName().c_str()); |
| 50 | - cmo_task_def->set_logic_id(cmo_id); | 51 | + pf_cmo_task_def->set_logic_id(cmo_id); |
| 51 | // low 4bit: cmo type; high 4bit: data type | 52 | // low 4bit: cmo type; high 4bit: data type |
| 52 | // prefetch: 0x6 | 53 | // prefetch: 0x6 |
| 53 | uint8_t op_code = 0x6; | 54 | uint8_t op_code = 0x6; |
| @@ -56,16 +57,16 @@ Status GenerateCMOPrefetchTask::GenerateTask(std::vector<domi::TaskDef> &task_de | |||
| 56 | } else { | 57 | } else { |
| 57 | op_code += (DATA_TYPE_CODE.at(data_type) << 4); | 58 | op_code += (DATA_TYPE_CODE.at(data_type) << 4); |
| 58 | } | 59 | } |
| 59 | - cmo_task_def->set_op_code(op_code); | 60 | + pf_cmo_task_def->set_op_code(op_code); |
| 60 | - cmo_task_def->set_qos(0); | 61 | + pf_cmo_task_def->set_qos(0); |
| 61 | - cmo_task_def->set_part_id(0); | 62 | + pf_cmo_task_def->set_part_id(0); |
| 62 | - cmo_task_def->set_pmg(0); | 63 | + pf_cmo_task_def->set_pmg(0); |
| 63 | - cmo_task_def->set_num_inner(1); | 64 | + pf_cmo_task_def->set_num_inner(1); |
| 64 | - cmo_task_def->set_num_outer(1); | 65 | + pf_cmo_task_def->set_num_outer(1); |
| 65 | - cmo_task_def->set_length_inner(length_inner); | 66 | + pf_cmo_task_def->set_length_inner(length_inner); |
| 66 | - cmo_task_def->set_source_addr(source_addr); | 67 | + pf_cmo_task_def->set_source_addr(source_addr); |
| 67 | - cmo_task_def->set_strider_outer(0); | 68 | + pf_cmo_task_def->set_strider_outer(0); |
| 68 | - cmo_task_def->set_strider_inner(0); | 69 | + pf_cmo_task_def->set_strider_inner(0); |
| 69 | 70 | ||
| 70 | task_defs.push_back(task_def); | 71 | task_defs.push_back(task_def); |
| 71 | } | 72 | } |
| @@ -17,7 +17,7 @@ | |||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | -#include "runtime/rt_model.h" | 20 | +#include "rt_external_model.h" |
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | namespace fe { | 23 | namespace fe { |
| @@ -9,6 +9,7 @@ | |||
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | + | ||
| 12 | 13 | ||
| 13 | 14 | ||
| 14 | namespace fe { | 15 | namespace fe { |
| @@ -27,20 +28,20 @@ Status GenerateCMOWritebackTask::GenerateTask(std::vector<domi::TaskDef> &task_d | |||
| 27 | } | 28 | } |
| 28 | domi::TaskDef task_def; | 29 | domi::TaskDef task_def; |
| 29 | task_def.set_stream_id(stream_id); | 30 | task_def.set_stream_id(stream_id); |
| 30 | - task_def.set_type(RT_MODEL_TASK_CMO); | 31 | + task_def.set_type(ACL_RT_MODEL_TASK_CMO); |
| 31 | - domi::CmoTaskDef *cmo_task_def = task_def.mutable_cmo_task(); | 32 | + domi::CmoTaskDef *wb_cmo_task_def = task_def.mutable_cmo_task(); |
| 32 | - if (cmo_task_def == nullptr) { | 33 | + if (wb_cmo_task_def == nullptr) { |
| 33 | FE_LOGW("Failed to create cmo task definition for node [%s].", node_.GetName().c_str()); | 34 | FE_LOGW("Failed to create cmo task definition for node [%s].", node_.GetName().c_str()); |
| 34 | return FAILED; | 35 | return FAILED; |
| 35 | } | 36 | } |
| 36 | - cmo_task_def->set_cmo_type(static_cast<uint32_t>(rtCMOType::rtCMOWriteBack)); | 37 | + wb_cmo_task_def->set_cmo_type(static_cast<uint32_t>(rtCMOType::rtCMOWriteBack)); |
| 37 | // gen cmo id | 38 | // gen cmo id |
| 38 | uint32_t cmo_id = static_cast<uint32_t>(CMOIdGenStrategy::Instance().GenerateCMOId(node_)); | 39 | uint32_t cmo_id = static_cast<uint32_t>(CMOIdGenStrategy::Instance().GenerateCMOId(node_)); |
| 39 | if (cmo_id == 0) { | 40 | if (cmo_id == 0) { |
| 40 | FE_LOGW("Failed to generate cmo id for node [%s], will not launch cmo task.", node_.GetName().c_str()); | 41 | FE_LOGW("Failed to generate cmo id for node [%s], will not launch cmo task.", node_.GetName().c_str()); |
| 41 | return FAILED; | 42 | return FAILED; |
| 42 | } | 43 | } |
| 43 | - cmo_task_def->set_logic_id(cmo_id); | 44 | + wb_cmo_task_def->set_logic_id(cmo_id); |
| 44 | ge::DataType data_type = ge::DT_UNDEFINED; | 45 | ge::DataType data_type = ge::DT_UNDEFINED; |
| 45 | uint32_t length_inner = 0; | 46 | uint32_t length_inner = 0; |
| 46 | uint64_t source_addr; | 47 | uint64_t source_addr; |
| @@ -59,16 +60,16 @@ Status GenerateCMOWritebackTask::GenerateTask(std::vector<domi::TaskDef> &task_d | |||
| 59 | } else { | 60 | } else { |
| 60 | op_code += (DATA_TYPE_CODE.at(data_type) << 4); | 61 | op_code += (DATA_TYPE_CODE.at(data_type) << 4); |
| 61 | } | 62 | } |
| 62 | - cmo_task_def->set_op_code(static_cast<uint32_t>(op_code)); | 63 | + wb_cmo_task_def->set_op_code(static_cast<uint32_t>(op_code)); |
| 63 | - cmo_task_def->set_qos(0); | 64 | + wb_cmo_task_def->set_qos(0); |
| 64 | - cmo_task_def->set_part_id(0); | 65 | + wb_cmo_task_def->set_part_id(0); |
| 65 | - cmo_task_def->set_pmg(0); | 66 | + wb_cmo_task_def->set_pmg(0); |
| 66 | - cmo_task_def->set_num_inner(1); | 67 | + wb_cmo_task_def->set_num_inner(1); |
| 67 | - cmo_task_def->set_num_outer(1); | 68 | + wb_cmo_task_def->set_num_outer(1); |
| 68 | - cmo_task_def->set_length_inner(length_inner); | 69 | + wb_cmo_task_def->set_length_inner(length_inner); |
| 69 | - cmo_task_def->set_source_addr(source_addr); | 70 | + wb_cmo_task_def->set_source_addr(source_addr); |
| 70 | - cmo_task_def->set_strider_outer(0); | 71 | + wb_cmo_task_def->set_strider_outer(0); |
| 71 | - cmo_task_def->set_strider_inner(0); | 72 | + wb_cmo_task_def->set_strider_inner(0); |
| 72 | 73 | ||
| 73 | task_defs.push_back(task_def); | 74 | task_defs.push_back(task_def); |
| 74 | } | 75 | } |
| @@ -9,6 +9,7 @@ | |||
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | + | ||
| 12 | 13 | ||
| 13 | 14 | ||
| 14 | 15 | ||
| @@ -27,8 +28,8 @@ | |||
| 27 | 28 | ||
| 28 | 29 | ||
| 29 | 30 | ||
| 30 | -#include "runtime/rt_model.h" | 31 | +#include "rt_external_model.h" |
| 31 | -#include "runtime/mem.h" | 32 | +#include "rt_external_mem.h" |
| 32 | 33 | ||
| 33 | 34 | ||
| 34 | namespace fe { | 35 | namespace fe { |
| @@ -88,7 +89,7 @@ Status DsaTaskBuilder::GenerateTask(const ge::Node &node, const ge::RunContext & | |||
| 88 | context_.dataMemBase = context.dataMemBase; | 89 | context_.dataMemBase = context.dataMemBase; |
| 89 | 90 | ||
| 90 | domi::TaskDef task_def; | 91 | domi::TaskDef task_def; |
| 91 | - task_def.set_type(RT_MODEL_TASK_DSA_TASK); | 92 | + task_def.set_type(ACL_RT_MODEL_TASK_DSA_TASK); |
| 92 | auto dsa_task_def = task_def.mutable_dsa_task(); | 93 | auto dsa_task_def = task_def.mutable_dsa_task(); |
| 93 | FE_CHECK_NOTNULL(dsa_task_def); | 94 | FE_CHECK_NOTNULL(dsa_task_def); |
| 94 | dsa_task_def->set_op_index(opDesc->GetId()); | 95 | dsa_task_def->set_op_index(opDesc->GetId()); |
| @@ -9,6 +9,8 @@ | |||
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | + | ||
| 13 | + | ||
| 12 | 14 | ||
| 13 | 15 | ||
| 14 | namespace fe { | 16 | namespace fe { |
| @@ -70,13 +72,13 @@ ge::Status GetWorkspacePattern(const ge::Node &node, std::string &super_kernel_a | |||
| 70 | 72 | ||
| 71 | ge::Status GetArgFormatV2(domi::TaskDef &task_temp, std::string &args_format) { | 73 | ge::Status GetArgFormatV2(domi::TaskDef &task_temp, std::string &args_format) { |
| 72 | args_format = ""; | 74 | args_format = ""; |
| 73 | - if (task_temp.type() == RT_MODEL_TASK_KERNEL || (task_temp.type() == RT_MODEL_TASK_PREPROCESS_KERNEL)) { | 75 | + if (task_temp.type() == ACL_RT_MODEL_TASK_KERNEL || (task_temp.type() == ACL_RT_MODEL_TASK_PREPROCESS_KERNEL)) { |
| 74 | auto kernel_def = task_temp.mutable_kernel(); | 76 | auto kernel_def = task_temp.mutable_kernel(); |
| 75 | FE_CHECK_NOTNULL(kernel_def); | 77 | FE_CHECK_NOTNULL(kernel_def); |
| 76 | auto kernel_context = kernel_def->mutable_context(); | 78 | auto kernel_context = kernel_def->mutable_context(); |
| 77 | FE_CHECK_NOTNULL(kernel_context); | 79 | FE_CHECK_NOTNULL(kernel_context); |
| 78 | args_format = kernel_context->args_format(); | 80 | args_format = kernel_context->args_format(); |
| 79 | - } else if(task_temp.type() == RT_MODEL_TASK_ALL_KERNEL) { | 81 | + } else if(task_temp.type() == ACL_RT_MODEL_TASK_ALL_KERNEL) { |
| 80 | auto kernel_def_with_handle = task_temp.mutable_kernel_with_handle(); | 82 | auto kernel_def_with_handle = task_temp.mutable_kernel_with_handle(); |
| 81 | FE_CHECK_NOTNULL(kernel_def_with_handle); | 83 | FE_CHECK_NOTNULL(kernel_def_with_handle); |
| 82 | auto kernel_context_with_handle = kernel_def_with_handle->mutable_context(); | 84 | auto kernel_context_with_handle = kernel_def_with_handle->mutable_context(); |
| @@ -122,7 +124,7 @@ bool IsAICpuKernelType(ge::ccKernelType kernel_type) { | |||
| 122 | 124 | ||
| 123 | bool KernelLaunch(const std::string &stub_func, const uint32_t block_dim, const void *args, | 125 | bool KernelLaunch(const std::string &stub_func, const uint32_t block_dim, const void *args, |
| 124 | uint32_t args_size, const rtSmDesc_t *sm_desc, domi::TaskDef &task_def) { | 126 | uint32_t args_size, const rtSmDesc_t *sm_desc, domi::TaskDef &task_def) { |
| 125 | - task_def.set_type(static_cast<uint32_t>(RT_MODEL_TASK_KERNEL)); | 127 | + task_def.set_type(static_cast<uint32_t>(ACL_RT_MODEL_TASK_KERNEL)); |
| 126 | domi::KernelDef *kernel_def = task_def.mutable_kernel(); | 128 | domi::KernelDef *kernel_def = task_def.mutable_kernel(); |
| 127 | if (kernel_def == nullptr) { | 129 | if (kernel_def == nullptr) { |
| 128 | FE_LOGE("[GenTask][KernelLaunch] kernel_def is nullptr."); | 130 | FE_LOGE("[GenTask][KernelLaunch] kernel_def is nullptr."); |
| @@ -177,21 +179,21 @@ ge::Status SetArgFormatValue(uint32_t args_size_workspace, std::vector<std::vect | |||
| 177 | continue; | 179 | continue; |
| 178 | } | 180 | } |
| 179 | uint32_t args_size = 0; | 181 | uint32_t args_size = 0; |
| 180 | - if (single_task.type() == static_cast<uint32_t>(RT_MODEL_TASK_KERNEL)) { | 182 | + if (single_task.type() == static_cast<uint32_t>(ACL_RT_MODEL_TASK_KERNEL)) { |
| 181 | kernel_def_tmp = single_task.mutable_kernel(); | 183 | kernel_def_tmp = single_task.mutable_kernel(); |
| 182 | FE_CHECK_NOTNULL(kernel_def_tmp); | 184 | FE_CHECK_NOTNULL(kernel_def_tmp); |
| 183 | args_size = kernel_def_tmp->args_size(); | 185 | args_size = kernel_def_tmp->args_size(); |
| 184 | - FE_LOGI( "task_arg.type is RT_MODEL_TASK_KERNEL args_size: %d %d", args_size, __LINE__); | 186 | + FE_LOGI( "task_arg.type is ACL_RT_MODEL_TASK_KERNEL args_size: %d %d", args_size, __LINE__); |
| 185 | } else { | 187 | } else { |
| 186 | FE_LOGW( "The Task type [%u] is invalid.", single_task.type()); | 188 | FE_LOGW( "The Task type [%u] is invalid.", single_task.type()); |
| 187 | // notify wait task | 189 | // notify wait task |
| 188 | continue; | 190 | continue; |
| 189 | } | 191 | } |
| 190 | - FE_LOGI( "RT_MODEL_TASK_KERNEL sec_ret %d", __LINE__); | 192 | + FE_LOGI( "ACL_RT_MODEL_TASK_KERNEL sec_ret %d", __LINE__); |
| 191 | uint8_t sec_ret = 1; | 193 | uint8_t sec_ret = 1; |
| 192 | - FE_LOGI( "RT_MODEL_TASK_KERNEL BEGIN MEMCPY"); | 194 | + FE_LOGI( "ACL_RT_MODEL_TASK_KERNEL BEGIN MEMCPY"); |
| 193 | if (args_size_total == 0) { | 195 | if (args_size_total == 0) { |
| 194 | - FE_LOGI( "Skip the RT_MODEL_TASK_KERNEL memcpy procedure for args_size_total is 0."); | 196 | + FE_LOGI( "Skip the ACL_RT_MODEL_TASK_KERNEL memcpy procedure for args_size_total is 0."); |
| 195 | continue; | 197 | continue; |
| 196 | } | 198 | } |
| 197 | sec_ret = memcpy_s((uint8_t*)all_args_buff_total + args_size_cur, static_cast<size_t>(args_size_total), | 199 | sec_ret = memcpy_s((uint8_t*)all_args_buff_total + args_size_cur, static_cast<size_t>(args_size_total), |
| @@ -200,7 +202,7 @@ ge::Status SetArgFormatValue(uint32_t args_size_workspace, std::vector<std::vect | |||
| 200 | FE_LOGE( "memcpy_s is fail"); | 202 | FE_LOGE( "memcpy_s is fail"); |
| 201 | return FAILED; | 203 | return FAILED; |
| 202 | } | 204 | } |
| 203 | - FE_LOGI( "RT_MODEL_TASK_KERNEL AFTER MEMCPY"); | 205 | + FE_LOGI( "ACL_RT_MODEL_TASK_KERNEL AFTER MEMCPY"); |
| 204 | args_size_cur += args_size; | 206 | args_size_cur += args_size; |
| 205 | args_size_total -= args_size; | 207 | args_size_total -= args_size; |
| 206 | std::vector<uint32_t> sk_send_event_ids; | 208 | std::vector<uint32_t> sk_send_event_ids; |
| @@ -243,7 +245,7 @@ ge::Status FillTaskDefAfterGenTask(const ge::OpDescPtr &op_desc, domi::TaskDef & | |||
| 243 | (void)ge::AttrUtils::GetInt(op_desc, "_soft_sync_schedule_mode", schedule_mode); | 245 | (void)ge::AttrUtils::GetInt(op_desc, "_soft_sync_schedule_mode", schedule_mode); |
| 244 | FE_LOGD("FillTaskDefAfterGenTask", "Set schedule mode[%u] on task of op[%s, %s]. ", schedule_mode, op_desc->GetNamePtr(), op_desc->GetTypePtr()); | 246 | FE_LOGD("FillTaskDefAfterGenTask", "Set schedule mode[%u] on task of op[%s, %s]. ", schedule_mode, op_desc->GetNamePtr(), op_desc->GetTypePtr()); |
| 245 | domi::KernelContext *kernel_context = nullptr; | 247 | domi::KernelContext *kernel_context = nullptr; |
| 246 | - if (task_def.type() == RT_MODEL_TASK_KERNEL) { | 248 | + if (task_def.type() == ACL_RT_MODEL_TASK_KERNEL) { |
| 247 | domi::KernelDef *kernel_def = task_def.mutable_kernel(); | 249 | domi::KernelDef *kernel_def = task_def.mutable_kernel(); |
| 248 | FE_CHECK_NOTNULL(kernel_def); | 250 | FE_CHECK_NOTNULL(kernel_def); |
| 249 | kernel_def->set_kernel_name(attr_val_kernel_name); | 251 | kernel_def->set_kernel_name(attr_val_kernel_name); |
| @@ -296,7 +298,7 @@ int64_t GetSuperKernelWorkspace(const ge::Node &node) { | |||
| 296 | } | 298 | } |
| 297 | 299 | ||
| 298 | bool IsAICpuTaskDef(domi::TaskDef &task_temp, domi::KernelContext *&kernel_context) { | 300 | bool IsAICpuTaskDef(domi::TaskDef &task_temp, domi::KernelContext *&kernel_context) { |
| 299 | - if (task_temp.type() == RT_MODEL_TASK_PREPROCESS_KERNEL) { | 301 | + if (task_temp.type() == ACL_RT_MODEL_TASK_PREPROCESS_KERNEL) { |
| 300 | auto kernel_def = task_temp.mutable_kernel(); | 302 | auto kernel_def = task_temp.mutable_kernel(); |
| 301 | FE_CHECK(kernel_def == nullptr, FE_LOGW("IsAICpuTaskDef kernel_def is null pointer!"), return false); | 303 | FE_CHECK(kernel_def == nullptr, FE_LOGW("IsAICpuTaskDef kernel_def is null pointer!"), return false); |
| 302 | kernel_context = kernel_def->mutable_context(); | 304 | kernel_context = kernel_def->mutable_context(); |
| @@ -343,16 +345,16 @@ ge::Status GetArgFormat(const std::vector<ge::Node *> &sub_nodes, uint32_t &args | |||
| 343 | tasks.emplace_back(single_task); | 345 | tasks.emplace_back(single_task); |
| 344 | } else { | 346 | } else { |
| 345 | uint32_t args_size; | 347 | uint32_t args_size; |
| 346 | - if (single_task.type() == static_cast<uint32_t>(RT_MODEL_TASK_KERNEL)) { | 348 | + if (single_task.type() == static_cast<uint32_t>(ACL_RT_MODEL_TASK_KERNEL)) { |
| 347 | kernel_def_tmp = single_task.mutable_kernel(); | 349 | kernel_def_tmp = single_task.mutable_kernel(); |
| 348 | FE_CHECK_NOTNULL(kernel_def_tmp); | 350 | FE_CHECK_NOTNULL(kernel_def_tmp); |
| 349 | args_size = kernel_def_tmp->args_size(); | 351 | args_size = kernel_def_tmp->args_size(); |
| 350 | - FE_LOGI( "task_arg.type is RT_MODEL_TASK_KERNEL args_size: %d %d", args_size, __LINE__); | 352 | + FE_LOGI( "task_arg.type is ACL_RT_MODEL_TASK_KERNEL args_size: %d %d", args_size, __LINE__); |
| 351 | - } else if (single_task.type() == static_cast<uint32_t>(RT_MODEL_TASK_ALL_KERNEL)) { | 353 | + } else if (single_task.type() == static_cast<uint32_t>(ACL_RT_MODEL_TASK_ALL_KERNEL)) { |
| 352 | auto kernel_def_with_handle = single_task.mutable_kernel_with_handle(); | 354 | auto kernel_def_with_handle = single_task.mutable_kernel_with_handle(); |
| 353 | FE_CHECK_NOTNULL(kernel_def_with_handle); | 355 | FE_CHECK_NOTNULL(kernel_def_with_handle); |
| 354 | args_size = kernel_def_with_handle->args_size(); | 356 | args_size = kernel_def_with_handle->args_size(); |
| 355 | - FE_LOGI( "task_arg.type is RT_MODEL_TASK_ALL_KERNEL args_size: %d %d", args_size, __LINE__); | 357 | + FE_LOGI( "task_arg.type is ACL_RT_MODEL_TASK_ALL_KERNEL args_size: %d %d", args_size, __LINE__); |
| 356 | } else { | 358 | } else { |
| 357 | FE_LOGE( "The task type[%u] is invalid.", single_task.type()); | 359 | FE_LOGE( "The task type[%u] is invalid.", single_task.type()); |
| 358 | continue; | 360 | continue; |
| @@ -494,7 +496,7 @@ ge::Status GenTaskForSuperKernel(const ge::Node &node, std::vector<std::vector<d | |||
| 494 | return ge::FAILED; | 496 | return ge::FAILED; |
| 495 | } | 497 | } |
| 496 | FE_LOGI("GenTaskForSuperKernel fill super kernel task def finished"); | 498 | FE_LOGI("GenTaskForSuperKernel fill super kernel task def finished"); |
| 497 | - superkernel_task_def.set_type(RT_MODEL_TASK_SUPER_KERNEL); | 499 | + superkernel_task_def.set_type(ACL_RT_MODEL_TASK_SUPER_KERNEL); |
| 498 | tasks.emplace_back(superkernel_task_def); | 500 | tasks.emplace_back(superkernel_task_def); |
| 499 | FE_LOGI("set superkernel type success."); | 501 | FE_LOGI("set superkernel type success."); |
| 500 | free(all_args_buff_total); | 502 | free(all_args_buff_total); |
Mcompiler/engines/nn_engine/optimizer/ops_kernel_builder/task_builder/superkernel_task_builder.cc+7-6
| @@ -9,6 +9,7 @@ | |||
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | + | ||
| 12 | 13 | ||
| 13 | 14 | ||
| 14 | 15 | ||
| @@ -26,7 +27,7 @@ | |||
| 26 | 27 | ||
| 27 | 28 | ||
| 28 | 29 | ||
| 29 | -#include "runtime/stream.h" | 30 | +#include "rt_external_stream.h" |
| 30 | 31 | ||
| 31 | 32 | ||
| 32 | 33 | ||
| @@ -207,14 +208,14 @@ Status SuperkernelTaskBuilder::SetTaskArgsAttr(const ge::NodePtr &node, TaskBuil | |||
| 207 | } | 208 | } |
| 208 | // set args attr | 209 | // set args attr |
| 209 | vector<int64_t> task_args_vec; | 210 | vector<int64_t> task_args_vec; |
| 210 | - if (task_def.type() == static_cast<uint32_t>(RT_MODEL_TASK_ALL_KERNEL)) { | 211 | + if (task_def.type() == static_cast<uint32_t>(ACL_RT_MODEL_TASK_ALL_KERNEL)) { |
| 211 | domi::KernelDefWithHandle *kernel_def_with_handle = task_def.mutable_kernel_with_handle(); | 212 | domi::KernelDefWithHandle *kernel_def_with_handle = task_def.mutable_kernel_with_handle(); |
| 212 | FE_CHECK_NOTNULL(kernel_def_with_handle); | 213 | FE_CHECK_NOTNULL(kernel_def_with_handle); |
| 213 | uint32_t args_size = kernel_def_with_handle->args_size(); | 214 | uint32_t args_size = kernel_def_with_handle->args_size(); |
| 214 | const void *args = reinterpret_cast<const void*>(kernel_def_with_handle->args().data()); | 215 | const void *args = reinterpret_cast<const void*>(kernel_def_with_handle->args().data()); |
| 215 | FE_CHECK_NOTNULL(args); | 216 | FE_CHECK_NOTNULL(args); |
| 216 | ConvertArgsToVec(args, args_size, task_args_vec); | 217 | ConvertArgsToVec(args, args_size, task_args_vec); |
| 217 | - } else if (task_def.type() == static_cast<uint32_t>(RT_MODEL_TASK_KERNEL)) { | 218 | + } else if (task_def.type() == static_cast<uint32_t>(ACL_RT_MODEL_TASK_KERNEL)) { |
| 218 | domi::KernelDef *kernel_def = task_def.mutable_kernel(); | 219 | domi::KernelDef *kernel_def = task_def.mutable_kernel(); |
| 219 | FE_CHECK_NOTNULL(kernel_def); | 220 | FE_CHECK_NOTNULL(kernel_def); |
| 220 | uint32_t args_size = kernel_def->args_size(); | 221 | uint32_t args_size = kernel_def->args_size(); |
| @@ -445,11 +446,11 @@ Status GetArgFormat(std::vector<domi::TaskDef> &tasks, std::string &args_format) | |||
| 445 | args_format = ""; | 446 | args_format = ""; |
| 446 | for (auto &task_temp : tasks) { | 447 | for (auto &task_temp : tasks) { |
| 447 | domi::KernelContext *kernel_context = nullptr; | 448 | domi::KernelContext *kernel_context = nullptr; |
| 448 | - if (task_temp.type() == RT_MODEL_TASK_KERNEL) { | 449 | + if (task_temp.type() == ACL_RT_MODEL_TASK_KERNEL) { |
| 449 | auto kernel_def = task_temp.mutable_kernel(); | 450 | auto kernel_def = task_temp.mutable_kernel(); |
| 450 | FE_CHECK_NOTNULL(kernel_def); | 451 | FE_CHECK_NOTNULL(kernel_def); |
| 451 | kernel_context = kernel_def->mutable_context(); | 452 | kernel_context = kernel_def->mutable_context(); |
| 452 | - } else if (task_temp.type() == RT_MODEL_TASK_ALL_KERNEL) { | 453 | + } else if (task_temp.type() == ACL_RT_MODEL_TASK_ALL_KERNEL) { |
| 453 | auto kernel_with_handle = task_temp.mutable_kernel_with_handle(); | 454 | auto kernel_with_handle = task_temp.mutable_kernel_with_handle(); |
| 454 | FE_CHECK_NOTNULL(kernel_with_handle); | 455 | FE_CHECK_NOTNULL(kernel_with_handle); |
| 455 | kernel_context = kernel_with_handle->mutable_context(); | 456 | kernel_context = kernel_with_handle->mutable_context(); |
| @@ -504,7 +505,7 @@ Status GenerateSubKernelExtTask(const ge::Node &node, ge::RunContext &context, s | |||
| 504 | bool IsTilingSinkTask(std::vector<domi::TaskDef> &sub_tasks, const std::string &sub_arg_format) { | 505 | bool IsTilingSinkTask(std::vector<domi::TaskDef> &sub_tasks, const std::string &sub_arg_format) { |
| 505 | bool has_tiling_task = false; | 506 | bool has_tiling_task = false; |
| 506 | for (auto &sub_task : sub_tasks) { | 507 | for (auto &sub_task : sub_tasks) { |
| 507 | - if (sub_task.type() == RT_MODEL_TASK_PREPROCESS_KERNEL) { | 508 | + if (sub_task.type() == ACL_RT_MODEL_TASK_PREPROCESS_KERNEL) { |
| 508 | has_tiling_task = true; | 509 | has_tiling_task = true; |
| 509 | break; | 510 | break; |
| 510 | } | 511 | } |
| @@ -9,6 +9,7 @@ | |||
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | + | ||
| 12 | 13 | ||
| 13 | 14 | ||
| 14 | 15 | ||
| @@ -27,9 +28,9 @@ | |||
| 27 | 28 | ||
| 28 | 29 | ||
| 29 | 30 | ||
| 30 | -#include "runtime/rt_model.h" | 31 | +#include "rt_external_model.h" |
| 31 | -#include "runtime/mem.h" | 32 | +#include "rt_external_mem.h" |
| 32 | -#include "runtime/stream.h" | 33 | +#include "rt_external_stream.h" |
| 33 | 34 | ||
| 34 | namespace fe { | 35 | namespace fe { |
| 35 | namespace { | 36 | namespace { |
| @@ -79,8 +80,8 @@ MixTaskPara CalcMixTaskParaByType(string &core_type, int64_t block_dim, int64_t | |||
| 79 | Status UpdateMixAiCoreTask(MixTaskPara ¶, domi::TaskDef& main_task, domi::TaskDef& sub_task) { | 80 | Status UpdateMixAiCoreTask(MixTaskPara ¶, domi::TaskDef& main_task, domi::TaskDef& sub_task) { |
| 80 | domi::KernelContext *main_kernel_context = nullptr; | 81 | domi::KernelContext *main_kernel_context = nullptr; |
| 81 | domi::KernelContext *sub_kernel_context = nullptr; | 82 | domi::KernelContext *sub_kernel_context = nullptr; |
| 82 | - if (main_task.type() == RT_MODEL_TASK_KERNEL) { | 83 | + if (main_task.type() == ACL_RT_MODEL_TASK_KERNEL) { |
| 83 | - sub_task.set_type(RT_MODEL_TASK_VECTOR_KERNEL); | 84 | + sub_task.set_type(ACL_RT_MODEL_TASK_VECTOR_KERNEL); |
| 84 | domi::KernelDef *main_kernel_def = main_task.mutable_kernel(); | 85 | domi::KernelDef *main_kernel_def = main_task.mutable_kernel(); |
| 85 | FE_CHECK_NOTNULL(main_kernel_def); | 86 | FE_CHECK_NOTNULL(main_kernel_def); |
| 86 | main_kernel_context = main_kernel_def->mutable_context(); | 87 | main_kernel_context = main_kernel_def->mutable_context(); |
| @@ -95,7 +96,7 @@ Status UpdateMixAiCoreTask(MixTaskPara ¶, domi::TaskDef& main_task, domi::Ta | |||
| 95 | domi::KernelDefWithHandle *main_kernel_def = main_task.mutable_kernel_with_handle(); | 96 | domi::KernelDefWithHandle *main_kernel_def = main_task.mutable_kernel_with_handle(); |
| 96 | FE_CHECK_NOTNULL(main_kernel_def); | 97 | FE_CHECK_NOTNULL(main_kernel_def); |
| 97 | main_kernel_context = main_kernel_def->mutable_context(); | 98 | main_kernel_context = main_kernel_def->mutable_context(); |
| 98 | - sub_task.set_type(RT_MODEL_TASK_VECTOR_ALL_KERNEL); | 99 | + sub_task.set_type(ACL_RT_MODEL_TASK_VECTOR_ALL_KERNEL); |
| 99 | domi::KernelDefWithHandle *sub_kernel_def = sub_task.mutable_kernel_with_handle(); | 100 | domi::KernelDefWithHandle *sub_kernel_def = sub_task.mutable_kernel_with_handle(); |
| 100 | FE_CHECK_NOTNULL(sub_kernel_def); | 101 | FE_CHECK_NOTNULL(sub_kernel_def); |
| 101 | sub_kernel_context = sub_kernel_def->mutable_context(); | 102 | sub_kernel_context = sub_kernel_def->mutable_context(); |
| @@ -135,22 +136,22 @@ Status FillMixExtraTask(const ge::Node &node, string &core_type, MixTaskPara &pa | |||
| 135 | domi::TaskDef sub_wait; | 136 | domi::TaskDef sub_wait; |
| 136 | sub_wait.set_notify_id(notify_id_v[0]); | 137 | sub_wait.set_notify_id(notify_id_v[0]); |
| 137 | sub_wait.set_stream_id(sub_stream_id); | 138 | sub_wait.set_stream_id(sub_stream_id); |
| 138 | - sub_wait.set_type(RT_MODEL_TASK_NOTIFY_WAIT); | 139 | + sub_wait.set_type(ACL_RT_MODEL_TASK_NOTIFY_WAIT); |
| 139 | 140 | ||
| 140 | domi::TaskDef main_record; | 141 | domi::TaskDef main_record; |
| 141 | main_record.set_notify_id(notify_id_v[0]); | 142 | main_record.set_notify_id(notify_id_v[0]); |
| 142 | main_record.set_stream_id(main_stream_id); | 143 | main_record.set_stream_id(main_stream_id); |
| 143 | - main_record.set_type(RT_MODEL_TASK_NOTIFY_RECORD); | 144 | + main_record.set_type(ACL_RT_MODEL_TASK_NOTIFY_RECORD); |
| 144 | 145 | ||
| 145 | domi::TaskDef sub_record; | 146 | domi::TaskDef sub_record; |
| 146 | sub_record.set_notify_id(notify_id_v[1]); | 147 | sub_record.set_notify_id(notify_id_v[1]); |
| 147 | sub_record.set_stream_id(sub_stream_id); | 148 | sub_record.set_stream_id(sub_stream_id); |
| 148 | - sub_record.set_type(RT_MODEL_TASK_NOTIFY_RECORD); | 149 | + sub_record.set_type(ACL_RT_MODEL_TASK_NOTIFY_RECORD); |
| 149 | 150 | ||
| 150 | domi::TaskDef main_wait; | 151 | domi::TaskDef main_wait; |
| 151 | main_wait.set_notify_id(notify_id_v[1]); | 152 | main_wait.set_notify_id(notify_id_v[1]); |
| 152 | main_wait.set_stream_id(main_stream_id); | 153 | main_wait.set_stream_id(main_stream_id); |
| 153 | - main_wait.set_type(RT_MODEL_TASK_NOTIFY_WAIT); | 154 | + main_wait.set_type(ACL_RT_MODEL_TASK_NOTIFY_WAIT); |
| 154 | 155 | ||
| 155 | task_defs.insert(task_defs.begin() + task_defs.size() - 1, main_record); | 156 | task_defs.insert(task_defs.begin() + task_defs.size() - 1, main_record); |
| 156 | task_defs.emplace_back(sub_wait); | 157 | task_defs.emplace_back(sub_wait); |
| @@ -229,7 +230,7 @@ Status GenerateMixTask(const ge::Node &node, std::vector<domi::TaskDef> &task_de | |||
| 229 | return SUCCESS; | 230 | return SUCCESS; |
| 230 | } | 231 | } |
| 231 | auto &ai_task = task_defs[task_defs.size() - 1]; | 232 | auto &ai_task = task_defs[task_defs.size() - 1]; |
| 232 | - if (ai_task.type() != RT_MODEL_TASK_KERNEL && ai_task.type() != RT_MODEL_TASK_ALL_KERNEL) { | 233 | + if (ai_task.type() != ACL_RT_MODEL_TASK_KERNEL && ai_task.type() != ACL_RT_MODEL_TASK_ALL_KERNEL) { |
| 233 | REPORT_FE_ERROR("[GenTask][GenerateMixTask] Op[%s][%s] did not find ai core task.", | 234 | REPORT_FE_ERROR("[GenTask][GenerateMixTask] Op[%s][%s] did not find ai core task.", |
| 234 | node.GetNamePtr(), node.GetTypePtr()); | 235 | node.GetNamePtr(), node.GetTypePtr()); |
| 235 | return FAILED; | 236 | return FAILED; |
| @@ -318,7 +319,7 @@ void TaskBuilder::StartKernelFusion(const ge::OpDescPtr &op_desc_ptr, const int3 | |||
| 318 | 319 | ||
| 319 | FE_LOGD("Start kernel fusion from node %s, type %s.", op_desc_ptr->GetName().c_str(), op_desc_ptr->GetType().c_str()); | 320 | FE_LOGD("Start kernel fusion from node %s, type %s.", op_desc_ptr->GetName().c_str(), op_desc_ptr->GetType().c_str()); |
| 320 | domi::TaskDef task_def = {}; | 321 | domi::TaskDef task_def = {}; |
| 321 | - task_def.set_type(RT_MODEL_TASK_FUSION_START); | 322 | + task_def.set_type(ACL_RT_MODEL_TASK_FUSION_START); |
| 322 | task_def.set_stream_id(stream_id); | 323 | task_def.set_stream_id(stream_id); |
| 323 | task_defs.push_back(task_def); | 324 | task_defs.push_back(task_def); |
| 324 | } | 325 | } |
| @@ -333,7 +334,7 @@ void TaskBuilder::EndKernelFusion(const ge::OpDescPtr &op_desc_ptr, const int32_ | |||
| 333 | 334 | ||
| 334 | FE_LOGD("Finish kernel fusion of node %s, type %s.", op_desc_ptr->GetName().c_str(), op_desc_ptr->GetType().c_str()); | 335 | FE_LOGD("Finish kernel fusion of node %s, type %s.", op_desc_ptr->GetName().c_str(), op_desc_ptr->GetType().c_str()); |
| 335 | domi::TaskDef task_def = {}; | 336 | domi::TaskDef task_def = {}; |
| 336 | - task_def.set_type(RT_MODEL_TASK_FUSION_END); | 337 | + task_def.set_type(ACL_RT_MODEL_TASK_FUSION_END); |
| 337 | task_def.set_stream_id(stream_id); | 338 | task_def.set_stream_id(stream_id); |
| 338 | task_defs.push_back(task_def); | 339 | task_defs.push_back(task_def); |
| 339 | } | 340 | } |
| @@ -428,7 +429,7 @@ Status TaskBuilder::FillTaskDefAfterGenTask(const ge::OpDescPtr &op_desc, domi:: | |||
| 428 | (void)ge::AttrUtils::GetInt(op_desc, kAttrScheduleMode, schedule_mode); | 429 | (void)ge::AttrUtils::GetInt(op_desc, kAttrScheduleMode, schedule_mode); |
| 429 | FE_LOGD("Set schedule mode[%u] on task of op[%s, %s].", schedule_mode, op_desc->GetNamePtr(), op_desc->GetTypePtr()); | 430 | FE_LOGD("Set schedule mode[%u] on task of op[%s, %s].", schedule_mode, op_desc->GetNamePtr(), op_desc->GetTypePtr()); |
| 430 | domi::KernelContext *kernel_context = nullptr; | 431 | domi::KernelContext *kernel_context = nullptr; |
| 431 | - if (task_def.type() == RT_MODEL_TASK_KERNEL) { | 432 | + if (task_def.type() == ACL_RT_MODEL_TASK_KERNEL) { |
| 432 | domi::KernelDef *kernel_def = task_def.mutable_kernel(); | 433 | domi::KernelDef *kernel_def = task_def.mutable_kernel(); |
| 433 | FE_CHECK_NOTNULL(kernel_def); | 434 | FE_CHECK_NOTNULL(kernel_def); |
| 434 | kernel_def->set_kernel_name(attr_val_kernel_name); | 435 | kernel_def->set_kernel_name(attr_val_kernel_name); |
| @@ -438,7 +439,7 @@ Status TaskBuilder::FillTaskDefAfterGenTask(const ge::OpDescPtr &op_desc, domi:: | |||
| 438 | kernel_def->set_schedule_mode(schedule_mode); | 439 | kernel_def->set_schedule_mode(schedule_mode); |
| 439 | kernel_context = kernel_def->mutable_context(); | 440 | kernel_context = kernel_def->mutable_context(); |
| 440 | } | 441 | } |
| 441 | - if (task_def.type() == RT_MODEL_TASK_ALL_KERNEL) { | 442 | + if (task_def.type() == ACL_RT_MODEL_TASK_ALL_KERNEL) { |
| 442 | domi::KernelDefWithHandle *kernel_def_with_handle = task_def.mutable_kernel_with_handle(); | 443 | domi::KernelDefWithHandle *kernel_def_with_handle = task_def.mutable_kernel_with_handle(); |
| 443 | FE_CHECK_NOTNULL(kernel_def_with_handle); | 444 | FE_CHECK_NOTNULL(kernel_def_with_handle); |
| 444 | std::string first_kernel_name; | 445 | std::string first_kernel_name; |
| @@ -10,7 +10,8 @@ | |||
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | -#include "runtime/rt_model.h" | 13 | +#include "rt_external_model.h" |
| 14 | + | ||
| 14 | 15 | ||
| 15 | 16 | ||
| 16 | 17 | ||
| @@ -33,8 +34,8 @@ const std::unordered_set<int64_t> BUILT_IN_IMPLY_TYPE{ | |||
| 33 | EN_IMPL_RL, EN_IMPL_PLUGIN_TBE, EN_IMPL_VECTOR_CORE_HW_TBE | 34 | EN_IMPL_RL, EN_IMPL_PLUGIN_TBE, EN_IMPL_VECTOR_CORE_HW_TBE |
| 34 | }; | 35 | }; |
| 35 | 36 | ||
| 36 | -const std::set<rtModelTaskType_t> op_task_list = {RT_MODEL_TASK_VECTOR_ALL_KERNEL, RT_MODEL_TASK_FFTS_PLUS_TASK, | 37 | +const std::set<aclrtModelTaskType_t> op_task_list = {ACL_RT_MODEL_TASK_VECTOR_ALL_KERNEL, ACL_RT_MODEL_TASK_FFTS_PLUS_TASK, |
| 37 | - RT_MODEL_TASK_ALL_KERNEL, RT_MODEL_TASK_KERNEL}; | 38 | + ACL_RT_MODEL_TASK_ALL_KERNEL, ACL_RT_MODEL_TASK_KERNEL}; |
| 38 | 39 | ||
| 39 | Status GetExecuteMode(const ge::Node &node, gert::ExecuteMode &exe_mode) { | 40 | Status GetExecuteMode(const ge::Node &node, gert::ExecuteMode &exe_mode) { |
| 40 | const auto own_graph = node.GetOwnerComputeGraph(); | 41 | const auto own_graph = node.GetOwnerComputeGraph(); |
| @@ -169,7 +170,7 @@ Status CreateTilingTask(const gert::ExeResGenerationContext* context, const Para | |||
| 169 | FE_CHECK(stream_v.size() != 1, FE_LOGE("Node[%s, %s] stream_v size is not equal to 1", context->GetNodeName(), | 170 | FE_CHECK(stream_v.size() != 1, FE_LOGE("Node[%s, %s] stream_v size is not equal to 1", context->GetNodeName(), |
| 170 | context->GetNodeType()), return FAILED); | 171 | context->GetNodeType()), return FAILED); |
| 171 | const int64_t stream_id = stream_v[0].stream_id; | 172 | const int64_t stream_id = stream_v[0].stream_id; |
| 172 | - aicpu_task.set_type(RT_MODEL_TASK_PREPROCESS_KERNEL); | 173 | + aicpu_task.set_type(ACL_RT_MODEL_TASK_PREPROCESS_KERNEL); |
| 173 | aicpu_task.set_stream_id(stream_id); | 174 | aicpu_task.set_stream_id(stream_id); |
| 174 | 175 | ||
| 175 | std::string task_args; | 176 | std::string task_args; |
| @@ -209,7 +210,7 @@ Status CreateRefreshTask(const gert::ExeResGenerationContext* context, domi::Tas | |||
| 209 | FE_CHECK(stream_v.size() != 1, FE_LOGE("Node[%s, %s] stream_v size is not equal to 1", context->GetNodeName(), | 210 | FE_CHECK(stream_v.size() != 1, FE_LOGE("Node[%s, %s] stream_v size is not equal to 1", context->GetNodeName(), |
| 210 | context->GetNodeType()), return FAILED); | 211 | context->GetNodeType()), return FAILED); |
| 211 | const int64_t stream_id = stream_v[0].stream_id; | 212 | const int64_t stream_id = stream_v[0].stream_id; |
| 212 | - task.set_type(RT_MODEL_TASK_UPDATE); | 213 | + task.set_type(ACL_RT_MODEL_TASK_UPDATE); |
| 213 | task.set_stream_id(stream_id); | 214 | task.set_stream_id(stream_id); |
| 214 | task.mutable_update_pc_task()->set_op_index(context->GetOpId()); | 215 | task.mutable_update_pc_task()->set_op_index(context->GetOpId()); |
| 215 | task.mutable_update_pc_task()->set_stream_id(stream_id); | 216 | task.mutable_update_pc_task()->set_stream_id(stream_id); |
| @@ -230,7 +231,7 @@ Status CreateRecordTask(const gert::ExeResGenerationContext* context, domi::Task | |||
| 230 | task.mutable_event_ex()->set_op_index(context->GetOpId()); | 231 | task.mutable_event_ex()->set_op_index(context->GetOpId()); |
| 231 | task.set_event_id(event_id); | 232 | task.set_event_id(event_id); |
| 232 | FE_LOGI("Node[%s, %s] event_id is %d", context->GetNodeName(), context->GetNodeType(), event_id); | 233 | FE_LOGI("Node[%s, %s] event_id is %d", context->GetNodeName(), context->GetNodeType(), event_id); |
| 233 | - task.set_type(RT_MODEL_TASK_EVENT_RECORD); | 234 | + task.set_type(ACL_RT_MODEL_TASK_EVENT_RECORD); |
| 234 | 235 | ||
| 235 | const vector<gert::StreamInfo> stream_v = context->GetAttachedStreamInfos(); | 236 | const vector<gert::StreamInfo> stream_v = context->GetAttachedStreamInfos(); |
| 236 | FE_CHECK(stream_v.size() != 1, FE_LOGE("Node[%s, %s] stream_v size is not equal to 1", context->GetNodeName(), | 237 | FE_CHECK(stream_v.size() != 1, FE_LOGE("Node[%s, %s] stream_v size is not equal to 1", context->GetNodeName(), |
| @@ -248,7 +249,7 @@ Status CreateWaitTask(const gert::ExeResGenerationContext* context, domi::TaskDe | |||
| 248 | task.mutable_event_ex()->set_op_index(context->GetOpId()); | 249 | task.mutable_event_ex()->set_op_index(context->GetOpId()); |
| 249 | task.set_event_id(event_id); | 250 | task.set_event_id(event_id); |
| 250 | FE_LOGI("Node[%s, %s] event_id is %d", context->GetNodeName(), context->GetNodeType(), event_id); | 251 | FE_LOGI("Node[%s, %s] event_id is %d", context->GetNodeName(), context->GetNodeType(), event_id); |
| 251 | - task.set_type(RT_MODEL_TASK_EVENT_WAIT); | 252 | + task.set_type(ACL_RT_MODEL_TASK_EVENT_WAIT); |
| 252 | 253 | ||
| 253 | const int64_t stream_id = context->GetStreamId(); | 254 | const int64_t stream_id = context->GetStreamId(); |
| 254 | task.set_stream_id(stream_id); | 255 | task.set_stream_id(stream_id); |
| @@ -256,7 +257,7 @@ Status CreateWaitTask(const gert::ExeResGenerationContext* context, domi::TaskDe | |||
| 256 | } | 257 | } |
| 257 | 258 | ||
| 258 | Status CreateNopTask(const gert::ExeResGenerationContext* context, domi::TaskDef &task) { | 259 | Status CreateNopTask(const gert::ExeResGenerationContext* context, domi::TaskDef &task) { |
| 259 | - task.set_type(RT_MODEL_TASK_NOP); | 260 | + task.set_type(ACL_RT_MODEL_TASK_NOP); |
| 260 | const int64_t stream_id = context->GetStreamId(); | 261 | const int64_t stream_id = context->GetStreamId(); |
| 261 | task.set_stream_id(stream_id); | 262 | task.set_stream_id(stream_id); |
| 262 | return SUCCESS; | 263 | return SUCCESS; |
| @@ -366,11 +367,11 @@ Status PreProcessTasks(const gert::ExeResGenerationContext* context, std::vector | |||
| 366 | auto op_name = context->GetNodeName(); | 367 | auto op_name = context->GetNodeName(); |
| 367 | auto op_type = context->GetNodeType(); | 368 | auto op_type = context->GetNodeType(); |
| 368 | for (; i < tasks.size(); ++i) { | 369 | for (; i < tasks.size(); ++i) { |
| 369 | - if (tasks[i].type() == RT_MODEL_TASK_FFTS_PLUS_TASK) { | 370 | + if (tasks[i].type() == ACL_RT_MODEL_TASK_FFTS_PLUS_TASK) { |
| 370 | if (ProcessFftsPlusTask(context, tasks[i]) == FAILED) return FAILED; | 371 | if (ProcessFftsPlusTask(context, tasks[i]) == FAILED) return FAILED; |
| 371 | break; // 找到当前aicoretask,直接break | 372 | break; // 找到当前aicoretask,直接break |
| 372 | } | 373 | } |
| 373 | - if (tasks[i].type() == RT_MODEL_TASK_ALL_KERNEL || tasks[i].type() == RT_MODEL_TASK_VECTOR_ALL_KERNEL) { | 374 | + if (tasks[i].type() == ACL_RT_MODEL_TASK_ALL_KERNEL || tasks[i].type() == ACL_RT_MODEL_TASK_VECTOR_ALL_KERNEL) { |
| 374 | if (ProcessMixAicoreTask(context, tasks[i]) == FAILED) return FAILED; | 375 | if (ProcessMixAicoreTask(context, tasks[i]) == FAILED) return FAILED; |
| 375 | break; // 找到当前aicoretask,直接break | 376 | break; // 找到当前aicoretask,直接break |
| 376 | } | 377 | } |
| @@ -438,7 +439,7 @@ ge::Status GenerateTaskSuperKernel(const gert::ExeResGenerationContext* context, | |||
| 438 | int64_t index = -1L; | 439 | int64_t index = -1L; |
| 439 | // find aicore task | 440 | // find aicore task |
| 440 | for (int64_t i = static_cast<int64_t>(tasks.size()) - 1; i >= 0; i--) { | 441 | for (int64_t i = static_cast<int64_t>(tasks.size()) - 1; i >= 0; i--) { |
| 441 | - if ((tasks[i].type() == RT_MODEL_TASK_KERNEL) || (tasks[i].type() == RT_MODEL_TASK_ALL_KERNEL)) { | 442 | + if ((tasks[i].type() == ACL_RT_MODEL_TASK_KERNEL) || (tasks[i].type() == ACL_RT_MODEL_TASK_ALL_KERNEL)) { |
| 442 | index = i; | 443 | index = i; |
| 443 | break; | 444 | break; |
| 444 | } | 445 | } |
| @@ -449,13 +450,13 @@ ge::Status GenerateTaskSuperKernel(const gert::ExeResGenerationContext* context, | |||
| 449 | FE_LOGD("FIA aicore index: %ld.", index); | 450 | FE_LOGD("FIA aicore index: %ld.", index); |
| 450 | // get aicore context | 451 | // get aicore context |
| 451 | domi::KernelContext *kernel_context; | 452 | domi::KernelContext *kernel_context; |
| 452 | - if (tasks[index].type() == RT_MODEL_TASK_KERNEL) { | 453 | + if (tasks[index].type() == ACL_RT_MODEL_TASK_KERNEL) { |
| 453 | auto kernel_def = tasks[index].mutable_kernel(); | 454 | auto kernel_def = tasks[index].mutable_kernel(); |
| 454 | FE_CHECK(kernel_def == nullptr, | 455 | FE_CHECK(kernel_def == nullptr, |
| 455 | FE_LOGE("kernel_def for aicore task is nullptr."), | 456 | FE_LOGE("kernel_def for aicore task is nullptr."), |
| 456 | return FAILED); | 457 | return FAILED); |
| 457 | kernel_context = kernel_def->mutable_context(); | 458 | kernel_context = kernel_def->mutable_context(); |
| 458 | - } else if (tasks[index].type() == RT_MODEL_TASK_ALL_KERNEL) { | 459 | + } else if (tasks[index].type() == ACL_RT_MODEL_TASK_ALL_KERNEL) { |
| 459 | auto kernelWithHandle = tasks[index].mutable_kernel_with_handle(); | 460 | auto kernelWithHandle = tasks[index].mutable_kernel_with_handle(); |
| 460 | FE_CHECK(kernelWithHandle == nullptr, | 461 | FE_CHECK(kernelWithHandle == nullptr, |
| 461 | FE_LOGE("The kernel_def for the aicore task is nullptr."), | 462 | FE_LOGE("The kernel_def for the aicore task is nullptr."), |
| @@ -629,7 +630,7 @@ Status GenerateOpExtTask(const ge::Node &node, const bool is_tiling_sink, std::v | |||
| 629 | std::vector<int> op_task_defs; | 630 | std::vector<int> op_task_defs; |
| 630 | int index = 0; | 631 | int index = 0; |
| 631 | for (const auto &task : task_defs) { | 632 | for (const auto &task : task_defs) { |
| 632 | - rtModelTaskType_t task_type = static_cast<rtModelTaskType_t>(task.type()); | 633 | + aclrtModelTaskType_t task_type = static_cast<aclrtModelTaskType_t>(task.type()); |
| 633 | if (op_task_list.count(task_type) == 0U) { | 634 | if (op_task_list.count(task_type) == 0U) { |
| 634 | index++; | 635 | index++; |
| 635 | continue; | 636 | continue; |
| @@ -20,7 +20,7 @@ | |||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | -#include "runtime/rt.h" | 23 | +#include "rt_external.h" |
| 24 | 24 | ||
| 25 | 25 | ||
| 26 | 26 | ||
| @@ -12,7 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | -#include "runtime/kernel.h" | 15 | +#include "rt_external_kernel.h" |
| 16 | 16 | ||
| 17 | namespace { | 17 | namespace { |
| 18 | const std::string RtSmData_L2MirrorAddr = "L2_mirror_addr"; | 18 | const std::string RtSmData_L2MirrorAddr = "L2_mirror_addr"; |
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | -#include "runtime/base.h" | 14 | +#include "rt_external_base.h" |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| @@ -7,6 +7,7 @@ | |||
| 7 | * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | 7 | * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. |
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | + | ||
| 10 | 11 | ||
| 11 | 12 | ||
| 12 | 13 | ||
| @@ -84,7 +85,7 @@ Status RecvOpMem::Init() { | |||
| 84 | Status RecvOpMem::Run(vector<TaskDef> &tasks) { | 85 | Status RecvOpMem::Run(vector<TaskDef> &tasks) { |
| 85 | RTS_LOGI("Recv mem op:%s wait value start", name_.c_str()); | 86 | RTS_LOGI("Recv mem op:%s wait value start", name_.c_str()); |
| 86 | TaskDef taskDef = {}; | 87 | TaskDef taskDef = {}; |
| 87 | - taskDef.set_type(RT_MODEL_TASK_MEM_EVENT_WAIT); | 88 | + taskDef.set_type(ACL_RT_MODEL_TASK_MEM_EVENT_WAIT); |
| 88 | taskDef.set_stream_id(op_desc_->GetStreamId()); | 89 | taskDef.set_stream_id(op_desc_->GetStreamId()); |
| 89 | taskDef.set_event_id(eventId_); | 90 | taskDef.set_event_id(eventId_); |
| 90 | 91 | ||
| @@ -94,7 +95,7 @@ Status RecvOpMem::Run(vector<TaskDef> &tasks) { | |||
| 94 | } | 95 | } |
| 95 | 96 | ||
| 96 | domi::EventExDef *event_ex_def = taskDef.mutable_event_ex(); | 97 | domi::EventExDef *event_ex_def = taskDef.mutable_event_ex(); |
| 97 | - event_ex_def->set_event_type(RT_MODEL_TASK_MEM_EVENT_WAIT); | 98 | + event_ex_def->set_event_type(ACL_RT_MODEL_TASK_MEM_EVENT_WAIT); |
| 98 | event_ex_def->set_op_index(static_cast<uint32_t>(op_desc_->GetId())); | 99 | event_ex_def->set_op_index(static_cast<uint32_t>(op_desc_->GetId())); |
| 99 | 100 | ||
| 100 | tasks.push_back(taskDef); | 101 | tasks.push_back(taskDef); |
| @@ -7,6 +7,7 @@ | |||
| 7 | * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | 7 | * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. |
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | + | ||
| 10 | 11 | ||
| 11 | 12 | ||
| 12 | 13 | ||
| @@ -7,6 +7,7 @@ | |||
| 7 | * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | 7 | * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. |
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | + | ||
| 10 | 11 | ||
| 11 | 12 | ||
| 12 | 13 | ||
| @@ -8,6 +8,7 @@ | |||
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | + | ||
| 11 | 12 | ||
| 12 | 13 | ||
| 13 | 14 | ||
| @@ -8,6 +8,7 @@ | |||
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | + | ||
| 11 | 12 | ||
| 12 | 13 | ||
| 13 | 14 | ||
| @@ -7,6 +7,8 @@ | |||
| 7 | * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | 7 | * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. |
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | + | ||
| 11 | + | ||
| 10 | 12 | ||
| 11 | 13 | ||
| 12 | 14 | ||
| @@ -31,7 +33,7 @@ Status NpuClearFloatStatusOp::Init() { | |||
| 31 | Status NpuClearFloatStatusOp::Run(vector<TaskDef> &tasks) { | 33 | Status NpuClearFloatStatusOp::Run(vector<TaskDef> &tasks) { |
| 32 | RTS_LOGI("NPU clear float status op run start, node: %s.", name_.c_str()); | 34 | RTS_LOGI("NPU clear float status op run start, node: %s.", name_.c_str()); |
| 33 | domi::TaskDef taskDef = {}; | 35 | domi::TaskDef taskDef = {}; |
| 34 | - taskDef.set_type(RT_MODEL_TASK_NPU_CLEAR_FLOAT_STATUS); | 36 | + taskDef.set_type(ACL_RT_MODEL_TASK_NPU_CLEAR_FLOAT_STATUS); |
| 35 | taskDef.set_stream_id(op_desc_->GetStreamId()); | 37 | taskDef.set_stream_id(op_desc_->GetStreamId()); |
| 36 | domi::NpuClearFloatStatusDef *npuClearStatusDef = taskDef.mutable_npu_clear_float_status(); | 38 | domi::NpuClearFloatStatusDef *npuClearStatusDef = taskDef.mutable_npu_clear_float_status(); |
| 37 | npuClearStatusDef->set_mode(check_mode_); | 39 | npuClearStatusDef->set_mode(check_mode_); |
| @@ -8,7 +8,7 @@ | |||
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | -#include "runtime/rt.h" | 11 | +#include "rt_external.h" |
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| @@ -7,6 +7,7 @@ | |||
| 7 | * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | 7 | * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. |
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | + | ||
| 10 | 11 | ||
| 11 | 12 | ||
| 12 | 13 | ||
| @@ -19,7 +19,7 @@ | |||
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | -#include "runtime/rt.h" | 22 | +#include "rt_external.h" |
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | 25 | ||
| @@ -16,7 +16,7 @@ | |||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | -#include "runtime/mem.h" | 19 | +#include "rt_external_mem.h" |
| 20 | 20 | ||
| 21 | namespace ge { | 21 | namespace ge { |
| 22 | class BufferPoolMemAssigner : public MemAssigner { | 22 | class BufferPoolMemAssigner : public MemAssigner { |
| @@ -20,7 +20,7 @@ | |||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | -#include "runtime/rt.h" | 23 | +#include "rt_external.h" |
| 24 | 24 | ||
| 25 | 25 | ||
| 26 | 26 | ||
| @@ -19,7 +19,7 @@ | |||
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | -#include "runtime/mem.h" | 22 | +#include "rt_external_mem.h" |
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | namespace ge { | 25 | namespace ge { |
| @@ -14,7 +14,7 @@ | |||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | -#include "runtime/rt.h" | 17 | +#include "rt_external.h" |
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | 20 | ||
| @@ -19,7 +19,7 @@ | |||
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | -#include "runtime/mem.h" | 22 | +#include "rt_external_mem.h" |
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | 25 | ||
| @@ -14,7 +14,7 @@ | |||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | -#include "runtime/rt.h" | 17 | +#include "rt_external.h" |
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | 20 | ||
| @@ -17,7 +17,7 @@ | |||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | -#include "runtime/rt.h" | 20 | +#include "rt_external.h" |
| 21 | 21 | ||
| 22 | namespace ge { | 22 | namespace ge { |
| 23 | /*lint -e148*/ | 23 | /*lint -e148*/ |
| @@ -68,7 +68,7 @@ Status DynamicStreamAllocator::AssignAttachedResource(const ComputeGraphPtr &com | |||
| 68 | } | 68 | } |
| 69 | AssignAttachedStreamPass attach_stream_pass; | 69 | AssignAttachedStreamPass attach_stream_pass; |
| 70 | AssignAttachedNotifyPass attached_notify_pass; | 70 | AssignAttachedNotifyPass attached_notify_pass; |
| 71 | - notify_types.resize(notify_num, RT_NOTIFY_DEFAULT); | 71 | + notify_types.resize(notify_num, ACL_NOTIFY_DEFAULT); |
| 72 | uint32_t cur_notify_num = static_cast<uint32_t>(notify_num); | 72 | uint32_t cur_notify_num = static_cast<uint32_t>(notify_num); |
| 73 | for (const auto &dyn_graph : dyn_graphs) { | 73 | for (const auto &dyn_graph : dyn_graphs) { |
| 74 | GE_ASSERT_SUCCESS(attach_stream_pass.Run(dyn_graph, stream_num)); | 74 | GE_ASSERT_SUCCESS(attach_stream_pass.Run(dyn_graph, stream_num)); |
| @@ -27,6 +27,7 @@ | |||
| 27 | 27 | ||
| 28 | 28 | ||
| 29 | 29 | ||
| 30 | + | ||
| 30 | 31 | ||
| 31 | namespace { | 32 | namespace { |
| 32 | constexpr int64_t kTaskNumPerNormalNode = 3; | 33 | constexpr int64_t kTaskNumPerNormalNode = 3; |
| @@ -661,7 +662,7 @@ Status StreamAllocator::InsertSyncNodesByLogicStream(int64_t &stream_num, int64_ | |||
| 661 | GE_ASSERT_SUCCESS(CoverAllStreamByNetoutput()); | 662 | GE_ASSERT_SUCCESS(CoverAllStreamByNetoutput()); |
| 662 | GE_ASSERT_SUCCESS(GenerateSyncEventNodes(), "[GenerateSyncEventNodes] failed! graph:%s", | 663 | GE_ASSERT_SUCCESS(GenerateSyncEventNodes(), "[GenerateSyncEventNodes] failed! graph:%s", |
| 663 | whole_graph_->GetName().c_str()); | 664 | whole_graph_->GetName().c_str()); |
| 664 | - notify_types_.resize(notify_num_, RT_NOTIFY_DEFAULT); | 665 | + notify_types_.resize(notify_num_, ACL_NOTIFY_DEFAULT); |
| 665 | GE_ASSERT_SUCCESS(AssignAttachedNotifyResource()); | 666 | GE_ASSERT_SUCCESS(AssignAttachedNotifyResource()); |
| 666 | GE_ASSERT_SUCCESS(AssignAttachedEventResource()); | 667 | GE_ASSERT_SUCCESS(AssignAttachedEventResource()); |
| 667 | 668 | ||
| @@ -500,7 +500,7 @@ Status TaskGenerator::GenerateTaskForNormalNode(Node *const node, const std::str | |||
| 500 | GetThreadLocalContext() = ge_context; | 500 | GetThreadLocalContext() = ge_context; |
| 501 | error_message::SetErrMgrContext(error_context); | 501 | error_message::SetErrMgrContext(error_context); |
| 502 | if (device_id != kInvalidDeviceId) { | 502 | if (device_id != kInvalidDeviceId) { |
| 503 | - GE_CHK_RT_RET(aclrtSetDevice(device_id)); | 503 | + GE_CHK_ACL_RET(aclrtSetDevice(device_id)); |
| 504 | } | 504 | } |
| 505 | GE_MAKE_GUARD(reset_device, [device_id]() { | 505 | GE_MAKE_GUARD(reset_device, [device_id]() { |
| 506 | if (device_id != kInvalidDeviceId) { | 506 | if (device_id != kInvalidDeviceId) { |
| @@ -548,7 +548,7 @@ Status TaskGenerator::GenerateTaskForFftsNode(Node *ffts_node, const std::string | |||
| 548 | GetThreadLocalContext() = ge_context; | 548 | GetThreadLocalContext() = ge_context; |
| 549 | error_message::SetErrMgrContext(error_context); | 549 | error_message::SetErrMgrContext(error_context); |
| 550 | if (device_id != kInvalidDeviceId) { | 550 | if (device_id != kInvalidDeviceId) { |
| 551 | - GE_CHK_RT_RET(aclrtSetDevice(device_id)); | 551 | + GE_CHK_ACL_RET(aclrtSetDevice(device_id)); |
| 552 | } | 552 | } |
| 553 | GE_MAKE_GUARD(reset_device, [device_id]() { | 553 | GE_MAKE_GUARD(reset_device, [device_id]() { |
| 554 | if (device_id != kInvalidDeviceId) { | 554 | if (device_id != kInvalidDeviceId) { |
| @@ -3635,7 +3635,7 @@ Status GraphManager::ProcessSubGraphWithMultiThreads(GraphManager *graph_manager | |||
| 3635 | 3635 | ||
| 3636 | { | 3636 | { |
| 3637 | if (device_id != kInvalidDeviceId) { | 3637 | if (device_id != kInvalidDeviceId) { |
| 3638 | - GE_CHK_RT_RET(aclrtSetDevice(device_id)); | 3638 | + GE_CHK_ACL_RET(aclrtSetDevice(device_id)); |
| 3639 | } | 3639 | } |
| 3640 | GE_MAKE_GUARD(reset_device, [device_id]() { | 3640 | GE_MAKE_GUARD(reset_device, [device_id]() { |
| 3641 | if (device_id != kInvalidDeviceId) { | 3641 | if (device_id != kInvalidDeviceId) { |
| @@ -14,7 +14,7 @@ | |||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | -#include "runtime/context.h" | 17 | +#include "common/ge_rts_decl.h" |
| 18 | 18 | ||
| 19 | namespace ge { | 19 | namespace ge { |
| 20 | namespace { | 20 | namespace { |
| @@ -27,12 +27,12 @@ RtContextUtil &RtContextUtil::GetInstance() { | |||
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | Status RtContextUtil::SetRtContext(const uint64_t session_id, const uint32_t graph_id, const int32_t device_id, | 29 | Status RtContextUtil::SetRtContext(const uint64_t session_id, const uint32_t graph_id, const int32_t device_id, |
| 30 | - const rtCtxMode_t mode, aclrtContext rt_context) const { | 30 | + const uint32_t mode, aclrtContext rt_context) const { |
| 31 | GELOGI("set rt_context, session id: %lu, graph id: %u, mode %d, device id:%u.", session_id, | 31 | GELOGI("set rt_context, session id: %lu, graph id: %u, mode %d, device id:%u.", session_id, |
| 32 | graph_id, static_cast<int32_t>(mode), ge::GetContext().DeviceId()); | 32 | graph_id, static_cast<int32_t>(mode), ge::GetContext().DeviceId()); |
| 33 | 33 | ||
| 34 | GE_CHK_STATUS_RET(aclrtCreateContext(&rt_context, device_id)); | 34 | GE_CHK_STATUS_RET(aclrtCreateContext(&rt_context, device_id)); |
| 35 | - GE_CHK_RT_RET(aclrtSetCurrentContext(rt_context)); | 35 | + GE_CHK_ACL_RET(aclrtSetCurrentContext(rt_context)); |
| 36 | RtContextUtil::GetInstance().AddRtContext(session_id, graph_id, rt_context); | 36 | RtContextUtil::GetInstance().AddRtContext(session_id, graph_id, rt_context); |
| 37 | 37 | ||
| 38 | return SUCCESS; | 38 | return SUCCESS; |
| @@ -15,7 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | -#include "runtime/context.h" | 18 | +#include "common/ge_rts_decl.h" |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | 21 | ||
| @@ -25,7 +25,7 @@ class RtContextUtil { | |||
| 25 | static RtContextUtil &GetInstance(); | 25 | static RtContextUtil &GetInstance(); |
| 26 | 26 | ||
| 27 | Status SetRtContext(const uint64_t session_id, const uint32_t graph_id, const int32_t device_id, | 27 | Status SetRtContext(const uint64_t session_id, const uint32_t graph_id, const int32_t device_id, |
| 28 | - const rtCtxMode_t mode, aclrtContext rt_context) const; | 28 | + const uint32_t mode, aclrtContext rt_context) const; |
| 29 | void AddRtContext(uint64_t session_id, aclrtContext context); | 29 | void AddRtContext(uint64_t session_id, aclrtContext context); |
| 30 | void AddRtContext(uint64_t session_id, uint32_t graph_id, aclrtContext context); | 30 | void AddRtContext(uint64_t session_id, uint32_t graph_id, aclrtContext context); |
| 31 | void DestroyRtContexts(uint64_t session_id); | 31 | void DestroyRtContexts(uint64_t session_id); |
| @@ -8,7 +8,7 @@ | |||
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | -#include "runtime/mem.h" | 11 | +#include "rt_external_mem.h" |
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| @@ -8,7 +8,7 @@ | |||
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | -#include "runtime/mem.h" | 11 | +#include "rt_external_mem.h" |
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| @@ -8,7 +8,7 @@ | |||
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | -#include "runtime/mem.h" | 11 | +#include "rt_external_mem.h" |
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| @@ -8,7 +8,7 @@ | |||
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | -#include "runtime/mem.h" | 11 | +#include "rt_external_mem.h" |
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| @@ -12,7 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | -#include "runtime/rt.h" | 15 | +#include "rt_external.h" |
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| @@ -12,7 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | -#include "runtime/rt.h" | 15 | +#include "rt_external.h" |
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| @@ -31,8 +31,7 @@ | |||
| 31 | 31 | ||
| 32 | 32 | ||
| 33 | 33 | ||
| 34 | -#include "runtime/config.h" | 34 | +#include "rt_external_device.h" |
| 35 | - | ||
| 36 | 35 | ||
| 37 | 36 | ||
| 38 | 37 | ||
| @@ -146,7 +145,7 @@ Status IsSupportTilingSink(gert::DataDependentInterpreter &ddi, bool &is_support | |||
| 146 | if (!is_build_graph_offline) { | 145 | if (!is_build_graph_offline) { |
| 147 | int32_t value = 0; | 146 | int32_t value = 0; |
| 148 | constexpr int32_t STUB_DEV_ID = 64; | 147 | constexpr int32_t STUB_DEV_ID = 64; |
| 149 | - GE_CHK_RT_RET(aclrtGetDeviceCapability(STUB_DEV_ID, ACL_FEATURE_TSCPU_TASK_UPDATE_SUPPORT_AIC_AIV, &value)); | 148 | + GE_CHK_ACL_RET(aclrtGetDeviceCapability(STUB_DEV_ID, ACL_FEATURE_TSCPU_TASK_UPDATE_SUPPORT_AIC_AIV, &value)); |
| 150 | if (value != ACL_DEV_FEATURE_SUPPORT) { | 149 | if (value != ACL_DEV_FEATURE_SUPPORT) { |
| 151 | GELOGD("tiling sink feature not support."); | 150 | GELOGD("tiling sink feature not support."); |
| 152 | return SUCCESS; | 151 | return SUCCESS; |
| @@ -16,7 +16,7 @@ | |||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | -#include "runtime/rt.h" | 19 | +#include "rt_external.h" |
| 20 | 20 | ||
| 21 | namespace ge { | 21 | namespace ge { |
| 22 | Status SwitchToStreamSwitchPass::Run(ComputeGraphPtr graph) { | 22 | Status SwitchToStreamSwitchPass::Run(ComputeGraphPtr graph) { |
| @@ -13,7 +13,7 @@ | |||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | -#include "runtime/rt.h" | 16 | +#include "rt_external.h" |
| 17 | 17 | ||
| 18 | namespace ge { | 18 | namespace ge { |
| 19 | class IteratorOpPass : public GraphPass { | 19 | class IteratorOpPass : public GraphPass { |
| @@ -19,7 +19,7 @@ | |||
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | -#include "runtime/mem.h" | 22 | +#include "rt_external_mem.h" |
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | 25 | ||
| @@ -22,7 +22,7 @@ | |||
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | -#include "runtime/mem.h" | 25 | +#include "rt_external_mem.h" |
| 26 | 26 | ||
| 27 | 27 | ||
| 28 | 28 | ||
| @@ -20,7 +20,7 @@ | |||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | -#include "runtime/rt.h" | 23 | +#include "rt_external.h" |
| 24 | 24 | ||
| 25 | 25 | ||
| 26 | namespace { | 26 | namespace { |
| @@ -20,7 +20,7 @@ | |||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | -#include "runtime/rt.h" | 23 | +#include "rt_external.h" |
| 24 | 24 | ||
| 25 | 25 | ||
| 26 | 26 | ||
| @@ -44,7 +44,7 @@ Status MemcpyAddrAsyncPass::Run(ComputeGraphPtr graph) { | |||
| 44 | GE_CHK_BOOL_RET_STATUS(rt_ret == RT_ERROR_NONE, RT_FAILED, "Call rtGetRtCapability failed, ret = 0x%x", | 44 | GE_CHK_BOOL_RET_STATUS(rt_ret == RT_ERROR_NONE, RT_FAILED, "Call rtGetRtCapability failed, ret = 0x%x", |
| 45 | static_cast<uint32_t>(rt_ret)); | 45 | static_cast<uint32_t>(rt_ret)); |
| 46 | 46 | ||
| 47 | - if (value == RT_CAPABILITY_NOT_SUPPORT) { | 47 | + if (value == ACL_DEV_FEATURE_NOT_SUPPORT) { |
| 48 | GELOGW("Not support zero copy, skip it."); | 48 | GELOGW("Not support zero copy, skip it."); |
| 49 | return SUCCESS; | 49 | return SUCCESS; |
| 50 | } | 50 | } |
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | -#include "runtime/mem.h" | 14 | +#include "rt_external_mem.h" |
| 15 | 15 | ||
| 16 | namespace ge { | 16 | namespace ge { |
| 17 | Status SetInputOutputOffsetPass::Run(ComputeGraphPtr graph) { | 17 | Status SetInputOutputOffsetPass::Run(ComputeGraphPtr graph) { |
| @@ -10,7 +10,7 @@ | |||
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | -#include "runtime/mem.h" | 13 | +#include "rt_external_mem.h" |
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | 16 | ||
| @@ -12,7 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | -#include "runtime/mem.h" | 15 | +#include "rt_external_mem.h" |
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| @@ -13,7 +13,7 @@ | |||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | -#include "runtime/mem.h" | 16 | +#include "rt_external_mem.h" |
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | namespace te { | 19 | namespace te { |
| @@ -16,7 +16,7 @@ | |||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | -#include "runtime/rt.h" | 19 | +#include "rt_external.h" |
| 20 | 20 | ||
| 21 | namespace ge { | 21 | namespace ge { |
| 22 | // bit 0 | 22 | // bit 0 |
| @@ -13,7 +13,7 @@ | |||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | -#include "runtime/rt.h" | 16 | +#include "rt_external.h" |
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | namespace ge { | 19 | namespace ge { |
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | -#include "runtime/rt.h" | 14 | +#include "rt_external.h" |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| @@ -15,7 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | -#include "runtime/rt.h" | 18 | +#include "rt_external.h" |
| 19 | 19 | ||
| 20 | namespace ge { | 20 | namespace ge { |
| 21 | class DeviceAbnormalStatusHandler { | 21 | class DeviceAbnormalStatusHandler { |
| @@ -21,6 +21,7 @@ | |||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | + | ||
| 24 | 25 | ||
| 25 | namespace ge { | 26 | namespace ge { |
| 26 | namespace { | 27 | namespace { |
| @@ -17,6 +17,7 @@ | |||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | + | ||
| 20 | 21 | ||
| 21 | 22 | ||
| 22 | 23 | ||
| @@ -182,7 +183,7 @@ Status DynamicModelExecutor::LoadModel(const ModelData &model_data, | |||
| 182 | } | 183 | } |
| 183 | 184 | ||
| 184 | void DynamicModelExecutor::DestroyDatasetResource() { | 185 | void DynamicModelExecutor::DestroyDatasetResource() { |
| 185 | - rtCtxSetCurrent(rt_context_); | 186 | + aclrtSetCurrentContext(rt_context_); |
| 186 | GEEVENT("Destroy dataset resource begin, inner model_id = %u.", model_id_); | 187 | GEEVENT("Destroy dataset resource begin, inner model_id = %u.", model_id_); |
| 187 | if (model_desc_ != nullptr) { | 188 | if (model_desc_ != nullptr) { |
| 188 | (void) aclmdlDestroyDesc(model_desc_); | 189 | (void) aclmdlDestroyDesc(model_desc_); |
| @@ -233,7 +234,7 @@ void DynamicModelExecutor::UnloadModel() { | |||
| 233 | } | 234 | } |
| 234 | GEEVENT("UnloadModel model external weight success, inner model_id = %u.", model_id_); | 235 | GEEVENT("UnloadModel model external weight success, inner model_id = %u.", model_id_); |
| 235 | } | 236 | } |
| 236 | - rtCtxSetCurrent(rt_context_); | 237 | + aclrtSetCurrentContext(rt_context_); |
| 237 | if (handle_ != nullptr) { | 238 | if (handle_ != nullptr) { |
| 238 | (void) aclmdlDestroyConfigHandle(handle_); | 239 | (void) aclmdlDestroyConfigHandle(handle_); |
| 239 | handle_ = nullptr; | 240 | handle_ = nullptr; |
| @@ -1060,7 +1061,7 @@ Status DynamicModelExecutor::DoLoadModel(const ModelData &model_data, const Comp | |||
| 1060 | int32_t device_id = is_host_ ? GetContext().DeviceId() : device_id_; | 1061 | int32_t device_id = is_host_ ? GetContext().DeviceId() : device_id_; |
| 1061 | aclError ret = aclrtSetDevice(device_id); | 1062 | aclError ret = aclrtSetDevice(device_id); |
| 1062 | GE_ASSERT_TRUE(ret == ACL_SUCCESS, "ACL set device id failed."); | 1063 | GE_ASSERT_TRUE(ret == ACL_SUCCESS, "ACL set device id failed."); |
| 1063 | - rtCtxSetCurrent(rt_context_); | 1064 | + aclrtSetCurrentContext(rt_context_); |
| 1064 | GE_CHK_STATUS_RET(InitExternalWeightMem(root_graph, external_weight_mem_data_), "Failed to init external weright mem."); | 1065 | GE_CHK_STATUS_RET(InitExternalWeightMem(root_graph, external_weight_mem_data_), "Failed to init external weright mem."); |
| 1065 | handle_ = aclmdlCreateConfigHandle(); | 1066 | handle_ = aclmdlCreateConfigHandle(); |
| 1066 | GE_CHECK_NOTNULL(handle_, "Create acl load config handle failed."); | 1067 | GE_CHECK_NOTNULL(handle_, "Create acl load config handle failed."); |
| @@ -1207,7 +1208,7 @@ Status DynamicModelExecutor::CreateOutputDataset(const std::vector<DataBuffer> & | |||
| 1207 | Status DynamicModelExecutor::DoExecuteModel(const std::vector<DataBuffer> &inputs, std::vector<DataBuffer> &outputs) { | 1208 | Status DynamicModelExecutor::DoExecuteModel(const std::vector<DataBuffer> &inputs, std::vector<DataBuffer> &outputs) { |
| 1208 | GE_CHK_STATUS_RET(CreateInputDataset(inputs), "Failed to prepare acl type input dataset."); | 1209 | GE_CHK_STATUS_RET(CreateInputDataset(inputs), "Failed to prepare acl type input dataset."); |
| 1209 | GE_CHK_STATUS_RET(CreateOutputDataset(outputs), "Failed to prepare acl type output dataset."); | 1210 | GE_CHK_STATUS_RET(CreateOutputDataset(outputs), "Failed to prepare acl type output dataset."); |
| 1210 | - rtCtxSetCurrent(rt_context_); | 1211 | + aclrtSetCurrentContext(rt_context_); |
| 1211 | auto ret = aclmdlExecute(model_id_, input_dataset_, output_dataset_); | 1212 | auto ret = aclmdlExecute(model_id_, input_dataset_, output_dataset_); |
| 1212 | GE_ASSERT_TRUE(ret == ACL_SUCCESS, "Failed to execute model."); | 1213 | GE_ASSERT_TRUE(ret == ACL_SUCCESS, "Failed to execute model."); |
| 1213 | 1214 | ||
| @@ -1243,7 +1244,7 @@ Status DynamicModelExecutor::ParseModelOutputToTensorDesc(const aclTensorDesc *a | |||
| 1243 | 1244 | ||
| 1244 | Status DynamicModelExecutor::GetGlobalStepAddr() { | 1245 | Status DynamicModelExecutor::GetGlobalStepAddr() { |
| 1245 | int32_t device_id = -1; | 1246 | int32_t device_id = -1; |
| 1246 | - GE_CHK_RT_RET(rtGetDevice(&device_id)); | 1247 | + DF_CHK_ACL_RET(aclrtGetDevice(&device_id)); |
| 1247 | GEEVENT("Current process procedure maybe runtime 2.0. Create global_step memory now."); | 1248 | GEEVENT("Current process procedure maybe runtime 2.0. Create global_step memory now."); |
| 1248 | if (is_host_) { | 1249 | if (is_host_) { |
| 1249 | GELOGI("Alloc global step memory for host cpu model."); | 1250 | GELOGI("Alloc global step memory for host cpu model."); |
| @@ -23,7 +23,7 @@ | |||
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | // for rtMbufPtr_t | 25 | // for rtMbufPtr_t |
| 26 | -#include "runtime/rt.h" | 26 | +#include "rt_external.h" |
| 27 | 27 | ||
| 28 | namespace ge { | 28 | namespace ge { |
| 29 | class DynamicModelExecutor { | 29 | class DynamicModelExecutor { |
| @@ -440,7 +440,7 @@ Status SchedTaskNotifyWait::Init(const uint32_t notify_id) { | |||
| 440 | GE_PRINT_DYNAMIC_MEMORY(aclrtMalloc, "args data.", args_size_); | 440 | GE_PRINT_DYNAMIC_MEMORY(aclrtMalloc, "args data.", args_size_); |
| 441 | AicpuNotifyKernelArgs notify_param{}; | 441 | AicpuNotifyKernelArgs notify_param{}; |
| 442 | notify_param.notify_id = notify_id; | 442 | notify_param.notify_id = notify_id; |
| 443 | - GE_CHK_RT_RET(aclrtMemcpy(args_, args_size_, ¬ify_param, sizeof(notify_param), ACL_MEMCPY_HOST_TO_DEVICE)); | 443 | + GE_CHK_ACL_RET(aclrtMemcpy(args_, args_size_, ¬ify_param, sizeof(notify_param), ACL_MEMCPY_HOST_TO_DEVICE)); |
| 444 | return SUCCESS; | 444 | return SUCCESS; |
| 445 | } | 445 | } |
| 446 | 446 | ||
| @@ -11,6 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | + | ||
| 14 | 15 | ||
| 15 | 16 | ||
| 16 | // -----------------runtime related macro definitions------------------------------- | 17 | // -----------------runtime related macro definitions------------------------------- |
| @@ -24,15 +25,7 @@ | |||
| 24 | } while (false) | 25 | } while (false) |
| 25 | 26 | ||
| 26 | // If expr is not ACL_ERROR_NONE, print the log and return | 27 | // If expr is not ACL_ERROR_NONE, print the log and return |
| 27 | -#define DF_CHK_ACL_RET(expr) \ | 28 | +#define DF_CHK_ACL_RET(expr) GE_CHK_ACL_RET(expr) |
| 28 | - do { \ | ||
| 29 | - const aclError _acl_ret = (expr); \ | ||
| 30 | - if (_acl_ret != ACL_ERROR_NONE) { \ | ||
| 31 | - REPORT_INNER_ERR_MSG("E19999", "Call %s fail, ret: 0x%X", | ||
| 32 | - GELOGE(ge::RT_FAILED, "Call aclrt api failed, ret: 0x%X", static_cast<uint32_t>(_acl_ret)); \ | ||
| 33 | - return RT_ERROR_TO_GE_STATUS(_acl_ret); \ | ||
| 34 | - } \ | ||
| 35 | - } while (false) | ||
| 36 | 29 | ||
| 37 | 30 | ||
| 38 | do { \ | 31 | do { \ |
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | -#include "runtime/rt_model.h" | 14 | +#include "rt_external_model.h" |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| @@ -142,7 +142,7 @@ bool KernelLaunchInfoImpl::ProcessFusionTask(const gert::ExeResGenerationContext | |||
| 142 | if (!ProcessFusionSubTask(sub_task, fusion_task_def)) { | 142 | if (!ProcessFusionSubTask(sub_task, fusion_task_def)) { |
| 143 | return false; | 143 | return false; |
| 144 | } | 144 | } |
| 145 | - uint32_t task_sqe_num = sub_task->task_def_.sqe_num(); | 145 | + const uint32_t task_sqe_num = sub_task->task_def_.sqe_num(); |
| 146 | if (task_sqe_num == 0) { | 146 | if (task_sqe_num == 0) { |
| 147 | sqe_num++; | 147 | sqe_num++; |
| 148 | } else { | 148 | } else { |
| @@ -317,7 +317,7 @@ ge::graphStatus ConstructInferShapeRangeContextOutputs( | |||
| 317 | 317 | ||
| 318 | ge::graphStatus UpdateOpDescOutShape(const ge::OpDescPtr &op_desc, gert::InferShapeContext *infer_shape_ctx) { | 318 | ge::graphStatus UpdateOpDescOutShape(const ge::OpDescPtr &op_desc, gert::InferShapeContext *infer_shape_ctx) { |
| 319 | for (size_t index = 0UL; index < op_desc->GetOutputsSize(); index++) { | 319 | for (size_t index = 0UL; index < op_desc->GetOutputsSize(); index++) { |
| 320 | - auto &dst_out_shape = op_desc->MutableOutputDesc(static_cast<size_t>(index))->MutableShape(); | 320 | + auto &dst_out_shape = op_desc->MutableOutputDesc(static_cast<uint32_t>(index))->MutableShape(); |
| 321 | const auto *shape = infer_shape_ctx->GetOutputShape(index); | 321 | const auto *shape = infer_shape_ctx->GetOutputShape(index); |
| 322 | GE_ASSERT_NOTNULL(shape); | 322 | GE_ASSERT_NOTNULL(shape); |
| 323 | dst_out_shape.SetDimNum(shape->GetDimNum()); | 323 | dst_out_shape.SetDimNum(shape->GetDimNum()); |
| @@ -667,7 +667,7 @@ ge::graphStatus CustomOpInferDataTypeOnCompile(ge::ShapeInferOp *shape_infer_op, | |||
| 667 | GE_CHK_STATUS_RET(ret, "[Check][CustomOpInferDataType] result failed, op_desc[%s], ret[%d]", | 667 | GE_CHK_STATUS_RET(ret, "[Check][CustomOpInferDataType] result failed, op_desc[%s], ret[%d]", |
| 668 | op_desc->GetName().c_str(), ret); | 668 | op_desc->GetName().c_str(), ret); |
| 669 | for (size_t i = 0UL; i < op_desc->GetOutputsSize(); i++) { | 669 | for (size_t i = 0UL; i < op_desc->GetOutputsSize(); i++) { |
| 670 | - const auto &out_desc = op_desc->MutableOutputDesc(static_cast<size_t>(i)); | 670 | + const auto &out_desc = op_desc->MutableOutputDesc(static_cast<uint32_t>(i)); |
| 671 | out_desc->SetDataType(kernel_context->GetOutputDataType(i)); | 671 | out_desc->SetDataType(kernel_context->GetOutputDataType(i)); |
| 672 | out_desc->SetOriginDataType(kernel_context->GetOutputDataType(i)); | 672 | out_desc->SetOriginDataType(kernel_context->GetOutputDataType(i)); |
| 673 | } | 673 | } |
| @@ -770,7 +770,7 @@ ge::graphStatus InferDataTypeOnCompile(const ge::OpDescPtr &op_desc) { | |||
| 770 | const ge::graphStatus ret = InferDtypeByRegisteredFuncOrRule(functions, op_desc, kernel_context); | 770 | const ge::graphStatus ret = InferDtypeByRegisteredFuncOrRule(functions, op_desc, kernel_context); |
| 771 | GE_CHK_STATUS_RET(ret, "[Check][InferDataType] result failed, op_desc[%s], ret[%d]", op_desc->GetName().c_str(), ret); | 771 | GE_CHK_STATUS_RET(ret, "[Check][InferDataType] result failed, op_desc[%s], ret[%d]", op_desc->GetName().c_str(), ret); |
| 772 | for (size_t i = 0UL; i < op_desc->GetOutputsSize(); i++) { | 772 | for (size_t i = 0UL; i < op_desc->GetOutputsSize(); i++) { |
| 773 | - const auto &out_desc = op_desc->MutableOutputDesc(static_cast<size_t>(i)); | 773 | + const auto &out_desc = op_desc->MutableOutputDesc(static_cast<uint32_t>(i)); |
| 774 | out_desc->SetDataType(kernel_context->GetOutputDataType(i)); | 774 | out_desc->SetDataType(kernel_context->GetOutputDataType(i)); |
| 775 | } | 775 | } |
| 776 | return ge::GRAPH_SUCCESS; | 776 | return ge::GRAPH_SUCCESS; |
| @@ -0,0 +1,166 @@ | |||
| 1 | +/** | ||
| 2 | + * Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 3 | + * This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 4 | + * CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 5 | + * Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 6 | + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 7 | + * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 8 | + * See LICENSE in the root of the software repository for the full text of the License. | ||
| 9 | + */ | ||
| 10 | + | ||
| 11 | + | ||
| 12 | + | ||
| 13 | + | ||
| 14 | +// 这里的rt接口声明用于日落的GE代码使用,待GE代码日落时同时删除这些声明。 | ||
| 15 | + | ||
| 16 | + | ||
| 17 | + | ||
| 18 | + | ||
| 19 | + | ||
| 20 | + | ||
| 21 | + | ||
| 22 | +typedef struct rtFunctionInfo { | ||
| 23 | + void *pcAddr; | ||
| 24 | + uint32_t prefetchCnt; | ||
| 25 | + uint8_t mixType; | ||
| 26 | + uint8_t reserved[3]; | ||
| 27 | +} rtFunctionInfo_t; | ||
| 28 | + | ||
| 29 | +typedef struct tagRtKernelInfo { | ||
| 30 | + uint8_t functionInfoNum; | ||
| 31 | + uint8_t reserved[3]; | ||
| 32 | + rtFunctionInfo_t functionInfo[2]; | ||
| 33 | +} rtKernelDetailInfo_t; | ||
| 34 | + | ||
| 35 | + | ||
| 36 | + | ||
| 37 | + | ||
| 38 | + | ||
| 39 | + | ||
| 40 | + | ||
| 41 | + | ||
| 42 | + | ||
| 43 | + | ||
| 44 | +typedef rtSmDesc_t rtL2Ctrl_t; | ||
| 45 | + | ||
| 46 | +typedef struct { | ||
| 47 | + uint32_t addrOffset; | ||
| 48 | + uint32_t dataOffset; | ||
| 49 | +} rtPlaceHolderInfo_t; | ||
| 50 | + | ||
| 51 | +typedef struct { | ||
| 52 | + rtAicpuArgsEx_t baseArgs; | ||
| 53 | + size_t cpuParamHeadOffset; | ||
| 54 | + uint32_t rsv[4]; | ||
| 55 | +} rtCpuKernelArgs_t; | ||
| 56 | + | ||
| 57 | +typedef enum tagRtMemRequestFeature { | ||
| 58 | + MEM_REQUEST_FEATURE_DEFAULT = 0, | ||
| 59 | + MEM_REQUEST_FEATURE_OPP, | ||
| 60 | + MEM_REQUEST_FEATURE_RESERVED | ||
| 61 | +} rtMemRequestFeature_t; | ||
| 62 | + | ||
| 63 | + | ||
| 64 | + | ||
| 65 | +typedef struct tagNodeInfo_t { | ||
| 66 | + uint32_t nodeIdx; | ||
| 67 | + uint32_t reserved[1]; | ||
| 68 | +} rtNodeInfo; | ||
| 69 | + | ||
| 70 | +typedef struct tagHwtsInfo_t { | ||
| 71 | + uint16_t taskId; | ||
| 72 | + uint16_t sqExeHead; | ||
| 73 | + uint16_t streamExeHead; | ||
| 74 | + uint16_t reserved[2]; | ||
| 75 | +} rtHwtsInfo; | ||
| 76 | + | ||
| 77 | +typedef struct tagLabelDevInfo_t { | ||
| 78 | + uint16_t modelId; | ||
| 79 | + uint16_t streamId; | ||
| 80 | + uint16_t labelId; | ||
| 81 | + union { | ||
| 82 | + rtNodeInfo nodeInfo; | ||
| 83 | + rtHwtsInfo hwtsInfo; | ||
| 84 | + uint16_t reserved[5]; | ||
| 85 | + }u; | ||
| 86 | +} rtLabelDevInfo; | ||
| 87 | + | ||
| 88 | + | ||
| 89 | + | ||
| 90 | + | ||
| 91 | +typedef void (*rtCallback_t)(void *fnData); | ||
| 92 | + | ||
| 93 | +typedef enum { | ||
| 94 | + KERNEL_TYPE_AICORE = 0, | ||
| 95 | + KERNEL_TYPE_AICPU = 1, | ||
| 96 | + KERNEL_TYPE_AICPU_CUSTOM = 4, | ||
| 97 | + KERNEL_TYPE_AICPU_KFC = 5, | ||
| 98 | + KERNEL_TYPE_CUSTOM_KFC = 6, | ||
| 99 | + KERNEL_TYPE_HWTS = 10, | ||
| 100 | + KERNEL_TYPE_FWK = 11, | ||
| 101 | + KERNEL_TYPE_RESERVED = 99, | ||
| 102 | +} rtKernelType_t; | ||
| 103 | + | ||
| 104 | + | ||
| 105 | + | ||
| 106 | + | ||
| 107 | + | ||
| 108 | +extern "C" { | ||
| 109 | + | ||
| 110 | + | ||
| 111 | +RTS_API rtError_t rtKernelLaunchWithHandleV2(void *hdl, const uint64_t tilingKey, uint32_t numBlocks, | ||
| 112 | + rtArgsEx_t *argsInfo, rtSmDesc_t *smDesc, rtStream_t stm, const rtTaskCfgInfo_t *cfgInfo); | ||
| 113 | + | ||
| 114 | +RTS_API rtError_t rtVectorCoreKernelLaunchWithHandle(void *hdl, const uint64_t tilingKey, uint32_t numBlocks, | ||
| 115 | + rtArgsEx_t *argsInfo, rtSmDesc_t *smDesc, rtStream_t stm, const rtTaskCfgInfo_t *cfgInfo); | ||
| 116 | + | ||
| 117 | +RTS_API rtError_t rtVectorCoreKernelLaunch(const void *stubFunc, uint32_t numBlocks, rtArgsEx_t *argsInfo, | ||
| 118 | + rtSmDesc_t *smDesc, rtStream_t stm, uint32_t flags, const rtTaskCfgInfo_t *cfgInfo); | ||
| 119 | + | ||
| 120 | +RTS_API rtError_t rtsGetThreadLastTaskId(uint32_t *taskId); | ||
| 121 | + | ||
| 122 | +RTS_API rtError_t rtGetSocVersion(char_t *ver, const uint32_t maxLen); | ||
| 123 | + | ||
| 124 | +RTS_API rtError_t rtMemcpyAsync(void *dst, uint64_t destMax, const void *src, uint64_t cnt, rtMemcpyKind_t kind, | ||
| 125 | + rtStream_t stm); | ||
| 126 | + | ||
| 127 | +RTS_API rtError_t rtKernelLaunchWithFlagV2(const void *stubFunc, uint32_t numBlocks, rtArgsEx_t *argsInfo, | ||
| 128 | + rtSmDesc_t *smDesc, rtStream_t stm, uint32_t flags, const rtTaskCfgInfo_t *cfgInfo); | ||
| 129 | + | ||
| 130 | +RTS_API rtError_t rtKernelLaunchEx(void *args, uint32_t argsSize, uint32_t flags, rtStream_t stm); | ||
| 131 | + | ||
| 132 | +RTS_API rtError_t rtKernelLaunchFwk(const char_t *opName, void *args, uint32_t argsSize, uint32_t flags, | ||
| 133 | + rtStream_t rtStream); | ||
| 134 | + | ||
| 135 | +RTS_API rtError_t rtAicpuKernelLaunchWithFlag(const rtKernelLaunchNames_t *launchNames, uint32_t numBlocks, | ||
| 136 | + const rtArgsEx_t *argsInfo, rtSmDesc_t *smDesc, rtStream_t stm, uint32_t flags); | ||
| 137 | + | ||
| 138 | +RTS_API rtError_t rtDevBinaryRegister(const rtDevBinary_t *bin, void **hdl); | ||
| 139 | + | ||
| 140 | +RTS_API rtError_t rtDevBinaryUnRegister(void *hdl); | ||
| 141 | + | ||
| 142 | +RTS_API rtError_t rtFunctionRegister(void *binHandle, const void *stubFunc, const char_t *stubName, | ||
| 143 | + const void *kernelInfoExt, uint32_t funcMode); | ||
| 144 | + | ||
| 145 | +RTS_API rtError_t rtGetFunctionByName(const char_t *stubName, void **stubFunc); | ||
| 146 | + | ||
| 147 | +RTS_API rtError_t rtKernelGetAddrAndPrefCnt(void *hdl, const uint64_t tilingKey, const void * const stubFunc, | ||
| 148 | + const uint32_t flag, void **addr, uint32_t *prefetchCnt); | ||
| 149 | + | ||
| 150 | +RTS_API rtError_t rtKernelGetAddrAndPrefCntV2(void *hdl, const uint64_t tilingKey, const void * const stubFunc, | ||
| 151 | + const uint32_t flag, rtKernelDetailInfo_t *kernelInfo); | ||
| 152 | + | ||
| 153 | +RTS_API rtError_t rtQueryFunctionRegistered(const char_t *stubName); | ||
| 154 | + | ||
| 155 | +RTS_API uint32_t rtGetTsMemType(rtMemRequestFeature_t featureType, uint32_t memSize); | ||
| 156 | + | ||
| 157 | +RTS_API rtError_t rtCmoAddrTaskLaunch(void *cmoAddrInfo, uint64_t destMax, rtCmoOpCode_t cmoOpCode, | ||
| 158 | + rtStream_t stm, uint32_t flag); | ||
| 159 | + | ||
| 160 | +RTS_API rtError_t rtGetC2cCtrlAddr(uint64_t *addr, uint32_t *len); | ||
| 161 | + | ||
| 162 | + | ||
| 163 | +} | ||
| 164 | + | ||
| 165 | + | ||
| 166 | + | ||
| @@ -14,4 +14,19 @@ | |||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | + | ||
| 18 | + | ||
| 19 | +// If expr is not ACL_ERROR_NONE, print the log and return | ||
| 20 | + | ||
| 21 | + do { \ | ||
| 22 | + const aclError _acl_ret = (expr); \ | ||
| 23 | + if (_acl_ret != ACL_ERROR_NONE) { \ | ||
| 24 | + REPORT_INNER_ERR_MSG("E19999", "Call %s fail, ret: 0x%X", | ||
| 25 | + GELOGE(ge::RT_FAILED, "Call aclrt api failed, ret: 0x%X", static_cast<uint32_t>(_acl_ret)); \ | ||
| 26 | + return RT_ERROR_TO_GE_STATUS(_acl_ret); \ | ||
| 27 | + } \ | ||
| 28 | + } while (false) | ||
| 29 | + | ||
| 30 | + | ||
| 31 | + | ||
| 17 | 32 | ||
| @@ -12,7 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | -#include "runtime/base.h" | 15 | +#include "rt_external_base.h" |
| 16 | 16 | ||
| 17 | GE_FUNC_VISIBILITY ge::Status ProfGetDeviceFormGraphId(const uint32_t graph_id, uint32_t &device_id); | 17 | GE_FUNC_VISIBILITY ge::Status ProfGetDeviceFormGraphId(const uint32_t graph_id, uint32_t &device_id); |
| 18 | 18 | ||
| @@ -61,5 +61,56 @@ typedef enum acltagModelTaskType { | |||
| 61 | ACL_RT_MODEL_TASK_MEM_EVENT_WAIT, | 61 | ACL_RT_MODEL_TASK_MEM_EVENT_WAIT, |
| 62 | } aclrtModelTaskType_t; | 62 | } aclrtModelTaskType_t; |
| 63 | 63 | ||
| 64 | + | ||
| 65 | +typedef aclrtModelTaskType_t rtModelTaskType_t; | ||
| 66 | + | ||
| 67 | + | ||
| 68 | + | ||
| 69 | + | ||
| 70 | + | ||
| 71 | + | ||
| 72 | + | ||
| 73 | + | ||
| 74 | + | ||
| 75 | + | ||
| 76 | + | ||
| 77 | + | ||
| 78 | + | ||
| 79 | + | ||
| 80 | + | ||
| 81 | + | ||
| 82 | + | ||
| 83 | + | ||
| 84 | + | ||
| 85 | + | ||
| 86 | + | ||
| 87 | + | ||
| 88 | + | ||
| 89 | + | ||
| 90 | + | ||
| 91 | + | ||
| 92 | + | ||
| 93 | + | ||
| 94 | + | ||
| 95 | + | ||
| 96 | + | ||
| 97 | + | ||
| 98 | + | ||
| 99 | + | ||
| 100 | + | ||
| 101 | + | ||
| 102 | + | ||
| 103 | + | ||
| 104 | + | ||
| 105 | + | ||
| 106 | + | ||
| 107 | + | ||
| 108 | + | ||
| 109 | + | ||
| 110 | + | ||
| 111 | + | ||
| 112 | + | ||
| 113 | + | ||
| 114 | + | ||
| 64 | 115 | ||
| 65 | 116 | ||
| @@ -11,9 +11,10 @@ | |||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | -#include "runtime/rt.h" | 14 | +#include "rt_external.h" |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | + | ||
| 17 | 18 | ||
| 18 | namespace ge { | 19 | namespace ge { |
| 19 | 20 | ||
| @@ -13,7 +13,7 @@ | |||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | -#include "runtime/mem.h" | 16 | +#include "rt_external_mem.h" |
| 17 | 17 | ||
| 18 | namespace ge { | 18 | namespace ge { |
| 19 | enum MemStorageType { | 19 | enum MemStorageType { |
| @@ -25,7 +25,7 @@ | |||
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | 27 | ||
| 28 | -#include "runtime/kernel.h" | 28 | +#include "rt_external_kernel.h" |
| 29 | 29 | ||
| 30 | namespace ge { | 30 | namespace ge { |
| 31 | /** | 31 | /** |
| @@ -18,7 +18,7 @@ | |||
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | -#include "runtime/base.h" | 21 | +#include "rt_external_base.h" |
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | namespace ge { | 24 | namespace ge { |
| @@ -16,7 +16,7 @@ | |||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | -#include "runtime/base.h" | 19 | +#include "rt_external_base.h" |
| 20 | 20 | ||
| 21 | namespace ge { | 21 | namespace ge { |
| 22 | namespace dump { | 22 | namespace dump { |
| @@ -13,7 +13,7 @@ | |||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | -#include "runtime/rt.h" | 16 | +#include "rt_external.h" |
| 17 | 17 | ||
| 18 | namespace ge { | 18 | namespace ge { |
| 19 | namespace dump { | 19 | namespace dump { |
| @@ -14,7 +14,7 @@ | |||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | -#include "runtime/base.h" | 17 | +#include "rt_external_base.h" |
| 18 | 18 | ||
| 19 | namespace ge { | 19 | namespace ge { |
| 20 | namespace dump { | 20 | namespace dump { |
| @@ -18,7 +18,6 @@ | |||
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | - | ||
| 22 | 21 | ||
| 23 | namespace ge { | 22 | namespace ge { |
| 24 | namespace dump { | 23 | namespace dump { |
| @@ -13,7 +13,6 @@ | |||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | - | ||
| 17 | 16 | ||
| 18 | namespace ge { | 17 | namespace ge { |
| 19 | namespace dump { | 18 | namespace dump { |
| @@ -15,7 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | -#include "runtime/mem.h" | 18 | +#include "rt_external_mem.h" |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | namespace gert { | 21 | namespace gert { |
| @@ -16,7 +16,7 @@ | |||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | -#include "runtime/stream.h" | 19 | +#include "rt_external_stream.h" |
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | 22 | ||
| @@ -12,7 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | -#include "runtime/stream.h" | 15 | +#include "rt_external_stream.h" |
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | -#include "runtime/rt_ffts_plus_define.h" | 14 | +#include "rt_external_ffts_define.h" |
| 15 | 15 | ||
| 16 | namespace ffts { | 16 | namespace ffts { |
| 17 | 17 | ||
| @@ -41,7 +41,7 @@ enum class GraphStage : int64_t { | |||
| 41 | GRAPH_STAGE_RESERVED | 41 | GRAPH_STAGE_RESERVED |
| 42 | }; | 42 | }; |
| 43 | 43 | ||
| 44 | -const char_t *const kGraphDumpStage = "DumpStage"; | 44 | +constexpr const char_t *const kGraphDumpStage = "DumpStage"; |
| 45 | 45 | ||
| 46 | const std::map<std::string, std::string> kFwkTypeToStr = {{"0", "Caffe"}, | 46 | const std::map<std::string, std::string> kFwkTypeToStr = {{"0", "Caffe"}, |
| 47 | {"1", "MindSpore"}, | 47 | {"1", "MindSpore"}, |
| @@ -102,8 +102,8 @@ const std::string kEngineNameAiCore = "AIcoreEngine"; | |||
| 102 | const std::string kEngineNameDvpp = "dvpp_ops_kernel"; | 102 | const std::string kEngineNameDvpp = "dvpp_ops_kernel"; |
| 103 | const std::string kEngineNameDsa = "DSAEngine"; | 103 | const std::string kEngineNameDsa = "DSAEngine"; |
| 104 | const std::string kAtomicOpType = "DynamicAtomicAddrClean"; | 104 | const std::string kAtomicOpType = "DynamicAtomicAddrClean"; |
| 105 | -const char_t *const kAICpuKernelLibName = "aicpu_kernel_lib_name"; | 105 | +constexpr const char_t *const kAICpuKernelLibName = "aicpu_kernel_lib_name"; |
| 106 | -const char_t *const kPartiallySupported = "partially_supported"; | 106 | +constexpr const char_t *const kPartiallySupported = "partially_supported"; |
| 107 | 107 | ||
| 108 | // runtime2.0 lowering func | 108 | // runtime2.0 lowering func |
| 109 | const std::string kAttrLowingFunc = "_ge_attr_lowering_func"; | 109 | const std::string kAttrLowingFunc = "_ge_attr_lowering_func"; |
| @@ -128,8 +128,8 @@ constexpr size_t kNumTaskWithAtomicAddrCleanTask = 2U; | |||
| 128 | constexpr uint32_t INVALID_MODEL_ID = 0xFFFFFFFFU; | 128 | constexpr uint32_t INVALID_MODEL_ID = 0xFFFFFFFFU; |
| 129 | 129 | ||
| 130 | // dynamic execute mode | 130 | // dynamic execute mode |
| 131 | -const char_t *const kLazyRecompile = "lazy_recompile"; | 131 | +constexpr const char_t *const kLazyRecompile = "lazy_recompile"; |
| 132 | -const char_t *const kIsCopyOuputAddr = "1"; | 132 | +constexpr const char_t *const kIsCopyOuputAddr = "1"; |
| 133 | 133 | ||
| 134 | constexpr size_t kMaxHostMemInputLen = 128U; // 64 aligned | 134 | constexpr size_t kMaxHostMemInputLen = 128U; // 64 aligned |
| 135 | 135 | ||
| @@ -546,31 +546,31 @@ struct ModelQueueParam { | |||
| 546 | 546 | ||
| 547 | // internal options | 547 | // internal options |
| 548 | // 1: Graph resource evaluation does not limit model memory size. | 548 | // 1: Graph resource evaluation does not limit model memory size. |
| 549 | -const char_t *const EVALUATE_GRAPH_RESOURCE_MODE = "ge.evaluateGraphResourceMode"; | 549 | +constexpr const char_t *const EVALUATE_GRAPH_RESOURCE_MODE = "ge.evaluateGraphResourceMode"; |
| 550 | 550 | ||
| 551 | // 3: Config all resource and device mesh | 551 | // 3: Config all resource and device mesh |
| 552 | -const char_t *const RESOURCE_CONFIG_PATH = "ge.resourceConfigPath"; | 552 | +constexpr const char_t *const RESOURCE_CONFIG_PATH = "ge.resourceConfigPath"; |
| 553 | 553 | ||
| 554 | // 5: auto recompute attribute | 554 | // 5: auto recompute attribute |
| 555 | -const char_t *const RECOMPUTE = "ge.recompute"; | 555 | +constexpr const char_t *const RECOMPUTE = "ge.recompute"; |
| 556 | -const char_t *const GRAPH_SLICE_MODE = "ge.graphSliceMode"; | 556 | +constexpr const char_t *const GRAPH_SLICE_MODE = "ge.graphSliceMode"; |
| 557 | 557 | ||
| 558 | // 6: Topological Sorting Mode | 558 | // 6: Topological Sorting Mode |
| 559 | -const char_t *const OPTION_TOPOSORTING_MODE = "ge.topoSortingMode"; | 559 | +constexpr const char_t *const OPTION_TOPOSORTING_MODE = "ge.topoSortingMode"; |
| 560 | 560 | ||
| 561 | -const char_t *const OPTION_EXEC_RANK_TABLE = "ge.exec.rankTable"; | 561 | +constexpr const char_t *const OPTION_EXEC_RANK_TABLE = "ge.exec.rankTable"; |
| 562 | -const char_t *const OPTION_EXEC_HCOM_GROUPLIST = "ge.exec.hcomGrouplist"; | 562 | +constexpr const char_t *const OPTION_EXEC_HCOM_GROUPLIST = "ge.exec.hcomGrouplist"; |
| 563 | -const char_t *const OPTION_EXEC_HCOM_RANK_MAPPING = "ge.exec.hcomRankMapping"; | 563 | +constexpr const char_t *const OPTION_EXEC_HCOM_RANK_MAPPING = "ge.exec.hcomRankMapping"; |
| 564 | -const char_t *const OPTION_EXEC_HCOM_GROUPLIST_V2 = "ge.exec.hcomGrouplistV2"; | 564 | +constexpr const char_t *const OPTION_EXEC_HCOM_GROUPLIST_V2 = "ge.exec.hcomGrouplistV2"; |
| 565 | -const char_t *const OPTION_EXEC_GLOBAL_HCCL_COMM_CONFIG = "ge.exec.globalHcclCommConfig"; | 565 | +constexpr const char_t *const OPTION_EXEC_GLOBAL_HCCL_COMM_CONFIG = "ge.exec.globalHcclCommConfig"; |
| 566 | 566 | ||
| 567 | -const char_t *const OPTION_NUMA_CONFIG = "ge.numaConfig"; | 567 | +constexpr const char_t *const OPTION_NUMA_CONFIG = "ge.numaConfig"; |
| 568 | 568 | ||
| 569 | // 7: config format mode(expirimental option) | 569 | // 7: config format mode(expirimental option) |
| 570 | -const char_t *const OPTION_EXEC_FORMAT_MODEL = "ge.exec.formatMode"; | 570 | +constexpr const char_t *const OPTION_EXEC_FORMAT_MODEL = "ge.exec.formatMode"; |
| 571 | 571 | ||
| 572 | // 8: config build graph mode(online or offline) | 572 | // 8: config build graph mode(online or offline) |
| 573 | -const char_t *const OPTION_BUILD_GRAPH_MODE = "ge.buildGraphMode"; | 573 | +constexpr const char_t *const OPTION_BUILD_GRAPH_MODE = "ge.buildGraphMode"; |
| 574 | 574 | ||
| 575 | // Configure Attribute Compression flag(true or false, default true for backward compatibility) | 575 | // Configure Attribute Compression flag(true or false, default true for backward compatibility) |
| 576 | const std::string ENABLE_ATTR_COMPRESSION = "ge.enableAttrCompression"; | 576 | const std::string ENABLE_ATTR_COMPRESSION = "ge.enableAttrCompression"; |
| @@ -55,7 +55,7 @@ using AddrGetter = std::function<const void*(size_t)>; | |||
| 55 | 55 | ||
| 56 | GE_MAKE_GUARD(var, [&var]() { \ | 56 | GE_MAKE_GUARD(var, [&var]() { \ |
| 57 | if ((var) != nullptr) { \ | 57 | if ((var) != nullptr) { \ |
| 58 | - GE_CHK_RT(rtStreamDestroy(var)); \ | 58 | + GE_CHK_RT(aclrtDestroyStream(var)); \ |
| 59 | } \ | 59 | } \ |
| 60 | }) | 60 | }) |
| 61 | 61 | ||
| @@ -15,7 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | -#include "runtime/rt.h" | 18 | +#include "rt_external.h" |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | namespace ge { | 21 | namespace ge { |
| @@ -15,7 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | -#include "runtime/rt_model.h" | 18 | +#include "rt_external_model.h" |
| 19 | 19 | ||
| 20 | namespace ge { | 20 | namespace ge { |
| 21 | /*lint -e148*/ | 21 | /*lint -e148*/ |
| @@ -12,7 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | -#include "runtime/rt_ffts_plus.h" | 15 | +#include "rt_external_ffts.h" |
| 16 | 16 | ||
| 17 | namespace ffts { | 17 | namespace ffts { |
| 18 | class FFTSPlusEngineUpdate { | 18 | class FFTSPlusEngineUpdate { |
| @@ -15,7 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | -#include "runtime/rt_ffts_plus.h" | 18 | +#include "rt_external_ffts.h" |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | namespace ge { | 21 | namespace ge { |
| @@ -51,6 +51,7 @@ if(${TARGET_SYSTEM_NAME} STREQUAL "Linux") | |||
| 51 | ${AIR_CODE_DIR}/inc/external | 51 | ${AIR_CODE_DIR}/inc/external |
| 52 | ${AIR_CODE_DIR}/inc/framework/executor_c/c_base | 52 | ${AIR_CODE_DIR}/inc/framework/executor_c/c_base |
| 53 | ${AIR_CODE_DIR}/inc/framework/executor_c/c_mmpa | 53 | ${AIR_CODE_DIR}/inc/framework/executor_c/c_mmpa |
| 54 | + ${TOP_DIR}/runtime/include/external | ||
| 54 | ) | 55 | ) |
| 55 | 56 | ||
| 56 | target_compile_options(ge_dbg_c PRIVATE | 57 | target_compile_options(ge_dbg_c PRIVATE |
| @@ -100,6 +101,7 @@ elseif(${TARGET_SYSTEM_NAME} STREQUAL "LiteOS") | |||
| 100 | ${AIR_CODE_DIR}/inc/external | 101 | ${AIR_CODE_DIR}/inc/external |
| 101 | ${AIR_CODE_DIR}/inc/framework/executor_c/c_base | 102 | ${AIR_CODE_DIR}/inc/framework/executor_c/c_base |
| 102 | ${AIR_CODE_DIR}/inc/framework/executor_c/c_mmpa | 103 | ${AIR_CODE_DIR}/inc/framework/executor_c/c_mmpa |
| 104 | + ${TOP_DIR}/runtime/include/external | ||
| 103 | ) | 105 | ) |
| 104 | 106 | ||
| 105 | target_compile_options(ge_dbg_c_static_stub PRIVATE | 107 | target_compile_options(ge_dbg_c_static_stub PRIVATE |
| @@ -145,6 +147,7 @@ elseif(${TARGET_SYSTEM_NAME} STREQUAL "LiteOS") | |||
| 145 | ${AIR_CODE_DIR}/inc/external | 147 | ${AIR_CODE_DIR}/inc/external |
| 146 | ${AIR_CODE_DIR}/inc/framework/executor_c/c_base | 148 | ${AIR_CODE_DIR}/inc/framework/executor_c/c_base |
| 147 | ${AIR_CODE_DIR}/inc/framework/executor_c/c_mmpa | 149 | ${AIR_CODE_DIR}/inc/framework/executor_c/c_mmpa |
| 150 | + ${TOP_DIR}/runtime/include/external | ||
| 148 | ) | 151 | ) |
| 149 | 152 | ||
| 150 | target_compile_options(ge_dbg_c_static_debug PRIVATE | 153 | target_compile_options(ge_dbg_c_static_debug PRIVATE |
| @@ -15,8 +15,8 @@ | |||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | -#include "runtime/rt_model.h" | 18 | +#include "rt_external_model.h" |
| 19 | -#include "runtime/mem.h" | 19 | +#include "rt_external_mem.h" |
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | 22 | ||
| @@ -12,7 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | -#include "runtime/rt_model.h" | 15 | +#include "rt_external_model.h" |
| 16 | 16 | ||
| 17 | extern "C" { | 17 | extern "C" { |
| 18 | 18 | ||
| @@ -10,7 +10,7 @@ | |||
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | -#include "runtime/rt_model.h" | 13 | +#include "rt_external_model.h" |
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | typedef int(*CAC_AICPU_INIT_FUNC)(void); | 16 | typedef int(*CAC_AICPU_INIT_FUNC)(void); |
| @@ -9,7 +9,7 @@ | |||
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | -#include "runtime/rt_model.h" | 12 | +#include "rt_external_model.h" |
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | static Status StartDumpThread(void) { | 15 | static Status StartDumpThread(void) { |
| @@ -16,9 +16,10 @@ | |||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | -#include "runtime/dev.h" | 19 | +#include "rt_external_device.h" |
| 20 | -#include "runtime/rt_model.h" | 20 | +#include "acl/acl_rt.h" |
| 21 | -#include "runtime/mem.h" | 21 | +#include "rt_external_model.h" |
| 22 | + | ||
| 22 | 23 | ||
| 23 | 24 | ||
| 24 | 25 | ||
| @@ -187,7 +188,7 @@ static char *ConcatDumpPath(char *dumpPath) { | |||
| 187 | (void)strftime(timeStamp, BUFFER_SIZE, "%Y%m%d%H%M%S", ptm); | 188 | (void)strftime(timeStamp, BUFFER_SIZE, "%Y%m%d%H%M%S", ptm); |
| 188 | } | 189 | } |
| 189 | int32_t deviceId = 0; | 190 | int32_t deviceId = 0; |
| 190 | - (void)rtGetDevice(&deviceId); | 191 | + (void)aclrtGetDevice(&deviceId); |
| 191 | bool result = 0; | 192 | bool result = 0; |
| 192 | char devIdStr[IDMAX]; | 193 | char devIdStr[IDMAX]; |
| 193 | uint32_t devLen = IntToStr((size_t)deviceId, devIdStr, IDMAX); | 194 | uint32_t devLen = IntToStr((size_t)deviceId, devIdStr, IDMAX); |
| @@ -33,6 +33,7 @@ target_include_directories(ge_executor_c_static PRIVATE | |||
| 33 | ${AIR_CODE_DIR}/inc/framework/executor_c/c_base | 33 | ${AIR_CODE_DIR}/inc/framework/executor_c/c_base |
| 34 | ${AIR_CODE_DIR}/inc/framework/executor_c/c_mmpa | 34 | ${AIR_CODE_DIR}/inc/framework/executor_c/c_mmpa |
| 35 | ${AIR_CODE_DIR}/runtime/c/executor | 35 | ${AIR_CODE_DIR}/runtime/c/executor |
| 36 | + ${TOP_DIR}/runtime/include/external | ||
| 36 | $<$<STREQUAL:${TARGET_SYSTEM_NAME},LiteOS>:${AIR_CODE_DIR}/runtime/c/dbg/profiling> | 37 | $<$<STREQUAL:${TARGET_SYSTEM_NAME},LiteOS>:${AIR_CODE_DIR}/runtime/c/dbg/profiling> |
| 37 | $<$<STREQUAL:${TARGET_SYSTEM_NAME},LiteOS>:${AIR_CODE_DIR}/runtime/c/dbg/dump> | 38 | $<$<STREQUAL:${TARGET_SYSTEM_NAME},LiteOS>:${AIR_CODE_DIR}/runtime/c/dbg/dump> |
| 38 | $<$<STREQUAL:${TARGET_SYSTEM_NAME},LiteOS>:${AIR_CODE_DIR}/runtime/c/dbg/> | 39 | $<$<STREQUAL:${TARGET_SYSTEM_NAME},LiteOS>:${AIR_CODE_DIR}/runtime/c/dbg/> |
| @@ -13,7 +13,7 @@ | |||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | -#include "runtime/rt_model.h" | 16 | +#include "rt_external_model.h" |
| 17 | 17 | ||
| 18 | extern "C" { | 18 | extern "C" { |
| 19 | 19 | ||
| @@ -10,7 +10,7 @@ | |||
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | -#include "runtime/mem.h" | 13 | +#include "rt_external_mem.h" |
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | Status CheckOmHeadWithMem(const ModelData *model_data) { | 16 | Status CheckOmHeadWithMem(const ModelData *model_data) { |
| @@ -107,7 +107,7 @@ static Status GetModelFifoSize(const ModelData *modelData, size_t *fifoSize) { | |||
| 107 | } | 107 | } |
| 108 | 108 | ||
| 109 | if (mdlDesc.fifoInfo.fifoBaseAddr != NULL) { | 109 | if (mdlDesc.fifoInfo.fifoBaseAddr != NULL) { |
| 110 | - (void)rtFree(mdlDesc.fifoInfo.fifoBaseAddr); | 110 | + (void)aclrtFree(mdlDesc.fifoInfo.fifoBaseAddr); |
| 111 | mdlDesc.fifoInfo.fifoBaseAddr = NULL; | 111 | mdlDesc.fifoInfo.fifoBaseAddr = NULL; |
| 112 | } | 112 | } |
| 113 | DeInitModelFifoInfo(&(mdlDesc.fifoInfo)); | 113 | DeInitModelFifoInfo(&(mdlDesc.fifoInfo)); |
| @@ -14,22 +14,22 @@ | |||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | -#include "runtime/stream.h" | 17 | +#include "rt_external_stream.h" |
| 18 | -#include "runtime/mem.h" | 18 | +#include "rt_external_mem.h" |
| 19 | -#include "runtime/rt_model.h" | 19 | +#include "rt_external_model.h" |
| 20 | static void *ModelGetIoAddr(uint32_t in_nums, uint32_t out_nums, | 20 | static void *ModelGetIoAddr(uint32_t in_nums, uint32_t out_nums, |
| 21 | const InputData *input_data, | 21 | const InputData *input_data, |
| 22 | OutputData *output_data, GeModelDesc *mdlDesc) { | 22 | OutputData *output_data, GeModelDesc *mdlDesc) { |
| 23 | uint32_t ioa_size = in_nums + out_nums; | 23 | uint32_t ioa_size = in_nums + out_nums; |
| 24 | GELOGI("output->ioa_size:%u, ioa_size:%u", output_data->ioa_size, ioa_size); | 24 | GELOGI("output->ioa_size:%u, ioa_size:%u", output_data->ioa_size, ioa_size); |
| 25 | if ((output_data->ioa_size < ioa_size) && (output_data->io_addr != NULL)) { | 25 | if ((output_data->ioa_size < ioa_size) && (output_data->io_addr != NULL)) { |
| 26 | - rtFree(output_data->io_addr); | 26 | + aclrtFree(output_data->io_addr); |
| 27 | output_data->io_addr = NULL; | 27 | output_data->io_addr = NULL; |
| 28 | } | 28 | } |
| 29 | uint32_t fifo_num = mdlDesc->fifoInfo.fifoNum; | 29 | uint32_t fifo_num = mdlDesc->fifoInfo.fifoNum; |
| 30 | uint64_t addr_size = sizeof(uint64_t) * (ioa_size + fifo_num); | 30 | uint64_t addr_size = sizeof(uint64_t) * (ioa_size + fifo_num); |
| 31 | if (output_data->io_addr == NULL) { | 31 | if (output_data->io_addr == NULL) { |
| 32 | - if (rtMalloc((void **)&output_data->io_addr, addr_size, mdlDesc->memType, 0) != RT_ERROR_NONE) { | 32 | + if (aclrtMalloc((void **)&output_data->io_addr, addr_size, mdlDesc->memType) != ACL_ERROR_NONE) { |
| 33 | output_data->io_addr = NULL; | 33 | output_data->io_addr = NULL; |
| 34 | output_data->ioa_size = 0; | 34 | output_data->ioa_size = 0; |
| 35 | return NULL; | 35 | return NULL; |
| @@ -39,7 +39,7 @@ static void *ModelGetIoAddr(uint32_t in_nums, uint32_t out_nums, | |||
| 39 | if (output_data->io_addr_host == NULL) { | 39 | if (output_data->io_addr_host == NULL) { |
| 40 | output_data->io_addr_host = mmMalloc(addr_size); | 40 | output_data->io_addr_host = mmMalloc(addr_size); |
| 41 | if (output_data->io_addr_host == NULL) { | 41 | if (output_data->io_addr_host == NULL) { |
| 42 | - (void)rtFree(output_data->io_addr); | 42 | + (void)aclrtFree(output_data->io_addr); |
| 43 | output_data->io_addr = NULL; | 43 | output_data->io_addr = NULL; |
| 44 | output_data->ioa_size = 0; | 44 | output_data->ioa_size = 0; |
| 45 | return NULL; | 45 | return NULL; |
| @@ -60,7 +60,7 @@ static void *ModelGetIoAddr(uint32_t in_nums, uint32_t out_nums, | |||
| 60 | ioa_src_addr_host[index++] = mdlDesc->fifoInfo.fifoAllAddr[i]; | 60 | ioa_src_addr_host[index++] = mdlDesc->fifoInfo.fifoAllAddr[i]; |
| 61 | } | 61 | } |
| 62 | if (rtMemcpy(ioa_src_addr, addr_size, ioa_src_addr_host, addr_size, RT_MEMCPY_HOST_TO_DEVICE) != RT_ERROR_NONE) { | 62 | if (rtMemcpy(ioa_src_addr, addr_size, ioa_src_addr_host, addr_size, RT_MEMCPY_HOST_TO_DEVICE) != RT_ERROR_NONE) { |
| 63 | - (void)rtFree(output_data->io_addr); | 63 | + (void)aclrtFree(output_data->io_addr); |
| 64 | (void)mmFree(output_data->io_addr_host); | 64 | (void)mmFree(output_data->io_addr_host); |
| 65 | output_data->io_addr = NULL; | 65 | output_data->io_addr = NULL; |
| 66 | output_data->io_addr_host = NULL; | 66 | output_data->io_addr_host = NULL; |
| @@ -11,8 +11,8 @@ | |||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | -#include "runtime/rt_model.h" | 14 | +#include "rt_external_model.h" |
| 15 | -#include "runtime/mem.h" | 15 | +#include "rt_external_mem.h" |
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | typedef struct { | 18 | typedef struct { |
| @@ -92,7 +92,7 @@ static ModelDescRefObj *CreateModelDescRefObj(void) { | |||
| 92 | mdlDescRefObj->modelDesc.modelDbgHandle = NULL; | 92 | mdlDescRefObj->modelDesc.modelDbgHandle = NULL; |
| 93 | InitModelInOutInfo(&mdlDescRefObj->modelDesc.ioInfo); | 93 | InitModelInOutInfo(&mdlDescRefObj->modelDesc.ioInfo); |
| 94 | InitModelFifoInfo(&mdlDescRefObj->modelDesc.fifoInfo); | 94 | InitModelFifoInfo(&mdlDescRefObj->modelDesc.fifoInfo); |
| 95 | - mdlDescRefObj->modelDesc.memType = RT_MEMORY_DEFAULT; | 95 | + mdlDescRefObj->modelDesc.memType = ACL_MEM_MALLOC_HUGE_FIRST; |
| 96 | GELOGD("create model desc ref obj success."); | 96 | GELOGD("create model desc ref obj success."); |
| 97 | return mdlDescRefObj; | 97 | return mdlDescRefObj; |
| 98 | } | 98 | } |
| @@ -10,8 +10,8 @@ | |||
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | -#include "runtime/mem.h" | 13 | +#include "rt_external_mem.h" |
| 14 | -#include "runtime/rt_model.h" | 14 | +#include "rt_external_model.h" |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| @@ -33,37 +33,37 @@ static int32_t ModelDescRefObjCmp(void *a, void *b, void *appInfo) { | |||
| 33 | 33 | ||
| 34 | static void FreeModelDescMem(GeModelDesc *modelDesc) { | 34 | static void FreeModelDescMem(GeModelDesc *modelDesc) { |
| 35 | if ((modelDesc->innerPtrState & INNER_TBE_KERNELS_PTR) != 0) { | 35 | if ((modelDesc->innerPtrState & INNER_TBE_KERNELS_PTR) != 0) { |
| 36 | - (void)rtFree(modelDesc->part.kernelPtr); | 36 | + (void)aclrtFree(modelDesc->part.kernelPtr); |
| 37 | modelDesc->part.kernelPtr = NULL; | 37 | modelDesc->part.kernelPtr = NULL; |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | if ((modelDesc->innerPtrState & INNER_WEIGHTS_DATA_PTR) != 0) { | 40 | if ((modelDesc->innerPtrState & INNER_WEIGHTS_DATA_PTR) != 0) { |
| 41 | - (void)rtFree(modelDesc->part.weightPtr); | 41 | + (void)aclrtFree(modelDesc->part.weightPtr); |
| 42 | modelDesc->part.weightPtr = NULL; | 42 | modelDesc->part.weightPtr = NULL; |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | if ((modelDesc->innerPtrState & INNER_STATIC_TASK_DESC_PTR) != 0) { | 45 | if ((modelDesc->innerPtrState & INNER_STATIC_TASK_DESC_PTR) != 0) { |
| 46 | - (void)rtFree(modelDesc->part.taskPtr); | 46 | + (void)aclrtFree(modelDesc->part.taskPtr); |
| 47 | modelDesc->part.taskPtr = NULL; | 47 | modelDesc->part.taskPtr = NULL; |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | if ((modelDesc->innerPtrState & INNER_TASK_PARAM_PTR) != 0) { | 50 | if ((modelDesc->innerPtrState & INNER_TASK_PARAM_PTR) != 0) { |
| 51 | - (void)rtFree(modelDesc->part.paramPtr); | 51 | + (void)aclrtFree(modelDesc->part.paramPtr); |
| 52 | modelDesc->part.paramPtr = NULL; | 52 | modelDesc->part.paramPtr = NULL; |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | if ((modelDesc->innerPtrState & INNER_DYNAMIC_TASK_DESC_PTR) != 0) { | 55 | if ((modelDesc->innerPtrState & INNER_DYNAMIC_TASK_DESC_PTR) != 0) { |
| 56 | - (void)rtFree(modelDesc->part.dynTaskPtr); | 56 | + (void)aclrtFree(modelDesc->part.dynTaskPtr); |
| 57 | modelDesc->part.dynTaskPtr = NULL; | 57 | modelDesc->part.dynTaskPtr = NULL; |
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | if ((modelDesc->innerPtrState & INNER_PRE_MODEL_DESC_PTR) != 0) { | 60 | if ((modelDesc->innerPtrState & INNER_PRE_MODEL_DESC_PTR) != 0) { |
| 61 | - (void)rtFree(modelDesc->part.modelDescPtr); | 61 | + (void)aclrtFree(modelDesc->part.modelDescPtr); |
| 62 | modelDesc->part.modelDescPtr = NULL; | 62 | modelDesc->part.modelDescPtr = NULL; |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | if ((modelDesc->innerPtrState & INNER_FIFO_PTR) != 0) { | 65 | if ((modelDesc->innerPtrState & INNER_FIFO_PTR) != 0) { |
| 66 | - (void)rtFree(modelDesc->part.fifoPtr); | 66 | + (void)aclrtFree(modelDesc->part.fifoPtr); |
| 67 | modelDesc->part.fifoPtr = NULL; | 67 | modelDesc->part.fifoPtr = NULL; |
| 68 | } | 68 | } |
| 69 | 69 | ||
| @@ -12,6 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | + | ||
| 15 | 16 | ||
| 16 | 17 | ||
| 17 | extern "C" { | 18 | extern "C" { |
| @@ -34,7 +35,7 @@ typedef struct { | |||
| 34 | uint64_t stepId; | 35 | uint64_t stepId; |
| 35 | void *modelDbgHandle; | 36 | void *modelDbgHandle; |
| 36 | ModelFifoInfo fifoInfo; | 37 | ModelFifoInfo fifoInfo; |
| 37 | - size_t memType; | 38 | + aclrtMemMallocPolicy memType; |
| 38 | } GeModelDesc; | 39 | } GeModelDesc; |
| 39 | 40 | ||
| 40 | typedef struct { | 41 | typedef struct { |
| @@ -9,7 +9,7 @@ | |||
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | -#include "runtime/mem.h" | 12 | +#include "rt_external_mem.h" |
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| @@ -33,8 +33,8 @@ static Status ParseModelDesc(const ModelData *modelData, size_t offset, | |||
| 33 | uint8_t *data, size_t size, GeModelDesc *mdlDesc) { | 33 | uint8_t *data, size_t size, GeModelDesc *mdlDesc) { |
| 34 | void *dstAddr = modelData->part.modelDescPtr; | 34 | void *dstAddr = modelData->part.modelDescPtr; |
| 35 | if ((modelData->part.modelDescPtr == NULL) || (modelData->part.modelDescSize < size)) { | 35 | if ((modelData->part.modelDescPtr == NULL) || (modelData->part.modelDescSize < size)) { |
| 36 | - rtError_t rtRet = rtMalloc((void **)&dstAddr, size, mdlDesc->memType, 0); | 36 | + aclError rtRet = aclrtMalloc((void **)&dstAddr, size, mdlDesc->memType); |
| 37 | - if (rtRet != RT_ERROR_NONE) { | 37 | + if (rtRet != ACL_ERROR_NONE) { |
| 38 | return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; | 38 | return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; |
| 39 | } | 39 | } |
| 40 | mdlDesc->innerPtrState = mdlDesc->innerPtrState | INNER_PRE_MODEL_DESC_PTR; | 40 | mdlDesc->innerPtrState = mdlDesc->innerPtrState | INNER_PRE_MODEL_DESC_PTR; |
| @@ -58,8 +58,8 @@ static Status ParseWeightData(const ModelData *modelData, size_t offset, | |||
| 58 | uint8_t *data, size_t size, GeModelDesc *mdlDesc) { | 58 | uint8_t *data, size_t size, GeModelDesc *mdlDesc) { |
| 59 | void *dstAddr = modelData->part.weightPtr; | 59 | void *dstAddr = modelData->part.weightPtr; |
| 60 | if ((modelData->part.weightPtr == NULL) || (modelData->part.weightSize < size)) { | 60 | if ((modelData->part.weightPtr == NULL) || (modelData->part.weightSize < size)) { |
| 61 | - rtError_t rtRet = rtMalloc((void **)&dstAddr, size, mdlDesc->memType, 0); | 61 | + aclError rtRet = aclrtMalloc((void **)&dstAddr, size, mdlDesc->memType); |
| 62 | - if (rtRet != RT_ERROR_NONE) { | 62 | + if (rtRet != ACL_ERROR_NONE) { |
| 63 | return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; | 63 | return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; |
| 64 | } | 64 | } |
| 65 | mdlDesc->innerPtrState = mdlDesc->innerPtrState | INNER_WEIGHTS_DATA_PTR; | 65 | mdlDesc->innerPtrState = mdlDesc->innerPtrState | INNER_WEIGHTS_DATA_PTR; |
| @@ -83,8 +83,8 @@ static Status ParseTbeKernels(const ModelData *modelData, size_t offset, | |||
| 83 | uint8_t *data, size_t size, GeModelDesc *mdlDesc) { | 83 | uint8_t *data, size_t size, GeModelDesc *mdlDesc) { |
| 84 | void *dstAddr = modelData->part.kernelPtr; | 84 | void *dstAddr = modelData->part.kernelPtr; |
| 85 | if ((modelData->part.kernelPtr == NULL) || (modelData->part.kernelSize < size)) { | 85 | if ((modelData->part.kernelPtr == NULL) || (modelData->part.kernelSize < size)) { |
| 86 | - rtError_t rtRet = rtMalloc((void **)&dstAddr, size, mdlDesc->memType, 0); | 86 | + aclError rtRet = aclrtMalloc((void **)&dstAddr, size, mdlDesc->memType); |
| 87 | - if (rtRet != RT_ERROR_NONE) { | 87 | + if (rtRet != ACL_ERROR_NONE) { |
| 88 | return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; | 88 | return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; |
| 89 | } | 89 | } |
| 90 | mdlDesc->innerPtrState = mdlDesc->innerPtrState | INNER_TBE_KERNELS_PTR; | 90 | mdlDesc->innerPtrState = mdlDesc->innerPtrState | INNER_TBE_KERNELS_PTR; |
| @@ -108,8 +108,8 @@ static Status ParseStaticTaskDesc(const ModelData *modelData, size_t offset, | |||
| 108 | uint8_t *data, size_t size, GeModelDesc *mdlDesc) { | 108 | uint8_t *data, size_t size, GeModelDesc *mdlDesc) { |
| 109 | void *dstAddr = modelData->part.taskPtr; | 109 | void *dstAddr = modelData->part.taskPtr; |
| 110 | if ((modelData->part.taskPtr == NULL) || (modelData->part.taskSize < size)) { | 110 | if ((modelData->part.taskPtr == NULL) || (modelData->part.taskSize < size)) { |
| 111 | - rtError_t rtRet = rtMalloc((void **)&dstAddr, size, mdlDesc->memType, 0); | 111 | + aclError rtRet = aclrtMalloc((void **)&dstAddr, size, mdlDesc->memType); |
| 112 | - if (rtRet != RT_ERROR_NONE) { | 112 | + if (rtRet != ACL_ERROR_NONE) { |
| 113 | return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; | 113 | return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; |
| 114 | } | 114 | } |
| 115 | mdlDesc->innerPtrState = mdlDesc->innerPtrState | INNER_STATIC_TASK_DESC_PTR; | 115 | mdlDesc->innerPtrState = mdlDesc->innerPtrState | INNER_STATIC_TASK_DESC_PTR; |
| @@ -134,8 +134,8 @@ static Status ParseDynamicTaskDesc(const ModelData *modelData, size_t offset, | |||
| 134 | uint8_t *data, size_t size, GeModelDesc *mdlDesc) { | 134 | uint8_t *data, size_t size, GeModelDesc *mdlDesc) { |
| 135 | void *dstAddr = modelData->part.dynTaskPtr; | 135 | void *dstAddr = modelData->part.dynTaskPtr; |
| 136 | if ((modelData->part.dynTaskPtr == NULL) || (modelData->part.dynTaskSize < size)) { | 136 | if ((modelData->part.dynTaskPtr == NULL) || (modelData->part.dynTaskSize < size)) { |
| 137 | - rtError_t rtRet = rtMalloc((void **)&dstAddr, size, mdlDesc->memType, 0); | 137 | + aclError rtRet = aclrtMalloc((void **)&dstAddr, size, mdlDesc->memType); |
| 138 | - if (rtRet != RT_ERROR_NONE) { | 138 | + if (rtRet != ACL_ERROR_NONE) { |
| 139 | return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; | 139 | return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; |
| 140 | } | 140 | } |
| 141 | mdlDesc->innerPtrState = mdlDesc->innerPtrState | INNER_DYNAMIC_TASK_DESC_PTR; | 141 | mdlDesc->innerPtrState = mdlDesc->innerPtrState | INNER_DYNAMIC_TASK_DESC_PTR; |
| @@ -159,8 +159,8 @@ static Status ParseTaskParam(const ModelData *modelData, size_t offset, | |||
| 159 | uint8_t *data, size_t size, GeModelDesc *mdlDesc) { | 159 | uint8_t *data, size_t size, GeModelDesc *mdlDesc) { |
| 160 | void *dstAddr = modelData->part.paramPtr; | 160 | void *dstAddr = modelData->part.paramPtr; |
| 161 | if ((modelData->part.paramPtr == NULL) || (modelData->part.paramSize < size)) { | 161 | if ((modelData->part.paramPtr == NULL) || (modelData->part.paramSize < size)) { |
| 162 | - rtError_t rtRet = rtMalloc((void **)&dstAddr, size, mdlDesc->memType, 0); | 162 | + aclError rtRet = aclrtMalloc((void **)&dstAddr, size, mdlDesc->memType); |
| 163 | - if (rtRet != RT_ERROR_NONE) { | 163 | + if (rtRet != ACL_ERROR_NONE) { |
| 164 | return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; | 164 | return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; |
| 165 | } | 165 | } |
| 166 | mdlDesc->innerPtrState = mdlDesc->innerPtrState | INNER_TASK_PARAM_PTR; | 166 | mdlDesc->innerPtrState = mdlDesc->innerPtrState | INNER_TASK_PARAM_PTR; |
| @@ -440,9 +440,9 @@ static Status ProcFifoInfo(const ModelData *modelData, uint8_t *tlvValue, uint32 | |||
| 440 | } | 440 | } |
| 441 | geFifoInfo->fifoBaseAddr = modelData->part.fifoPtr; | 441 | geFifoInfo->fifoBaseAddr = modelData->part.fifoPtr; |
| 442 | if ((modelData->part.fifoPtr == NULL) || (modelData->part.fifoSize < geFifoInfo->totalSize)) { | 442 | if ((modelData->part.fifoPtr == NULL) || (modelData->part.fifoSize < geFifoInfo->totalSize)) { |
| 443 | - rtError_t rtRet = rtMalloc(&geFifoInfo->fifoBaseAddr, geFifoInfo->totalSize, mdlDesc->memType, 0); | 443 | + aclError rtRet = aclrtMalloc(&geFifoInfo->fifoBaseAddr, geFifoInfo->totalSize, mdlDesc->memType); |
| 444 | - if (rtRet != RT_ERROR_NONE) { | 444 | + if (rtRet != ACL_ERROR_NONE) { |
| 445 | - GELOGE(ACL_ERROR_GE_INTERNAL_ERROR, "rtMalloc failed."); | 445 | + GELOGE(ACL_ERROR_GE_INTERNAL_ERROR, "aclrtMalloc failed."); |
| 446 | return ACL_ERROR_GE_LOAD_MODEL; | 446 | return ACL_ERROR_GE_LOAD_MODEL; |
| 447 | } | 447 | } |
| 448 | mdlDesc->innerPtrState = mdlDesc->innerPtrState | INNER_FIFO_PTR; | 448 | mdlDesc->innerPtrState = mdlDesc->innerPtrState | INNER_FIFO_PTR; |
| @@ -12,7 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | -#include "runtime/rt.h" | 15 | +#include "rt_external.h" |
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | namespace ge { | 18 | namespace ge { |
| @@ -14,7 +14,7 @@ | |||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | -#include "runtime/kernel.h" | 17 | +#include "rt_external_kernel.h" |
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | 20 | ||
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | -#include "runtime/rt.h" | 14 | +#include "rt_external.h" |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | namespace ge { | 17 | namespace ge { |
| @@ -22,6 +22,8 @@ | |||
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | + | ||
| 26 | + | ||
| 25 | 27 | ||
| 26 | namespace ge { | 28 | namespace ge { |
| 27 | namespace dump { | 29 | namespace dump { |
| @@ -26,7 +26,7 @@ | |||
| 26 | 26 | ||
| 27 | 27 | ||
| 28 | 28 | ||
| 29 | -#include "runtime/mem.h" | 29 | +#include "rt_external_mem.h" |
| 30 | 30 | ||
| 31 | namespace gert { | 31 | namespace gert { |
| 32 | namespace { | 32 | namespace { |
| @@ -25,7 +25,7 @@ | |||
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | 27 | ||
| 28 | -#include "runtime/mem.h" | 28 | +#include "rt_external_mem.h" |
| 29 | 29 | ||
| 30 | 30 | ||
| 31 | 31 | ||
| @@ -24,9 +24,7 @@ | |||
| 24 | 24 | ||
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | -#include "runtime/rt.h" | 27 | +#include "rt_external.h" |
| 28 | -// 待rt.h删除后再替换 | ||
| 29 | - | ||
| 30 | 28 | ||
| 31 | 29 | ||
| 32 | 30 | ||
| @@ -1479,7 +1477,7 @@ Status DataDumper::UnloadDumpInfoByModel(uint32_t model_id) { | |||
| 1479 | GE_FREE_RT_LOG(dev_mem_unload_for_model_); | 1477 | GE_FREE_RT_LOG(dev_mem_unload_for_model_); |
| 1480 | } | 1478 | } |
| 1481 | 1479 | ||
| 1482 | - GE_ASSERT_RT_OK(ge::AclrtMalloc(&dev_mem_unload_for_model_, proto_size, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 1480 | + GE_ASSERT_ACL_OK(ge::AclrtMalloc(&dev_mem_unload_for_model_, proto_size, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 1483 | GE_ASSERT_RT_OK(aclrtMemcpy(dev_mem_unload_for_model_, proto_size, proto_str.c_str(), | 1481 | GE_ASSERT_RT_OK(aclrtMemcpy(dev_mem_unload_for_model_, proto_size, proto_str.c_str(), |
| 1484 | proto_size, ACL_MEMCPY_HOST_TO_DEVICE)); | 1482 | proto_size, ACL_MEMCPY_HOST_TO_DEVICE)); |
| 1485 | GE_ASSERT_TRUE(rtDatadumpInfoLoad(dev_mem_unload_for_model_, static_cast<uint32_t>(proto_size)) == RT_ERROR_NONE); | 1483 | GE_ASSERT_TRUE(rtDatadumpInfoLoad(dev_mem_unload_for_model_, static_cast<uint32_t>(proto_size)) == RT_ERROR_NONE); |
| @@ -22,10 +22,10 @@ | |||
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | -#include "runtime/mem.h" | 25 | +#include "rt_external_mem.h" |
| 26 | 26 | ||
| 27 | 27 | ||
| 28 | -#include "runtime/base.h" | 28 | +#include "rt_external_base.h" |
| 29 | 29 | ||
| 30 | 30 | ||
| 31 | namespace ge { | 31 | namespace ge { |
| @@ -10,7 +10,7 @@ | |||
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | -#include "runtime/kernel.h" | 13 | +#include "rt_external_kernel.h" |
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | 16 | ||
| @@ -85,7 +85,7 @@ Status OpdebugRegister::CreateOpDebugTaskByStream(aclrtStream const stream, cons | |||
| 85 | auto &op_debug_task = op_debug_tasks_[stream]; | 85 | auto &op_debug_task = op_debug_tasks_[stream]; |
| 86 | op_debug_task = MakeUnique<OpDebugTask>(); | 86 | op_debug_task = MakeUnique<OpDebugTask>(); |
| 87 | GE_CHECK_NOTNULL(op_debug_task); | 87 | GE_CHECK_NOTNULL(op_debug_task); |
| 88 | - GE_CHK_RT_RET(ge::AclrtMallocForTaskScheduler(&op_debug_task->op_debug_addr_, kOpDebugMemorySize, ACL_MEM_MALLOC_HUGE_FIRST, GE_MODULE_NAME_U16)); | 88 | + GE_CHK_ACL_RET(ge::AclrtMallocForTaskScheduler(&op_debug_task->op_debug_addr_, kOpDebugMemorySize, ACL_MEM_MALLOC_HUGE_FIRST, GE_MODULE_NAME_U16)); |
| 89 | GE_CHK_RT_RET(rtDebugRegisterForStream(stream, op_debug_mode, op_debug_task->op_debug_addr_, | 89 | GE_CHK_RT_RET(rtDebugRegisterForStream(stream, op_debug_mode, op_debug_task->op_debug_addr_, |
| 90 | &op_debug_task->debug_stream_id_, &op_debug_task->debug_task_id_)); | 90 | &op_debug_task->debug_stream_id_, &op_debug_task->debug_task_id_)); |
| 91 | return SUCCESS; | 91 | return SUCCESS; |
| @@ -93,8 +93,8 @@ Status OpdebugRegister::CreateOpDebugTaskByStream(aclrtStream const stream, cons | |||
| 93 | 93 | ||
| 94 | Status OpdebugRegister::MallocP2PDebugMem(const void * const op_debug_addr) { | 94 | Status OpdebugRegister::MallocP2PDebugMem(const void * const op_debug_addr) { |
| 95 | const uint64_t debug_addrs_tmp = PtrToValue(op_debug_addr); | 95 | const uint64_t debug_addrs_tmp = PtrToValue(op_debug_addr); |
| 96 | - GE_CHK_RT_RET(aclrtMalloc(&p2p_debug_addr_, kDebugP2pSize, ACL_MEM_TYPE_HIGH_BAND_WIDTH)); | 96 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&p2p_debug_addr_, kDebugP2pSize, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 97 | - GE_CHK_RT_RET(aclrtMemcpy(p2p_debug_addr_, sizeof(uint64_t), &debug_addrs_tmp, sizeof(uint64_t), | 97 | + GE_CHK_ACL_RET(aclrtMemcpy(p2p_debug_addr_, sizeof(uint64_t), &debug_addrs_tmp, sizeof(uint64_t), |
| 98 | ACL_MEMCPY_HOST_TO_DEVICE)); | 98 | ACL_MEMCPY_HOST_TO_DEVICE)); |
| 99 | return SUCCESS; | 99 | return SUCCESS; |
| 100 | } | 100 | } |
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | -#include "runtime/base.h" | 14 | +#include "rt_external_base.h" |
| 15 | 15 | ||
| 16 | namespace ge { | 16 | namespace ge { |
| 17 | // RTS Callback(runtime/base.h): typedef rtError_t (*rtProfCtrlHandle)(uint32_t type, void *data, uint32_t len) | 17 | // RTS Callback(runtime/base.h): typedef rtError_t (*rtProfCtrlHandle)(uint32_t type, void *data, uint32_t len) |
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | -#include "runtime/rt.h" | 14 | +#include "rt_external.h" |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| @@ -13,7 +13,7 @@ | |||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | -#include "runtime/base.h" | 16 | +#include "rt_external_base.h" |
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | 19 | ||
| @@ -21,7 +21,7 @@ | |||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | -#include "runtime/stream.h" | 24 | +#include "rt_external_stream.h" |
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | 27 | ||
| @@ -10,9 +10,9 @@ | |||
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | -#include "runtime/rt_ffts_plus.h" | 13 | +#include "rt_external_ffts.h" |
| 14 | -#include "runtime/rt_stars.h" | 14 | +#include "rt_external_stars.h" |
| 15 | -#include "runtime/mem.h" | 15 | +#include "rt_external_mem.h" |
| 16 | 16 | ||
| 17 | namespace ge { | 17 | namespace ge { |
| 18 | rtError_t rtFftsPlusTaskLaunchWithFlag(const rtFftsPlusTaskInfo_t *const fftsPlusTaskInfo, const void *const stm, | 18 | rtError_t rtFftsPlusTaskLaunchWithFlag(const rtFftsPlusTaskInfo_t *const fftsPlusTaskInfo, const void *const stm, |
| @@ -312,9 +312,9 @@ Status ExecutorUtils::AssembleReuseBinaryArgs(const OpDescPtr &op_desc, optiling | |||
| 312 | memcpy_kind = op_desc->HasAttr(ge::ATTR_SINGLE_OP_SCENE) ? ACL_MEMCPY_HOST_TO_HOST : ACL_MEMCPY_HOST_TO_DEVICE; | 312 | memcpy_kind = op_desc->HasAttr(ge::ATTR_SINGLE_OP_SCENE) ? ACL_MEMCPY_HOST_TO_HOST : ACL_MEMCPY_HOST_TO_DEVICE; |
| 313 | void *const tiling_data_addr = ge::ValueToPtr(ge::PtrToValue(args_ex.args) + args_ex.tilingDataOffset); | 313 | void *const tiling_data_addr = ge::ValueToPtr(ge::PtrToValue(args_ex.args) + args_ex.tilingDataOffset); |
| 314 | void *const tiling_addr_offset = ge::ValueToPtr(ge::PtrToValue(args_ex.args) + args_ex.tilingAddrOffset); | 314 | void *const tiling_addr_offset = ge::ValueToPtr(ge::PtrToValue(args_ex.args) + args_ex.tilingAddrOffset); |
| 315 | - GE_CHK_RT_RET(aclrtMemcpy(tiling_addr_offset, sizeof(uintptr_t), &tiling_data_addr, | 315 | + GE_CHK_ACL_RET(aclrtMemcpy(tiling_addr_offset, sizeof(uintptr_t), &tiling_data_addr, |
| 316 | sizeof(uintptr_t), memcpy_kind)); | 316 | sizeof(uintptr_t), memcpy_kind)); |
| 317 | - GE_CHK_RT_RET(aclrtMemcpy(tiling_data_addr, max_tiling_size, run_info.GetAllTilingData().str().data(), | 317 | + GE_CHK_ACL_RET(aclrtMemcpy(tiling_data_addr, max_tiling_size, run_info.GetAllTilingData().str().data(), |
| 318 | tiling_data_size, memcpy_kind)); | 318 | tiling_data_size, memcpy_kind)); |
| 319 | 319 | ||
| 320 | GELOGD("Update args of %s, block dim: %u, tiling key: %" PRIu64 ", tilingAddrOffset: %u," | 320 | GELOGD("Update args of %s, block dim: %u, tiling key: %" PRIu64 ", tilingAddrOffset: %u," |
| @@ -30,8 +30,7 @@ | |||
| 30 | 30 | ||
| 31 | 31 | ||
| 32 | 32 | ||
| 33 | -#include "runtime/base.h" | 33 | +#include "rt_external_base.h" |
| 34 | - | ||
| 35 | 34 | ||
| 36 | 35 | ||
| 37 | 36 | ||
| @@ -1317,7 +1316,7 @@ Status GeExecutor::ReleaseSingleOpResource(void *const stream) { | |||
| 1317 | 1316 | ||
| 1318 | Status GeExecutor::ClearCustomAicpuSo(const uint32_t device_id) { | 1317 | Status GeExecutor::ClearCustomAicpuSo(const uint32_t device_id) { |
| 1319 | int32_t cur_device_id = -1; | 1318 | int32_t cur_device_id = -1; |
| 1320 | - GE_CHK_RT_RET(aclrtGetDevice(&cur_device_id)); | 1319 | + GE_CHK_ACL_RET(aclrtGetDevice(&cur_device_id)); |
| 1321 | if (device_id != static_cast<uint32_t>(cur_device_id)) { | 1320 | if (device_id != static_cast<uint32_t>(cur_device_id)) { |
| 1322 | GELOGW("given device_id[%u] is not equal to cur_device_id[%i], skip clear so", device_id, cur_device_id); | 1321 | GELOGW("given device_id[%u] is not equal to cur_device_id[%i], skip clear so", device_id, cur_device_id); |
| 1323 | return SUCCESS; | 1322 | return SUCCESS; |
| @@ -109,12 +109,12 @@ Status ModelExecutor::Finalize() { | |||
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | Status ModelExecutor::GetDeviceMemorySize(size_t &free_mem, size_t &total_mem_size) { | 111 | Status ModelExecutor::GetDeviceMemorySize(size_t &free_mem, size_t &total_mem_size) { |
| 112 | - GE_CHK_RT_RET(aclrtSetDevice(static_cast<int32_t>(GetContext().DeviceId()))); | 112 | + GE_CHK_ACL_RET(aclrtSetDevice(static_cast<int32_t>(GetContext().DeviceId()))); |
| 113 | - GE_CHK_RT_RET(aclrtGetMemInfo(ACL_HBM_MEM, &free_mem, &total_mem_size)); | 113 | + GE_CHK_ACL_RET(aclrtGetMemInfo(ACL_HBM_MEM, &free_mem, &total_mem_size)); |
| 114 | if (total_mem_size == 0U) { | 114 | if (total_mem_size == 0U) { |
| 115 | - GE_CHK_RT_RET(aclrtGetMemInfo(ACL_DDR_MEM, &free_mem, &total_mem_size)); | 115 | + GE_CHK_ACL_RET(aclrtGetMemInfo(ACL_DDR_MEM, &free_mem, &total_mem_size)); |
| 116 | } | 116 | } |
| 117 | - GE_CHK_RT_RET(aclrtResetDevice(static_cast<int32_t>(GetContext().DeviceId()))); | 117 | + GE_CHK_ACL_RET(aclrtResetDevice(static_cast<int32_t>(GetContext().DeviceId()))); |
| 118 | return SUCCESS; | 118 | return SUCCESS; |
| 119 | } | 119 | } |
| 120 | 120 | ||
| @@ -151,14 +151,14 @@ Status ModelExecutor::LoadGraph(const GeRootModelPtr &ge_root_model, const Graph | |||
| 151 | /// | 151 | /// |
| 152 | Status ModelExecutor::UnloadGraph(const GeRootModelPtr &ge_root_model, const uint32_t graph_id) { | 152 | Status ModelExecutor::UnloadGraph(const GeRootModelPtr &ge_root_model, const uint32_t graph_id) { |
| 153 | GE_CHECK_NOTNULL(ge_root_model); | 153 | GE_CHECK_NOTNULL(ge_root_model); |
| 154 | - GE_CHK_RT_RET(aclrtSetDevice(static_cast<int32_t>(GetContext().DeviceId()))); | 154 | + GE_CHK_ACL_RET(aclrtSetDevice(static_cast<int32_t>(GetContext().DeviceId()))); |
| 155 | RemoveGraphNode(graph_id); | 155 | RemoveGraphNode(graph_id); |
| 156 | const Status ret = UnloadModel(ge_root_model, graph_id); | 156 | const Status ret = UnloadModel(ge_root_model, graph_id); |
| 157 | if (ret != SUCCESS) { | 157 | if (ret != SUCCESS) { |
| 158 | GELOGW("[GraphExecutor] unload model failed, graph_id=%u.", graph_id); | 158 | GELOGW("[GraphExecutor] unload model failed, graph_id=%u.", graph_id); |
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | - GE_CHK_RT_RET(aclrtResetDevice(static_cast<int32_t>(GetContext().DeviceId()))); | 161 | + GE_CHK_ACL_RET(aclrtResetDevice(static_cast<int32_t>(GetContext().DeviceId()))); |
| 162 | return ret; | 162 | return ret; |
| 163 | } | 163 | } |
| 164 | 164 | ||
| @@ -427,9 +427,9 @@ Status ModelExecutor::MallocByDiffAllocator(const uint64_t session_id, | |||
| 427 | auto session_allocator = SessionMemAllocator<FixedBaseExpandableAllocator>::Instance(). | 427 | auto session_allocator = SessionMemAllocator<FixedBaseExpandableAllocator>::Instance(). |
| 428 | GetMemAllocator(session_id, GetContext().DeviceId(), rt_mem_type); | 428 | GetMemAllocator(session_id, GetContext().DeviceId(), rt_mem_type); |
| 429 | GE_ASSERT_NOTNULL(session_allocator); | 429 | GE_ASSERT_NOTNULL(session_allocator); |
| 430 | - GE_CHK_RT_RET(aclrtSetDevice(static_cast<int32_t>(GetContext().DeviceId()))); | 430 | + GE_CHK_ACL_RET(aclrtSetDevice(static_cast<int32_t>(GetContext().DeviceId()))); |
| 431 | const auto mem_block = session_allocator->Malloc(fixed_feature_mem->GetSize()); | 431 | const auto mem_block = session_allocator->Malloc(fixed_feature_mem->GetSize()); |
| 432 | - GE_CHK_RT_RET(aclrtResetDevice(static_cast<int32_t>(GetContext().DeviceId()))); | 432 | + GE_CHK_ACL_RET(aclrtResetDevice(static_cast<int32_t>(GetContext().DeviceId()))); |
| 433 | if ((mem_block != nullptr) && (mem_block->GetAddr() != nullptr)) { | 433 | if ((mem_block != nullptr) && (mem_block->GetAddr() != nullptr)) { |
| 434 | (void)ge_root_model->MutableFixedFeatureMemory().insert( | 434 | (void)ge_root_model->MutableFixedFeatureMemory().insert( |
| 435 | {rt_mem_type, {rt_mem_type, mem_block->GetAddr(), fixed_feature_mem->GetSize(), false, true, true, | 435 | {rt_mem_type, {rt_mem_type, mem_block->GetAddr(), fixed_feature_mem->GetSize(), false, true, true, |
| @@ -446,10 +446,10 @@ Status ModelExecutor::MallocByDiffAllocator(const uint64_t session_id, | |||
| 446 | 446 | ||
| 447 | const std::string purpose = MemTypeUtils::ToString(rt_mem_type) + " fixed feature base"; | 447 | const std::string purpose = MemTypeUtils::ToString(rt_mem_type) + " fixed feature base"; |
| 448 | auto &mem_instance = MemManager::Instance().MemInstance(rt_mem_type); | 448 | auto &mem_instance = MemManager::Instance().MemInstance(rt_mem_type); |
| 449 | - GE_CHK_RT_RET(aclrtSetDevice(static_cast<int32_t>(GetContext().DeviceId()))); | 449 | + GE_CHK_ACL_RET(aclrtSetDevice(static_cast<int32_t>(GetContext().DeviceId()))); |
| 450 | addr = mem_instance.MallocMemory(purpose, | 450 | addr = mem_instance.MallocMemory(purpose, |
| 451 | fixed_feature_mem->GetSize(), GetContext().DeviceId()); | 451 | fixed_feature_mem->GetSize(), GetContext().DeviceId()); |
| 452 | - GE_CHK_RT_RET(aclrtResetDevice(static_cast<int32_t>(GetContext().DeviceId()))); | 452 | + GE_CHK_ACL_RET(aclrtResetDevice(static_cast<int32_t>(GetContext().DeviceId()))); |
| 453 | GE_ASSERT_NOTNULL(addr, "malloc %zu bytes failed using inner allocator", fixed_feature_mem->GetSize()); | 453 | GE_ASSERT_NOTNULL(addr, "malloc %zu bytes failed using inner allocator", fixed_feature_mem->GetSize()); |
| 454 | GELOGI("malloc fixed_feature_memory success, type: %s, addr: %p, size: %zu", | 454 | GELOGI("malloc fixed_feature_memory success, type: %s, addr: %p, size: %zu", |
| 455 | MemTypeUtils::ToString(rt_mem_type).c_str(), addr, fixed_feature_mem->GetSize()); | 455 | MemTypeUtils::ToString(rt_mem_type).c_str(), addr, fixed_feature_mem->GetSize()); |
| @@ -475,9 +475,9 @@ Status ModelExecutor::FreeFixedFeatureMemoryIfNeed(const GeRootModelPtr &ge_root | |||
| 475 | } | 475 | } |
| 476 | } else { | 476 | } else { |
| 477 | auto &mem_instance = MemManager::Instance().MemInstance(iter->second.type); | 477 | auto &mem_instance = MemManager::Instance().MemInstance(iter->second.type); |
| 478 | - GE_CHK_RT_RET(aclrtSetDevice(static_cast<int32_t>(GetContext().DeviceId()))); | 478 | + GE_CHK_ACL_RET(aclrtSetDevice(static_cast<int32_t>(GetContext().DeviceId()))); |
| 479 | GE_ASSERT_SUCCESS(mem_instance.FreeMemory(iter->second.addr, GetContext().DeviceId())); | 479 | GE_ASSERT_SUCCESS(mem_instance.FreeMemory(iter->second.addr, GetContext().DeviceId())); |
| 480 | - GE_CHK_RT_RET(aclrtResetDevice(static_cast<int32_t>(GetContext().DeviceId()))); | 480 | + GE_CHK_ACL_RET(aclrtResetDevice(static_cast<int32_t>(GetContext().DeviceId()))); |
| 481 | GELOGI("free fixed_feature_memory by inner allocator success, %s", iter->second.ToString().c_str()); | 481 | GELOGI("free fixed_feature_memory by inner allocator success, %s", iter->second.ToString().c_str()); |
| 482 | } | 482 | } |
| 483 | iter = all_fixed_mems.erase(iter); | 483 | iter = all_fixed_mems.erase(iter); |
| @@ -849,13 +849,13 @@ Status ModelExecutor::CheckAndReleaseStream(const GeRootModelPtr &ge_root_model, | |||
| 849 | } | 849 | } |
| 850 | 850 | ||
| 851 | uint32_t available_stream_num = 0U; | 851 | uint32_t available_stream_num = 0U; |
| 852 | - GE_CHK_RT_RET(aclrtSetDevice(static_cast<int32_t>(GetContext().DeviceId()))); | 852 | + GE_CHK_ACL_RET(aclrtSetDevice(static_cast<int32_t>(GetContext().DeviceId()))); |
| 853 | - GE_CHK_RT_RET(aclrtGetStreamAvailableNum(&available_stream_num)); | 853 | + GE_CHK_ACL_RET(aclrtGetStreamAvailableNum(&available_stream_num)); |
| 854 | 854 | ||
| 855 | if (required_stream_num <= available_stream_num) { | 855 | if (required_stream_num <= available_stream_num) { |
| 856 | GELOGI("Graph id[%u] no need to unload other models, required stream num[%u], available stream num[%u]", | 856 | GELOGI("Graph id[%u] no need to unload other models, required stream num[%u], available stream num[%u]", |
| 857 | graph_node->GetGraphId(), required_stream_num, available_stream_num); | 857 | graph_node->GetGraphId(), required_stream_num, available_stream_num); |
| 858 | - GE_CHK_RT_RET(aclrtResetDevice(static_cast<int32_t>(GetContext().DeviceId()))); | 858 | + GE_CHK_ACL_RET(aclrtResetDevice(static_cast<int32_t>(GetContext().DeviceId()))); |
| 859 | return SUCCESS; | 859 | return SUCCESS; |
| 860 | } | 860 | } |
| 861 | 861 | ||
| @@ -878,14 +878,14 @@ Status ModelExecutor::CheckAndReleaseStream(const GeRootModelPtr &ge_root_model, | |||
| 878 | it.second->SetLoadCount(it.second->GetLoadRecord()); | 878 | it.second->SetLoadCount(it.second->GetLoadRecord()); |
| 879 | it.second->SetLoadRecord(kNeverLoaded); | 879 | it.second->SetLoadRecord(kNeverLoaded); |
| 880 | 880 | ||
| 881 | - GE_CHK_RT_RET(aclrtGetStreamAvailableNum(&available_stream_num)); | 881 | + GE_CHK_ACL_RET(aclrtGetStreamAvailableNum(&available_stream_num)); |
| 882 | if (required_stream_num <= available_stream_num) { | 882 | if (required_stream_num <= available_stream_num) { |
| 883 | - GE_CHK_RT_RET(aclrtResetDevice(static_cast<int32_t>(GetContext().DeviceId()))); | 883 | + GE_CHK_ACL_RET(aclrtResetDevice(static_cast<int32_t>(GetContext().DeviceId()))); |
| 884 | return SUCCESS; | 884 | return SUCCESS; |
| 885 | } | 885 | } |
| 886 | } | 886 | } |
| 887 | 887 | ||
| 888 | - GE_CHK_RT_RET(aclrtResetDevice(static_cast<int32_t>(GetContext().DeviceId()))); | 888 | + GE_CHK_ACL_RET(aclrtResetDevice(static_cast<int32_t>(GetContext().DeviceId()))); |
| 889 | REPORT_INNER_ERR_MSG( | 889 | REPORT_INNER_ERR_MSG( |
| 890 | "E19999", | 890 | "E19999", |
| 891 | "Graph id[%u] check and release stream failed, required total stream num[%u], required hccl follow stream num[%u], available stream num[%u]", | 891 | "Graph id[%u] check and release stream failed, required total stream num[%u], required hccl follow stream num[%u], available stream num[%u]", |
| @@ -925,13 +925,13 @@ Status ModelExecutor::CheckAndReleaseEvent(const GeRootModelPtr &ge_root_model, | |||
| 925 | } | 925 | } |
| 926 | 926 | ||
| 927 | uint32_t available_event_num = 0U; | 927 | uint32_t available_event_num = 0U; |
| 928 | - GE_CHK_RT_RET(aclrtSetDevice(static_cast<int32_t>(GetContext().DeviceId()))); | 928 | + GE_CHK_ACL_RET(aclrtSetDevice(static_cast<int32_t>(GetContext().DeviceId()))); |
| 929 | - GE_CHK_RT_RET(aclrtGetEventAvailNum(&available_event_num)); | 929 | + GE_CHK_ACL_RET(aclrtGetEventAvailNum(&available_event_num)); |
| 930 | 930 | ||
| 931 | if (required_event_num <= available_event_num) { | 931 | if (required_event_num <= available_event_num) { |
| 932 | GELOGI("Graph id[%u] no need to unload other models, required event nums[%u], available event nums[%u]", | 932 | GELOGI("Graph id[%u] no need to unload other models, required event nums[%u], available event nums[%u]", |
| 933 | graph_node->GetGraphId(), required_event_num, available_event_num); | 933 | graph_node->GetGraphId(), required_event_num, available_event_num); |
| 934 | - GE_CHK_RT_RET(aclrtResetDevice(static_cast<int32_t>(GetContext().DeviceId()))); | 934 | + GE_CHK_ACL_RET(aclrtResetDevice(static_cast<int32_t>(GetContext().DeviceId()))); |
| 935 | return SUCCESS; | 935 | return SUCCESS; |
| 936 | } | 936 | } |
| 937 | 937 | ||
| @@ -954,14 +954,14 @@ Status ModelExecutor::CheckAndReleaseEvent(const GeRootModelPtr &ge_root_model, | |||
| 954 | it.second->SetLoadCount(it.second->GetLoadRecord()); | 954 | it.second->SetLoadCount(it.second->GetLoadRecord()); |
| 955 | it.second->SetLoadRecord(kNeverLoaded); | 955 | it.second->SetLoadRecord(kNeverLoaded); |
| 956 | 956 | ||
| 957 | - GE_CHK_RT_RET(aclrtGetEventAvailNum(&available_event_num)); | 957 | + GE_CHK_ACL_RET(aclrtGetEventAvailNum(&available_event_num)); |
| 958 | if (required_event_num <= available_event_num) { | 958 | if (required_event_num <= available_event_num) { |
| 959 | - GE_CHK_RT_RET(aclrtResetDevice(static_cast<int32_t>(GetContext().DeviceId()))); | 959 | + GE_CHK_ACL_RET(aclrtResetDevice(static_cast<int32_t>(GetContext().DeviceId()))); |
| 960 | return SUCCESS; | 960 | return SUCCESS; |
| 961 | } | 961 | } |
| 962 | } | 962 | } |
| 963 | 963 | ||
| 964 | - GE_CHK_RT_RET(aclrtResetDevice(static_cast<int32_t>(GetContext().DeviceId()))); | 964 | + GE_CHK_ACL_RET(aclrtResetDevice(static_cast<int32_t>(GetContext().DeviceId()))); |
| 965 | REPORT_INNER_ERR_MSG( | 965 | REPORT_INNER_ERR_MSG( |
| 966 | "E19999", | 966 | "E19999", |
| 967 | "Graph id[%u] check and release event failed, required event nums[%u], available event nums[%u]", | 967 | "Graph id[%u] check and release event failed, required event nums[%u], available event nums[%u]", |
| @@ -23,7 +23,7 @@ | |||
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | 25 | ||
| 26 | -#include "runtime/mem.h" | 26 | +#include "rt_external_mem.h" |
| 27 | 27 | ||
| 28 | 28 | ||
| 29 | 29 | ||
| @@ -14,7 +14,7 @@ | |||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | -#include "runtime/rt.h" | 17 | +#include "rt_external.h" |
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | 20 | ||
| @@ -57,14 +57,14 @@ Status AiCpuResources::CreateQueue(const std::string &name, const uint32_t depth | |||
| 57 | GELOGD("Start to create queue, name = %s, depth = %u", name.c_str(), depth); | 57 | GELOGD("Start to create queue, name = %s, depth = %u", name.c_str(), depth); |
| 58 | std::vector<uint8_t> task_args; | 58 | std::vector<uint8_t> task_args; |
| 59 | void *queue_id_dev = nullptr; | 59 | void *queue_id_dev = nullptr; |
| 60 | - GE_CHK_RT_RET(ge::AclrtMalloc(&queue_id_dev, sizeof(queue_id), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 60 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&queue_id_dev, sizeof(queue_id), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 61 | GE_MAKE_GUARD(queue_id_dev, [&queue_id_dev]() { | 61 | GE_MAKE_GUARD(queue_id_dev, [&queue_id_dev]() { |
| 62 | GE_CHK_RT(aclrtFree(queue_id_dev)); | 62 | GE_CHK_RT(aclrtFree(queue_id_dev)); |
| 63 | }); | 63 | }); |
| 64 | GE_CHK_STATUS_RET_NOLOG( | 64 | GE_CHK_STATUS_RET_NOLOG( |
| 65 | BuildCreateQueueTask(static_cast<uintptr_t>(PtrToValue(queue_id_dev)), name, depth, task_args)); | 65 | BuildCreateQueueTask(static_cast<uintptr_t>(PtrToValue(queue_id_dev)), name, depth, task_args)); |
| 66 | GE_CHK_STATUS_RET(ExecuteKernel(kKernelNameCreateQueue, task_args)); | 66 | GE_CHK_STATUS_RET(ExecuteKernel(kKernelNameCreateQueue, task_args)); |
| 67 | - GE_CHK_RT_RET(aclrtMemcpy(&queue_id, sizeof(queue_id), queue_id_dev, | 67 | + GE_CHK_ACL_RET(aclrtMemcpy(&queue_id, sizeof(queue_id), queue_id_dev, |
| 68 | sizeof(queue_id), ACL_MEMCPY_DEVICE_TO_HOST)); | 68 | sizeof(queue_id), ACL_MEMCPY_DEVICE_TO_HOST)); |
| 69 | GELOGD("Queue created successfully, name = %s, queue id = %u", name.c_str(), queue_id); | 69 | GELOGD("Queue created successfully, name = %s, queue id = %u", name.c_str(), queue_id); |
| 70 | return SUCCESS; | 70 | return SUCCESS; |
| @@ -152,7 +152,7 @@ Status AiCpuResources::ExecuteKernel(const char_t *const so_name, | |||
| 152 | const std::string &kernel_name, | 152 | const std::string &kernel_name, |
| 153 | const std::vector<uint8_t> &task_args) { | 153 | const std::vector<uint8_t> &task_args) { |
| 154 | aclrtStream stream = nullptr; | 154 | aclrtStream stream = nullptr; |
| 155 | - GE_CHK_RT_RET(aclrtCreateStream(&stream)); | 155 | + GE_CHK_ACL_RET(aclrtCreateStream(&stream)); |
| 156 | GE_MAKE_GUARD_ACLRTSTREAM(stream); | 156 | GE_MAKE_GUARD_ACLRTSTREAM(stream); |
| 157 | rtArgsEx_t args_info = {}; | 157 | rtArgsEx_t args_info = {}; |
| 158 | args_info.args = const_cast<void *>(static_cast<const void *>(task_args.data())); | 158 | args_info.args = const_cast<void *>(static_cast<const void *>(task_args.data())); |
| @@ -161,7 +161,7 @@ Status AiCpuResources::ExecuteKernel(const char_t *const so_name, | |||
| 161 | GE_CHK_RT_RET(rtCpuKernelLaunchWithFlag(so_name, | 161 | GE_CHK_RT_RET(rtCpuKernelLaunchWithFlag(so_name, |
| 162 | kernel_name.c_str(), kKernelBlockDim, &args_info, nullptr, stream, RT_KERNEL_DEFAULT)); | 162 | kernel_name.c_str(), kKernelBlockDim, &args_info, nullptr, stream, RT_KERNEL_DEFAULT)); |
| 163 | GELOGD("Launch kernel successfully, kernel name = %s", kernel_name.c_str()); | 163 | GELOGD("Launch kernel successfully, kernel name = %s", kernel_name.c_str()); |
| 164 | - GE_CHK_RT_RET(aclrtSynchronizeStream(stream)); | 164 | + GE_CHK_ACL_RET(aclrtSynchronizeStream(stream)); |
| 165 | GELOGD("Sync stream successfully, kernel name = %s", kernel_name.c_str()); | 165 | GELOGD("Sync stream successfully, kernel name = %s", kernel_name.c_str()); |
| 166 | return SUCCESS; | 166 | return SUCCESS; |
| 167 | } | 167 | } |
| @@ -434,9 +434,9 @@ Status AiCpuResources::SetStaticModelShapeConfig(const AiCpuModelShapeConfig &co | |||
| 434 | } | 434 | } |
| 435 | 435 | ||
| 436 | void *tlv_device_addr = nullptr; | 436 | void *tlv_device_addr = nullptr; |
| 437 | - GE_CHK_RT_RET(ge::AclrtMalloc(&tlv_device_addr, config_buff.size(), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 437 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&tlv_device_addr, config_buff.size(), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 438 | GE_MAKE_GUARD(tlv_device_addr, [&tlv_device_addr]() { GE_CHK_RT(aclrtFree(tlv_device_addr)); }); | 438 | GE_MAKE_GUARD(tlv_device_addr, [&tlv_device_addr]() { GE_CHK_RT(aclrtFree(tlv_device_addr)); }); |
| 439 | - GE_CHK_RT_RET(aclrtMemcpy(tlv_device_addr, config_buff.size(), config_buff.data(), | 439 | + GE_CHK_ACL_RET(aclrtMemcpy(tlv_device_addr, config_buff.size(), config_buff.data(), |
| 440 | config_buff.size(), ACL_MEMCPY_HOST_TO_DEVICE)); | 440 | config_buff.size(), ACL_MEMCPY_HOST_TO_DEVICE)); |
| 441 | AiCpuModelShapeConfig config_with_input_desc = config; | 441 | AiCpuModelShapeConfig config_with_input_desc = config; |
| 442 | GE_CHK_BOOL_RET_STATUS(tlv_data_len <= UINT32_MAX, FAILED, "tlv_data_len %zu greater than uint32_max.", tlv_data_len); | 442 | GE_CHK_BOOL_RET_STATUS(tlv_data_len <= UINT32_MAX, FAILED, "tlv_data_len %zu greater than uint32_max.", tlv_data_len); |
| @@ -59,14 +59,14 @@ Status CpuTaskModelDequeue::Init(const uint32_t queue_id, uintptr_t &in_mbuf) { | |||
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | args_size_ = sizeof(MbufQueueInfo) + sizeof(uintptr_t); // sizeof(uintptr_t) for save in_mbuf. | 61 | args_size_ = sizeof(MbufQueueInfo) + sizeof(uintptr_t); // sizeof(uintptr_t) for save in_mbuf. |
| 62 | - GE_CHK_RT_RET(ge::AclrtMalloc(&args_, static_cast<uint64_t>(args_size_), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 62 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&args_, static_cast<uint64_t>(args_size_), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 63 | in_mbuf = PtrToValue(args_) + sizeof(MbufQueueInfo); | 63 | in_mbuf = PtrToValue(args_) + sizeof(MbufQueueInfo); |
| 64 | GE_PRINT_DYNAMIC_MEMORY(aclrtMalloc, "args data.", args_size_); | 64 | GE_PRINT_DYNAMIC_MEMORY(aclrtMalloc, "args data.", args_size_); |
| 65 | 65 | ||
| 66 | MbufQueueInfo queue_info; | 66 | MbufQueueInfo queue_info; |
| 67 | queue_info.queue_id = queue_id; | 67 | queue_info.queue_id = queue_id; |
| 68 | queue_info.in_mbuf = in_mbuf; // Placeholder, input mbuf addr will save to this place. | 68 | queue_info.in_mbuf = in_mbuf; // Placeholder, input mbuf addr will save to this place. |
| 69 | - GE_CHK_RT_RET(aclrtMemcpy(args_, static_cast<uint64_t>(args_size_), &queue_info, sizeof(MbufQueueInfo), | 69 | + GE_CHK_ACL_RET(aclrtMemcpy(args_, static_cast<uint64_t>(args_size_), &queue_info, sizeof(MbufQueueInfo), |
| 70 | ACL_MEMCPY_HOST_TO_DEVICE)); | 70 | ACL_MEMCPY_HOST_TO_DEVICE)); |
| 71 | 71 | ||
| 72 | return SUCCESS; | 72 | return SUCCESS; |
| @@ -182,12 +182,12 @@ Status CpuTaskZeroCopy::Init(std::vector<uintptr_t> &mbuf_list, | |||
| 182 | } | 182 | } |
| 183 | 183 | ||
| 184 | // malloc mem for src_addrs/dst_addrs, and copy data of src_addrs/dst_addrs | 184 | // malloc mem for src_addrs/dst_addrs, and copy data of src_addrs/dst_addrs |
| 185 | - GE_CHK_RT_RET(ge::AclrtMalloc(&src_addr_, src_addrs_.size() * sizeof(uint64_t), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 185 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&src_addr_, src_addrs_.size() * sizeof(uint64_t), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 186 | - GE_CHK_RT_RET(aclrtMemcpy(src_addr_, src_addrs_.size() * sizeof(uint64_t), src_addrs_.data(), | 186 | + GE_CHK_ACL_RET(aclrtMemcpy(src_addr_, src_addrs_.size() * sizeof(uint64_t), src_addrs_.data(), |
| 187 | src_addrs_.size() * sizeof(uint64_t), ACL_MEMCPY_HOST_TO_DEVICE)); | 187 | src_addrs_.size() * sizeof(uint64_t), ACL_MEMCPY_HOST_TO_DEVICE)); |
| 188 | 188 | ||
| 189 | - GE_CHK_RT_RET(ge::AclrtMalloc(&dst_addr_, dst_addrs_.size() * sizeof(uint64_t), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 189 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&dst_addr_, dst_addrs_.size() * sizeof(uint64_t), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 190 | - GE_CHK_RT_RET(aclrtMemcpy(dst_addr_, dst_addrs_.size() * sizeof(uint64_t), dst_addrs_.data(), | 190 | + GE_CHK_ACL_RET(aclrtMemcpy(dst_addr_, dst_addrs_.size() * sizeof(uint64_t), dst_addrs_.data(), |
| 191 | dst_addrs_.size() * sizeof(uint64_t), ACL_MEMCPY_HOST_TO_DEVICE)); | 191 | dst_addrs_.size() * sizeof(uint64_t), ACL_MEMCPY_HOST_TO_DEVICE)); |
| 192 | 192 | ||
| 193 | // src_addr_list is init to src_addr, which is the point to src_addrs | 193 | // src_addr_list is init to src_addr, which is the point to src_addrs |
| @@ -206,14 +206,14 @@ Status CpuTaskZeroCopy::Init(std::vector<uintptr_t> &mbuf_list, | |||
| 206 | addr_map_info.src_addr_list, addr_map_info.dst_addr_list); | 206 | addr_map_info.src_addr_list, addr_map_info.dst_addr_list); |
| 207 | } else { | 207 | } else { |
| 208 | AddrMapInfoV2 *const addr_map_info_v2 = PtrToPtr<uint8_t, AddrMapInfoV2>(&buff[0]); | 208 | AddrMapInfoV2 *const addr_map_info_v2 = PtrToPtr<uint8_t, AddrMapInfoV2>(&buff[0]); |
| 209 | - GE_CHK_RT_RET(ge::AclrtMalloc(&no_tiling_addr_, no_tilings_.size() * sizeof(int32_t), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 209 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&no_tiling_addr_, no_tilings_.size() * sizeof(int32_t), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 210 | - GE_CHK_RT_RET(aclrtMemcpy(no_tiling_addr_, no_tilings_.size() * sizeof(int32_t), no_tilings_.data(), | 210 | + GE_CHK_ACL_RET(aclrtMemcpy(no_tiling_addr_, no_tilings_.size() * sizeof(int32_t), no_tilings_.data(), |
| 211 | no_tilings_.size() * sizeof(int32_t), ACL_MEMCPY_HOST_TO_DEVICE)); | 211 | no_tilings_.size() * sizeof(int32_t), ACL_MEMCPY_HOST_TO_DEVICE)); |
| 212 | - GE_CHK_RT_RET(ge::AclrtMalloc(&dest_is_tiling_addr_, dest_is_tilings_.size() * sizeof(int32_t), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 212 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&dest_is_tiling_addr_, dest_is_tilings_.size() * sizeof(int32_t), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 213 | - GE_CHK_RT_RET(aclrtMemcpy(dest_is_tiling_addr_, dest_is_tilings_.size() * sizeof(int32_t), | 213 | + GE_CHK_ACL_RET(aclrtMemcpy(dest_is_tiling_addr_, dest_is_tilings_.size() * sizeof(int32_t), |
| 214 | dest_is_tilings_.data(), dest_is_tilings_.size() * sizeof(int32_t), ACL_MEMCPY_HOST_TO_DEVICE)); | 214 | dest_is_tilings_.data(), dest_is_tilings_.size() * sizeof(int32_t), ACL_MEMCPY_HOST_TO_DEVICE)); |
| 215 | - GE_CHK_RT_RET(ge::AclrtMalloc(&fusion_offsets_addr_, fusion_offsets_.size() * sizeof(int32_t), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 215 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&fusion_offsets_addr_, fusion_offsets_.size() * sizeof(int32_t), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 216 | - GE_CHK_RT_RET(aclrtMemcpy(fusion_offsets_addr_, fusion_offsets_.size() * sizeof(int32_t), fusion_offsets_.data(), | 216 | + GE_CHK_ACL_RET(aclrtMemcpy(fusion_offsets_addr_, fusion_offsets_.size() * sizeof(int32_t), fusion_offsets_.data(), |
| 217 | fusion_offsets_.size() * sizeof(int32_t), ACL_MEMCPY_HOST_TO_DEVICE)); | 217 | fusion_offsets_.size() * sizeof(int32_t), ACL_MEMCPY_HOST_TO_DEVICE)); |
| 218 | addr_map_info_v2->addr_num = addr_num_; | 218 | addr_map_info_v2->addr_num = addr_num_; |
| 219 | addr_map_info_v2->src_addr_list = PtrToValue(src_addr_); | 219 | addr_map_info_v2->src_addr_list = PtrToValue(src_addr_); |
| @@ -239,9 +239,9 @@ Status CpuTaskZeroCopy::Init(std::vector<uintptr_t> &mbuf_list, | |||
| 239 | addr_map_info_v2->len, args_size_); | 239 | addr_map_info_v2->len, args_size_); |
| 240 | } | 240 | } |
| 241 | 241 | ||
| 242 | - GE_CHK_RT_RET(ge::AclrtMalloc(&args_, static_cast<uint64_t>(args_size_), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 242 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&args_, static_cast<uint64_t>(args_size_), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 243 | GE_PRINT_DYNAMIC_MEMORY(aclrtMalloc, "args data.", args_size_); | 243 | GE_PRINT_DYNAMIC_MEMORY(aclrtMalloc, "args data.", args_size_); |
| 244 | - GE_CHK_RT_RET(aclrtMemcpy(args_, static_cast<uint64_t>(args_size_), args, static_cast<uint64_t>(args_size_), | 244 | + GE_CHK_ACL_RET(aclrtMemcpy(args_, static_cast<uint64_t>(args_size_), args, static_cast<uint64_t>(args_size_), |
| 245 | ACL_MEMCPY_HOST_TO_DEVICE)); | 245 | ACL_MEMCPY_HOST_TO_DEVICE)); |
| 246 | return SUCCESS; | 246 | return SUCCESS; |
| 247 | } | 247 | } |
| @@ -290,7 +290,7 @@ Status CpuTaskProcessOutput::Init(const uintptr_t addr, const uint32_t size, con | |||
| 290 | static_cast<uint32_t>(sizeof(ProcessOutputInfo) + sizeof(uintptr_t)); // sizeof(uintptr_t) for save out_mbuf. | 290 | static_cast<uint32_t>(sizeof(ProcessOutputInfo) + sizeof(uintptr_t)); // sizeof(uintptr_t) for save out_mbuf. |
| 291 | if (output_desc != nullptr) { | 291 | if (output_desc != nullptr) { |
| 292 | args_size_ += static_cast<uint32_t>(sizeof(RuntimeTensorDesc)); | 292 | args_size_ += static_cast<uint32_t>(sizeof(RuntimeTensorDesc)); |
| 293 | - GE_CHK_RT_RET(ge::AclrtMalloc(&args_, static_cast<uint64_t>(args_size_), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 293 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&args_, static_cast<uint64_t>(args_size_), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 294 | out_mbuf = PtrToValue(args_) + static_cast<uint64_t>(sizeof(ProcessOutputInfo)) + | 294 | out_mbuf = PtrToValue(args_) + static_cast<uint64_t>(sizeof(ProcessOutputInfo)) + |
| 295 | static_cast<uint64_t>(sizeof(RuntimeTensorDesc)); | 295 | static_cast<uint64_t>(sizeof(RuntimeTensorDesc)); |
| 296 | RuntimeTensorDesc tensor_desc{}; | 296 | RuntimeTensorDesc tensor_desc{}; |
| @@ -307,11 +307,11 @@ Status CpuTaskProcessOutput::Init(const uintptr_t addr, const uint32_t size, con | |||
| 307 | tensor_desc.data_size = static_cast<uint64_t>(size); | 307 | tensor_desc.data_size = static_cast<uint64_t>(size); |
| 308 | GELOGD("Tensordesc type = %d, shape = original shape = %s, data size = %u", static_cast<int32_t>(tensor_desc.dtype), | 308 | GELOGD("Tensordesc type = %d, shape = original shape = %s, data size = %u", static_cast<int32_t>(tensor_desc.dtype), |
| 309 | ToString(output_desc->shape_info.dims).c_str(), size); | 309 | ToString(output_desc->shape_info.dims).c_str(), size); |
| 310 | - GE_CHK_RT_RET(aclrtMemcpy(ValueToPtr(PtrToValue(args_) + sizeof(ProcessOutputInfo)), | 310 | + GE_CHK_ACL_RET(aclrtMemcpy(ValueToPtr(PtrToValue(args_) + sizeof(ProcessOutputInfo)), |
| 311 | (static_cast<uint64_t>(args_size_) - static_cast<uint64_t>(sizeof(ProcessOutputInfo))), | 311 | (static_cast<uint64_t>(args_size_) - static_cast<uint64_t>(sizeof(ProcessOutputInfo))), |
| 312 | &tensor_desc, static_cast<uint64_t>(sizeof(RuntimeTensorDesc)), ACL_MEMCPY_HOST_TO_DEVICE)); | 312 | &tensor_desc, static_cast<uint64_t>(sizeof(RuntimeTensorDesc)), ACL_MEMCPY_HOST_TO_DEVICE)); |
| 313 | } else { | 313 | } else { |
| 314 | - GE_CHK_RT_RET(ge::AclrtMalloc(&args_, static_cast<uint64_t>(args_size_), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 314 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&args_, static_cast<uint64_t>(args_size_), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 315 | out_mbuf = PtrToValue(args_) + sizeof(ProcessOutputInfo); | 315 | out_mbuf = PtrToValue(args_) + sizeof(ProcessOutputInfo); |
| 316 | GE_PRINT_DYNAMIC_MEMORY(aclrtMalloc, "args data.", args_size_); | 316 | GE_PRINT_DYNAMIC_MEMORY(aclrtMalloc, "args data.", args_size_); |
| 317 | } | 317 | } |
| @@ -322,7 +322,7 @@ Status CpuTaskProcessOutput::Init(const uintptr_t addr, const uint32_t size, con | |||
| 322 | process.data_addr = addr; | 322 | process.data_addr = addr; |
| 323 | process.in_mbuf = in_mbuf; | 323 | process.in_mbuf = in_mbuf; |
| 324 | process.out_mbuf = out_mbuf; // Placeholder, output mbuf addr will save to this place. | 324 | process.out_mbuf = out_mbuf; // Placeholder, output mbuf addr will save to this place. |
| 325 | - GE_CHK_RT_RET(aclrtMemcpy(args_, static_cast<uint64_t>(args_size_), &process, sizeof(ProcessOutputInfo), | 325 | + GE_CHK_ACL_RET(aclrtMemcpy(args_, static_cast<uint64_t>(args_size_), &process, sizeof(ProcessOutputInfo), |
| 326 | ACL_MEMCPY_HOST_TO_DEVICE)); | 326 | ACL_MEMCPY_HOST_TO_DEVICE)); |
| 327 | 327 | ||
| 328 | return SUCCESS; | 328 | return SUCCESS; |
| @@ -371,13 +371,13 @@ Status CpuTaskModelEnqueue::Init(const uint32_t queue_id, const uintptr_t out_mb | |||
| 371 | 371 | ||
| 372 | // Get NetOutput Input address and bind to queue. | 372 | // Get NetOutput Input address and bind to queue. |
| 373 | args_size_ = sizeof(MbufQueueInfo); | 373 | args_size_ = sizeof(MbufQueueInfo); |
| 374 | - GE_CHK_RT_RET(ge::AclrtMalloc(&args_, static_cast<uint64_t>(args_size_), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 374 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&args_, static_cast<uint64_t>(args_size_), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 375 | GE_PRINT_DYNAMIC_MEMORY(aclrtMalloc, "args data.", args_size_); | 375 | GE_PRINT_DYNAMIC_MEMORY(aclrtMalloc, "args data.", args_size_); |
| 376 | 376 | ||
| 377 | MbufQueueInfo queue_info; | 377 | MbufQueueInfo queue_info; |
| 378 | queue_info.queue_id = queue_id; | 378 | queue_info.queue_id = queue_id; |
| 379 | queue_info.in_mbuf = out_mbuf; | 379 | queue_info.in_mbuf = out_mbuf; |
| 380 | - GE_CHK_RT_RET(aclrtMemcpy(args_, static_cast<uint64_t>(args_size_), &queue_info, static_cast<uint64_t>(args_size_), | 380 | + GE_CHK_ACL_RET(aclrtMemcpy(args_, static_cast<uint64_t>(args_size_), &queue_info, static_cast<uint64_t>(args_size_), |
| 381 | ACL_MEMCPY_HOST_TO_DEVICE)); | 381 | ACL_MEMCPY_HOST_TO_DEVICE)); |
| 382 | 382 | ||
| 383 | return SUCCESS; | 383 | return SUCCESS; |
| @@ -420,7 +420,7 @@ Status CpuTaskActiveEntry::Distribute() { | |||
| 420 | return FAILED; | 420 | return FAILED; |
| 421 | } | 421 | } |
| 422 | 422 | ||
| 423 | - GE_CHK_RT_RET(aclrtActiveStream(active_stream_, stream_)); | 423 | + GE_CHK_ACL_RET(aclrtActiveStream(active_stream_, stream_)); |
| 424 | 424 | ||
| 425 | GELOGI("Cpu kernel launch active entry task success."); | 425 | GELOGI("Cpu kernel launch active entry task success."); |
| 426 | return SUCCESS; | 426 | return SUCCESS; |
| @@ -435,7 +435,7 @@ Status CpuTaskMarkStep::Init(const GroupInfo &group_info, const std::string &dum | |||
| 435 | } | 435 | } |
| 436 | 436 | ||
| 437 | args_size_ = static_cast<uint32_t>(sizeof(MarkStepInfo)); | 437 | args_size_ = static_cast<uint32_t>(sizeof(MarkStepInfo)); |
| 438 | - GE_CHK_RT_RET(ge::AclrtMalloc(&args_, static_cast<uint64_t>(args_size_), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 438 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&args_, static_cast<uint64_t>(args_size_), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 439 | GE_PRINT_DYNAMIC_MEMORY(aclrtMalloc, "args data.", args_size_); | 439 | GE_PRINT_DYNAMIC_MEMORY(aclrtMalloc, "args data.", args_size_); |
| 440 | 440 | ||
| 441 | MarkStepInfo mark_step_info{}; | 441 | MarkStepInfo mark_step_info{}; |
| @@ -454,14 +454,14 @@ Status CpuTaskMarkStep::Init(const GroupInfo &group_info, const std::string &dum | |||
| 454 | 454 | ||
| 455 | void * const step_id = reinterpret_cast<void *>(step_id_addr); | 455 | void * const step_id = reinterpret_cast<void *>(step_id_addr); |
| 456 | if (step_id != nullptr) { | 456 | if (step_id != nullptr) { |
| 457 | - GE_CHK_RT_RET(aclrtMemset(step_id, sizeof(uint64_t), 0U, sizeof(uint64_t))); | 457 | + GE_CHK_ACL_RET(aclrtMemset(step_id, sizeof(uint64_t), 0U, sizeof(uint64_t))); |
| 458 | } | 458 | } |
| 459 | mark_step_info.step_id_addr = step_id_addr; | 459 | mark_step_info.step_id_addr = step_id_addr; |
| 460 | GELOGI("[MarkStep] group_total_count[%u], group_index[%u], step_id_addr: 0x%" PRIx64 ", dump_step: %s, is_head: %d.", | 460 | GELOGI("[MarkStep] group_total_count[%u], group_index[%u], step_id_addr: 0x%" PRIx64 ", dump_step: %s, is_head: %d.", |
| 461 | mark_step_info.group_total_count, mark_step_info.group_index, mark_step_info.step_id_addr, | 461 | mark_step_info.group_total_count, mark_step_info.group_index, mark_step_info.step_id_addr, |
| 462 | mark_step_info.dump_step, static_cast<int32_t>(mark_step_info.is_head)); | 462 | mark_step_info.dump_step, static_cast<int32_t>(mark_step_info.is_head)); |
| 463 | 463 | ||
| 464 | - GE_CHK_RT_RET(aclrtMemcpy(args_, static_cast<uint64_t>(args_size_), &mark_step_info, sizeof(MarkStepInfo), | 464 | + GE_CHK_ACL_RET(aclrtMemcpy(args_, static_cast<uint64_t>(args_size_), &mark_step_info, sizeof(MarkStepInfo), |
| 465 | ACL_MEMCPY_HOST_TO_DEVICE)); | 465 | ACL_MEMCPY_HOST_TO_DEVICE)); |
| 466 | 466 | ||
| 467 | return SUCCESS; | 467 | return SUCCESS; |
| @@ -489,10 +489,10 @@ Status CpuTaskWaitEndGraph::Init(const uint32_t model_id) { | |||
| 489 | } | 489 | } |
| 490 | 490 | ||
| 491 | args_size_ = sizeof(model_id); | 491 | args_size_ = sizeof(model_id); |
| 492 | - GE_CHK_RT_RET(ge::AclrtMalloc(&args_, static_cast<uint64_t>(args_size_), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 492 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&args_, static_cast<uint64_t>(args_size_), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 493 | GE_PRINT_DYNAMIC_MEMORY(aclrtMalloc, "args data.", args_size_); | 493 | GE_PRINT_DYNAMIC_MEMORY(aclrtMalloc, "args data.", args_size_); |
| 494 | 494 | ||
| 495 | - GE_CHK_RT_RET(aclrtMemcpy(args_, static_cast<uint64_t>(args_size_), &model_id, static_cast<uint64_t>(args_size_), | 495 | + GE_CHK_ACL_RET(aclrtMemcpy(args_, static_cast<uint64_t>(args_size_), &model_id, static_cast<uint64_t>(args_size_), |
| 496 | ACL_MEMCPY_HOST_TO_DEVICE)); | 496 | ACL_MEMCPY_HOST_TO_DEVICE)); |
| 497 | 497 | ||
| 498 | return SUCCESS; | 498 | return SUCCESS; |
| @@ -519,18 +519,18 @@ Status CpuTaskModelReportStatus::Init(const uint32_t model_uuid, | |||
| 519 | return FAILED; | 519 | return FAILED; |
| 520 | } | 520 | } |
| 521 | args_size_ = static_cast<uint32_t>(sizeof(ReportStatusInfo) + (sizeof(QueueAttrs) * input_queues.size())); | 521 | args_size_ = static_cast<uint32_t>(sizeof(ReportStatusInfo) + (sizeof(QueueAttrs) * input_queues.size())); |
| 522 | - GE_CHK_RT_RET(ge::AclrtMalloc(&args_, static_cast<uint64_t>(args_size_), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 522 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&args_, static_cast<uint64_t>(args_size_), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 523 | GE_PRINT_DYNAMIC_MEMORY(aclrtMalloc, "args data.", args_size_); | 523 | GE_PRINT_DYNAMIC_MEMORY(aclrtMalloc, "args data.", args_size_); |
| 524 | 524 | ||
| 525 | ReportStatusInfo report_status_info; | 525 | ReportStatusInfo report_status_info; |
| 526 | report_status_info.model_uuid = model_uuid; | 526 | report_status_info.model_uuid = model_uuid; |
| 527 | report_status_info.status_output_queue = status_output_queue; | 527 | report_status_info.status_output_queue = status_output_queue; |
| 528 | report_status_info.input_num = static_cast<uint32_t>(input_queues.size()); | 528 | report_status_info.input_num = static_cast<uint32_t>(input_queues.size()); |
| 529 | - GE_CHK_RT_RET(aclrtMemcpy(args_, static_cast<uint64_t>(args_size_), | 529 | + GE_CHK_ACL_RET(aclrtMemcpy(args_, static_cast<uint64_t>(args_size_), |
| 530 | &report_status_info, sizeof(ReportStatusInfo), ACL_MEMCPY_HOST_TO_DEVICE)); | 530 | &report_status_info, sizeof(ReportStatusInfo), ACL_MEMCPY_HOST_TO_DEVICE)); |
| 531 | QueueAttrs * const input_queues_ptr = PtrToPtr<void, QueueAttrs>(ValueToPtr(PtrToValue(args_) + | 531 | QueueAttrs * const input_queues_ptr = PtrToPtr<void, QueueAttrs>(ValueToPtr(PtrToValue(args_) + |
| 532 | sizeof(ReportStatusInfo))); | 532 | sizeof(ReportStatusInfo))); |
| 533 | - GE_CHK_RT_RET(aclrtMemcpy(input_queues_ptr, static_cast<uint64_t>(args_size_ - sizeof(ReportStatusInfo)), | 533 | + GE_CHK_ACL_RET(aclrtMemcpy(input_queues_ptr, static_cast<uint64_t>(args_size_ - sizeof(ReportStatusInfo)), |
| 534 | input_queues.data(), sizeof(QueueAttrs) * input_queues.size(), ACL_MEMCPY_HOST_TO_DEVICE)); | 534 | input_queues.data(), sizeof(QueueAttrs) * input_queues.size(), ACL_MEMCPY_HOST_TO_DEVICE)); |
| 535 | return SUCCESS; | 535 | return SUCCESS; |
| 536 | } | 536 | } |
| @@ -561,10 +561,10 @@ Status CpuTaskModelRepeat::Init(const uint32_t model_id) { | |||
| 561 | } | 561 | } |
| 562 | 562 | ||
| 563 | args_size_ = sizeof(model_id); | 563 | args_size_ = sizeof(model_id); |
| 564 | - GE_CHK_RT_RET(ge::AclrtMalloc(&args_, static_cast<uint64_t>(args_size_), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 564 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&args_, static_cast<uint64_t>(args_size_), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 565 | GE_PRINT_DYNAMIC_MEMORY(aclrtMalloc, "args data.", args_size_); | 565 | GE_PRINT_DYNAMIC_MEMORY(aclrtMalloc, "args data.", args_size_); |
| 566 | 566 | ||
| 567 | - GE_CHK_RT_RET(aclrtMemcpy(args_, static_cast<uint64_t>(args_size_), &model_id, static_cast<uint64_t>(args_size_), | 567 | + GE_CHK_ACL_RET(aclrtMemcpy(args_, static_cast<uint64_t>(args_size_), &model_id, static_cast<uint64_t>(args_size_), |
| 568 | ACL_MEMCPY_HOST_TO_DEVICE)); | 568 | ACL_MEMCPY_HOST_TO_DEVICE)); |
| 569 | 569 | ||
| 570 | return SUCCESS; | 570 | return SUCCESS; |
| @@ -605,7 +605,7 @@ Status CpuTaskModelBatchDequeue::Init(const uint32_t align_interval, | |||
| 605 | const uint32_t align_offsets_offset = args_size_; | 605 | const uint32_t align_offsets_offset = args_size_; |
| 606 | const size_t align_offsets_size = sizeof(uint32_t) * num_inputs; | 606 | const size_t align_offsets_size = sizeof(uint32_t) * num_inputs; |
| 607 | args_size_+= static_cast<uint32_t>(sizeof(uint32_t) * align_offsets_size); | 607 | args_size_+= static_cast<uint32_t>(sizeof(uint32_t) * align_offsets_size); |
| 608 | - GE_CHK_RT_RET(ge::AclrtMalloc(&args_, static_cast<uint64_t>(args_size_), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 608 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&args_, static_cast<uint64_t>(args_size_), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 609 | kernel_args.align_offsets_addr = PtrToValue(args_) + align_offsets_offset; | 609 | kernel_args.align_offsets_addr = PtrToValue(args_) + align_offsets_offset; |
| 610 | kernel_args.queue_ids_addr = PtrToValue(args_) + queue_ids_offset; | 610 | kernel_args.queue_ids_addr = PtrToValue(args_) + queue_ids_offset; |
| 611 | kernel_args.mbuf_addrs_addr = PtrToValue(args_) + mbuf_addrs_offset; | 611 | kernel_args.mbuf_addrs_addr = PtrToValue(args_) + mbuf_addrs_offset; |
| @@ -614,13 +614,13 @@ Status CpuTaskModelBatchDequeue::Init(const uint32_t align_interval, | |||
| 614 | } | 614 | } |
| 615 | 615 | ||
| 616 | GE_PRINT_DYNAMIC_MEMORY(aclrtMalloc, "args data.", args_size_); | 616 | GE_PRINT_DYNAMIC_MEMORY(aclrtMalloc, "args data.", args_size_); |
| 617 | - GE_CHK_RT_RET(aclrtMemcpy(args_, args_size_, | 617 | + GE_CHK_ACL_RET(aclrtMemcpy(args_, args_size_, |
| 618 | &kernel_args, sizeof(kernel_args), ACL_MEMCPY_HOST_TO_DEVICE)); | 618 | &kernel_args, sizeof(kernel_args), ACL_MEMCPY_HOST_TO_DEVICE)); |
| 619 | - GE_CHK_RT_RET(aclrtMemcpy(ValueToPtr(kernel_args.align_offsets_addr), align_offsets_size, | 619 | + GE_CHK_ACL_RET(aclrtMemcpy(ValueToPtr(kernel_args.align_offsets_addr), align_offsets_size, |
| 620 | align_offsets.data(), align_offsets_size, ACL_MEMCPY_HOST_TO_DEVICE)); | 620 | align_offsets.data(), align_offsets_size, ACL_MEMCPY_HOST_TO_DEVICE)); |
| 621 | - GE_CHK_RT_RET(aclrtMemcpy(ValueToPtr(kernel_args.queue_ids_addr), queue_ids_size, | 621 | + GE_CHK_ACL_RET(aclrtMemcpy(ValueToPtr(kernel_args.queue_ids_addr), queue_ids_size, |
| 622 | queue_ids.data(), queue_ids_size, ACL_MEMCPY_HOST_TO_DEVICE)); | 622 | queue_ids.data(), queue_ids_size, ACL_MEMCPY_HOST_TO_DEVICE)); |
| 623 | - GE_CHK_RT_RET(aclrtMemcpy(ValueToPtr(kernel_args.mbuf_addrs_addr), mbuf_addrs_size, | 623 | + GE_CHK_ACL_RET(aclrtMemcpy(ValueToPtr(kernel_args.mbuf_addrs_addr), mbuf_addrs_size, |
| 624 | in_mbufs.data(), mbuf_addrs_size, ACL_MEMCPY_HOST_TO_DEVICE)); | 624 | in_mbufs.data(), mbuf_addrs_size, ACL_MEMCPY_HOST_TO_DEVICE)); |
| 625 | return SUCCESS; | 625 | return SUCCESS; |
| 626 | } | 626 | } |
| @@ -667,7 +667,7 @@ Status CpuTaskModelGatherDequeue::Init(const std::vector<QueueAttrs> &queues, | |||
| 667 | const size_t mbuff_size = sizeof(uint64_t) * queue_num; | 667 | const size_t mbuff_size = sizeof(uint64_t) * queue_num; |
| 668 | args_size_ += static_cast<uint32_t>(mbuff_size); | 668 | args_size_ += static_cast<uint32_t>(mbuff_size); |
| 669 | 669 | ||
| 670 | - GE_CHK_RT_RET(ge::AclrtMalloc(&args_, static_cast<uint64_t>(args_size_), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 670 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&args_, static_cast<uint64_t>(args_size_), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 671 | GE_PRINT_DYNAMIC_MEMORY(aclrtMalloc, "args data.", args_size_); | 671 | GE_PRINT_DYNAMIC_MEMORY(aclrtMalloc, "args data.", args_size_); |
| 672 | kernel_args.queue_ids_addr = PtrToValue(args_) + queue_ids_offset; | 672 | kernel_args.queue_ids_addr = PtrToValue(args_) + queue_ids_offset; |
| 673 | kernel_args.mbuf_addrs_addr = PtrToValue(args_) + mbuf_addrs_offset; | 673 | kernel_args.mbuf_addrs_addr = PtrToValue(args_) + mbuf_addrs_offset; |
| @@ -684,15 +684,15 @@ Status CpuTaskModelGatherDequeue::Init(const std::vector<QueueAttrs> &queues, | |||
| 684 | device_ids.emplace_back(queues[i].device_id); | 684 | device_ids.emplace_back(queues[i].device_id); |
| 685 | device_types.emplace_back(queues[i].device_type); | 685 | device_types.emplace_back(queues[i].device_type); |
| 686 | } | 686 | } |
| 687 | - GE_CHK_RT_RET(aclrtMemcpy(args_, static_cast<uint64_t>(args_size_), | 687 | + GE_CHK_ACL_RET(aclrtMemcpy(args_, static_cast<uint64_t>(args_size_), |
| 688 | &kernel_args, sizeof(kernel_args), ACL_MEMCPY_HOST_TO_DEVICE)); | 688 | &kernel_args, sizeof(kernel_args), ACL_MEMCPY_HOST_TO_DEVICE)); |
| 689 | - GE_CHK_RT_RET(aclrtMemcpy(ValueToPtr(kernel_args.queue_ids_addr), queue_id_addrs_size, | 689 | + GE_CHK_ACL_RET(aclrtMemcpy(ValueToPtr(kernel_args.queue_ids_addr), queue_id_addrs_size, |
| 690 | queue_ids.data(), queue_id_addrs_size, ACL_MEMCPY_HOST_TO_DEVICE)); | 690 | queue_ids.data(), queue_id_addrs_size, ACL_MEMCPY_HOST_TO_DEVICE)); |
| 691 | - GE_CHK_RT_RET(aclrtMemcpy(ValueToPtr(kernel_args.mbuf_addrs_addr), mbuf_addrs_size, | 691 | + GE_CHK_ACL_RET(aclrtMemcpy(ValueToPtr(kernel_args.mbuf_addrs_addr), mbuf_addrs_size, |
| 692 | in_mbufs.data(), in_mbufs.size() * sizeof(uint64_t), ACL_MEMCPY_HOST_TO_DEVICE)); | 692 | in_mbufs.data(), in_mbufs.size() * sizeof(uint64_t), ACL_MEMCPY_HOST_TO_DEVICE)); |
| 693 | - GE_CHK_RT_RET(aclrtMemcpy(ValueToPtr(kernel_args.queue_device_ids_addr), device_ids_size, | 693 | + GE_CHK_ACL_RET(aclrtMemcpy(ValueToPtr(kernel_args.queue_device_ids_addr), device_ids_size, |
| 694 | device_ids.data(), device_ids_size, ACL_MEMCPY_HOST_TO_DEVICE)); | 694 | device_ids.data(), device_ids_size, ACL_MEMCPY_HOST_TO_DEVICE)); |
| 695 | - GE_CHK_RT_RET(aclrtMemcpy(ValueToPtr(kernel_args.queue_device_type_addr), device_type_size, | 695 | + GE_CHK_ACL_RET(aclrtMemcpy(ValueToPtr(kernel_args.queue_device_type_addr), device_type_size, |
| 696 | device_types.data(), device_type_size, ACL_MEMCPY_HOST_TO_DEVICE)); | 696 | device_types.data(), device_type_size, ACL_MEMCPY_HOST_TO_DEVICE)); |
| 697 | return SUCCESS; | 697 | return SUCCESS; |
| 698 | } | 698 | } |
| @@ -729,19 +729,19 @@ Status CpuTaskProcessInputsMemCopy::Init(const std::vector<uintptr_t> &mbuf_list | |||
| 729 | } | 729 | } |
| 730 | 730 | ||
| 731 | // construct InputCopyAddrMapInfo and copy data to device | 731 | // construct InputCopyAddrMapInfo and copy data to device |
| 732 | - GE_CHK_RT_RET(ge::AclrtMalloc(&src_addr_, mbuf_list.size() * sizeof(uint64_t), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 732 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&src_addr_, mbuf_list.size() * sizeof(uint64_t), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 733 | - GE_CHK_RT_RET(aclrtMemcpy(src_addr_, mbuf_list.size() * sizeof(uint64_t), mbuf_list.data(), | 733 | + GE_CHK_ACL_RET(aclrtMemcpy(src_addr_, mbuf_list.size() * sizeof(uint64_t), mbuf_list.data(), |
| 734 | mbuf_list.size() * sizeof(uint64_t), ACL_MEMCPY_HOST_TO_DEVICE)); | 734 | mbuf_list.size() * sizeof(uint64_t), ACL_MEMCPY_HOST_TO_DEVICE)); |
| 735 | 735 | ||
| 736 | - GE_CHK_RT_RET(ge::AclrtMalloc(&dst_addr_, data_addr_list.size() * sizeof(uint64_t), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 736 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&dst_addr_, data_addr_list.size() * sizeof(uint64_t), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 737 | - GE_CHK_RT_RET(aclrtMemcpy(dst_addr_, data_addr_list.size() * sizeof(uint64_t), data_addr_list.data(), | 737 | + GE_CHK_ACL_RET(aclrtMemcpy(dst_addr_, data_addr_list.size() * sizeof(uint64_t), data_addr_list.data(), |
| 738 | data_addr_list.size() * sizeof(uint64_t), ACL_MEMCPY_HOST_TO_DEVICE)); | 738 | data_addr_list.size() * sizeof(uint64_t), ACL_MEMCPY_HOST_TO_DEVICE)); |
| 739 | 739 | ||
| 740 | - GE_CHK_RT_RET(ge::AclrtMalloc(&len_list_, length_list.size() * sizeof(uint64_t), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 740 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&len_list_, length_list.size() * sizeof(uint64_t), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 741 | - GE_CHK_RT_RET(aclrtMemcpy(len_list_, length_list.size() * sizeof(uint64_t), length_list.data(), | 741 | + GE_CHK_ACL_RET(aclrtMemcpy(len_list_, length_list.size() * sizeof(uint64_t), length_list.data(), |
| 742 | length_list.size() * sizeof(uint64_t), ACL_MEMCPY_HOST_TO_DEVICE)); | 742 | length_list.size() * sizeof(uint64_t), ACL_MEMCPY_HOST_TO_DEVICE)); |
| 743 | - GE_CHK_RT_RET(ge::AclrtMalloc(&input_fusion_offset_list_, input_fusion_offset_list.size() * sizeof(int32_t), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 743 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&input_fusion_offset_list_, input_fusion_offset_list.size() * sizeof(int32_t), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 744 | - GE_CHK_RT_RET(aclrtMemcpy(input_fusion_offset_list_, input_fusion_offset_list.size() * sizeof(int32_t), | 744 | + GE_CHK_ACL_RET(aclrtMemcpy(input_fusion_offset_list_, input_fusion_offset_list.size() * sizeof(int32_t), |
| 745 | input_fusion_offset_list.data(), input_fusion_offset_list.size() * sizeof(int32_t), | 745 | input_fusion_offset_list.data(), input_fusion_offset_list.size() * sizeof(int32_t), |
| 746 | ACL_MEMCPY_HOST_TO_DEVICE)); | 746 | ACL_MEMCPY_HOST_TO_DEVICE)); |
| 747 | InputCopyAddrMapInfo addr_map_info; | 747 | InputCopyAddrMapInfo addr_map_info; |
| @@ -753,9 +753,9 @@ Status CpuTaskProcessInputsMemCopy::Init(const std::vector<uintptr_t> &mbuf_list | |||
| 753 | args_size_ = static_cast<uint32_t>(sizeof(InputCopyAddrMapInfo)); | 753 | args_size_ = static_cast<uint32_t>(sizeof(InputCopyAddrMapInfo)); |
| 754 | GELOGI("src_addr_list is 0x%" PRIx64 ", dst_addr_list is 0x%" PRIx64 ", data_len_addr is 0x%" PRIx64, | 754 | GELOGI("src_addr_list is 0x%" PRIx64 ", dst_addr_list is 0x%" PRIx64 ", data_len_addr is 0x%" PRIx64, |
| 755 | addr_map_info.src_addr_list, addr_map_info.dst_addr_list, addr_map_info.data_len_list); | 755 | addr_map_info.src_addr_list, addr_map_info.dst_addr_list, addr_map_info.data_len_list); |
| 756 | - GE_CHK_RT_RET(ge::AclrtMalloc(&args_, static_cast<uint64_t>(args_size_), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 756 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&args_, static_cast<uint64_t>(args_size_), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 757 | GE_PRINT_DYNAMIC_MEMORY(aclrtMalloc, "args data.", args_size_); | 757 | GE_PRINT_DYNAMIC_MEMORY(aclrtMalloc, "args data.", args_size_); |
| 758 | - GE_CHK_RT_RET(aclrtMemcpy(args_, static_cast<uint64_t>(args_size_), &addr_map_info, | 758 | + GE_CHK_ACL_RET(aclrtMemcpy(args_, static_cast<uint64_t>(args_size_), &addr_map_info, |
| 759 | static_cast<uint64_t>(args_size_), ACL_MEMCPY_HOST_TO_DEVICE)); | 759 | static_cast<uint64_t>(args_size_), ACL_MEMCPY_HOST_TO_DEVICE)); |
| 760 | return SUCCESS; | 760 | return SUCCESS; |
| 761 | } | 761 | } |
| @@ -801,15 +801,15 @@ Status CpuTaskProcessInputsShapeCheck::Init(const std::vector<uintptr_t> &mbuf_l | |||
| 801 | validation.offset = static_cast<uint64_t>(input_fusion_offset_list[i]); | 801 | validation.offset = static_cast<uint64_t>(input_fusion_offset_list[i]); |
| 802 | shape_validation.emplace_back(validation); | 802 | shape_validation.emplace_back(validation); |
| 803 | } | 803 | } |
| 804 | - GE_CHK_RT_RET(ge::AclrtMalloc(&shape_validation_addr_, sizeof(ShapeValidation) * shape_validation.size(), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 804 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&shape_validation_addr_, sizeof(ShapeValidation) * shape_validation.size(), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 805 | - GE_CHK_RT_RET(aclrtMemcpy(shape_validation_addr_, sizeof(ShapeValidation) * shape_validation.size(), | 805 | + GE_CHK_ACL_RET(aclrtMemcpy(shape_validation_addr_, sizeof(ShapeValidation) * shape_validation.size(), |
| 806 | shape_validation.data(), sizeof(ShapeValidation) * shape_validation.size(), ACL_MEMCPY_HOST_TO_DEVICE)); | 806 | shape_validation.data(), sizeof(ShapeValidation) * shape_validation.size(), ACL_MEMCPY_HOST_TO_DEVICE)); |
| 807 | ShapeValidationInfo shape_validation_info = {}; | 807 | ShapeValidationInfo shape_validation_info = {}; |
| 808 | shape_validation_info.validation_num = shape_validation.size(); | 808 | shape_validation_info.validation_num = shape_validation.size(); |
| 809 | shape_validation_info.validation_info_device_addr = PtrToValue(shape_validation_addr_); | 809 | shape_validation_info.validation_info_device_addr = PtrToValue(shape_validation_addr_); |
| 810 | GELOGI("Addr of shape validation info is 0x%" PRIx64 ".", shape_validation_addr_); | 810 | GELOGI("Addr of shape validation info is 0x%" PRIx64 ".", shape_validation_addr_); |
| 811 | - GE_CHK_RT_RET(ge::AclrtMalloc(&args_, sizeof(ShapeValidationInfo), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 811 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&args_, sizeof(ShapeValidationInfo), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 812 | - GE_CHK_RT_RET(aclrtMemcpy(args_, sizeof(ShapeValidationInfo), | 812 | + GE_CHK_ACL_RET(aclrtMemcpy(args_, sizeof(ShapeValidationInfo), |
| 813 | &shape_validation_info, sizeof(ShapeValidationInfo), ACL_MEMCPY_HOST_TO_DEVICE)); | 813 | &shape_validation_info, sizeof(ShapeValidationInfo), ACL_MEMCPY_HOST_TO_DEVICE)); |
| 814 | args_size_ = static_cast<uint32_t>(sizeof(ShapeValidationInfo)); | 814 | args_size_ = static_cast<uint32_t>(sizeof(ShapeValidationInfo)); |
| 815 | return SUCCESS; | 815 | return SUCCESS; |
| @@ -49,6 +49,8 @@ | |||
| 49 | 49 | ||
| 50 | 50 | ||
| 51 | 51 | ||
| 52 | + | ||
| 53 | + | ||
| 52 | 54 | ||
| 53 | 55 | ||
| 54 | 56 | ||
| @@ -565,7 +567,7 @@ Status DavinciModel::InitWeightMem(const uintptr_t mem_ptr, const uintptr_t weig | |||
| 565 | } | 567 | } |
| 566 | GELOGI("[IMAS]InitWeightMem graph_%u MallocMemory type[W] memaddr[0x%" PRIx64 "] mem_size[%zu]", | 568 | GELOGI("[IMAS]InitWeightMem graph_%u MallocMemory type[W] memaddr[0x%" PRIx64 "] mem_size[%zu]", |
| 567 | runtime_param_.graph_id, weights_mem_base_, weights_size); | 569 | runtime_param_.graph_id, weights_mem_base_, weights_size); |
| 568 | - GE_CHK_RT_RET(aclrtMemcpy(ValueToPtr(weights_mem_base_), weights_size, ge_model_->GetWeightData(), weights_size, | 570 | + GE_CHK_ACL_RET(aclrtMemcpy(ValueToPtr(weights_mem_base_), weights_size, ge_model_->GetWeightData(), weights_size, |
| 569 | ACL_MEMCPY_HOST_TO_DEVICE)); | 571 | ACL_MEMCPY_HOST_TO_DEVICE)); |
| 570 | GELOGI("copy weights data to device"); | 572 | GELOGI("copy weights data to device"); |
| 571 | } | 573 | } |
| @@ -737,7 +739,7 @@ Status DavinciModel::BindModelStream() { | |||
| 737 | ACL_MODEL_STREAM_FLAG_HEAD : ACL_MODEL_STREAM_FLAG_DEFAULT; | 739 | ACL_MODEL_STREAM_FLAG_HEAD : ACL_MODEL_STREAM_FLAG_DEFAULT; |
| 738 | GELOGI("model_id=%u, aclmdlRIBindStream[%zu] stream: %p, flag: %#x", | 740 | GELOGI("model_id=%u, aclmdlRIBindStream[%zu] stream: %p, flag: %#x", |
| 739 | model_id_, stream_id, stream_list_[stream_id], static_cast<uint32_t>(bind_flag)); | 741 | model_id_, stream_id, stream_list_[stream_id], static_cast<uint32_t>(bind_flag)); |
| 740 | - GE_CHK_RT_RET(aclmdlRIBindStream(rt_model_handle_, | 742 | + GE_CHK_ACL_RET(aclmdlRIBindStream(rt_model_handle_, |
| 741 | stream_list_[stream_id], static_cast<uint32_t>(bind_flag))); | 743 | stream_list_[stream_id], static_cast<uint32_t>(bind_flag))); |
| 742 | } | 744 | } |
| 743 | is_stream_list_bind_ = true; | 745 | is_stream_list_bind_ = true; |
| @@ -760,20 +762,20 @@ Status DavinciModel::UpdateStaticModelArgsByFm() { | |||
| 760 | // 此时已经确定了执行时是否走算子化刷新,使用正确的device地址来 更新对应io的device地址 | 762 | // 此时已经确定了执行时是否走算子化刷新,使用正确的device地址来 更新对应io的device地址 |
| 761 | GE_ASSERT_SUCCESS(InitCopyHostInputInfos()); | 763 | GE_ASSERT_SUCCESS(InitCopyHostInputInfos()); |
| 762 | aclrtStream stream = nullptr; | 764 | aclrtStream stream = nullptr; |
| 763 | - GE_CHK_RT_RET(aclrtCreateStream(&stream)); | 765 | + GE_CHK_ACL_RET(aclrtCreateStream(&stream)); |
| 764 | GE_MAKE_GUARD_ACLRTSTREAM(stream); | 766 | GE_MAKE_GUARD_ACLRTSTREAM(stream); |
| 765 | // 加载阶段同老流程走全量model args h2d拷贝 | 767 | // 加载阶段同老流程走全量model args h2d拷贝 |
| 766 | GE_ASSERT_SUCCESS(args_manager_.UpdateForExecute(ret_up, stream, kModelLoadStage)); | 768 | GE_ASSERT_SUCCESS(args_manager_.UpdateForExecute(ret_up, stream, kModelLoadStage)); |
| 767 | args_manager_.InitDfxStatsticsEnd(); | 769 | args_manager_.InitDfxStatsticsEnd(); |
| 768 | args_manager_.PrintDfxStatistics(kModelLoadStage); | 770 | args_manager_.PrintDfxStatistics(kModelLoadStage); |
| 769 | - GE_CHK_RT_RET(aclrtSynchronizeStream(stream)); | 771 | + GE_CHK_ACL_RET(aclrtSynchronizeStream(stream)); |
| 770 | GELOGI("Sync stream successfully, model_id: %u", model_id_); | 772 | GELOGI("Sync stream successfully, model_id: %u", model_id_); |
| 771 | return SUCCESS; | 773 | return SUCCESS; |
| 772 | } | 774 | } |
| 773 | 775 | ||
| 774 | Status DavinciModel::CreateHcclGroupOrderedEvent() { | 776 | Status DavinciModel::CreateHcclGroupOrderedEvent() { |
| 775 | int32_t device_id = -1; | 777 | int32_t device_id = -1; |
| 776 | - GE_CHK_RT_RET(aclrtGetDevice(&device_id)); | 778 | + GE_CHK_ACL_RET(aclrtGetDevice(&device_id)); |
| 777 | for (const auto &group_id : hccl_group_id_set_) { | 779 | for (const auto &group_id : hccl_group_id_set_) { |
| 778 | aclrtStream stream = nullptr; | 780 | aclrtStream stream = nullptr; |
| 779 | if (HcomTopoInfo::Instance().GetGroupOrderedStream(device_id, group_id.c_str(), stream) != GRAPH_SUCCESS) { | 781 | if (HcomTopoInfo::Instance().GetGroupOrderedStream(device_id, group_id.c_str(), stream) != GRAPH_SUCCESS) { |
| @@ -789,7 +791,7 @@ Status DavinciModel::CreateHcclGroupOrderedEvent() { | |||
| 789 | while (i < hccl_group_ordered_stream_list_.size()) { | 791 | while (i < hccl_group_ordered_stream_list_.size()) { |
| 790 | aclrtEvent rt_event = nullptr; | 792 | aclrtEvent rt_event = nullptr; |
| 791 | int32_t stream_id = 0; | 793 | int32_t stream_id = 0; |
| 792 | - GE_CHK_RT_RET(aclrtCreateEventExWithFlag( | 794 | + GE_CHK_ACL_RET(aclrtCreateEventExWithFlag( |
| 793 | &rt_event, static_cast<uint32_t>(ACL_EVENT_SYNC | ACL_EVENT_CAPTURE_STREAM_PROGRESS | ACL_EVENT_TIME_LINE))); | 795 | &rt_event, static_cast<uint32_t>(ACL_EVENT_SYNC | ACL_EVENT_CAPTURE_STREAM_PROGRESS | ACL_EVENT_TIME_LINE))); |
| 794 | hccl_group_ordered_event_list_.push_back(rt_event); | 796 | hccl_group_ordered_event_list_.push_back(rt_event); |
| 795 | (void)aclrtStreamGetId(hccl_group_ordered_stream_list_[i], &stream_id); | 797 | (void)aclrtStreamGetId(hccl_group_ordered_stream_list_[i], &stream_id); |
| @@ -864,7 +866,7 @@ Status DavinciModel::DoTaskSink() { | |||
| 864 | 866 | ||
| 865 | GE_CHK_STATUS_RET(UpdateStaticModelArgsByFm()); | 867 | GE_CHK_STATUS_RET(UpdateStaticModelArgsByFm()); |
| 866 | 868 | ||
| 867 | - GE_CHK_RT_RET(aclmdlRIBuildEnd(rt_model_handle_, nullptr)); | 869 | + GE_CHK_ACL_RET(aclmdlRIBuildEnd(rt_model_handle_, nullptr)); |
| 868 | 870 | ||
| 869 | GE_CHK_STATUS_RET(LoadWithHardwareQueue(), "[Init][LoadWithHardwareQueue] failed, model_id: %u.", model_id_); | 871 | GE_CHK_STATUS_RET(LoadWithHardwareQueue(), "[Init][LoadWithHardwareQueue] failed, model_id: %u.", model_id_); |
| 870 | 872 | ||
| @@ -892,11 +894,11 @@ Status DavinciModel::RecoverModel() { | |||
| 892 | // 从流清理 | 894 | // 从流清理 |
| 893 | if (main_follow_stream_mapping_.find(pair.first) != main_follow_stream_mapping_.end()) { | 895 | if (main_follow_stream_mapping_.find(pair.first) != main_follow_stream_mapping_.end()) { |
| 894 | for (auto &follow_stream : main_follow_stream_mapping_[pair.first]) { | 896 | for (auto &follow_stream : main_follow_stream_mapping_[pair.first]) { |
| 895 | - GE_CHK_RT_RET(aclrtPersistentTaskClean(follow_stream)); | 897 | + GE_CHK_ACL_RET(aclrtPersistentTaskClean(follow_stream)); |
| 896 | } | 898 | } |
| 897 | } | 899 | } |
| 898 | 900 | ||
| 899 | - GE_CHK_RT_RET(aclrtPersistentTaskClean(ge::ValueToPtr(pair.first))); | 901 | + GE_CHK_ACL_RET(aclrtPersistentTaskClean(ge::ValueToPtr(pair.first))); |
| 900 | for (auto &task_index : pair.second) { | 902 | for (auto &task_index : pair.second) { |
| 901 | const auto &task_info = task_list_.at(static_cast<size_t>(task_index)); | 903 | const auto &task_info = task_list_.at(static_cast<size_t>(task_index)); |
| 902 | GE_ASSERT_NOTNULL(task_info); | 904 | GE_ASSERT_NOTNULL(task_info); |
| @@ -936,7 +938,7 @@ Status DavinciModel::SetTSDevice() { | |||
| 936 | const bool ret = AttrUtils::GetInt(ge_model_, ATTR_MODEL_CORE_TYPE, value); | 938 | const bool ret = AttrUtils::GetInt(ge_model_, ATTR_MODEL_CORE_TYPE, value); |
| 937 | const uint32_t core_type = ret ? static_cast<uint32_t>(value) : 0U; | 939 | const uint32_t core_type = ret ? static_cast<uint32_t>(value) : 0U; |
| 938 | GELOGD("Set TSDevice: %u.", core_type); | 940 | GELOGD("Set TSDevice: %u.", core_type); |
| 939 | - GE_CHK_RT_RET(aclrtSetTsDevice(static_cast<aclrtTsId>(core_type))); | 941 | + GE_CHK_ACL_RET(aclrtSetTsDevice(static_cast<aclrtTsId>(core_type))); |
| 940 | return SUCCESS; | 942 | return SUCCESS; |
| 941 | } | 943 | } |
| 942 | 944 | ||
| @@ -1431,8 +1433,8 @@ Status DavinciModel::InitStreamInfoOfTask(const ComputeGraphPtr &compute_graph) | |||
| 1431 | 1433 | ||
| 1432 | Status DavinciModel::InitRuntimeResource() { | 1434 | Status DavinciModel::InitRuntimeResource() { |
| 1433 | // create model_handle to load model | 1435 | // create model_handle to load model |
| 1434 | - GE_CHK_RT_RET(aclmdlRIBuildBegin(&rt_model_handle_, 0U)); | 1436 | + GE_CHK_ACL_RET(aclmdlRIBuildBegin(&rt_model_handle_, 0U)); |
| 1435 | - GE_CHK_RT_RET(aclmdlRISetName(rt_model_handle_, name_.c_str())); | 1437 | + GE_CHK_ACL_RET(aclmdlRISetName(rt_model_handle_, name_.c_str())); |
| 1436 | GE_CHK_RT_RET(rtModelGetId(rt_model_handle_, &runtime_model_id_)); | 1438 | GE_CHK_RT_RET(rtModelGetId(rt_model_handle_, &runtime_model_id_)); |
| 1437 | std::vector<int64_t> huge_stream_list; | 1439 | std::vector<int64_t> huge_stream_list; |
| 1438 | (void)AttrUtils::GetListInt(ge_model_, ATTR_MODEL_HUGE_STREAM_LIST, huge_stream_list); | 1440 | (void)AttrUtils::GetListInt(ge_model_, ATTR_MODEL_HUGE_STREAM_LIST, huge_stream_list); |
| @@ -1495,7 +1497,7 @@ Status DavinciModel::InitRuntimeResource() { | |||
| 1495 | i = 0U; | 1497 | i = 0U; |
| 1496 | while (i < runtime_param_.event_num) { | 1498 | while (i < runtime_param_.event_num) { |
| 1497 | aclrtEvent rt_event = nullptr; | 1499 | aclrtEvent rt_event = nullptr; |
| 1498 | - GE_CHK_RT_RET(aclrtCreateEventWithFlag( | 1500 | + GE_CHK_ACL_RET(aclrtCreateEventWithFlag( |
| 1499 | &rt_event, static_cast<uint32_t>(ACL_EVENT_SYNC | ACL_EVENT_CAPTURE_STREAM_PROGRESS | ACL_EVENT_TIME_LINE))); | 1501 | &rt_event, static_cast<uint32_t>(ACL_EVENT_SYNC | ACL_EVENT_CAPTURE_STREAM_PROGRESS | ACL_EVENT_TIME_LINE))); |
| 1500 | event_list_.push_back(rt_event); | 1502 | event_list_.push_back(rt_event); |
| 1501 | ++i; | 1503 | ++i; |
| @@ -1512,7 +1514,7 @@ Status DavinciModel::InitSupplyResource() { | |||
| 1512 | GE_CHK_STATUS_RET(OpDebugRegister(), "[Call][OpDebugRegister] failed, model_id: %u.", model_id_); | 1514 | GE_CHK_STATUS_RET(OpDebugRegister(), "[Call][OpDebugRegister] failed, model_id: %u.", model_id_); |
| 1513 | 1515 | ||
| 1514 | // malloc mem for overflow detetcion | 1516 | // malloc mem for overflow detetcion |
| 1515 | - GE_CHK_RT_RET(aclrtCtxGetFloatOverflowAddr(&globalworkspace_overflow_addr_)); | 1517 | + GE_CHK_ACL_RET(aclrtCtxGetFloatOverflowAddr(&globalworkspace_overflow_addr_)); |
| 1516 | return SUCCESS; | 1518 | return SUCCESS; |
| 1517 | } | 1519 | } |
| 1518 | 1520 | ||
| @@ -2097,7 +2099,7 @@ Status DavinciModel::InitNodes(const ComputeGraphPtr &compute_graph) { | |||
| 2097 | auto fut = thread_pool.commit([this, node, op_type, thread_local_context, error_manager_context]() -> Status { | 2099 | auto fut = thread_pool.commit([this, node, op_type, thread_local_context, error_manager_context]() -> Status { |
| 2098 | GetThreadLocalContext() = thread_local_context; | 2100 | GetThreadLocalContext() = thread_local_context; |
| 2099 | error_message::SetErrMgrContext(error_manager_context); | 2101 | error_message::SetErrMgrContext(error_manager_context); |
| 2100 | - GE_CHK_RT_RET(aclrtSetDevice(device_id_)); | 2102 | + GE_CHK_ACL_RET(aclrtSetDevice(device_id_)); |
| 2101 | GE_MAKE_GUARD(reset_device, [this]() { GE_CHK_RT(aclrtResetDevice(device_id_)); }); | 2103 | GE_MAKE_GUARD(reset_device, [this]() { GE_CHK_RT(aclrtResetDevice(device_id_)); }); |
| 2102 | if (op_type == FILECONSTANT) { | 2104 | if (op_type == FILECONSTANT) { |
| 2103 | GE_CHK_STATUS_RET_NOLOG(InitFileConstant(node)); | 2105 | GE_CHK_STATUS_RET_NOLOG(InitFileConstant(node)); |
| @@ -2207,7 +2209,7 @@ Status DavinciModel::InitNoTaskAndDumpNeededNode(const OpDescPtr &op_desc) { | |||
| 2207 | GE_ASSERT_NOTNULL(addr); | 2209 | GE_ASSERT_NOTNULL(addr); |
| 2208 | saved_task_addrs_[op_desc] = addr; | 2210 | saved_task_addrs_[op_desc] = addr; |
| 2209 | 2211 | ||
| 2210 | - GE_CHK_RT_RET(aclrtMemcpy(addr, addr_size, device_addrs.data(), addr_size, ACL_MEMCPY_HOST_TO_DEVICE)); | 2212 | + GE_CHK_ACL_RET(aclrtMemcpy(addr, addr_size, device_addrs.data(), addr_size, ACL_MEMCPY_HOST_TO_DEVICE)); |
| 2211 | } | 2213 | } |
| 2212 | 2214 | ||
| 2213 | return SUCCESS; | 2215 | return SUCCESS; |
| @@ -3225,7 +3227,7 @@ Status DavinciModel::InitLabelSet(const OpDescPtr &op_desc) { | |||
| 3225 | GE_CHK_STATUS_RET_NOLOG(GetOpStream(op_desc, stream_id, stream)); | 3227 | GE_CHK_STATUS_RET_NOLOG(GetOpStream(op_desc, stream_id, stream)); |
| 3226 | 3228 | ||
| 3227 | aclrtLabel rt_label = nullptr; | 3229 | aclrtLabel rt_label = nullptr; |
| 3228 | - GE_CHK_RT_RET(aclrtCreateLabel(&rt_label)); | 3230 | + GE_CHK_ACL_RET(aclrtCreateLabel(&rt_label)); |
| 3229 | 3231 | ||
| 3230 | GELOGI("InitLabelSet: label[%u]=%p stream[%zu]=%p", label_index, rt_label, stream_id, stream); | 3232 | GELOGI("InitLabelSet: label[%u]=%p stream[%zu]=%p", label_index, rt_label, stream_id, stream); |
| 3231 | (void)label_id_indication_.insert(label_index); | 3233 | (void)label_id_indication_.insert(label_index); |
| @@ -4451,7 +4453,7 @@ Status DavinciModel::GetOutputDescInfo(std::vector<InputOutputDescInfo> &output_ | |||
| 4451 | static Status CopyInputForNoTiling(const InputData &input_data, const size_t data_idx, void *&mem_addr) { | 4453 | static Status CopyInputForNoTiling(const InputData &input_data, const size_t data_idx, void *&mem_addr) { |
| 4452 | RuntimeTensorDesc tensor_desc; | 4454 | RuntimeTensorDesc tensor_desc; |
| 4453 | // copy data_addr from tensor_desc addr | 4455 | // copy data_addr from tensor_desc addr |
| 4454 | - GE_CHK_RT_RET(aclrtMemcpy(&tensor_desc, sizeof(RuntimeTensorDesc), mem_addr, sizeof(RuntimeTensorDesc), | 4456 | + GE_CHK_ACL_RET(aclrtMemcpy(&tensor_desc, sizeof(RuntimeTensorDesc), mem_addr, sizeof(RuntimeTensorDesc), |
| 4455 | ACL_MEMCPY_DEVICE_TO_HOST)); | 4457 | ACL_MEMCPY_DEVICE_TO_HOST)); |
| 4456 | if (data_idx >= input_data.shapes.size()) { | 4458 | if (data_idx >= input_data.shapes.size()) { |
| 4457 | GELOGE(PARAM_INVALID, "invalid index[%zu], input shape size[%zu]", data_idx, input_data.shapes.size()); | 4459 | GELOGE(PARAM_INVALID, "invalid index[%zu], input shape size[%zu]", data_idx, input_data.shapes.size()); |
| @@ -4487,7 +4489,7 @@ Status DavinciModel::CopyInputData(const InputData &input_data) { | |||
| 4487 | GELOGW("The switch of input_batch_cpy is open but only one input exists, not enable batch memcpy"); | 4489 | GELOGW("The switch of input_batch_cpy is open but only one input exists, not enable batch memcpy"); |
| 4488 | } else { | 4490 | } else { |
| 4489 | ResetMemcpyBatchParams(); | 4491 | ResetMemcpyBatchParams(); |
| 4490 | - GE_CHK_RT_RET(aclrtGetDevice(&cur_device_id)); | 4492 | + GE_CHK_ACL_RET(aclrtGetDevice(&cur_device_id)); |
| 4491 | } | 4493 | } |
| 4492 | } | 4494 | } |
| 4493 | size_t idx = 0; | 4495 | size_t idx = 0; |
| @@ -4537,7 +4539,7 @@ Status DavinciModel::CopyInputData(const InputData &input_data) { | |||
| 4537 | // 目前只有开启了批拷贝开关+H2D场景支持batch memcpy | 4539 | // 目前只有开启了批拷贝开关+H2D场景支持batch memcpy |
| 4538 | memcpy_batch_params_.device_id = cur_device_id; | 4540 | memcpy_batch_params_.device_id = cur_device_id; |
| 4539 | if (!enable_input_batch_cpy_ || kind != ACL_MEMCPY_HOST_TO_DEVICE) { | 4541 | if (!enable_input_batch_cpy_ || kind != ACL_MEMCPY_HOST_TO_DEVICE) { |
| 4540 | - GE_CHK_RT_RET(aclrtMemcpy(mem_addr, data_size, data_buf.data, data_buf.length, kind)); | 4542 | + GE_CHK_ACL_RET(aclrtMemcpy(mem_addr, data_size, data_buf.data, data_buf.length, kind)); |
| 4541 | } else { | 4543 | } else { |
| 4542 | MemcpyParam memcpy_param {mem_addr, data_size, data_buf.data, data_buf.length, idx++}; | 4544 | MemcpyParam memcpy_param {mem_addr, data_size, data_buf.data, data_buf.length, idx++}; |
| 4543 | TensorTransUtils::AddMemcpyBatchParam(memcpy_param, memcpy_batch_params_); | 4545 | TensorTransUtils::AddMemcpyBatchParam(memcpy_param, memcpy_batch_params_); |
| @@ -4609,13 +4611,13 @@ Status DavinciModel::CopyInputDataWithMergeH2D(const InputData &input_data) { | |||
| 4609 | input_merge_copy_mem_size_); | 4611 | input_merge_copy_mem_size_); |
| 4610 | GE_CHECK_NOTNULL(input_merge_copy_device_addr, | 4612 | GE_CHECK_NOTNULL(input_merge_copy_device_addr, |
| 4611 | "invalid input_merge_copy_device_addr value, input_merge_copy_device_addr is nullptr"); | 4613 | "invalid input_merge_copy_device_addr value, input_merge_copy_device_addr is nullptr"); |
| 4612 | - GE_CHK_RT_RET(aclrtMemcpy(input_merge_copy_device_addr, input_merge_copy_mem_size_, input_merge_copy_mem_base_.get(), | 4614 | + GE_CHK_ACL_RET(aclrtMemcpy(input_merge_copy_device_addr, input_merge_copy_mem_size_, input_merge_copy_mem_base_.get(), |
| 4613 | input_merge_copy_mem_size_, ACL_MEMCPY_HOST_TO_DEVICE)); | 4615 | input_merge_copy_mem_size_, ACL_MEMCPY_HOST_TO_DEVICE)); |
| 4614 | // copy non merge copy input | 4616 | // copy non merge copy input |
| 4615 | 4617 | ||
| 4616 | int32_t cur_device_id = -1; | 4618 | int32_t cur_device_id = -1; |
| 4617 | if (enable_input_batch_cpy_) { | 4619 | if (enable_input_batch_cpy_) { |
| 4618 | - GE_CHK_RT_RET(aclrtGetDevice(&cur_device_id)); | 4620 | + GE_CHK_ACL_RET(aclrtGetDevice(&cur_device_id)); |
| 4619 | ResetMemcpyBatchParams(); | 4621 | ResetMemcpyBatchParams(); |
| 4620 | } | 4622 | } |
| 4621 | size_t idx = 0; | 4623 | size_t idx = 0; |
| @@ -4634,7 +4636,7 @@ Status DavinciModel::CopyInputDataWithMergeH2D(const InputData &input_data) { | |||
| 4634 | memcpy_batch_params_.device_id = cur_device_id; | 4636 | memcpy_batch_params_.device_id = cur_device_id; |
| 4635 | if (!enable_input_batch_cpy_ || kind != ACL_MEMCPY_HOST_TO_DEVICE) { | 4637 | if (!enable_input_batch_cpy_ || kind != ACL_MEMCPY_HOST_TO_DEVICE) { |
| 4636 | GELOGD("Call aclrtMemcpy for non_merge_copy_indexs"); | 4638 | GELOGD("Call aclrtMemcpy for non_merge_copy_indexs"); |
| 4637 | - GE_CHK_RT_RET(aclrtMemcpy(mem_addr, data_size, data_buf.data, data_buf.length, kind)); | 4639 | + GE_CHK_ACL_RET(aclrtMemcpy(mem_addr, data_size, data_buf.data, data_buf.length, kind)); |
| 4638 | } else { | 4640 | } else { |
| 4639 | MemcpyParam memcpy_param {mem_addr, data_size, data_buf.data, data_buf.length, idx++}; | 4641 | MemcpyParam memcpy_param {mem_addr, data_size, data_buf.data, data_buf.length, idx++}; |
| 4640 | TensorTransUtils::AddMemcpyBatchParam(memcpy_param, memcpy_batch_params_); | 4642 | TensorTransUtils::AddMemcpyBatchParam(memcpy_param, memcpy_batch_params_); |
| @@ -5028,9 +5030,9 @@ Status DavinciModel::CopyOutputForNoZeroCopy(const std::vector<GeTensor> &output | |||
| 5028 | } | 5030 | } |
| 5029 | 5031 | ||
| 5030 | if (is_async_mode_) { | 5032 | if (is_async_mode_) { |
| 5031 | - GE_CHK_RT_RET(aclrtMemcpyAsync(data, buffer_length, src_addr, data_size, kind, rt_model_stream_)); | 5033 | + GE_CHK_ACL_RET(aclrtMemcpyAsync(data, buffer_length, src_addr, data_size, kind, rt_model_stream_)); |
| 5032 | } else { | 5034 | } else { |
| 5033 | - GE_CHK_RT_RET(aclrtMemcpy(data, buffer_length, src_addr, data_size, kind)); | 5035 | + GE_CHK_ACL_RET(aclrtMemcpy(data, buffer_length, src_addr, data_size, kind)); |
| 5034 | } | 5036 | } |
| 5035 | } | 5037 | } |
| 5036 | 5038 | ||
| @@ -5082,9 +5084,9 @@ Status DavinciModel::CopyOutputForNoZeroCopy(const std::vector<gert::Tensor> &ou | |||
| 5082 | } | 5084 | } |
| 5083 | 5085 | ||
| 5084 | if (is_async_mode_) { | 5086 | if (is_async_mode_) { |
| 5085 | - GE_CHK_RT_RET(aclrtMemcpyAsync(data, buffer_length, src_addr, data_size, kind, rt_model_stream_)); | 5087 | + GE_CHK_ACL_RET(aclrtMemcpyAsync(data, buffer_length, src_addr, data_size, kind, rt_model_stream_)); |
| 5086 | } else { | 5088 | } else { |
| 5087 | - GE_CHK_RT_RET(aclrtMemcpy(data, buffer_length, src_addr, data_size, kind)); | 5089 | + GE_CHK_ACL_RET(aclrtMemcpy(data, buffer_length, src_addr, data_size, kind)); |
| 5088 | } | 5090 | } |
| 5089 | } | 5091 | } |
| 5090 | 5092 | ||
| @@ -5095,10 +5097,10 @@ Status DavinciModel::UpdateStepInfoWithStream() { | |||
| 5095 | // iterator_count_ used both in tran and inferance, to get(or manager) resouces between diffrence run times | 5097 | // iterator_count_ used both in tran and inferance, to get(or manager) resouces between diffrence run times |
| 5096 | if ((global_step_addr_ != 0U) && (global_step_size_ != 0U)) { | 5098 | if ((global_step_addr_ != 0U) && (global_step_size_ != 0U)) { |
| 5097 | if (is_async_mode_) { | 5099 | if (is_async_mode_) { |
| 5098 | - GE_CHK_RT_RET(aclrtMemcpyAsync(ValueToPtr(static_cast<uint64_t>(global_step_addr_)), global_step_size_, | 5100 | + GE_CHK_ACL_RET(aclrtMemcpyAsync(ValueToPtr(static_cast<uint64_t>(global_step_addr_)), global_step_size_, |
| 5099 | &iterator_count_, sizeof(uint64_t), ACL_MEMCPY_HOST_TO_BUF_TO_DEVICE, rt_model_stream_)); | 5101 | &iterator_count_, sizeof(uint64_t), ACL_MEMCPY_HOST_TO_BUF_TO_DEVICE, rt_model_stream_)); |
| 5100 | } else { | 5102 | } else { |
| 5101 | - GE_CHK_RT_RET(aclrtMemcpy(ValueToPtr(static_cast<uint64_t>(global_step_addr_)), global_step_size_, | 5103 | + GE_CHK_ACL_RET(aclrtMemcpy(ValueToPtr(static_cast<uint64_t>(global_step_addr_)), global_step_size_, |
| 5102 | &iterator_count_, sizeof(uint64_t), ACL_MEMCPY_HOST_TO_DEVICE)); | 5104 | &iterator_count_, sizeof(uint64_t), ACL_MEMCPY_HOST_TO_DEVICE)); |
| 5103 | } | 5105 | } |
| 5104 | } | 5106 | } |
| @@ -5205,10 +5207,10 @@ Status DavinciModel::CopyOutputDataLegacy(const OutputData &output_data) { | |||
| 5205 | (is_async_mode_ ? "async" : "sync"), runtime_param_.graph_id, output.first, buffer.data, output_addr, | 5207 | (is_async_mode_ ? "async" : "sync"), runtime_param_.graph_id, output.first, buffer.data, output_addr, |
| 5206 | copied_size, buffer.length); | 5208 | copied_size, buffer.length); |
| 5207 | if (is_async_mode_) { | 5209 | if (is_async_mode_) { |
| 5208 | - GE_CHK_RT_RET(aclrtMemcpyAsync(buffer.data, buffer.length, output_addr, | 5210 | + GE_CHK_ACL_RET(aclrtMemcpyAsync(buffer.data, buffer.length, output_addr, |
| 5209 | copied_size, kind, rt_model_stream_)); | 5211 | copied_size, kind, rt_model_stream_)); |
| 5210 | } else { | 5212 | } else { |
| 5211 | - GE_CHK_RT_RET(aclrtMemcpy(buffer.data, buffer.length, output_addr, copied_size, kind)); | 5213 | + GE_CHK_ACL_RET(aclrtMemcpy(buffer.data, buffer.length, output_addr, copied_size, kind)); |
| 5212 | } | 5214 | } |
| 5213 | } | 5215 | } |
| 5214 | return SUCCESS; | 5216 | return SUCCESS; |
| @@ -5258,7 +5260,7 @@ Status DavinciModel::BuildOutputShapeInfo(const size_t output_idx, std::vector<i | |||
| 5258 | return FAILED; | 5260 | return FAILED; |
| 5259 | } | 5261 | } |
| 5260 | RuntimeTensorDesc tensor_desc; | 5262 | RuntimeTensorDesc tensor_desc; |
| 5261 | - GE_CHK_RT_RET(aclrtMemcpy(&tensor_desc, sizeof(RuntimeTensorDesc), output->second.GetBasicAddr(), | 5263 | + GE_CHK_ACL_RET(aclrtMemcpy(&tensor_desc, sizeof(RuntimeTensorDesc), output->second.GetBasicAddr(), |
| 5262 | sizeof(RuntimeTensorDesc), ACL_MEMCPY_DEVICE_TO_HOST)); | 5264 | sizeof(RuntimeTensorDesc), ACL_MEMCPY_DEVICE_TO_HOST)); |
| 5263 | const int64_t dim_num = tensor_desc.shape[0]; | 5265 | const int64_t dim_num = tensor_desc.shape[0]; |
| 5264 | for (int64_t dim_loop = 0; dim_loop < dim_num; dim_loop++) { | 5266 | for (int64_t dim_loop = 0; dim_loop < dim_num; dim_loop++) { |
| @@ -5610,8 +5612,8 @@ void DavinciModel::Run() { | |||
| 5610 | GE_IF_BOOL_EXEC(is_first_execute_, GE_TIMESTAMP_EVENT_END(aclmdlRIExecuteAsync, "aclmdlRIExecuteAsync")); | 5612 | GE_IF_BOOL_EXEC(is_first_execute_, GE_TIMESTAMP_EVENT_END(aclmdlRIExecuteAsync, "aclmdlRIExecuteAsync")); |
| 5611 | iterator_count_++; | 5613 | iterator_count_++; |
| 5612 | 5614 | ||
| 5613 | - GE_TIMESTAMP_START(rtStreamSynchronizeWithTimeout); | 5615 | + GE_TIMESTAMP_START(aclrtSynchronizeStreamWithTimeout); |
| 5614 | - GELOGI("rtStreamSynchronizeWithTimeout start, model id:%u.", model_id_); | 5616 | + GELOGI("aclrtSynchronizeStreamWithTimeout start, model id:%u.", model_id_); |
| 5615 | rt_ret = aclrtSynchronizeStreamWithTimeout(rt_model_stream_, stream_sync_timeout_); | 5617 | rt_ret = aclrtSynchronizeStreamWithTimeout(rt_model_stream_, stream_sync_timeout_); |
| 5616 | if (rt_ret == ACL_ERROR_RT_SOCKET_CLOSE) { | 5618 | if (rt_ret == ACL_ERROR_RT_SOCKET_CLOSE) { |
| 5617 | GELOGI("connect lost to model exec, befause socket closed, model_id:%u", model_id_); | 5619 | GELOGI("connect lost to model exec, befause socket closed, model_id:%u", model_id_); |
| @@ -5620,9 +5622,9 @@ void DavinciModel::Run() { | |||
| 5620 | if (rt_ret == ACL_ERROR_RT_STREAM_SYNC_TIMEOUT) { | 5622 | if (rt_ret == ACL_ERROR_RT_STREAM_SYNC_TIMEOUT) { |
| 5621 | is_stream_sync_timeout_ = true; | 5623 | is_stream_sync_timeout_ = true; |
| 5622 | GE_LOGW_IF(aclmdlRIAbort(rt_model_handle_) != ACL_SUCCESS, "Abort model failed!"); | 5624 | GE_LOGW_IF(aclmdlRIAbort(rt_model_handle_) != ACL_SUCCESS, "Abort model failed!"); |
| 5623 | - REPORT_INNER_ERR_MSG("E19999", "rtStreamSynchronizeWithTimeout failed, stream synchronize timeout:%dms, ret:%d.", | 5625 | + REPORT_INNER_ERR_MSG("E19999", "aclrtSynchronizeStreamWithTimeout failed, stream synchronize timeout:%dms, ret:%d.", |
| 5624 | stream_sync_timeout_, rt_ret); | 5626 | stream_sync_timeout_, rt_ret); |
| 5625 | - GELOGE(FAILED, "[Invoke][rtStreamSynchronizeWithTimeout] failed, timeout:%dms, ret:%d.", stream_sync_timeout_, | 5627 | + GELOGE(FAILED, "[Invoke][aclrtSynchronizeStreamWithTimeout] failed, timeout:%dms, ret:%d.", stream_sync_timeout_, |
| 5626 | rt_ret); | 5628 | rt_ret); |
| 5627 | OnComputeDoneWithResultCallback(args, 0U, INTERNAL_ERROR, outputs); | 5629 | OnComputeDoneWithResultCallback(args, 0U, INTERNAL_ERROR, outputs); |
| 5628 | return; | 5630 | return; |
| @@ -5634,9 +5636,9 @@ void DavinciModel::Run() { | |||
| 5634 | ReturnSequenceResult(args, 0U, seq_end_flag); | 5636 | ReturnSequenceResult(args, 0U, seq_end_flag); |
| 5635 | continue; | 5637 | continue; |
| 5636 | } | 5638 | } |
| 5637 | - GELOGI("rtStreamSynchronizeWithTimeout end, model id:%u, status:%s.", model_id_, model_abort ? "abort" : "normal"); | 5639 | + GELOGI("aclrtSynchronizeStreamWithTimeout end, model id:%u, status:%s.", model_id_, model_abort ? "abort" : "normal"); |
| 5638 | GE_IF_BOOL_EXEC(is_first_execute_, | 5640 | GE_IF_BOOL_EXEC(is_first_execute_, |
| 5639 | - GE_TIMESTAMP_EVENT_END(rtStreamSynchronizeWithTimeout, "Wait for rtStreamSynchronizeWithTimeout")); | 5641 | + GE_TIMESTAMP_EVENT_END(aclrtSynchronizeStreamWithTimeout, "Wait for aclrtSynchronizeStreamWithTimeout")); |
| 5640 | GE_IF_BOOL_EXEC(is_prof_enabled, SetProfileTime(ModelProcStage::MODEL_INFER_END)); | 5642 | GE_IF_BOOL_EXEC(is_prof_enabled, SetProfileTime(ModelProcStage::MODEL_INFER_END)); |
| 5641 | GE_IF_BOOL_EXEC(is_prof_enabled, SetProfileTime(ModelProcStage::MODEL_AFTER_PROC_START)); | 5643 | GE_IF_BOOL_EXEC(is_prof_enabled, SetProfileTime(ModelProcStage::MODEL_AFTER_PROC_START)); |
| 5642 | GE_TIMESTAMP_START(ReturnResult); | 5644 | GE_TIMESTAMP_START(ReturnResult); |
| @@ -5691,7 +5693,7 @@ Status DavinciModel::ModelRunStart() { | |||
| 5691 | GE_ASSERT_SUCCESS( | 5693 | GE_ASSERT_SUCCESS( |
| 5692 | reusable_stream_allocator_->GetOrCreateRtStream(rt_model_stream_, runtime_model_id_, priority_, stream_flags)); | 5694 | reusable_stream_allocator_->GetOrCreateRtStream(rt_model_stream_, runtime_model_id_, priority_, stream_flags)); |
| 5693 | is_inner_model_stream_ = true; | 5695 | is_inner_model_stream_ = true; |
| 5694 | - GE_CHK_RT_RET(aclrtSetStreamFailureMode(rt_model_stream_, ACL_STOP_ON_FAILURE)); | 5696 | + GE_CHK_ACL_RET(aclrtSetStreamFailureMode(rt_model_stream_, ACL_STOP_ON_FAILURE)); |
| 5695 | error_context_ = error_message::GetErrMgrContext(); | 5697 | error_context_ = error_message::GetErrMgrContext(); |
| 5696 | thread_id_ = std::thread(&DavinciModel::Run, this); | 5698 | thread_id_ = std::thread(&DavinciModel::Run, this); |
| 5697 | 5699 | ||
| @@ -6724,9 +6726,9 @@ Status DavinciModel::CopyInputForNoZeroCopy(const std::vector<DataBuffer> &blobs | |||
| 6724 | static_cast<int32_t>(is_async_mode_), static_cast<int32_t>(kind)); | 6726 | static_cast<int32_t>(is_async_mode_), static_cast<int32_t>(kind)); |
| 6725 | } | 6727 | } |
| 6726 | if (is_async_mode_) { | 6728 | if (is_async_mode_) { |
| 6727 | - GE_CHK_RT_RET(aclrtMemcpyAsync(des_addr, data_size, data, src_len, kind, rt_model_stream_)); | 6729 | + GE_CHK_ACL_RET(aclrtMemcpyAsync(des_addr, data_size, data, src_len, kind, rt_model_stream_)); |
| 6728 | } else { | 6730 | } else { |
| 6729 | - GE_CHK_RT_RET(aclrtMemcpy(des_addr, data_size, data, src_len, kind)); | 6731 | + GE_CHK_ACL_RET(aclrtMemcpy(des_addr, data_size, data, src_len, kind)); |
| 6730 | } | 6732 | } |
| 6731 | } | 6733 | } |
| 6732 | 6734 | ||
| @@ -6785,9 +6787,9 @@ Status DavinciModel::CopyInputForNoZeroCopy(const std::vector<DataBuffer> &blobs | |||
| 6785 | } | 6787 | } |
| 6786 | 6788 | ||
| 6787 | if (is_async_mode_) { | 6789 | if (is_async_mode_) { |
| 6788 | - GE_CHK_RT_RET(aclrtMemcpyAsync(des_addr, data_size, data, src_len, kind, rt_model_stream_)); | 6790 | + GE_CHK_ACL_RET(aclrtMemcpyAsync(des_addr, data_size, data, src_len, kind, rt_model_stream_)); |
| 6789 | } else { | 6791 | } else { |
| 6790 | - GE_CHK_RT_RET(aclrtMemcpy(des_addr, data_size, data, src_len, kind)); | 6792 | + GE_CHK_ACL_RET(aclrtMemcpy(des_addr, data_size, data, src_len, kind)); |
| 6791 | } | 6793 | } |
| 6792 | } | 6794 | } |
| 6793 | 6795 | ||
| @@ -7178,12 +7180,12 @@ void DavinciModel::FreeInnerFeatureMapMem() { | |||
| 7178 | if (rt_ret == ACL_ERROR_RT_STREAM_SYNC_TIMEOUT) { | 7180 | if (rt_ret == ACL_ERROR_RT_STREAM_SYNC_TIMEOUT) { |
| 7179 | is_stream_sync_timeout_ = true; | 7181 | is_stream_sync_timeout_ = true; |
| 7180 | GE_LOGE_IF(aclmdlRIAbort(rt_model_handle_) != ACL_SUCCESS, "Abort model failed!"); | 7182 | GE_LOGE_IF(aclmdlRIAbort(rt_model_handle_) != ACL_SUCCESS, "Abort model failed!"); |
| 7181 | - GELOGW("[Invoke][rtStreamSynchronizeWithTimeout] failed, timeout:%dms, ret:%d.", stream_sync_timeout_, rt_ret); | 7183 | + GELOGW("[Invoke][aclrtSynchronizeStreamWithTimeout] failed, timeout:%dms, ret:%d.", stream_sync_timeout_, rt_ret); |
| 7182 | FreeFeatureMapMem(); | 7184 | FreeFeatureMapMem(); |
| 7183 | return; | 7185 | return; |
| 7184 | } | 7186 | } |
| 7185 | if (rt_ret != RT_ERROR_NONE) { | 7187 | if (rt_ret != RT_ERROR_NONE) { |
| 7186 | - GELOGE(FAILED, "[Invoke][rtStreamSynchronizeWithTimeout] failed, ret:%d.", rt_ret); | 7188 | + GELOGE(FAILED, "[Invoke][aclrtSynchronizeStreamWithTimeout] failed, ret:%d.", rt_ret); |
| 7187 | return; | 7189 | return; |
| 7188 | } | 7190 | } |
| 7189 | FreeFeatureMapMem(); | 7191 | FreeFeatureMapMem(); |
| @@ -7361,7 +7363,7 @@ Status DavinciModel::InitConstant(const OpDescPtr &op_desc) { | |||
| 7361 | GE_CHECK_NOTNULL(var_manager); | 7363 | GE_CHECK_NOTNULL(var_manager); |
| 7362 | if (!var_manager->CheckAndSetVarLoaded(op_desc, device_id_)) { | 7364 | if (!var_manager->CheckAndSetVarLoaded(op_desc, device_id_)) { |
| 7363 | GELOGD("Copy weight to device, node:%s, weight size:%zu", op_desc->GetName().c_str(), tensor->GetData().size()); | 7365 | GELOGD("Copy weight to device, node:%s, weight size:%zu", op_desc->GetName().c_str(), tensor->GetData().size()); |
| 7364 | - GE_CHK_RT_RET(aclrtMemcpy(v_output_addr[0U], static_cast<uint64_t>(v_output_size[0U]), tensor->GetData().data(), | 7366 | + GE_CHK_ACL_RET(aclrtMemcpy(v_output_addr[0U], static_cast<uint64_t>(v_output_size[0U]), tensor->GetData().data(), |
| 7365 | tensor->GetData().size(), ACL_MEMCPY_HOST_TO_DEVICE)); | 7367 | tensor->GetData().size(), ACL_MEMCPY_HOST_TO_DEVICE)); |
| 7366 | } | 7368 | } |
| 7367 | return SUCCESS; | 7369 | return SUCCESS; |
| @@ -7636,14 +7638,14 @@ Status DavinciModel::CheckRtStreamSynchronize(rtError_t rt_ret) { | |||
| 7636 | if (rt_ret == ACL_ERROR_RT_STREAM_SYNC_TIMEOUT) { | 7638 | if (rt_ret == ACL_ERROR_RT_STREAM_SYNC_TIMEOUT) { |
| 7637 | is_stream_sync_timeout_ = true; | 7639 | is_stream_sync_timeout_ = true; |
| 7638 | GE_LOGW_IF(aclmdlRIAbort(rt_model_handle_) != ACL_SUCCESS, "Abort model failed!"); | 7640 | GE_LOGW_IF(aclmdlRIAbort(rt_model_handle_) != ACL_SUCCESS, "Abort model failed!"); |
| 7639 | - GELOGE(FAILED, "[Invoke][rtStreamSynchronizeWithTimeout] failed, timeout:%dms, ret:%d.", stream_sync_timeout_, | 7641 | + GELOGE(FAILED, "[Invoke][aclrtSynchronizeStreamWithTimeout] failed, timeout:%dms, ret:%d.", stream_sync_timeout_, |
| 7640 | rt_ret); | 7642 | rt_ret); |
| 7641 | - REPORT_INNER_ERR_MSG("E19999", "rtStreamSynchronizeWithTimeout failed, stream synchronize timeout:%dms, ret:%d.", | 7643 | + REPORT_INNER_ERR_MSG("E19999", "aclrtSynchronizeStreamWithTimeout failed, stream synchronize timeout:%dms, ret:%d.", |
| 7642 | stream_sync_timeout_, rt_ret); | 7644 | stream_sync_timeout_, rt_ret); |
| 7643 | return FAILED; | 7645 | return FAILED; |
| 7644 | } | 7646 | } |
| 7645 | if (rt_ret != RT_ERROR_NONE) { | 7647 | if (rt_ret != RT_ERROR_NONE) { |
| 7646 | - GELOGE(FAILED, "[Invoke][rtStreamSynchronizeWithTimeout] failed, ret:%d.", rt_ret); | 7648 | + GELOGE(FAILED, "[Invoke][aclrtSynchronizeStreamWithTimeout] failed, ret:%d.", rt_ret); |
| 7647 | return FAILED; | 7649 | return FAILED; |
| 7648 | } | 7650 | } |
| 7649 | return SUCCESS; | 7651 | return SUCCESS; |
| @@ -7710,14 +7712,14 @@ Status DavinciModel::NnExecute(aclrtStream const stream, const bool async_mode, | |||
| 7710 | if (rt_ret == ACL_ERROR_RT_STREAM_SYNC_TIMEOUT) { | 7712 | if (rt_ret == ACL_ERROR_RT_STREAM_SYNC_TIMEOUT) { |
| 7711 | is_stream_sync_timeout_ = true; | 7713 | is_stream_sync_timeout_ = true; |
| 7712 | GE_LOGW_IF(aclmdlRIAbort(rt_model_handle_) != ACL_SUCCESS, "Abort model failed!"); | 7714 | GE_LOGW_IF(aclmdlRIAbort(rt_model_handle_) != ACL_SUCCESS, "Abort model failed!"); |
| 7713 | - GELOGE(FAILED, "[Invoke][rtStreamSynchronizeWithTimeout] failed, timeout:%dms, ret:%d.", stream_sync_timeout_, | 7715 | + GELOGE(FAILED, "[Invoke][aclrtSynchronizeStreamWithTimeout] failed, timeout:%dms, ret:%d.", stream_sync_timeout_, |
| 7714 | rt_ret); | 7716 | rt_ret); |
| 7715 | - REPORT_INNER_ERR_MSG("E19999", "rtStreamSynchronizeWithTimeout failed, stream synchronize timeout:%dms, ret:%d.", | 7717 | + REPORT_INNER_ERR_MSG("E19999", "aclrtSynchronizeStreamWithTimeout failed, stream synchronize timeout:%dms, ret:%d.", |
| 7716 | stream_sync_timeout_, rt_ret); | 7718 | stream_sync_timeout_, rt_ret); |
| 7717 | return FAILED; | 7719 | return FAILED; |
| 7718 | } | 7720 | } |
| 7719 | if (rt_ret != RT_ERROR_NONE) { | 7721 | if (rt_ret != RT_ERROR_NONE) { |
| 7720 | - GELOGE(FAILED, "[Invoke][rtStreamSynchronizeWithTimeout] failed, ret:%d.", rt_ret); | 7722 | + GELOGE(FAILED, "[Invoke][aclrtSynchronizeStreamWithTimeout] failed, ret:%d.", rt_ret); |
| 7721 | return FAILED; | 7723 | return FAILED; |
| 7722 | } | 7724 | } |
| 7723 | } | 7725 | } |
| @@ -7817,14 +7819,14 @@ Status DavinciModel::NnExecute(aclrtStream const stream, const bool async_mode, | |||
| 7817 | if (rt_ret == ACL_ERROR_RT_STREAM_SYNC_TIMEOUT) { | 7819 | if (rt_ret == ACL_ERROR_RT_STREAM_SYNC_TIMEOUT) { |
| 7818 | is_stream_sync_timeout_ = true; | 7820 | is_stream_sync_timeout_ = true; |
| 7819 | GE_LOGW_IF(aclmdlRIAbort(rt_model_handle_) != ACL_SUCCESS, "Abort model failed!"); | 7821 | GE_LOGW_IF(aclmdlRIAbort(rt_model_handle_) != ACL_SUCCESS, "Abort model failed!"); |
| 7820 | - GELOGE(FAILED, "[Invoke][rtStreamSynchronizeWithTimeout] failed, timeout:%dms, ret:%d.", stream_sync_timeout_, | 7822 | + GELOGE(FAILED, "[Invoke][aclrtSynchronizeStreamWithTimeout] failed, timeout:%dms, ret:%d.", stream_sync_timeout_, |
| 7821 | rt_ret); | 7823 | rt_ret); |
| 7822 | - REPORT_INNER_ERR_MSG("E19999", "rtStreamSynchronizeWithTimeout failed, stream synchronize timeout:%dms, ret:%d.", | 7824 | + REPORT_INNER_ERR_MSG("E19999", "aclrtSynchronizeStreamWithTimeout failed, stream synchronize timeout:%dms, ret:%d.", |
| 7823 | stream_sync_timeout_, rt_ret); | 7825 | stream_sync_timeout_, rt_ret); |
| 7824 | return FAILED; | 7826 | return FAILED; |
| 7825 | } | 7827 | } |
| 7826 | if (rt_ret != RT_ERROR_NONE) { | 7828 | if (rt_ret != RT_ERROR_NONE) { |
| 7827 | - GELOGE(FAILED, "[Invoke][rtStreamSynchronizeWithTimeout] failed, ret:%d.", rt_ret); | 7829 | + GELOGE(FAILED, "[Invoke][aclrtSynchronizeStreamWithTimeout] failed, ret:%d.", rt_ret); |
| 7828 | return FAILED; | 7830 | return FAILED; |
| 7829 | } | 7831 | } |
| 7830 | } | 7832 | } |
| @@ -7877,7 +7879,7 @@ Status DavinciModel::AddHeadStream() { | |||
| 7877 | GE_CHECK_NOTNULL(reusable_stream_allocator_); | 7879 | GE_CHECK_NOTNULL(reusable_stream_allocator_); |
| 7878 | GE_ASSERT_SUCCESS(reusable_stream_allocator_->GetOrCreateRtStream(rt_head_stream_, runtime_model_id_, priority_, | 7880 | GE_ASSERT_SUCCESS(reusable_stream_allocator_->GetOrCreateRtStream(rt_head_stream_, runtime_model_id_, priority_, |
| 7879 | RT_STREAM_PERSISTENT)); | 7881 | RT_STREAM_PERSISTENT)); |
| 7880 | - GE_CHK_RT_RET(aclmdlRIBindStream(rt_model_handle_, rt_head_stream_, | 7882 | + GE_CHK_ACL_RET(aclmdlRIBindStream(rt_model_handle_, rt_head_stream_, |
| 7881 | static_cast<uint32_t>(ACL_MODEL_STREAM_FLAG_DEFAULT))); | 7883 | static_cast<uint32_t>(ACL_MODEL_STREAM_FLAG_DEFAULT))); |
| 7882 | is_pure_head_stream_ = true; | 7884 | is_pure_head_stream_ = true; |
| 7883 | 7885 | ||
| @@ -7897,7 +7899,7 @@ Status DavinciModel::AddHeadStream() { | |||
| 7897 | // Create entry stream active head stream. AICPU stream. | 7899 | // Create entry stream active head stream. AICPU stream. |
| 7898 | GE_ASSERT_SUCCESS(reusable_stream_allocator_->GetOrCreateRtStream(rt_entry_stream_, runtime_model_id_, priority_, | 7900 | GE_ASSERT_SUCCESS(reusable_stream_allocator_->GetOrCreateRtStream(rt_entry_stream_, runtime_model_id_, priority_, |
| 7899 | RT_STREAM_AICPU | RT_STREAM_PERSISTENT)); | 7901 | RT_STREAM_AICPU | RT_STREAM_PERSISTENT)); |
| 7900 | - GE_CHK_RT_RET(aclmdlRIBindStream(rt_model_handle_, rt_entry_stream_, | 7902 | + GE_CHK_ACL_RET(aclmdlRIBindStream(rt_model_handle_, rt_entry_stream_, |
| 7901 | static_cast<uint32_t>(ACL_MODEL_STREAM_FLAG_HEAD))); | 7903 | static_cast<uint32_t>(ACL_MODEL_STREAM_FLAG_HEAD))); |
| 7902 | return SUCCESS; | 7904 | return SUCCESS; |
| 7903 | } | 7905 | } |
| @@ -8189,7 +8191,7 @@ Status DavinciModel::SetDataDumperArgs(const ComputeGraphPtr &graph, | |||
| 8189 | data_dumper_.SetRefInfo(saved_task_addrs_); | 8191 | data_dumper_.SetRefInfo(saved_task_addrs_); |
| 8190 | 8192 | ||
| 8191 | int32_t tmp_device_id = -1; | 8193 | int32_t tmp_device_id = -1; |
| 8192 | - GE_CHK_RT_RET(aclrtGetDevice(&tmp_device_id)); | 8194 | + GE_CHK_ACL_RET(aclrtGetDevice(&tmp_device_id)); |
| 8193 | data_dumper_.SetDeviceId(static_cast<uint32_t>(tmp_device_id)); | 8195 | data_dumper_.SetDeviceId(static_cast<uint32_t>(tmp_device_id)); |
| 8194 | 8196 | ||
| 8195 | const auto get_var_addr = [&variable_by_name, this](const std::string &var_name) -> uintptr_t { | 8197 | const auto get_var_addr = [&variable_by_name, this](const std::string &var_name) -> uintptr_t { |
| @@ -8346,10 +8348,10 @@ Status DavinciModel::GetEventIdForBlockingAicpuOp(const OpDescPtr &op_desc, aclr | |||
| 8346 | GELOGI("Get event id for aicpu blocking op:%s", op_desc->GetName().c_str()); | 8348 | GELOGI("Get event id for aicpu blocking op:%s", op_desc->GetName().c_str()); |
| 8347 | const auto it = stream_2_event_.find(stream); | 8349 | const auto it = stream_2_event_.find(stream); |
| 8348 | if (it != stream_2_event_.end()) { | 8350 | if (it != stream_2_event_.end()) { |
| 8349 | - GE_CHK_RT_RET(aclrtGetEventId(it->second, &event_id)); | 8351 | + GE_CHK_ACL_RET(aclrtGetEventId(it->second, &event_id)); |
| 8350 | } else { | 8352 | } else { |
| 8351 | aclrtEvent rt_event = nullptr; | 8353 | aclrtEvent rt_event = nullptr; |
| 8352 | - GE_CHK_RT_RET(aclrtCreateEventWithFlag( | 8354 | + GE_CHK_ACL_RET(aclrtCreateEventWithFlag( |
| 8353 | &rt_event, ACL_EVENT_SYNC | ACL_EVENT_CAPTURE_STREAM_PROGRESS | ACL_EVENT_TIME_LINE)); | 8355 | &rt_event, ACL_EVENT_SYNC | ACL_EVENT_CAPTURE_STREAM_PROGRESS | ACL_EVENT_TIME_LINE)); |
| 8354 | const aclError rt_ret = aclrtGetEventId(rt_event, &event_id); | 8356 | const aclError rt_ret = aclrtGetEventId(rt_event, &event_id); |
| 8355 | if (rt_ret != ACL_SUCCESS) { | 8357 | if (rt_ret != ACL_SUCCESS) { |
| @@ -8466,7 +8468,7 @@ Status DavinciModel::UpdateOpInputValue(const OpDescPtr &op_desc, const int32_t | |||
| 8466 | GE_CHECK_NOTNULL(input_desc); | 8468 | GE_CHECK_NOTNULL(input_desc); |
| 8467 | int64_t tensor_size = 0; | 8469 | int64_t tensor_size = 0; |
| 8468 | (void)TensorUtils::GetSize(*input_desc, tensor_size); | 8470 | (void)TensorUtils::GetSize(*input_desc, tensor_size); |
| 8469 | - GE_CHK_RT_RET(aclrtMemcpy(ValueToPtr(input_addresses[static_cast<size_t>(input_index)]), | 8471 | + GE_CHK_ACL_RET(aclrtMemcpy(ValueToPtr(input_addresses[static_cast<size_t>(input_index)]), |
| 8470 | static_cast<uint64_t>(tensor_size), &queue_id, sizeof(queue_id), ACL_MEMCPY_HOST_TO_DEVICE)); | 8472 | static_cast<uint64_t>(tensor_size), &queue_id, sizeof(queue_id), ACL_MEMCPY_HOST_TO_DEVICE)); |
| 8471 | return SUCCESS; | 8473 | return SUCCESS; |
| 8472 | } | 8474 | } |
| @@ -8710,7 +8712,7 @@ Status DavinciModel::CpuInputCopyProcess() { | |||
| 8710 | RuntimeTensorDesc *const tensor_desc = | 8712 | RuntimeTensorDesc *const tensor_desc = |
| 8711 | PtrToPtr<void, RuntimeTensorDesc>(ValueToPtr(iter->second.GetDataInfo().at(0U).second)); | 8713 | PtrToPtr<void, RuntimeTensorDesc>(ValueToPtr(iter->second.GetDataInfo().at(0U).second)); |
| 8712 | GE_CHECK_NOTNULL(tensor_desc); | 8714 | GE_CHECK_NOTNULL(tensor_desc); |
| 8713 | - GE_CHK_RT_RET(aclrtMemcpy(&data_ptr, sizeof(data_ptr), tensor_desc, | 8715 | + GE_CHK_ACL_RET(aclrtMemcpy(&data_ptr, sizeof(data_ptr), tensor_desc, |
| 8714 | sizeof(data_ptr), ACL_MEMCPY_DEVICE_TO_HOST)); | 8716 | sizeof(data_ptr), ACL_MEMCPY_DEVICE_TO_HOST)); |
| 8715 | } | 8717 | } |
| 8716 | if (copy_only_addrs_.Count(data_ptr) == 0) { | 8718 | if (copy_only_addrs_.Count(data_ptr) == 0) { |
| @@ -8951,7 +8953,7 @@ bool DavinciModel::UpdateCoreCountWithOpDesc(const NodePtr &node, fe::PlatFormIn | |||
| 8951 | 8953 | ||
| 8952 | Status DavinciModel::UpdatePlatformInfos(const NodePtr &node, fe::PlatFormInfos &platform_infos) const { | 8954 | Status DavinciModel::UpdatePlatformInfos(const NodePtr &node, fe::PlatFormInfos &platform_infos) const { |
| 8953 | int32_t device_id = -1; | 8955 | int32_t device_id = -1; |
| 8954 | - GE_CHK_RT_RET(aclrtGetDevice(&device_id)); | 8956 | + GE_CHK_ACL_RET(aclrtGetDevice(&device_id)); |
| 8955 | 8957 | ||
| 8956 | fe::PlatFormInfos platform_infos_bak; | 8958 | fe::PlatFormInfos platform_infos_bak; |
| 8957 | auto ret = fe::PlatformInfoManager::GeInstance().GetRuntimePlatformInfosByDevice( | 8959 | auto ret = fe::PlatformInfoManager::GeInstance().GetRuntimePlatformInfosByDevice( |
| @@ -9096,7 +9098,7 @@ Status DavinciModel::LaunchFromPlatformSo(const std::string &platform_so_path) { | |||
| 9096 | } | 9098 | } |
| 9097 | }; | 9099 | }; |
| 9098 | GE_MAKE_GUARD(release, callback); | 9100 | GE_MAKE_GUARD(release, callback); |
| 9099 | - GE_CHK_RT_RET(aclrtCreateStream(&stream)); | 9101 | + GE_CHK_ACL_RET(aclrtCreateStream(&stream)); |
| 9100 | LaunchKernelParam launch_param; | 9102 | LaunchKernelParam launch_param; |
| 9101 | launch_param.block_dim = 1U; | 9103 | launch_param.block_dim = 1U; |
| 9102 | launch_param.stream = stream; | 9104 | launch_param.stream = stream; |
| @@ -9113,7 +9115,7 @@ Status DavinciModel::LaunchFromPlatformSo(const std::string &platform_so_path) { | |||
| 9113 | GELOGI("Launch custom platform infos: so_path[%s], kernel_name[%s], stream[%" PRIu64 "].", | 9115 | GELOGI("Launch custom platform infos: so_path[%s], kernel_name[%s], stream[%" PRIu64 "].", |
| 9114 | platform_so_path.c_str(), kAicpuCustLoadPlatformInfo.c_str(), PtrToValue(stream)); | 9116 | platform_so_path.c_str(), kAicpuCustLoadPlatformInfo.c_str(), PtrToValue(stream)); |
| 9115 | cust_platform_infos_addr_[addr_key] = cust_platform_infos_addr; | 9117 | cust_platform_infos_addr_[addr_key] = cust_platform_infos_addr; |
| 9116 | - GE_CHK_RT_RET(aclrtSynchronizeStream(stream)); | 9118 | + GE_CHK_ACL_RET(aclrtSynchronizeStream(stream)); |
| 9117 | GELOGI("Succeed to launch custom platform infos task."); | 9119 | GELOGI("Succeed to launch custom platform infos task."); |
| 9118 | } | 9120 | } |
| 9119 | cust_platform_infos_addr_to_launch_.clear(); | 9121 | cust_platform_infos_addr_to_launch_.clear(); |
| @@ -9138,7 +9140,7 @@ Status DavinciModel::LaunchFromOpMasterSo() { | |||
| 9138 | } | 9140 | } |
| 9139 | }; | 9141 | }; |
| 9140 | GE_MAKE_GUARD(release, callback); | 9142 | GE_MAKE_GUARD(release, callback); |
| 9141 | - GE_CHK_RT_RET(aclrtCreateStream(&stream)); | 9143 | + GE_CHK_ACL_RET(aclrtCreateStream(&stream)); |
| 9142 | LoadCustPlatformInfosArgs load_args = {}; | 9144 | LoadCustPlatformInfosArgs load_args = {}; |
| 9143 | load_args.args = PtrToValue(cust_platform_infos_addr) + it.second.second; | 9145 | load_args.args = PtrToValue(cust_platform_infos_addr) + it.second.second; |
| 9144 | load_args.args_size = static_cast<uint64_t>(sizeof(PlatformInfosLaunchArgs)); | 9146 | load_args.args_size = static_cast<uint64_t>(sizeof(PlatformInfosLaunchArgs)); |
| @@ -9153,7 +9155,7 @@ Status DavinciModel::LaunchFromOpMasterSo() { | |||
| 9153 | cust_platform_infos_addr_[addr_key] = cust_platform_infos_addr; | 9155 | cust_platform_infos_addr_[addr_key] = cust_platform_infos_addr; |
| 9154 | GELOGI("Launch custom platform infos: kernel_name[%s], stream[%" PRIu64 "].", | 9156 | GELOGI("Launch custom platform infos: kernel_name[%s], stream[%" PRIu64 "].", |
| 9155 | kAicpuCustLoadPlatformInfo.c_str(), PtrToValue(stream)); | 9157 | kAicpuCustLoadPlatformInfo.c_str(), PtrToValue(stream)); |
| 9156 | - GE_CHK_RT_RET(aclrtSynchronizeStream(stream)); | 9158 | + GE_CHK_ACL_RET(aclrtSynchronizeStream(stream)); |
| 9157 | GELOGI("Succeed to launch custom platform infos task."); | 9159 | GELOGI("Succeed to launch custom platform infos task."); |
| 9158 | } | 9160 | } |
| 9159 | cust_platform_infos_addr_to_launch_.clear(); | 9161 | cust_platform_infos_addr_to_launch_.clear(); |
| @@ -9162,7 +9164,7 @@ Status DavinciModel::LaunchFromOpMasterSo() { | |||
| 9162 | 9164 | ||
| 9163 | Status DavinciModel::LaunchPlatformInfos(void *&platform_infos_addr, const NodePtr &node) { | 9165 | Status DavinciModel::LaunchPlatformInfos(void *&platform_infos_addr, const NodePtr &node) { |
| 9164 | int32_t device_id = -1; | 9166 | int32_t device_id = -1; |
| 9165 | - GE_CHK_RT_RET(aclrtGetDevice(&device_id)); | 9167 | + GE_CHK_ACL_RET(aclrtGetDevice(&device_id)); |
| 9166 | fe::PlatFormInfos platform_infos_bak; | 9168 | fe::PlatFormInfos platform_infos_bak; |
| 9167 | GE_ASSERT_TRUE(fe::PlatformInfoManager::GeInstance().GetRuntimePlatformInfosByDevice( | 9169 | GE_ASSERT_TRUE(fe::PlatformInfoManager::GeInstance().GetRuntimePlatformInfosByDevice( |
| 9168 | static_cast<uint32_t>(device_id), platform_infos_bak, true) == 0, | 9170 | static_cast<uint32_t>(device_id), platform_infos_bak, true) == 0, |
| @@ -55,7 +55,7 @@ | |||
| 55 | 55 | ||
| 56 | 56 | ||
| 57 | 57 | ||
| 58 | -#include "rts/rts_dqs.h" | 58 | +#include "rt_external_dqs.h" |
| 59 | 59 | ||
| 60 | 60 | ||
| 61 | namespace ge { | 61 | namespace ge { |
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | -#include "runtime/mem.h" | 14 | +#include "rt_external_mem.h" |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| @@ -45,7 +45,7 @@ class DeviceMemoryPtr { | |||
| 45 | private: | 45 | private: |
| 46 | void Free() noexcept { | 46 | void Free() noexcept { |
| 47 | if (addr_ != 0UL) { | 47 | if (addr_ != 0UL) { |
| 48 | - if (aclrtFree(ValueToPtr(addr_)) == RT_ERROR_NONE) { | 48 | + if (aclrtFree(ValueToPtr(addr_)) == ACL_ERROR_NONE) { |
| 49 | addr_ = 0UL; | 49 | addr_ = 0UL; |
| 50 | } | 50 | } |
| 51 | } | 51 | } |
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | -#include "runtime/rt.h" | 14 | +#include "rt_external.h" |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| @@ -13,7 +13,7 @@ | |||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | -#include "runtime/mem.h" | 16 | +#include "rt_external_mem.h" |
| 17 | 17 | ||
| 18 | namespace ge { | 18 | namespace ge { |
| 19 | constexpr size_t kHugePagesize = 2U * 1024U * 1024U; | 19 | constexpr size_t kHugePagesize = 2U * 1024U * 1024U; |
| @@ -30,7 +30,7 @@ | |||
| 30 | 30 | ||
| 31 | 31 | ||
| 32 | 32 | ||
| 33 | -#include "runtime/mem.h" | 33 | +#include "rt_external_mem.h" |
| 34 | 34 | ||
| 35 | 35 | ||
| 36 | 36 | ||
| @@ -774,7 +774,7 @@ Status ModelArgsManager::PrintKernelLaunchArgsDfxInfo(aclrtStream const stm) { | |||
| 774 | i, active_mem_base_addr[i]); | 774 | i, active_mem_base_addr[i]); |
| 775 | } | 775 | } |
| 776 | 776 | ||
| 777 | - GE_CHK_RT_RET(aclrtSynchronizeStream(stm)); | 777 | + GE_CHK_ACL_RET(aclrtSynchronizeStream(stm)); |
| 778 | std::vector<uint64_t> model_args_device_addrs(model_args_len_[0] / sizeof(uint64_t), 0); | 778 | std::vector<uint64_t> model_args_device_addrs(model_args_len_[0] / sizeof(uint64_t), 0); |
| 779 | (void)aclrtMemcpy(model_args_device_addrs.data(), model_args_len_[0], | 779 | (void)aclrtMemcpy(model_args_device_addrs.data(), model_args_len_[0], |
| 780 | ValueToPtr(model_args_[0].model_args_device_addr), model_args_len_[0], ACL_MEMCPY_DEVICE_TO_HOST); | 780 | ValueToPtr(model_args_[0].model_args_device_addr), model_args_len_[0], ACL_MEMCPY_DEVICE_TO_HOST); |
| @@ -1010,7 +1010,7 @@ Status ModelArgsManager::ReportKernelLaunchOpProfilingData(const uint64_t begin_ | |||
| 1010 | bool l0_prof_enable = gert::GlobalProfilingWrapper::GetInstance()->IsEnabled(gert::ProfilingType::kTaskTime); | 1010 | bool l0_prof_enable = gert::GlobalProfilingWrapper::GetInstance()->IsEnabled(gert::ProfilingType::kTaskTime); |
| 1011 | uint64_t kernel_launch_prof_begin_time = 0; | 1011 | uint64_t kernel_launch_prof_begin_time = 0; |
| 1012 | GE_IF_BOOL_EXEC(l0_prof_enable, kernel_launch_prof_begin_time = MsprofSysCycleTime()); | 1012 | GE_IF_BOOL_EXEC(l0_prof_enable, kernel_launch_prof_begin_time = MsprofSysCycleTime()); |
| 1013 | - GE_IF_BOOL_EXEC(dfx_info_.get_model_args_device_table_flag, GE_CHK_RT_RET(aclrtSynchronizeStream(stm))); | 1013 | + GE_IF_BOOL_EXEC(dfx_info_.get_model_args_device_table_flag, GE_CHK_ACL_RET(aclrtSynchronizeStream(stm))); |
| 1014 | 1014 | ||
| 1015 | LaunchKernelParam launch_kernel_param; | 1015 | LaunchKernelParam launch_kernel_param; |
| 1016 | launch_kernel_param.stream = stm; | 1016 | launch_kernel_param.stream = stm; |
| @@ -518,10 +518,10 @@ Status ModelManager::KernelLaunchEx(const aicpu::FWKAdapter::FWKOperateType op_t | |||
| 518 | 518 | ||
| 519 | const uint64_t kernel_size = sizeof(uint64_t) * (v_aicpu_kernel.size()); | 519 | const uint64_t kernel_size = sizeof(uint64_t) * (v_aicpu_kernel.size()); |
| 520 | void *aicpu_kernel_addr = nullptr; | 520 | void *aicpu_kernel_addr = nullptr; |
| 521 | - GE_CHK_RT_RET(ge::AclrtMalloc(&aicpu_kernel_addr, kernel_size, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 521 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&aicpu_kernel_addr, kernel_size, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 522 | allocated_mem.emplace_back(aicpu_kernel_addr); | 522 | allocated_mem.emplace_back(aicpu_kernel_addr); |
| 523 | 523 | ||
| 524 | - GE_CHK_RT_RET(aclrtMemcpy(aicpu_kernel_addr, kernel_size, v_aicpu_kernel.data(), kernel_size, | 524 | + GE_CHK_ACL_RET(aclrtMemcpy(aicpu_kernel_addr, kernel_size, v_aicpu_kernel.data(), kernel_size, |
| 525 | ACL_MEMCPY_HOST_TO_DEVICE)); | 525 | ACL_MEMCPY_HOST_TO_DEVICE)); |
| 526 | param_base.fwkKernelBase.fwk_kernel.kernelID = PtrToValue(aicpu_kernel_addr); | 526 | param_base.fwkKernelBase.fwk_kernel.kernelID = PtrToValue(aicpu_kernel_addr); |
| 527 | // In the scene of loading once and running many times, the kernel needs to be destroyed many times, | 527 | // In the scene of loading once and running many times, the kernel needs to be destroyed many times, |
| @@ -531,11 +531,11 @@ Status ModelManager::KernelLaunchEx(const aicpu::FWKAdapter::FWKOperateType op_t | |||
| 531 | 531 | ||
| 532 | void *device_base = nullptr; | 532 | void *device_base = nullptr; |
| 533 | constexpr size_t op_kernel_size = sizeof(STR_FWK_OP_KERNEL); | 533 | constexpr size_t op_kernel_size = sizeof(STR_FWK_OP_KERNEL); |
| 534 | - GE_CHK_RT_RET(ge::AclrtMalloc(&device_base, op_kernel_size, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 534 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&device_base, op_kernel_size, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 535 | allocated_mem.emplace_back(device_base); | 535 | allocated_mem.emplace_back(device_base); |
| 536 | - GE_CHK_RT_RET(aclrtMemcpy(device_base, op_kernel_size, ¶m_base, op_kernel_size, ACL_MEMCPY_HOST_TO_DEVICE)); | 536 | + GE_CHK_ACL_RET(aclrtMemcpy(device_base, op_kernel_size, ¶m_base, op_kernel_size, ACL_MEMCPY_HOST_TO_DEVICE)); |
| 537 | 537 | ||
| 538 | - GE_CHK_RT_RET(aclrtCreateStream(&stream)); | 538 | + GE_CHK_ACL_RET(aclrtCreateStream(&stream)); |
| 539 | KernelRegisterInfo register_info; | 539 | KernelRegisterInfo register_info; |
| 540 | GE_ASSERT_SUCCESS(KernelRegisterInfoBuilder::ConstructAicpuRegisterInfo("TfSessionTask", | 540 | GE_ASSERT_SUCCESS(KernelRegisterInfoBuilder::ConstructAicpuRegisterInfo("TfSessionTask", |
| 541 | "libtf_kernels.so", "TFOperateAPI", "TFKernel", register_info)); | 541 | "libtf_kernels.so", "TFOperateAPI", "TFKernel", register_info)); |
| @@ -552,7 +552,7 @@ Status ModelManager::KernelLaunchEx(const aicpu::FWKAdapter::FWKOperateType op_t | |||
| 552 | launch_kernel_param.block_dim = 1U; | 552 | launch_kernel_param.block_dim = 1U; |
| 553 | launch_kernel_param.stream = stream; | 553 | launch_kernel_param.stream = stream; |
| 554 | GE_ASSERT_SUCCESS(KernelHandleUtils::LaunchKernel(func_handle, launch_kernel_param)); | 554 | GE_ASSERT_SUCCESS(KernelHandleUtils::LaunchKernel(func_handle, launch_kernel_param)); |
| 555 | - GE_CHK_RT_RET(aclrtSynchronizeStream(stream)); | 555 | + GE_CHK_ACL_RET(aclrtSynchronizeStream(stream)); |
| 556 | return SUCCESS; | 556 | return SUCCESS; |
| 557 | } | 557 | } |
| 558 | 558 | ||
| @@ -562,7 +562,7 @@ Status ModelManager::DestroyAicpuSessionForDevice(const uint64_t session_id, | |||
| 562 | GELOGI("DestroyAicpuSession device id:%u", device_id); | 562 | GELOGI("DestroyAicpuSession device id:%u", device_id); |
| 563 | if (need_set_device) { | 563 | if (need_set_device) { |
| 564 | GELOGI("Set device %u.", device_id); | 564 | GELOGI("Set device %u.", device_id); |
| 565 | - GE_CHK_RT_RET(aclrtSetDevice(static_cast<int32_t>(device_id))); | 565 | + GE_CHK_ACL_RET(aclrtSetDevice(static_cast<int32_t>(device_id))); |
| 566 | } | 566 | } |
| 567 | 567 | ||
| 568 | const auto ret = KernelLaunchEx(aicpu::FWKAdapter::FWKOperateType::FWK_ADPT_SESSION_DESTROY, session_id, 0U, 0U); | 568 | const auto ret = KernelLaunchEx(aicpu::FWKAdapter::FWKOperateType::FWK_ADPT_SESSION_DESTROY, session_id, 0U, 0U); |
| @@ -572,7 +572,7 @@ Status ModelManager::DestroyAicpuSessionForDevice(const uint64_t session_id, | |||
| 572 | 572 | ||
| 573 | if (need_set_device) { | 573 | if (need_set_device) { |
| 574 | GELOGI("Reset device %u.", device_id); | 574 | GELOGI("Reset device %u.", device_id); |
| 575 | - GE_CHK_RT_RET(aclrtResetDevice(static_cast<int32_t>(device_id))); | 575 | + GE_CHK_ACL_RET(aclrtResetDevice(static_cast<int32_t>(device_id))); |
| 576 | } | 576 | } |
| 577 | return ret; | 577 | return ret; |
| 578 | } | 578 | } |
| @@ -955,7 +955,7 @@ Status ModelManager::SyncExecuteModel(const uint32_t model_id, const std::vector | |||
| 955 | const auto &model = GetModel(model_id); | 955 | const auto &model = GetModel(model_id); |
| 956 | GE_CHECK_NOTNULL(model); | 956 | GE_CHECK_NOTNULL(model); |
| 957 | const auto device_id = model->GetDeviceId(); | 957 | const auto device_id = model->GetDeviceId(); |
| 958 | - GE_CHK_RT_RET(aclrtSetDevice(static_cast<int32_t>(device_id))); | 958 | + GE_CHK_ACL_RET(aclrtSetDevice(static_cast<int32_t>(device_id))); |
| 959 | GE_MAKE_GUARD(reset_device, [device_id]() { | 959 | GE_MAKE_GUARD(reset_device, [device_id]() { |
| 960 | GE_CHK_RT(aclrtResetDevice(static_cast<int32_t>(device_id))); | 960 | GE_CHK_RT(aclrtResetDevice(static_cast<int32_t>(device_id))); |
| 961 | }); | 961 | }); |
| @@ -1489,7 +1489,7 @@ Status ModelManager::LoadModelOffline(const ModelData &model, const ModelParam & | |||
| 1489 | GE_CHK_STATUS_RET(FileConstantUtils::RefreshRelativePath(model_helper.GetGeRootModel()->GetRootGraph()), | 1489 | GE_CHK_STATUS_RET(FileConstantUtils::RefreshRelativePath(model_helper.GetGeRootModel()->GetRootGraph()), |
| 1490 | "Failed to refresh relative path, model_id:%u.", model_id); | 1490 | "Failed to refresh relative path, model_id:%u.", model_id); |
| 1491 | int32_t device_id = -1; | 1491 | int32_t device_id = -1; |
| 1492 | - GE_CHK_RT_RET(aclrtGetDevice(&device_id)); | 1492 | + GE_CHK_ACL_RET(aclrtGetDevice(&device_id)); |
| 1493 | (void)MsprofSetDeviceIdByGeModelIdx(model_id, static_cast<uint32_t>(device_id)); | 1493 | (void)MsprofSetDeviceIdByGeModelIdx(model_id, static_cast<uint32_t>(device_id)); |
| 1494 | /// In multi-threaded inference, using the same session_id among multiple threads may cause some threads to fail. | 1494 | /// In multi-threaded inference, using the same session_id among multiple threads may cause some threads to fail. |
| 1495 | /// These session_ids come from the same model, so the values of session_id are the same. | 1495 | /// These session_ids come from the same model, so the values of session_id are the same. |
| @@ -1641,7 +1641,7 @@ Status ModelManager::LoadModelWithQueueParam(uint32_t &model_id, | |||
| 1641 | GenModelId(model_id); | 1641 | GenModelId(model_id); |
| 1642 | davinci_model->SetId(model_id); | 1642 | davinci_model->SetId(model_id); |
| 1643 | int32_t device_id = -1; | 1643 | int32_t device_id = -1; |
| 1644 | - GE_CHK_RT_RET(aclrtGetDevice(&device_id)); | 1644 | + GE_CHK_ACL_RET(aclrtGetDevice(&device_id)); |
| 1645 | GELOGD("Get device_id %d success", device_id); | 1645 | GELOGD("Get device_id %d success", device_id); |
| 1646 | davinci_model->SetDeviceId(static_cast<uint32_t>(device_id)); | 1646 | davinci_model->SetDeviceId(static_cast<uint32_t>(device_id)); |
| 1647 | ret = davinci_model->SetQueIds(model_queue_param.input_queues_attrs, model_queue_param.output_queues_attrs); | 1647 | ret = davinci_model->SetQueIds(model_queue_param.input_queues_attrs, model_queue_param.output_queues_attrs); |
| @@ -1714,7 +1714,7 @@ Status ModelManager::LoadModelWithoutQ(uint32_t &model_id, const GeRootModelPtr | |||
| 1714 | davinci_model->SetDumpProperties(dump_properties_); | 1714 | davinci_model->SetDumpProperties(dump_properties_); |
| 1715 | davinci_model->SetNeedModelConfig(true); | 1715 | davinci_model->SetNeedModelConfig(true); |
| 1716 | int32_t device_id = -1; | 1716 | int32_t device_id = -1; |
| 1717 | - GE_CHK_RT_RET(aclrtGetDevice(&device_id)); | 1717 | + GE_CHK_ACL_RET(aclrtGetDevice(&device_id)); |
| 1718 | GELOGD("Get device_id %d success", device_id); | 1718 | GELOGD("Get device_id %d success", device_id); |
| 1719 | davinci_model->SetDeviceId(static_cast<uint32_t>(device_id)); | 1719 | davinci_model->SetDeviceId(static_cast<uint32_t>(device_id)); |
| 1720 | GE_CHK_STATUS_RET(davinci_model->InitSpaceRegistry(root_model), "Get space registry failed!"); | 1720 | GE_CHK_STATUS_RET(davinci_model->InitSpaceRegistry(root_model), "Get space registry failed!"); |
| @@ -1949,7 +1949,7 @@ Status ModelManager::CreateAicpuSession(const uint64_t session_id) { | |||
| 1949 | const std::lock_guard<std::recursive_mutex> lk(map_mutex_); | 1949 | const std::lock_guard<std::recursive_mutex> lk(map_mutex_); |
| 1950 | auto &device_ids = sess_id_to_device_ids_[session_id]; | 1950 | auto &device_ids = sess_id_to_device_ids_[session_id]; |
| 1951 | int32_t device_id = 0; | 1951 | int32_t device_id = 0; |
| 1952 | - GE_CHK_RT_RET(aclrtGetDevice(&device_id)); | 1952 | + GE_CHK_ACL_RET(aclrtGetDevice(&device_id)); |
| 1953 | GELOGI("CreateAicpuSession device id:%d", device_id); | 1953 | GELOGI("CreateAicpuSession device id:%d", device_id); |
| 1954 | const auto &it = device_ids.find(static_cast<uint32_t>(device_id)); | 1954 | const auto &it = device_ids.find(static_cast<uint32_t>(device_id)); |
| 1955 | // never been created by any model | 1955 | // never been created by any model |
| @@ -1978,7 +1978,7 @@ Status ModelManager::LoadCustAicpuSo(const CustAICPUKernelPtr &aicpu_kernel, con | |||
| 1978 | 1978 | ||
| 1979 | // get current context | 1979 | // get current context |
| 1980 | aclrtContext rt_cur_ctx = nullptr; | 1980 | aclrtContext rt_cur_ctx = nullptr; |
| 1981 | - GE_CHK_RT_RET(aclrtGetCurrentContext(&rt_cur_ctx)); | 1981 | + GE_CHK_ACL_RET(aclrtGetCurrentContext(&rt_cur_ctx)); |
| 1982 | 1982 | ||
| 1983 | // use current context as resource key | 1983 | // use current context as resource key |
| 1984 | const std::lock_guard<std::mutex> lk(cust_aicpu_mutex_); | 1984 | const std::lock_guard<std::mutex> lk(cust_aicpu_mutex_); |
| @@ -2019,7 +2019,7 @@ Status ModelManager::LaunchKernelCustAicpuSo(const std::string &kernel_name) { | |||
| 2019 | } | 2019 | } |
| 2020 | // get current context | 2020 | // get current context |
| 2021 | aclrtContext rt_cur_ctx = nullptr; | 2021 | aclrtContext rt_cur_ctx = nullptr; |
| 2022 | - GE_CHK_RT_RET(aclrtGetCurrentContext(&rt_cur_ctx)); | 2022 | + GE_CHK_ACL_RET(aclrtGetCurrentContext(&rt_cur_ctx)); |
| 2023 | 2023 | ||
| 2024 | const uintptr_t resource_id = static_cast<uintptr_t>(PtrToValue(rt_cur_ctx)); | 2024 | const uintptr_t resource_id = static_cast<uintptr_t>(PtrToValue(rt_cur_ctx)); |
| 2025 | const auto it = cust_aicpu_so_.find(resource_id); | 2025 | const auto it = cust_aicpu_so_.find(resource_id); |
| @@ -2070,9 +2070,9 @@ Status ModelManager::LaunchKernelCustAicpuSo(const std::string &kernel_name) { | |||
| 2070 | void *d_aicpu_data = nullptr; | 2070 | void *d_aicpu_data = nullptr; |
| 2071 | void *d_so_name = nullptr; | 2071 | void *d_so_name = nullptr; |
| 2072 | 2072 | ||
| 2073 | - GE_CHK_RT_RET(ge::AclrtMalloc(&d_aicpu_data, aicpu_data_length, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 2073 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&d_aicpu_data, aicpu_data_length, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 2074 | allocated_mem.push_back(d_aicpu_data); | 2074 | allocated_mem.push_back(d_aicpu_data); |
| 2075 | - GE_CHK_RT_RET(ge::AclrtMalloc(&d_so_name, so_name.size(), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 2075 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&d_so_name, so_name.size(), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 2076 | allocated_mem.push_back(d_so_name); | 2076 | allocated_mem.push_back(d_so_name); |
| 2077 | GE_CHK_RT(aclrtMemcpy(d_aicpu_data, aicpu_data_length, aicpu_data, aicpu_data_length, ACL_MEMCPY_HOST_TO_DEVICE)); | 2077 | GE_CHK_RT(aclrtMemcpy(d_aicpu_data, aicpu_data_length, aicpu_data, aicpu_data_length, ACL_MEMCPY_HOST_TO_DEVICE)); |
| 2078 | GE_CHK_RT(aclrtMemcpy(d_so_name, so_name.size(), so_name.c_str(), so_name.size(), ACL_MEMCPY_HOST_TO_DEVICE)); | 2078 | GE_CHK_RT(aclrtMemcpy(d_so_name, so_name.size(), so_name.c_str(), so_name.size(), ACL_MEMCPY_HOST_TO_DEVICE)); |
| @@ -2092,7 +2092,7 @@ Status ModelManager::LaunchKernelCustAicpuSo(const std::string &kernel_name) { | |||
| 2092 | 2092 | ||
| 2093 | void *args = nullptr; | 2093 | void *args = nullptr; |
| 2094 | const size_t args_size = sizeof(CustAicpuSoBuf) * v_cust_so.size(); | 2094 | const size_t args_size = sizeof(CustAicpuSoBuf) * v_cust_so.size(); |
| 2095 | - GE_CHK_RT_RET(ge::AclrtMalloc(&args, args_size, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 2095 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&args, args_size, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 2096 | allocated_mem.push_back(args); | 2096 | allocated_mem.push_back(args); |
| 2097 | GE_CHK_RT(aclrtMemcpy(args, args_size, v_cust_so.data(), args_size, ACL_MEMCPY_HOST_TO_DEVICE)); | 2097 | GE_CHK_RT(aclrtMemcpy(args, args_size, v_cust_so.data(), args_size, ACL_MEMCPY_HOST_TO_DEVICE)); |
| 2098 | 2098 | ||
| @@ -2117,7 +2117,7 @@ Status ModelManager::LaunchKernelCustAicpuSo(const std::string &kernel_name) { | |||
| 2117 | GELOGI("Load cust so, soNameAddrOffset %u, kernelNameAddrOffset %u, timeout %u", args_info.soNameAddrOffset, | 2117 | GELOGI("Load cust so, soNameAddrOffset %u, kernelNameAddrOffset %u, timeout %u", args_info.soNameAddrOffset, |
| 2118 | args_info.kernelNameAddrOffset, args_info.timeout); | 2118 | args_info.kernelNameAddrOffset, args_info.timeout); |
| 2119 | 2119 | ||
| 2120 | - GE_CHK_RT_RET(aclrtSynchronizeStream(stream)); | 2120 | + GE_CHK_ACL_RET(aclrtSynchronizeStream(stream)); |
| 2121 | GELOGI("Cpu kernel launch task success."); | 2121 | GELOGI("Cpu kernel launch task success."); |
| 2122 | return SUCCESS; | 2122 | return SUCCESS; |
| 2123 | } | 2123 | } |
| @@ -2137,7 +2137,7 @@ Status ModelManager::LaunchCustAicpuSo() { | |||
| 2137 | Status ModelManager::GetPlatformInfosSoName(std::string &so_name) { | 2137 | Status ModelManager::GetPlatformInfosSoName(std::string &so_name) { |
| 2138 | // get current context | 2138 | // get current context |
| 2139 | aclrtContext rt_cur_ctx = nullptr; | 2139 | aclrtContext rt_cur_ctx = nullptr; |
| 2140 | - GE_CHK_RT_RET(aclrtGetCurrentContext(&rt_cur_ctx)); | 2140 | + GE_CHK_ACL_RET(aclrtGetCurrentContext(&rt_cur_ctx)); |
| 2141 | const uintptr_t resource_id = static_cast<uintptr_t>(PtrToValue(rt_cur_ctx)); | 2141 | const uintptr_t resource_id = static_cast<uintptr_t>(PtrToValue(rt_cur_ctx)); |
| 2142 | std::vector<std::string> v_so_name; | 2142 | std::vector<std::string> v_so_name; |
| 2143 | { | 2143 | { |
| @@ -2283,11 +2283,11 @@ Status ModelManager::LaunchKernelBuiltinAicpuSo(const std::string &kernel_name, | |||
| 2283 | const size_t aicpu_data_len = it_so.second.kernel_ptr->GetBinDataSize(); | 2283 | const size_t aicpu_data_len = it_so.second.kernel_ptr->GetBinDataSize(); |
| 2284 | const std::string &so_name = it_so.first; | 2284 | const std::string &so_name = it_so.first; |
| 2285 | if (kernel_name == kLoadBuiltinSo) { | 2285 | if (kernel_name == kLoadBuiltinSo) { |
| 2286 | - GE_CHK_RT_RET(ge::AclrtMalloc(&d_aicpu_data, aicpu_data_len, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 2286 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&d_aicpu_data, aicpu_data_len, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 2287 | - GE_CHK_RT_RET(aclrtMemcpy(d_aicpu_data, aicpu_data_len, aicpu_data, aicpu_data_len, ACL_MEMCPY_HOST_TO_DEVICE)); | 2287 | + GE_CHK_ACL_RET(aclrtMemcpy(d_aicpu_data, aicpu_data_len, aicpu_data, aicpu_data_len, ACL_MEMCPY_HOST_TO_DEVICE)); |
| 2288 | } | 2288 | } |
| 2289 | - GE_CHK_RT_RET(ge::AclrtMalloc(&d_so_name, so_name.size(), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 2289 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&d_so_name, so_name.size(), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 2290 | - GE_CHK_RT_RET(aclrtMemcpy(d_so_name, so_name.size(), so_name.c_str(), so_name.size(), ACL_MEMCPY_HOST_TO_DEVICE)); | 2290 | + GE_CHK_ACL_RET(aclrtMemcpy(d_so_name, so_name.size(), so_name.c_str(), so_name.size(), ACL_MEMCPY_HOST_TO_DEVICE)); |
| 2291 | 2291 | ||
| 2292 | LoadSoFromBufArgs aicpu_so_buf; | 2292 | LoadSoFromBufArgs aicpu_so_buf; |
| 2293 | ConstructLoadSoFromBufArgs(d_aicpu_data, aicpu_data_len, d_so_name, so_name.length(), aicpu_so_buf); | 2293 | ConstructLoadSoFromBufArgs(d_aicpu_data, aicpu_data_len, d_so_name, so_name.length(), aicpu_so_buf); |
| @@ -2312,7 +2312,7 @@ Status ModelManager::LaunchKernelBuiltinAicpuSo(const std::string &kernel_name, | |||
| 2312 | kernel_name.c_str(), PtrToValue(stream)); | 2312 | kernel_name.c_str(), PtrToValue(stream)); |
| 2313 | GELOGI("Load build in so, soNameAddrOffset %u, kernelNameAddrOffset %u, timeout %u", args_info.soNameAddrOffset, | 2313 | GELOGI("Load build in so, soNameAddrOffset %u, kernelNameAddrOffset %u, timeout %u", args_info.soNameAddrOffset, |
| 2314 | args_info.kernelNameAddrOffset, args_info.timeout); | 2314 | args_info.kernelNameAddrOffset, args_info.timeout); |
| 2315 | - GE_CHK_RT_RET(aclrtSynchronizeStream(stream)); | 2315 | + GE_CHK_ACL_RET(aclrtSynchronizeStream(stream)); |
| 2316 | } | 2316 | } |
| 2317 | return SUCCESS; | 2317 | return SUCCESS; |
| 2318 | } | 2318 | } |
| @@ -2440,7 +2440,7 @@ Status ModelManager::SyncExecuteHybridModel(const uint32_t model_id, const std:: | |||
| 2440 | const auto &model = GetHybridModel(model_id); | 2440 | const auto &model = GetHybridModel(model_id); |
| 2441 | GE_ASSERT_NOTNULL(model); | 2441 | GE_ASSERT_NOTNULL(model); |
| 2442 | const auto device_id = model->GetDeviceId(); | 2442 | const auto device_id = model->GetDeviceId(); |
| 2443 | - GE_CHK_RT_RET(aclrtSetDevice(static_cast<int32_t>(device_id))); | 2443 | + GE_CHK_ACL_RET(aclrtSetDevice(static_cast<int32_t>(device_id))); |
| 2444 | GE_MAKE_GUARD(reset_device, [device_id]() { | 2444 | GE_MAKE_GUARD(reset_device, [device_id]() { |
| 2445 | GE_CHK_RT(aclrtResetDevice(static_cast<int32_t>(device_id))); | 2445 | GE_CHK_RT(aclrtResetDevice(static_cast<int32_t>(device_id))); |
| 2446 | }); | 2446 | }); |
| @@ -2502,24 +2502,24 @@ Status ModelManager::LaunchKernelCheckAicpuOp(const std::vector<std::string> &ai | |||
| 2502 | 2502 | ||
| 2503 | // malloc sysOpInfoList in SysOpCheckInfo | 2503 | // malloc sysOpInfoList in SysOpCheckInfo |
| 2504 | void *d_req_op_list = nullptr; | 2504 | void *d_req_op_list = nullptr; |
| 2505 | - GE_CHK_RT_RET(ge::AclrtMalloc(&d_req_op_list, op_nums * sizeof(SysOpInfo), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 2505 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&d_req_op_list, op_nums * sizeof(SysOpInfo), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 2506 | allocated_mem.push_back(d_req_op_list); | 2506 | allocated_mem.push_back(d_req_op_list); |
| 2507 | 2507 | ||
| 2508 | // malloc sysOpInfoList in SysOpCheckResp | 2508 | // malloc sysOpInfoList in SysOpCheckResp |
| 2509 | void *d_res_op_list = nullptr; | 2509 | void *d_res_op_list = nullptr; |
| 2510 | - GE_CHK_RT_RET(ge::AclrtMalloc(&d_res_op_list, op_nums * sizeof(SysOpInfo), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 2510 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&d_res_op_list, op_nums * sizeof(SysOpInfo), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 2511 | allocated_mem.push_back(d_res_op_list); | 2511 | allocated_mem.push_back(d_res_op_list); |
| 2512 | 2512 | ||
| 2513 | // malloc returnCodeList in SysOpCheckResp | 2513 | // malloc returnCodeList in SysOpCheckResp |
| 2514 | void *d_ret_code_list = nullptr; | 2514 | void *d_ret_code_list = nullptr; |
| 2515 | - GE_CHK_RT_RET(ge::AclrtMalloc(&d_ret_code_list, op_nums * sizeof(ReturnCode), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 2515 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&d_ret_code_list, op_nums * sizeof(ReturnCode), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 2516 | allocated_mem.push_back(d_ret_code_list); | 2516 | allocated_mem.push_back(d_ret_code_list); |
| 2517 | 2517 | ||
| 2518 | for (const auto &op_type : aicpu_optype_list) { | 2518 | for (const auto &op_type : aicpu_optype_list) { |
| 2519 | SysOpInfo op_info; | 2519 | SysOpInfo op_info; |
| 2520 | // malloc op_type name in SysOpInfo | 2520 | // malloc op_type name in SysOpInfo |
| 2521 | void *d_op_type_name = nullptr; | 2521 | void *d_op_type_name = nullptr; |
| 2522 | - GE_CHK_RT_RET(ge::AclrtMalloc(&d_op_type_name, op_type.length(), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 2522 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&d_op_type_name, op_type.length(), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 2523 | 2523 | ||
| 2524 | allocated_mem.push_back(d_op_type_name); | 2524 | allocated_mem.push_back(d_op_type_name); |
| 2525 | GE_CHK_RT(aclrtMemcpy(d_op_type_name, op_type.length(), op_type.c_str(), | 2525 | GE_CHK_RT(aclrtMemcpy(d_op_type_name, op_type.length(), op_type.c_str(), |
| @@ -2534,7 +2534,7 @@ Status ModelManager::LaunchKernelCheckAicpuOp(const std::vector<std::string> &ai | |||
| 2534 | SysOpInfo op_info; | 2534 | SysOpInfo op_info; |
| 2535 | // malloc op_type name in SysOpInfo | 2535 | // malloc op_type name in SysOpInfo |
| 2536 | void *d_op_type_name = nullptr; | 2536 | void *d_op_type_name = nullptr; |
| 2537 | - GE_CHK_RT_RET(ge::AclrtMalloc(&d_op_type_name, op_type.length(), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 2537 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&d_op_type_name, op_type.length(), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 2538 | 2538 | ||
| 2539 | allocated_mem.push_back(d_op_type_name); | 2539 | allocated_mem.push_back(d_op_type_name); |
| 2540 | GE_CHK_RT(aclrtMemcpy(d_op_type_name, op_type.size(), op_type.c_str(), | 2540 | GE_CHK_RT(aclrtMemcpy(d_op_type_name, op_type.size(), op_type.c_str(), |
| @@ -2569,7 +2569,7 @@ Status ModelManager::LaunchKernelCheckAicpuOp(const std::vector<std::string> &ai | |||
| 2569 | GE_CHK_BOOL_RET_STATUS(ret == EOK, FAILED, "[Memcpy] Call memcpy failed from src op_check_info_res, ret=%d", ret); | 2569 | GE_CHK_BOOL_RET_STATUS(ret == EOK, FAILED, "[Memcpy] Call memcpy failed from src op_check_info_res, ret=%d", ret); |
| 2570 | 2570 | ||
| 2571 | aclrtStream stream = nullptr; | 2571 | aclrtStream stream = nullptr; |
| 2572 | - GE_CHK_RT_RET(aclrtCreateStream(&stream)); | 2572 | + GE_CHK_ACL_RET(aclrtCreateStream(&stream)); |
| 2573 | GE_MAKE_GUARD(stream_guard, [&stream]() { | 2573 | GE_MAKE_GUARD(stream_guard, [&stream]() { |
| 2574 | GE_CHK_RT(aclrtDestroyStream(stream)); | 2574 | GE_CHK_RT(aclrtDestroyStream(stream)); |
| 2575 | }); | 2575 | }); |
| @@ -2580,7 +2580,7 @@ Status ModelManager::LaunchKernelCheckAicpuOp(const std::vector<std::string> &ai | |||
| 2580 | GE_CHK_RT(rtCpuKernelLaunchWithFlag(nullptr, | 2580 | GE_CHK_RT(rtCpuKernelLaunchWithFlag(nullptr, |
| 2581 | kernel_name.c_str(), 1U, &args_info, nullptr, stream, RT_KERNEL_DEFAULT)); | 2581 | kernel_name.c_str(), 1U, &args_info, nullptr, stream, RT_KERNEL_DEFAULT)); |
| 2582 | 2582 | ||
| 2583 | - GE_CHK_RT_RET(aclrtSynchronizeStream(stream)); | 2583 | + GE_CHK_ACL_RET(aclrtSynchronizeStream(stream)); |
| 2584 | 2584 | ||
| 2585 | // Check the response | 2585 | // Check the response |
| 2586 | const void *const d_op_check_info_res = ValueToPtr(PtrToValue(args.get()) + op_check_info_req.offSetLen); | 2586 | const void *const d_op_check_info_res = ValueToPtr(PtrToValue(args.get()) + op_check_info_req.offSetLen); |
| @@ -2795,7 +2795,7 @@ Status ModelManager::UnloadTaskForDavinciModel(const DumpProperties &dump_proper | |||
| 2795 | bool is_set = false; | 2795 | bool is_set = false; |
| 2796 | if ((aclrtGetDevice(&device_id) != ACL_SUCCESS) || (device_id < 0)) { | 2796 | if ((aclrtGetDevice(&device_id) != ACL_SUCCESS) || (device_id < 0)) { |
| 2797 | device_id = static_cast<int32_t>(davinci_model->GetDeviceId()); | 2797 | device_id = static_cast<int32_t>(davinci_model->GetDeviceId()); |
| 2798 | - GE_CHK_RT_RET(aclrtSetDevice(device_id)); | 2798 | + GE_CHK_ACL_RET(aclrtSetDevice(device_id)); |
| 2799 | is_set = true; | 2799 | is_set = true; |
| 2800 | } | 2800 | } |
| 2801 | davinci_model->UnloadDumpInfo(); | 2801 | davinci_model->UnloadDumpInfo(); |
| @@ -36,8 +36,8 @@ | |||
| 36 | 36 | ||
| 37 | 37 | ||
| 38 | 38 | ||
| 39 | -#include "runtime/context.h" | 39 | +#include "common/ge_rts_decl.h" |
| 40 | -#include "runtime/rt.h" | 40 | +#include "rt_external.h" |
| 41 | 41 | ||
| 42 | 42 | ||
| 43 | 43 | ||
| @@ -10,8 +10,8 @@ | |||
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | -#include "runtime/rt_model.h" | 13 | +#include "rt_external_model.h" |
| 14 | -#include "runtime/stream.h" | 14 | +#include "rt_external_stream.h" |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| @@ -80,7 +80,7 @@ Status KernelExTaskInfo::InitTaskExtInfo(const std::string &ext_info, const OpDe | |||
| 80 | } | 80 | } |
| 81 | ext_info_addr_ = davinci_model_->MallocDynamicMemory(ext_handle.GetExtInfoLen(), mem_type_); | 81 | ext_info_addr_ = davinci_model_->MallocDynamicMemory(ext_handle.GetExtInfoLen(), mem_type_); |
| 82 | GE_ASSERT_NOTNULL(ext_info_addr_); | 82 | GE_ASSERT_NOTNULL(ext_info_addr_); |
| 83 | - GE_CHK_RT_RET(aclrtMemcpy(ext_info_addr_, ext_handle.GetExtInfoLen(), ext_handle.GetExtInfo(), | 83 | + GE_CHK_ACL_RET(aclrtMemcpy(ext_info_addr_, ext_handle.GetExtInfoLen(), ext_handle.GetExtInfo(), |
| 84 | ext_handle.GetExtInfoLen(), memcpy_kind_)); | 84 | ext_handle.GetExtInfoLen(), memcpy_kind_)); |
| 85 | GELOGD("Op %s use %s mem %p for ext info with flag %d", op_desc->GetName().c_str(), | 85 | GELOGD("Op %s use %s mem %p for ext info with flag %d", op_desc->GetName().c_str(), |
| 86 | mem_type_ == RT_MEMORY_HOST_SVM ? "host" : "device", ext_info_addr_, deploy_type_flag_); | 86 | mem_type_ == RT_MEMORY_HOST_SVM ? "host" : "device", ext_info_addr_, deploy_type_flag_); |
| @@ -130,7 +130,7 @@ Status KernelExTaskInfo::InitInputOutputAddr(const PisToArgs &args, const IowAdd | |||
| 130 | } | 130 | } |
| 131 | 131 | ||
| 132 | Status KernelExTaskInfo::AssembleKernelBuffer(const STR_FWK_OP_KERNEL * const fwk_op_kernel) const { | 132 | Status KernelExTaskInfo::AssembleKernelBuffer(const STR_FWK_OP_KERNEL * const fwk_op_kernel) const { |
| 133 | - GE_CHK_RT_RET(aclrtMemcpy(kernel_buf_, kernel_buf_size_, PtrToPtr<STR_FWK_OP_KERNEL, void>(fwk_op_kernel), | 133 | + GE_CHK_ACL_RET(aclrtMemcpy(kernel_buf_, kernel_buf_size_, PtrToPtr<STR_FWK_OP_KERNEL, void>(fwk_op_kernel), |
| 134 | kernel_buf_size_, memcpy_kind_)); | 134 | kernel_buf_size_, memcpy_kind_)); |
| 135 | GELOGD("Op %s use %s mem %p for kernel_buf with flag %d", op_desc_->GetName().c_str(), | 135 | GELOGD("Op %s use %s mem %p for kernel_buf with flag %d", op_desc_->GetName().c_str(), |
| 136 | mem_type_ == RT_MEMORY_HOST_SVM ? "host" : "device", kernel_buf_, deploy_type_flag_); | 136 | mem_type_ == RT_MEMORY_HOST_SVM ? "host" : "device", kernel_buf_, deploy_type_flag_); |
| @@ -392,7 +392,7 @@ Status KernelExTaskInfo::AssembleWorkSpaceAddr(const domi::KernelExDef &kernel_d | |||
| 392 | // 故此处用独立申请的地址,后面修改为persistent workspace | 392 | // 故此处用独立申请的地址,后面修改为persistent workspace |
| 393 | void *workspace_base_addr = davinci_model_->MallocDynamicMemory(kernel_def.task_info().size(), mem_type_); | 393 | void *workspace_base_addr = davinci_model_->MallocDynamicMemory(kernel_def.task_info().size(), mem_type_); |
| 394 | GE_ASSERT_NOTNULL(workspace_base_addr); | 394 | GE_ASSERT_NOTNULL(workspace_base_addr); |
| 395 | - GE_CHK_RT_RET(aclrtMemcpy(workspace_base_addr, kernel_def.task_info().size(), kernel_def.task_info().data(), | 395 | + GE_CHK_ACL_RET(aclrtMemcpy(workspace_base_addr, kernel_def.task_info().size(), kernel_def.task_info().data(), |
| 396 | kernel_def.task_info().size(), memcpy_kind_)); | 396 | kernel_def.task_info().size(), memcpy_kind_)); |
| 397 | workspace_data_addrs_.emplace_back(workspace_base_addr); | 397 | workspace_data_addrs_.emplace_back(workspace_base_addr); |
| 398 | 398 | ||
| @@ -420,8 +420,8 @@ Status KernelExTaskInfo::Distribute() { | |||
| 420 | launch_kernel_param.launch_config.is_data_dump = is_data_dump_; | 420 | launch_kernel_param.launch_config.is_data_dump = is_data_dump_; |
| 421 | GE_ASSERT_SUCCESS(KernelHandleUtils::LaunchKernel(func_handle_, launch_kernel_param)); | 421 | GE_ASSERT_SUCCESS(KernelHandleUtils::LaunchKernel(func_handle_, launch_kernel_param)); |
| 422 | GE_CHECK_NOTNULL(davinci_model_); | 422 | GE_CHECK_NOTNULL(davinci_model_); |
| 423 | - GE_CHK_RT_RET(aclrtGetThreadLastTaskId(&task_id_)); | 423 | + GE_CHK_ACL_RET(aclrtGetThreadLastTaskId(&task_id_)); |
| 424 | - GE_CHK_RT_RET(aclrtStreamGetId(stream_, reinterpret_cast<int32_t*>(&stream_id_))); | 424 | + GE_CHK_ACL_RET(aclrtStreamGetId(stream_, reinterpret_cast<int32_t*>(&stream_id_))); |
| 425 | 425 | ||
| 426 | GELOGI("KernelExTaskInfo %s Distribute Success. task id: %u, stream id: %u, stream: %p.", | 426 | GELOGI("KernelExTaskInfo %s Distribute Success. task id: %u, stream id: %u, stream: %p.", |
| 427 | op_desc_->GetNamePtr(), task_id_, stream_id_, stream_); | 427 | op_desc_->GetNamePtr(), task_id_, stream_id_, stream_); |
| @@ -500,11 +500,11 @@ Status KernelExTaskInfo::DistributeWaitTaskForAicpuBlockingOp() const { | |||
| 500 | uint32_t timeout = 0xffffffff; | 500 | uint32_t timeout = 0xffffffff; |
| 501 | (void)AttrUtils::GetInt(op_desc_, ATTR_NAME_BLOCKING_OP_TIMEOUT, timeout); | 501 | (void)AttrUtils::GetInt(op_desc_, ATTR_NAME_BLOCKING_OP_TIMEOUT, timeout); |
| 502 | if (timeout != 0xffffffff) { | 502 | if (timeout != 0xffffffff) { |
| 503 | - GE_CHK_RT_RET(aclrtStreamWaitEventWithTimeout(stream_, rt_event, static_cast<int32_t>(timeout))); | 503 | + GE_CHK_ACL_RET(aclrtStreamWaitEventWithTimeout(stream_, rt_event, static_cast<int32_t>(timeout))); |
| 504 | } else { | 504 | } else { |
| 505 | - GE_CHK_RT_RET(aclrtStreamWaitEvent(stream_, rt_event)); | 505 | + GE_CHK_ACL_RET(aclrtStreamWaitEvent(stream_, rt_event)); |
| 506 | } | 506 | } |
| 507 | - GE_CHK_RT_RET(aclrtResetEvent(rt_event, stream_)); | 507 | + GE_CHK_ACL_RET(aclrtResetEvent(rt_event, stream_)); |
| 508 | 508 | ||
| 509 | return SUCCESS; | 509 | return SUCCESS; |
| 510 | } | 510 | } |
| @@ -161,7 +161,7 @@ Status ArgsFormatUtils::SinkTilingContext(const NodePtr &node, DavinciModel &dav | |||
| 161 | } | 161 | } |
| 162 | 162 | ||
| 163 | // H2D | 163 | // H2D |
| 164 | - GE_CHK_RT_RET(aclrtMemcpy(device_addr, total_plain_size, host_pointer.get(), | 164 | + GE_CHK_ACL_RET(aclrtMemcpy(device_addr, total_plain_size, host_pointer.get(), |
| 165 | total_plain_size, ACL_MEMCPY_HOST_TO_DEVICE)); | 165 | total_plain_size, ACL_MEMCPY_HOST_TO_DEVICE)); |
| 166 | 166 | ||
| 167 | std::shared_ptr<TilingContextAddr> tiling_context_addr = MakeShared<TilingContextAddr>(); | 167 | std::shared_ptr<TilingContextAddr> tiling_context_addr = MakeShared<TilingContextAddr>(); |
| @@ -12,7 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | -#include "runtime/rt.h" | 15 | +#include "rt_external.h" |
| 16 | 16 | ||
| 17 | namespace ge { | 17 | namespace ge { |
| 18 | class CmoTaskInfo : public TaskInfo { | 18 | class CmoTaskInfo : public TaskInfo { |
| @@ -114,7 +114,7 @@ Status DSATaskInfo::InitWorkspace(const OpDescPtr &op_desc, const domi::DSATaskD | |||
| 114 | 114 | ||
| 115 | // todo: 后面修改成静态图不可刷新场景, 在此拷贝, 采用model; 注意不支持刷新的也需要在此拷贝 | 115 | // todo: 后面修改成静态图不可刷新场景, 在此拷贝, 采用model; 注意不支持刷新的也需要在此拷贝 |
| 116 | if ((!davinci_model_->IsFeatureBaseRefreshable()) || (!support_refresh_)) { | 116 | if ((!davinci_model_->IsFeatureBaseRefreshable()) || (!support_refresh_)) { |
| 117 | - GE_CHK_RT_RET(aclrtMemcpy(ValueToPtr(hbm_args), dev_size, workspace_io_addrs_.data(), | 117 | + GE_CHK_ACL_RET(aclrtMemcpy(ValueToPtr(hbm_args), dev_size, workspace_io_addrs_.data(), |
| 118 | sizeof(uint64_t) * workspace_io_addrs_.size(), ACL_MEMCPY_HOST_TO_DEVICE)); | 118 | sizeof(uint64_t) * workspace_io_addrs_.size(), ACL_MEMCPY_HOST_TO_DEVICE)); |
| 119 | } | 119 | } |
| 120 | 120 | ||
| @@ -308,8 +308,8 @@ Status DSATaskInfo::Distribute() { | |||
| 308 | } | 308 | } |
| 309 | const TaskProfGuarder prof_guarder(this); | 309 | const TaskProfGuarder prof_guarder(this); |
| 310 | GE_CHK_RT_RET(ge::rtStarsTaskLaunchWithFlag(&dsa_sqe_, static_cast<uint32_t>(sizeof(dsa_sqe_)), stream_, dump_flag_)); | 310 | GE_CHK_RT_RET(ge::rtStarsTaskLaunchWithFlag(&dsa_sqe_, static_cast<uint32_t>(sizeof(dsa_sqe_)), stream_, dump_flag_)); |
| 311 | - GE_CHK_RT_RET(aclrtGetThreadLastTaskId(&task_id_)); | 311 | + GE_CHK_ACL_RET(aclrtGetThreadLastTaskId(&task_id_)); |
| 312 | - GE_CHK_RT_RET(aclrtStreamGetId(stream_, reinterpret_cast<int32_t*>(&stream_id_))); | 312 | + GE_CHK_ACL_RET(aclrtStreamGetId(stream_, reinterpret_cast<int32_t*>(&stream_id_))); |
| 313 | GELOGI("DSATaskInfo %s Distribute TaskId[%u], stream id [%u], dumpflag [%u] Success.", | 313 | GELOGI("DSATaskInfo %s Distribute TaskId[%u], stream id [%u], dumpflag [%u] Success.", |
| 314 | op_desc_->GetNamePtr(), task_id_, stream_id_, dump_flag_); | 314 | op_desc_->GetNamePtr(), task_id_, stream_id_, dump_flag_); |
| 315 | 315 | ||
| @@ -24,7 +24,7 @@ | |||
| 24 | 24 | ||
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | -#include "runtime/kernel.h" | 27 | +#include "rt_external_kernel.h" |
| 28 | 28 | ||
| 29 | 29 | ||
| 30 | 30 | ||
| @@ -731,7 +731,7 @@ Status FusionTaskInfo::CopyTilingDataIfNeeded() { | |||
| 731 | tiling_data_size_ = tiling_data_host_.size(); | 731 | tiling_data_size_ = tiling_data_host_.size(); |
| 732 | tiling_data_addr_ = davinci_model_->MallocDynamicMemory(tiling_data_size_); | 732 | tiling_data_addr_ = davinci_model_->MallocDynamicMemory(tiling_data_size_); |
| 733 | GE_CHECK_NOTNULL(tiling_data_addr_); | 733 | GE_CHECK_NOTNULL(tiling_data_addr_); |
| 734 | - GE_CHK_RT_RET(aclrtMemcpy(tiling_data_addr_, tiling_data_size_, | 734 | + GE_CHK_ACL_RET(aclrtMemcpy(tiling_data_addr_, tiling_data_size_, |
| 735 | tiling_data_host_.data(), tiling_data_host_.size(), ACL_MEMCPY_HOST_TO_DEVICE)); | 735 | tiling_data_host_.data(), tiling_data_host_.size(), ACL_MEMCPY_HOST_TO_DEVICE)); |
| 736 | 736 | ||
| 737 | GELOGI("Success to update tiling data to io_addr of %s, device addr: %p, size: %zu, host tiling data addr: %p", | 737 | GELOGI("Success to update tiling data to io_addr of %s, device addr: %p, size: %zu, host tiling data addr: %p", |
| @@ -27,7 +27,7 @@ | |||
| 27 | 27 | ||
| 28 | 28 | ||
| 29 | 29 | ||
| 30 | -#include "runtime/kernel.h" | 30 | +#include "rt_external_kernel.h" |
| 31 | 31 | ||
| 32 | 32 | ||
| 33 | 33 | ||
| @@ -759,11 +759,11 @@ Status KernelTaskInfo::DistributeWaitTaskForAicpuBlockingOp() const { | |||
| 759 | uint32_t timeout = 0xffffffff; | 759 | uint32_t timeout = 0xffffffff; |
| 760 | (void) AttrUtils::GetInt(op_desc_, ATTR_NAME_BLOCKING_OP_TIMEOUT, timeout); | 760 | (void) AttrUtils::GetInt(op_desc_, ATTR_NAME_BLOCKING_OP_TIMEOUT, timeout); |
| 761 | if (timeout != 0xffffffff) { | 761 | if (timeout != 0xffffffff) { |
| 762 | - GE_CHK_RT_RET(aclrtStreamWaitEventWithTimeout(stream_, rt_event, static_cast<int32_t>(timeout))); | 762 | + GE_CHK_ACL_RET(aclrtStreamWaitEventWithTimeout(stream_, rt_event, static_cast<int32_t>(timeout))); |
| 763 | } else { | 763 | } else { |
| 764 | - GE_CHK_RT_RET(aclrtStreamWaitEvent(stream_, rt_event)); | 764 | + GE_CHK_ACL_RET(aclrtStreamWaitEvent(stream_, rt_event)); |
| 765 | } | 765 | } |
| 766 | - GE_CHK_RT_RET(aclrtResetEvent(rt_event, stream_)); | 766 | + GE_CHK_ACL_RET(aclrtResetEvent(rt_event, stream_)); |
| 767 | 767 | ||
| 768 | return SUCCESS; | 768 | return SUCCESS; |
| 769 | } | 769 | } |
| @@ -1365,7 +1365,7 @@ Status KernelTaskInfo::AssembleIoByArgsFormat() { | |||
| 1365 | } | 1365 | } |
| 1366 | case AddrType::FFTS_ADDR: { | 1366 | case AddrType::FFTS_ADDR: { |
| 1367 | void* mode_addr_ptr = nullptr; | 1367 | void* mode_addr_ptr = nullptr; |
| 1368 | - GE_CHK_RT_RET(aclrtGetHardwareSyncAddr(&mode_addr_ptr)); | 1368 | + GE_CHK_ACL_RET(aclrtGetHardwareSyncAddr(&mode_addr_ptr)); |
| 1369 | AppendIoAddr(reinterpret_cast<uint64_t>(mode_addr_ptr), kAbsoluteMemType); | 1369 | AppendIoAddr(reinterpret_cast<uint64_t>(mode_addr_ptr), kAbsoluteMemType); |
| 1370 | break; | 1370 | break; |
| 1371 | } | 1371 | } |
| @@ -1660,7 +1660,7 @@ Status KernelTaskInfo::CopyTilingDataIfNeeded() { | |||
| 1660 | tiling_data_size_ = tiling_data.size(); | 1660 | tiling_data_size_ = tiling_data.size(); |
| 1661 | tiling_data_addr_ = davinci_model_->MallocDynamicMemory(tiling_data_size_); | 1661 | tiling_data_addr_ = davinci_model_->MallocDynamicMemory(tiling_data_size_); |
| 1662 | GE_CHECK_NOTNULL(tiling_data_addr_); | 1662 | GE_CHECK_NOTNULL(tiling_data_addr_); |
| 1663 | - GE_CHK_RT_RET(aclrtMemcpy(tiling_data_addr_, tiling_data_size_, tiling_data.data(), tiling_data.size(), | 1663 | + GE_CHK_ACL_RET(aclrtMemcpy(tiling_data_addr_, tiling_data_size_, tiling_data.data(), tiling_data.size(), |
| 1664 | ACL_MEMCPY_HOST_TO_DEVICE)); | 1664 | ACL_MEMCPY_HOST_TO_DEVICE)); |
| 1665 | GELOGI("Success to update tiling data to io_addr of %s, addr: %p, size: %zu.", op_desc_->GetNamePtr(), | 1665 | GELOGI("Success to update tiling data to io_addr of %s, addr: %p, size: %zu.", op_desc_->GetNamePtr(), |
| 1666 | tiling_data_addr_, tiling_data.size()); | 1666 | tiling_data_addr_, tiling_data.size()); |
| @@ -2061,7 +2061,7 @@ Status KernelTaskInfo::InitAICPUCustomTask(const OpDescPtr &op_desc, const domi: | |||
| 2061 | 2061 | ||
| 2062 | custom_info_.attr_handle = davinci_model_->MallocDynamicMemory(op_attr_size); | 2062 | custom_info_.attr_handle = davinci_model_->MallocDynamicMemory(op_attr_size); |
| 2063 | GE_ASSERT_NOTNULL(custom_info_.attr_handle); | 2063 | GE_ASSERT_NOTNULL(custom_info_.attr_handle); |
| 2064 | - GE_CHK_RT_RET(aclrtMemcpy(custom_info_.attr_handle, op_attr_size, buffer.GetData(), op_attr_size, | 2064 | + GE_CHK_ACL_RET(aclrtMemcpy(custom_info_.attr_handle, op_attr_size, buffer.GetData(), op_attr_size, |
| 2065 | ACL_MEMCPY_HOST_TO_DEVICE)); | 2065 | ACL_MEMCPY_HOST_TO_DEVICE)); |
| 2066 | 2066 | ||
| 2067 | GE_ASSERT_TRUE((io_addrs_.size() * kAddressLen) >= kernel_def.args().size()); | 2067 | GE_ASSERT_TRUE((io_addrs_.size() * kAddressLen) >= kernel_def.args().size()); |
| @@ -2380,13 +2380,13 @@ Status KernelTaskInfo::UpdateExtraInfo(const hybrid::AicpuExtInfoHandler &ext_ha | |||
| 2380 | if (deploy_type_flag_ == static_cast<int32_t>(RT_KERNEL_HOST_ONLY)) { | 2380 | if (deploy_type_flag_ == static_cast<int32_t>(RT_KERNEL_HOST_ONLY)) { |
| 2381 | aicpu_ext_info_addr_ = davinci_model_->MallocDynamicMemory(ext_handle.GetExtInfoLen(), RT_MEMORY_HOST_SVM); | 2381 | aicpu_ext_info_addr_ = davinci_model_->MallocDynamicMemory(ext_handle.GetExtInfoLen(), RT_MEMORY_HOST_SVM); |
| 2382 | GE_ASSERT_NOTNULL(aicpu_ext_info_addr_); | 2382 | GE_ASSERT_NOTNULL(aicpu_ext_info_addr_); |
| 2383 | - GE_CHK_RT_RET(aclrtMemcpy(aicpu_ext_info_addr_, ext_handle.GetExtInfoLen(), ext_handle.GetExtInfo(), | 2383 | + GE_CHK_ACL_RET(aclrtMemcpy(aicpu_ext_info_addr_, ext_handle.GetExtInfoLen(), ext_handle.GetExtInfo(), |
| 2384 | ext_handle.GetExtInfoLen(), ACL_MEMCPY_HOST_TO_HOST)); | 2384 | ext_handle.GetExtInfoLen(), ACL_MEMCPY_HOST_TO_HOST)); |
| 2385 | GELOGI("op %s use host mem %p for ext info", op_desc_->GetName().c_str(), aicpu_ext_info_addr_); | 2385 | GELOGI("op %s use host mem %p for ext info", op_desc_->GetName().c_str(), aicpu_ext_info_addr_); |
| 2386 | } else { | 2386 | } else { |
| 2387 | aicpu_ext_info_addr_ = davinci_model_->MallocDynamicMemory(ext_handle.GetExtInfoLen()); | 2387 | aicpu_ext_info_addr_ = davinci_model_->MallocDynamicMemory(ext_handle.GetExtInfoLen()); |
| 2388 | GE_ASSERT_NOTNULL(aicpu_ext_info_addr_); | 2388 | GE_ASSERT_NOTNULL(aicpu_ext_info_addr_); |
| 2389 | - GE_CHK_RT_RET(aclrtMemcpy(aicpu_ext_info_addr_, ext_handle.GetExtInfoLen(), ext_handle.GetExtInfo(), | 2389 | + GE_CHK_ACL_RET(aclrtMemcpy(aicpu_ext_info_addr_, ext_handle.GetExtInfoLen(), ext_handle.GetExtInfo(), |
| 2390 | ext_handle.GetExtInfoLen(), ACL_MEMCPY_HOST_TO_DEVICE)); | 2390 | ext_handle.GetExtInfoLen(), ACL_MEMCPY_HOST_TO_DEVICE)); |
| 2391 | GELOGI("op %s use device mem %p for ext info with flag %d", op_desc_->GetName().c_str(), aicpu_ext_info_addr_, | 2391 | GELOGI("op %s use device mem %p for ext info with flag %d", op_desc_->GetName().c_str(), aicpu_ext_info_addr_, |
| 2392 | deploy_type_flag_); | 2392 | deploy_type_flag_); |
| @@ -2404,7 +2404,7 @@ Status KernelTaskInfo::StoreInputOutputTensor(const std::vector<uint64_t> &input | |||
| 2404 | // inputDescs | 2404 | // inputDescs |
| 2405 | custom_info_.input_descs = davinci_model_->MallocDynamicMemory(total_desc_size); | 2405 | custom_info_.input_descs = davinci_model_->MallocDynamicMemory(total_desc_size); |
| 2406 | GE_ASSERT_NOTNULL(custom_info_.input_descs); | 2406 | GE_ASSERT_NOTNULL(custom_info_.input_descs); |
| 2407 | - GE_CHK_RT_RET(aclrtMemcpy(custom_info_.input_descs, total_desc_size, input_descs.data(), total_desc_size, | 2407 | + GE_CHK_ACL_RET(aclrtMemcpy(custom_info_.input_descs, total_desc_size, input_descs.data(), total_desc_size, |
| 2408 | ACL_MEMCPY_HOST_TO_DEVICE)); | 2408 | ACL_MEMCPY_HOST_TO_DEVICE)); |
| 2409 | 2409 | ||
| 2410 | // inputAddrs | 2410 | // inputAddrs |
| @@ -2419,7 +2419,7 @@ Status KernelTaskInfo::StoreInputOutputTensor(const std::vector<uint64_t> &input | |||
| 2419 | // outputDescs | 2419 | // outputDescs |
| 2420 | custom_info_.output_descs = davinci_model_->MallocDynamicMemory(total_desc_size); | 2420 | custom_info_.output_descs = davinci_model_->MallocDynamicMemory(total_desc_size); |
| 2421 | GE_ASSERT_NOTNULL(custom_info_.output_descs); | 2421 | GE_ASSERT_NOTNULL(custom_info_.output_descs); |
| 2422 | - GE_CHK_RT_RET(aclrtMemcpy(custom_info_.output_descs, total_desc_size, output_descs.data(), | 2422 | + GE_CHK_ACL_RET(aclrtMemcpy(custom_info_.output_descs, total_desc_size, output_descs.data(), |
| 2423 | sizeof(ccAICPUTensor) * output_size, ACL_MEMCPY_HOST_TO_DEVICE)); | 2423 | sizeof(ccAICPUTensor) * output_size, ACL_MEMCPY_HOST_TO_DEVICE)); |
| 2424 | 2424 | ||
| 2425 | // outputAddrs | 2425 | // outputAddrs |
| @@ -2448,7 +2448,7 @@ Status KernelTaskInfo::AssembleKernelNamesAndLaunch() { | |||
| 2448 | launch_addr_ = davinci_model_->MallocDynamicMemory(total_launch_size, RT_MEMORY_HOST_SVM); | 2448 | launch_addr_ = davinci_model_->MallocDynamicMemory(total_launch_size, RT_MEMORY_HOST_SVM); |
| 2449 | } | 2449 | } |
| 2450 | GE_ASSERT_NOTNULL(launch_addr_); | 2450 | GE_ASSERT_NOTNULL(launch_addr_); |
| 2451 | - GE_CHK_RT_RET(aclrtMemcpy(launch_addr_, launch_info.size(), launch_info.c_str(), | 2451 | + GE_CHK_ACL_RET(aclrtMemcpy(launch_addr_, launch_info.size(), launch_info.c_str(), |
| 2452 | launch_info.size(), ACL_MEMCPY_HOST_TO_HOST)); | 2452 | launch_info.size(), ACL_MEMCPY_HOST_TO_HOST)); |
| 2453 | launch_name.soName = PtrToPtr<void, const char>(launch_addr_); | 2453 | launch_name.soName = PtrToPtr<void, const char>(launch_addr_); |
| 2454 | launch_name.kernelName = PtrAdd(PtrToPtr<void, const char>(launch_addr_), total_launch_size, so_name_.size()); | 2454 | launch_name.kernelName = PtrAdd(PtrToPtr<void, const char>(launch_addr_), total_launch_size, so_name_.size()); |
| @@ -2461,7 +2461,7 @@ Status KernelTaskInfo::AssembleKernelNamesAndLaunch() { | |||
| 2461 | GE_ASSERT_NOTNULL(kernel_name_arg_); | 2461 | GE_ASSERT_NOTNULL(kernel_name_arg_); |
| 2462 | GELOGI("Using host mem info: kernel_name_arg_ %p, so_name_host_ %p, kernel_name_host_ %p, op_name_host_ %p", | 2462 | GELOGI("Using host mem info: kernel_name_arg_ %p, so_name_host_ %p, kernel_name_host_ %p, op_name_host_ %p", |
| 2463 | kernel_name_arg_, launch_name.soName, launch_name.kernelName, launch_name.opName); | 2463 | kernel_name_arg_, launch_name.soName, launch_name.kernelName, launch_name.opName); |
| 2464 | - GE_CHK_RT_RET(aclrtMemcpy(kernel_name_arg_, sizeof(rtKernelLaunchNames_t), | 2464 | + GE_CHK_ACL_RET(aclrtMemcpy(kernel_name_arg_, sizeof(rtKernelLaunchNames_t), |
| 2465 | PtrToPtr<rtKernelLaunchNames_t, void>(&launch_name), sizeof(rtKernelLaunchNames_t), | 2465 | PtrToPtr<rtKernelLaunchNames_t, void>(&launch_name), sizeof(rtKernelLaunchNames_t), |
| 2466 | ACL_MEMCPY_HOST_TO_HOST)); | 2466 | ACL_MEMCPY_HOST_TO_HOST)); |
| 2467 | } else { | 2467 | } else { |
| @@ -26,7 +26,7 @@ | |||
| 26 | 26 | ||
| 27 | 27 | ||
| 28 | 28 | ||
| 29 | -#include "runtime/kernel.h" | 29 | +#include "rt_external_kernel.h" |
| 30 | 30 | ||
| 31 | 31 | ||
| 32 | 32 | ||
| @@ -806,7 +806,7 @@ Status SuperKernelV2TaskInfo::AssembleIoByArgsFormat() { | |||
| 806 | } | 806 | } |
| 807 | case AddrType::FFTS_ADDR: { | 807 | case AddrType::FFTS_ADDR: { |
| 808 | void *mode_addr_ptr = nullptr; | 808 | void *mode_addr_ptr = nullptr; |
| 809 | - GE_CHK_RT_RET(aclrtGetHardwareSyncAddr(&mode_addr_ptr)); | 809 | + GE_CHK_ACL_RET(aclrtGetHardwareSyncAddr(&mode_addr_ptr)); |
| 810 | l0_dump_list_.push_back(std::numeric_limits<uint64_t>::max()); // 占位 | 810 | l0_dump_list_.push_back(std::numeric_limits<uint64_t>::max()); // 占位 |
| 811 | AppendIoAddr(reinterpret_cast<uint64_t>(mode_addr_ptr), kAbsoluteMemType); | 811 | AppendIoAddr(reinterpret_cast<uint64_t>(mode_addr_ptr), kAbsoluteMemType); |
| 812 | break; | 812 | break; |
| @@ -54,7 +54,7 @@ Status UpdatePCTaskInfo::Distribute() { | |||
| 54 | taskUpdateInfo.val.aicAivTaskAttr.funcEntryAddr = reinterpret_cast<void *>(tiling_context_addr->tiling_key_addr); | 54 | taskUpdateInfo.val.aicAivTaskAttr.funcEntryAddr = reinterpret_cast<void *>(tiling_context_addr->tiling_key_addr); |
| 55 | taskUpdateInfo.val.aicAivTaskAttr.blockDimAddr = reinterpret_cast<uint64_t *>(tiling_context_addr->block_dim_addr); | 55 | taskUpdateInfo.val.aicAivTaskAttr.blockDimAddr = reinterpret_cast<uint64_t *>(tiling_context_addr->block_dim_addr); |
| 56 | 56 | ||
| 57 | - GE_CHK_RT_RET(aclrtTaskUpdateAsync(sink_task_info->stream, sink_task_info->task_id, &taskUpdateInfo, stream_)); | 57 | + GE_CHK_ACL_RET(aclrtTaskUpdateAsync(sink_task_info->stream, sink_task_info->task_id, &taskUpdateInfo, stream_)); |
| 58 | 58 | ||
| 59 | is_support_redistribute_ = true; | 59 | is_support_redistribute_ = true; |
| 60 | GELOGI("UpdatePCTaskInfo %s Distribute Success, stream: %p.", op_desc_->GetNamePtr(), stream_); | 60 | GELOGI("UpdatePCTaskInfo %s Distribute Success, stream: %p.", op_desc_->GetNamePtr(), stream_); |
| @@ -12,7 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | -#include "runtime/rt.h" | 15 | +#include "rt_external.h" |
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | namespace ge { | 18 | namespace ge { |
| @@ -28,7 +28,6 @@ class UpdatePCTaskInfo : public TaskInfo { | |||
| 28 | 28 | ||
| 29 | private: | 29 | private: |
| 30 | Status GetKernelHandle(void *&handle); | 30 | Status GetKernelHandle(void *&handle); |
| 31 | - rtMdlTaskUpdateInfo_t update_info_; | ||
| 32 | OpDescPtr op_desc_; | 31 | OpDescPtr op_desc_; |
| 33 | DavinciModel *davinci_model_{nullptr}; | 32 | DavinciModel *davinci_model_{nullptr}; |
| 34 | }; | 33 | }; |
| @@ -17,8 +17,8 @@ | |||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | -#include "runtime/rt.h" | 20 | +#include "rt_external.h" |
| 21 | -#include "runtime/rt_ffts_plus.h" | 21 | +#include "rt_external_ffts.h" |
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | 24 | ||
| @@ -13,7 +13,7 @@ | |||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | -#include "runtime/rt.h" | 16 | +#include "rt_external.h" |
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | 19 | ||
| @@ -18,7 +18,7 @@ | |||
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | -#include "runtime/rt.h" | 21 | +#include "rt_external.h" |
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | 24 | ||
| @@ -414,8 +414,8 @@ Status FftsPlusTaskInfo::Distribute() { | |||
| 414 | 414 | ||
| 415 | GE_CHK_RT_RET(ge::rtFftsPlusTaskLaunchWithFlag(&ffts_plus_task_info_, stream_, dump_flag_)); | 415 | GE_CHK_RT_RET(ge::rtFftsPlusTaskLaunchWithFlag(&ffts_plus_task_info_, stream_, dump_flag_)); |
| 416 | GE_CHECK_NOTNULL(davinci_model_); | 416 | GE_CHECK_NOTNULL(davinci_model_); |
| 417 | - GE_CHK_RT_RET(aclrtGetThreadLastTaskId(&task_id_)); | 417 | + GE_CHK_ACL_RET(aclrtGetThreadLastTaskId(&task_id_)); |
| 418 | - GE_CHK_RT_RET(aclrtStreamGetId(stream_, reinterpret_cast<int32_t*>(&stream_id_))); | 418 | + GE_CHK_ACL_RET(aclrtStreamGetId(stream_, reinterpret_cast<int32_t*>(&stream_id_))); |
| 419 | 419 | ||
| 420 | std::shared_ptr<TilingContextAddr> default_ctx_ptr = nullptr; | 420 | std::shared_ptr<TilingContextAddr> default_ctx_ptr = nullptr; |
| 421 | std::shared_ptr<TilingContextAddr> tiling_context_addr = | 421 | std::shared_ptr<TilingContextAddr> tiling_context_addr = |
| @@ -271,7 +271,7 @@ Status HcclTaskInfo::CreateStream(const int64_t stream_num, const int64_t main_s | |||
| 271 | davinci_model_->PushHcclStream(stream); | 271 | davinci_model_->PushHcclStream(stream); |
| 272 | 272 | ||
| 273 | // Create slave stream, inactive by default, activated by hccl | 273 | // Create slave stream, inactive by default, activated by hccl |
| 274 | - GE_CHK_RT_RET(aclmdlRIBindStream(davinci_model_->GetRtModelHandle(), stream, | 274 | + GE_CHK_ACL_RET(aclmdlRIBindStream(davinci_model_->GetRtModelHandle(), stream, |
| 275 | static_cast<uint32_t>(ACL_MODEL_STREAM_FLAG_DEFAULT))); | 275 | static_cast<uint32_t>(ACL_MODEL_STREAM_FLAG_DEFAULT))); |
| 276 | GELOGD("hccl_stream addr is=%p", stream); | 276 | GELOGD("hccl_stream addr is=%p", stream); |
| 277 | davinci_model_->SaveHcclFollowStream(main_stream_id, stream); | 277 | davinci_model_->SaveHcclFollowStream(main_stream_id, stream); |
| @@ -10,7 +10,7 @@ | |||
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | -#include "runtime/mem.h" | 13 | +#include "rt_external_mem.h" |
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | 16 | ||
| @@ -149,10 +149,10 @@ Status CmoAddrTaskInfo::Distribute() { | |||
| 149 | SetTaskTag(op_desc_->GetNamePtr()); | 149 | SetTaskTag(op_desc_->GetNamePtr()); |
| 150 | 150 | ||
| 151 | GE_CHK_RT_RET(rtCmoAddrTaskLaunch(args_, format_args_size_, cmo_op_code_, stream_, 0U)); | 151 | GE_CHK_RT_RET(rtCmoAddrTaskLaunch(args_, format_args_size_, cmo_op_code_, stream_, 0U)); |
| 152 | - GE_CHK_RT_RET(aclrtGetThreadLastTaskId(&task_id_)); | 152 | + GE_CHK_ACL_RET(aclrtGetThreadLastTaskId(&task_id_)); |
| 153 | - GE_CHK_RT_RET(aclrtStreamGetId(stream_, reinterpret_cast<int32_t*>(&stream_id_))); | 153 | + GE_CHK_ACL_RET(aclrtStreamGetId(stream_, reinterpret_cast<int32_t*>(&stream_id_))); |
| 154 | 154 | ||
| 155 | - GE_CHK_RT_RET(aclrtMemcpy(host_args_, format_args_size_, args_, format_args_size_, ACL_MEMCPY_DEVICE_TO_HOST)); | 155 | + GE_CHK_ACL_RET(aclrtMemcpy(host_args_, format_args_size_, args_, format_args_size_, ACL_MEMCPY_DEVICE_TO_HOST)); |
| 156 | uintptr_t host_addr = PtrToValue(host_args_); | 156 | uintptr_t host_addr = PtrToValue(host_args_); |
| 157 | for (const auto &iter : format_) { | 157 | for (const auto &iter : format_) { |
| 158 | if (iter.addr_type == AddrType::CUSTOM_VALUE) { | 158 | if (iter.addr_type == AddrType::CUSTOM_VALUE) { |
| @@ -41,8 +41,8 @@ Status EndGraphTaskInfo::Distribute() { | |||
| 41 | return RT_ERROR_TO_GE_STATUS(rt_ret); | 41 | return RT_ERROR_TO_GE_STATUS(rt_ret); |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | - GE_CHK_RT_RET(aclrtGetThreadLastTaskId(&task_id_)); | 44 | + GE_CHK_ACL_RET(aclrtGetThreadLastTaskId(&task_id_)); |
| 45 | - GE_CHK_RT_RET(aclrtStreamGetId(stream_, reinterpret_cast<int32_t*>(&stream_id_))); | 45 | + GE_CHK_ACL_RET(aclrtStreamGetId(stream_, reinterpret_cast<int32_t*>(&stream_id_))); |
| 46 | davinci_model_->SetEndGraphId(task_id_, stream_id_); | 46 | davinci_model_->SetEndGraphId(task_id_, stream_id_); |
| 47 | 47 | ||
| 48 | is_support_redistribute_ = true; | 48 | is_support_redistribute_ = true; |
| @@ -60,7 +60,7 @@ Status LabelGotoExTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *co | |||
| 60 | GE_ASSERT_NOTNULL(index_value_); | 60 | GE_ASSERT_NOTNULL(index_value_); |
| 61 | 61 | ||
| 62 | constexpr uint64_t branch_index = 0U; | 62 | constexpr uint64_t branch_index = 0U; |
| 63 | - GE_CHK_RT_RET(aclrtMemcpy(index_value_, sizeof(uint64_t), &branch_index, | 63 | + GE_CHK_ACL_RET(aclrtMemcpy(index_value_, sizeof(uint64_t), &branch_index, |
| 64 | sizeof(uint64_t), ACL_MEMCPY_HOST_TO_DEVICE)); | 64 | sizeof(uint64_t), ACL_MEMCPY_HOST_TO_DEVICE)); |
| 65 | 65 | ||
| 66 | GELOGI("LabelGotoExTaskInfo %s Init Success, label id:%u, logic stream id: %u, stream: %p.", | 66 | GELOGI("LabelGotoExTaskInfo %s Init Success, label id:%u, logic stream id: %u, stream: %p.", |
| @@ -10,7 +10,7 @@ | |||
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | -#include "runtime/mem.h" | 13 | +#include "rt_external_mem.h" |
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | 16 | ||
| @@ -146,7 +146,7 @@ Status MemcpyAddrAsyncTaskInfo::Distribute() { | |||
| 146 | GELOGE(RT_FAILED, "[Call][rtMemcpyAsyncWithCfg] failed, size:%" PRIu64 ", ret:%d", dst_max_, rt_ret); | 146 | GELOGE(RT_FAILED, "[Call][rtMemcpyAsyncWithCfg] failed, size:%" PRIu64 ", ret:%d", dst_max_, rt_ret); |
| 147 | return RT_ERROR_TO_GE_STATUS(rt_ret); | 147 | return RT_ERROR_TO_GE_STATUS(rt_ret); |
| 148 | } | 148 | } |
| 149 | - GE_CHK_RT_RET(aclrtMemcpy(host_args_aligned_, args_size_, ValueToPtr(device_args_aligned_), args_size_, | 149 | + GE_CHK_ACL_RET(aclrtMemcpy(host_args_aligned_, args_size_, ValueToPtr(device_args_aligned_), args_size_, |
| 150 | ACL_MEMCPY_DEVICE_TO_HOST)); | 150 | ACL_MEMCPY_DEVICE_TO_HOST)); |
| 151 | 151 | ||
| 152 | uintptr_t host_addr = PtrToValue(host_args_aligned_); | 152 | uintptr_t host_addr = PtrToValue(host_args_aligned_); |
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | -#include "runtime/mem.h" | 14 | +#include "rt_external_mem.h" |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| @@ -21,7 +21,8 @@ | |||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | -#include "runtime/rt_dfx.h" | 24 | +#include "common/ge_rts_decl.h" |
| 25 | + | ||
| 25 | 26 | ||
| 26 | 27 | ||
| 27 | namespace ge { | 28 | namespace ge { |
| @@ -276,7 +276,7 @@ Status TBEKernelHandle::FunctionRegister(const OpDescPtr &op_desc, const std::st | |||
| 276 | const void *const kernel_unique_ids_addr = bin_handle_store.GetUniqueIdPtr(bin_handle, kernel_name, inserted); | 276 | const void *const kernel_unique_ids_addr = bin_handle_store.GetUniqueIdPtr(bin_handle, kernel_name, inserted); |
| 277 | if (inserted) { | 277 | if (inserted) { |
| 278 | GE_CHK_RT_RET( | 278 | GE_CHK_RT_RET( |
| 279 | - rtFunctionRegister(bin_handle, kernel_unique_ids_addr, bin_handle_key.c_str(), kernel_name.c_str(), 0U)); | 279 | + rtFunctionRegister(bin_handle, kernel_unique_ids_addr, bin_handle_key.c_str(), kernel_name.c_str(), FUNC_MODE_NORMAL)); |
| 280 | } | 280 | } |
| 281 | 281 | ||
| 282 | uint64_t tiling_key = 0U; | 282 | uint64_t tiling_key = 0U; |
| @@ -17,7 +17,7 @@ | |||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | -#include "runtime/rt.h" | 20 | +#include "common/ge_rts_decl.h" |
| 21 | 21 | ||
| 22 | namespace ge { | 22 | namespace ge { |
| 23 | bool IsTbeTask(const OpDescPtr &op_desc); | 23 | bool IsTbeTask(const OpDescPtr &op_desc); |
| @@ -16,9 +16,9 @@ | |||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | -#include "runtime/base.h" | 19 | +#include "rt_external_base.h" |
| 20 | 20 | ||
| 21 | -#include "runtime/mem.h" | 21 | +#include "rt_external_mem.h" |
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | 24 | ||
| @@ -25,7 +25,7 @@ | |||
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | 27 | ||
| 28 | -#include "runtime/mem.h" | 28 | +#include "rt_external_mem.h" |
| 29 | 29 | ||
| 30 | 30 | ||
| 31 | 31 | ||
| @@ -410,7 +410,7 @@ void CachingAllocator::TryFreeBlocks() { | |||
| 410 | Status CachingAllocator::FreeBlocksAfterSynchronize(aclrtStream const stream) { | 410 | Status CachingAllocator::FreeBlocksAfterSynchronize(aclrtStream const stream) { |
| 411 | GELOGW("Stream synchronize and try free blocks! stream: %p.", stream); | 411 | GELOGW("Stream synchronize and try free blocks! stream: %p.", stream); |
| 412 | const std::lock_guard<std::recursive_mutex> lock(mutex_); | 412 | const std::lock_guard<std::recursive_mutex> lock(mutex_); |
| 413 | - GE_CHK_RT_RET(aclrtSynchronizeStream(stream)); | 413 | + GE_CHK_ACL_RET(aclrtSynchronizeStream(stream)); |
| 414 | (void)FreeCachedBlocks(); | 414 | (void)FreeCachedBlocks(); |
| 415 | PrintStatics(GeLogLevel::kEvent); | 415 | PrintStatics(GeLogLevel::kEvent); |
| 416 | return SUCCESS; | 416 | return SUCCESS; |
| @@ -18,7 +18,7 @@ | |||
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | -#include "runtime/mem.h" | 21 | +#include "rt_external_mem.h" |
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | namespace ge { | 24 | namespace ge { |
| @@ -98,7 +98,7 @@ Status MemoryAllocator::FreeMemory(void *memory_addr, const uint32_t device_id) | |||
| 98 | GELOGW("Can't Find block memory addr device_id = %u", device_id); | 98 | GELOGW("Can't Find block memory addr device_id = %u", device_id); |
| 99 | } | 99 | } |
| 100 | } | 100 | } |
| 101 | - GE_CHK_RT_RET(aclrtFree(memory_addr)); | 101 | + GE_CHK_ACL_RET(aclrtFree(memory_addr)); |
| 102 | memory_addr = nullptr; | 102 | memory_addr = nullptr; |
| 103 | return ge::SUCCESS; | 103 | return ge::SUCCESS; |
| 104 | } | 104 | } |
| @@ -19,7 +19,7 @@ | |||
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | -#include "runtime/mem.h" | 22 | +#include "rt_external_mem.h" |
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | namespace ge { | 25 | namespace ge { |
| @@ -16,7 +16,7 @@ | |||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | -#include "runtime/mem.h" | 19 | +#include "rt_external_mem.h" |
| 20 | 20 | ||
| 21 | namespace ge { | 21 | namespace ge { |
| 22 | class HostMemAllocator { | 22 | class HostMemAllocator { |
| @@ -15,7 +15,8 @@ | |||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | -#include "runtime/rt.h" | 18 | +#include "framework/common/debug/ge_log.h" |
| 19 | + | ||
| 19 | 20 | ||
| 20 | 21 | ||
| 21 | 22 | ||
| @@ -26,7 +27,7 @@ Status SharedMemAllocator::Allocate(SharedMemInfo &mem_info) { | |||
| 26 | GELOGD("SharedMemAllocator::Malloc host mem size= %zu for devid:[%u].", mem_info.mem_size, device_id); | 27 | GELOGD("SharedMemAllocator::Malloc host mem size= %zu for devid:[%u].", mem_info.mem_size, device_id); |
| 27 | 28 | ||
| 28 | const int32_t dev_id = static_cast<int32_t>(device_id); | 29 | const int32_t dev_id = static_cast<int32_t>(device_id); |
| 29 | - GE_CHK_RT_RET(aclrtSetDevice(dev_id)); | 30 | + GE_CHK_ACL_RET(aclrtSetDevice(dev_id)); |
| 30 | // DeviceReset before memory finished! | 31 | // DeviceReset before memory finished! |
| 31 | GE_MAKE_GUARD(not_used_var, [&dev_id]() { GE_CHK_RT(aclrtResetDevice(dev_id)); }); | 32 | GE_MAKE_GUARD(not_used_var, [&dev_id]() { GE_CHK_RT(aclrtResetDevice(dev_id)); }); |
| 32 | 33 | ||
| @@ -26,7 +26,7 @@ | |||
| 26 | 26 | ||
| 27 | 27 | ||
| 28 | 28 | ||
| 29 | -#include "runtime/mem.h" | 29 | +#include "rt_external_mem.h" |
| 30 | 30 | ||
| 31 | namespace ge { | 31 | namespace ge { |
| 32 | struct SharedMemInfo { | 32 | struct SharedMemInfo { |
| @@ -25,7 +25,7 @@ | |||
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | 27 | ||
| 28 | -#include "runtime/mem.h" | 28 | +#include "rt_external_mem.h" |
| 29 | 29 | ||
| 30 | 30 | ||
| 31 | 31 | ||
| @@ -15,7 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | -#include "runtime/dev.h" | 18 | +#include "rt_external_device.h" |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | 21 | ||
| @@ -93,7 +93,7 @@ Status RdmaPoolAllocator::InitMemory(const size_t mem_size) { | |||
| 93 | const std::string purpose = "Memory for rdma pool"; | 93 | const std::string purpose = "Memory for rdma pool"; |
| 94 | const std::lock_guard<std::recursive_mutex> lock(mutex_); | 94 | const std::lock_guard<std::recursive_mutex> lock(mutex_); |
| 95 | const int32_t dev_id = static_cast<int32_t>(device_id); | 95 | const int32_t dev_id = static_cast<int32_t>(device_id); |
| 96 | - GE_CHK_RT_RET(aclrtSetDevice(dev_id)); | 96 | + GE_CHK_ACL_RET(aclrtSetDevice(dev_id)); |
| 97 | // DeviceReset before memory finished! | 97 | // DeviceReset before memory finished! |
| 98 | GE_MAKE_GUARD(not_used_var, [&dev_id]() { GE_CHK_RT(aclrtResetDevice(dev_id)); }); | 98 | GE_MAKE_GUARD(not_used_var, [&dev_id]() { GE_CHK_RT(aclrtResetDevice(dev_id)); }); |
| 99 | 99 | ||
| @@ -18,7 +18,7 @@ | |||
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | -#include "runtime/mem.h" | 21 | +#include "rt_external_mem.h" |
| 22 | 22 | ||
| 23 | namespace ge { | 23 | namespace ge { |
| 24 | class RdmaPoolAllocator { | 24 | class RdmaPoolAllocator { |
| @@ -18,7 +18,7 @@ | |||
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | -#include "runtime/mem.h" | 21 | +#include "rt_external_mem.h" |
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | namespace ge { | 24 | namespace ge { |
| @@ -455,7 +455,7 @@ Status TransVarDataUtils::TransAllVarData(const std::vector<NodePtr> &variable_n | |||
| 455 | } | 455 | } |
| 456 | 456 | ||
| 457 | aclrtContext context = nullptr; | 457 | aclrtContext context = nullptr; |
| 458 | - GE_CHK_RT_RET(aclrtGetCurrentContext(&context)); | 458 | + GE_CHK_ACL_RET(aclrtGetCurrentContext(&context)); |
| 459 | 459 | ||
| 460 | ThreadPool executor("ge_vartrans", kDefaultVarTransThreadNum, true); | 460 | ThreadPool executor("ge_vartrans", kDefaultVarTransThreadNum, true); |
| 461 | std::vector<std::future<Status>> vector_future; | 461 | std::vector<std::future<Status>> vector_future; |
| @@ -18,7 +18,7 @@ | |||
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | -#include "runtime/context.h" | 21 | +#include "common/ge_rts_decl.h" |
| 22 | 22 | ||
| 23 | namespace ge { | 23 | namespace ge { |
| 24 | class TransVarDataUtils { | 24 | class TransVarDataUtils { |
| @@ -16,7 +16,7 @@ | |||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | -#include "runtime/rt.h" | 19 | +#include "rt_external.h" |
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | 22 | ||
| @@ -96,7 +96,7 @@ class TensorValue { | |||
| 96 | template<typename T> | 96 | template<typename T> |
| 97 | Status CopyScalarValueToHost(T &value) const { | 97 | Status CopyScalarValueToHost(T &value) const { |
| 98 | GE_CHECK_GE(this->GetSize(), sizeof(value)); | 98 | GE_CHECK_GE(this->GetSize(), sizeof(value)); |
| 99 | - GE_CHK_RT_RET(aclrtMemcpy(PtrToPtr<T, void>(&value), sizeof(value), this->GetData(), sizeof(value), | 99 | + GE_CHK_ACL_RET(aclrtMemcpy(PtrToPtr<T, void>(&value), sizeof(value), this->GetData(), sizeof(value), |
| 100 | ACL_MEMCPY_DEVICE_TO_HOST)); | 100 | ACL_MEMCPY_DEVICE_TO_HOST)); |
| 101 | return SUCCESS; | 101 | return SUCCESS; |
| 102 | } | 102 | } |
| @@ -88,13 +88,13 @@ Status GraphExecutionContext::Synchronize(const rtStream_t rt_stream) { | |||
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | if (rt_ret == ACL_ERROR_RT_STREAM_SYNC_TIMEOUT) { | 90 | if (rt_ret == ACL_ERROR_RT_STREAM_SYNC_TIMEOUT) { |
| 91 | - GELOGE(rt_ret, "[Invoke][rtStreamSynchronizeWithTimeout] failed, ret:%d.", rt_ret); | 91 | + GELOGE(rt_ret, "[Invoke][aclrtSynchronizeStreamWithTimeout] failed, ret:%d.", rt_ret); |
| 92 | - REPORT_INNER_ERR_MSG("E19999", "rtStreamSynchronizeWithTimeout failed, ret:%d.", rt_ret); | 92 | + REPORT_INNER_ERR_MSG("E19999", "aclrtSynchronizeStreamWithTimeout failed, ret:%d.", rt_ret); |
| 93 | return FAILED; | 93 | return FAILED; |
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | - GELOGE(RT_FAILED, "[Invoke][rtStreamSynchronizeWithTimeout] failed, ret = %d", rt_ret); | 96 | + GELOGE(RT_FAILED, "[Invoke][aclrtSynchronizeStreamWithTimeout] failed, ret = %d", rt_ret); |
| 97 | - REPORT_INNER_ERR_MSG("E19999", "invoke rtStreamSynchronizeWithTimeout failed, ret = %d", rt_ret); | 97 | + REPORT_INNER_ERR_MSG("E19999", "invoke aclrtSynchronizeStreamWithTimeout failed, ret = %d", rt_ret); |
| 98 | return RT_FAILED; | 98 | return RT_FAILED; |
| 99 | } | 99 | } |
| 100 | 100 | ||
| @@ -24,6 +24,7 @@ | |||
| 24 | 24 | ||
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | + | ||
| 27 | 28 | ||
| 28 | namespace ge { | 29 | namespace ge { |
| 29 | namespace hybrid { | 30 | namespace hybrid { |
| @@ -212,14 +213,14 @@ Status HybridModelAsyncExecutor::Init(const aclrtStream stream) { | |||
| 212 | if (default_stream_guarder.default_stream == nullptr) { | 213 | if (default_stream_guarder.default_stream == nullptr) { |
| 213 | GE_CHK_RT_RET(rtStreamCreateWithFlags(&default_stream_guarder.default_stream, | 214 | GE_CHK_RT_RET(rtStreamCreateWithFlags(&default_stream_guarder.default_stream, |
| 214 | static_cast<int32_t>(RT_STREAM_PRIORITY_DEFAULT), stream_flags)); | 215 | static_cast<int32_t>(RT_STREAM_PRIORITY_DEFAULT), stream_flags)); |
| 215 | - GE_CHK_RT_RET(aclrtSetStreamFailureMode(default_stream_guarder.default_stream, ACL_STOP_ON_FAILURE)); | 216 | + GE_CHK_ACL_RET(aclrtSetStreamFailureMode(default_stream_guarder.default_stream, ACL_STOP_ON_FAILURE)); |
| 216 | GELOGD("Create default stream=%p, device id = %u", default_stream_guarder.default_stream, device_id_); | 217 | GELOGD("Create default stream=%p, device id = %u", default_stream_guarder.default_stream, device_id_); |
| 217 | } | 218 | } |
| 218 | default_stream_guarder.stream_ref_count++; | 219 | default_stream_guarder.stream_ref_count++; |
| 219 | stream_ = default_stream_guarder.default_stream; | 220 | stream_ = default_stream_guarder.default_stream; |
| 220 | } else { | 221 | } else { |
| 221 | GE_CHK_RT_RET(rtStreamCreateWithFlags(&stream_, static_cast<int32_t>(RT_STREAM_PRIORITY_DEFAULT), stream_flags)); | 222 | GE_CHK_RT_RET(rtStreamCreateWithFlags(&stream_, static_cast<int32_t>(RT_STREAM_PRIORITY_DEFAULT), stream_flags)); |
| 222 | - GE_CHK_RT_RET(aclrtSetStreamFailureMode(stream_, ACL_STOP_ON_FAILURE)); | 223 | + GE_CHK_ACL_RET(aclrtSetStreamFailureMode(stream_, ACL_STOP_ON_FAILURE)); |
| 223 | GELOGD("Create stream=%p, device id = %u", stream_, device_id_); | 224 | GELOGD("Create stream=%p, device id = %u", stream_, device_id_); |
| 224 | owner_stream_ = true; | 225 | owner_stream_ = true; |
| 225 | } | 226 | } |
| @@ -232,7 +233,7 @@ Status HybridModelAsyncExecutor::Init(const aclrtStream stream) { | |||
| 232 | Status HybridModelAsyncExecutor::RunInternal() { | 233 | Status HybridModelAsyncExecutor::RunInternal() { |
| 233 | const auto device_id = static_cast<int32_t>(device_id_); | 234 | const auto device_id = static_cast<int32_t>(device_id_); |
| 234 | GELOGD("Hybrid model start. model_id = %u, device_id = %u", model_id_, device_id_); | 235 | GELOGD("Hybrid model start. model_id = %u, device_id = %u", model_id_, device_id_); |
| 235 | - GE_CHK_RT_RET(aclrtSetDevice(device_id)); | 236 | + GE_CHK_ACL_RET(aclrtSetDevice(device_id)); |
| 236 | // DeviceReset before thread run finished! | 237 | // DeviceReset before thread run finished! |
| 237 | GE_MAKE_GUARD(not_used_var, [&device_id] { GE_CHK_RT(aclrtResetDevice(device_id)); }); | 238 | GE_MAKE_GUARD(not_used_var, [&device_id] { GE_CHK_RT(aclrtResetDevice(device_id)); }); |
| 238 | 239 | ||
| @@ -57,7 +57,7 @@ Status HybridModelExecutor::SyncVarData() const { | |||
| 57 | if (global_step_var != nullptr) { | 57 | if (global_step_var != nullptr) { |
| 58 | std::vector<uint64_t> v_step; | 58 | std::vector<uint64_t> v_step; |
| 59 | v_step.push_back(iterator_count_); | 59 | v_step.push_back(iterator_count_); |
| 60 | - GE_CHK_RT_RET(aclrtMemcpy(global_step_var->MutableData(), global_step_var->GetSize(), | 60 | + GE_CHK_ACL_RET(aclrtMemcpy(global_step_var->MutableData(), global_step_var->GetSize(), |
| 61 | v_step.data(), v_step.size() * sizeof(uint64_t), ACL_MEMCPY_HOST_TO_DEVICE)); | 61 | v_step.data(), v_step.size() * sizeof(uint64_t), ACL_MEMCPY_HOST_TO_DEVICE)); |
| 62 | } else { | 62 | } else { |
| 63 | GELOGD("No GLOBAL_STEP variable was found."); | 63 | GELOGD("No GLOBAL_STEP variable was found."); |
| @@ -148,7 +148,7 @@ Status HybridModelExecutor::CopyDataToExecutArgs(const int64_t tensor_size, Hybr | |||
| 148 | args.inputs[input_index].GetData(), | 148 | args.inputs[input_index].GetData(), |
| 149 | mem_size, | 149 | mem_size, |
| 150 | data_buf.length); | 150 | data_buf.length); |
| 151 | - GE_CHK_RT_RET(aclrtMemcpy(args.inputs[input_index].MutableData(), mem_size, data_buf.data, | 151 | + GE_CHK_ACL_RET(aclrtMemcpy(args.inputs[input_index].MutableData(), mem_size, data_buf.data, |
| 152 | data_buf.length, ACL_MEMCPY_HOST_TO_DEVICE)); | 152 | data_buf.length, ACL_MEMCPY_HOST_TO_DEVICE)); |
| 153 | } | 153 | } |
| 154 | return SUCCESS; | 154 | return SUCCESS; |
| @@ -288,7 +288,7 @@ Status HybridModelExecutor::CopyOutputs(HybridModelExecutor::ExecuteArgs &args, | |||
| 288 | GE_CHECK_NOTNULL(aligned_ptr); | 288 | GE_CHECK_NOTNULL(aligned_ptr); |
| 289 | auto data_buf = aligned_ptr->MutableGet(); | 289 | auto data_buf = aligned_ptr->MutableGet(); |
| 290 | GE_CHECK_NOTNULL(data_buf); | 290 | GE_CHECK_NOTNULL(data_buf); |
| 291 | - GE_CHK_RT_RET(aclrtMemcpy(data_buf, static_cast<uint64_t>(output_size), output_tensor.GetData(), | 291 | + GE_CHK_ACL_RET(aclrtMemcpy(data_buf, static_cast<uint64_t>(output_size), output_tensor.GetData(), |
| 292 | static_cast<uint64_t>(output_size), ACL_MEMCPY_DEVICE_TO_HOST)); | 292 | static_cast<uint64_t>(output_size), ACL_MEMCPY_DEVICE_TO_HOST)); |
| 293 | GeTensor ge_tensor(ge_tensor_desc); | 293 | GeTensor ge_tensor(ge_tensor_desc); |
| 294 | ge_tensor.SetData(aligned_ptr, static_cast<size_t>(output_size)); | 294 | ge_tensor.SetData(aligned_ptr, static_cast<size_t>(output_size)); |
| @@ -365,7 +365,7 @@ Status HybridModelExecutor::CopyOutputs(const std::vector<gert::Tensor> &executo | |||
| 365 | GE_CHECK_NOTNULL(aligned_ptr); | 365 | GE_CHECK_NOTNULL(aligned_ptr); |
| 366 | auto data_buf = aligned_ptr->MutableGet(); | 366 | auto data_buf = aligned_ptr->MutableGet(); |
| 367 | GE_CHECK_NOTNULL(data_buf); | 367 | GE_CHECK_NOTNULL(data_buf); |
| 368 | - GE_CHK_RT_RET(aclrtMemcpy(data_buf, static_cast<uint64_t>(output_size), arg_output.GetAddr(), | 368 | + GE_CHK_ACL_RET(aclrtMemcpy(data_buf, static_cast<uint64_t>(output_size), arg_output.GetAddr(), |
| 369 | static_cast<uint64_t>(output_size), ACL_MEMCPY_DEVICE_TO_HOST)); | 369 | static_cast<uint64_t>(output_size), ACL_MEMCPY_DEVICE_TO_HOST)); |
| 370 | GeTensor ge_tensor; | 370 | GeTensor ge_tensor; |
| 371 | ge_tensor.SetData(aligned_ptr, static_cast<size_t>(output_size)); | 371 | ge_tensor.SetData(aligned_ptr, static_cast<size_t>(output_size)); |
| @@ -47,8 +47,8 @@ Status StageExecutor::Init() { | |||
| 47 | GELOGD("[Executor: %d] Start to init StateExecutor", id_); | 47 | GELOGD("[Executor: %d] Start to init StateExecutor", id_); |
| 48 | context_.rt_context = pipe_config_->rt_context; | 48 | context_.rt_context = pipe_config_->rt_context; |
| 49 | GE_CHK_STATUS_RET_NOLOG(InitExecutionContext()); | 49 | GE_CHK_STATUS_RET_NOLOG(InitExecutionContext()); |
| 50 | - GE_CHK_RT_RET(aclrtCreateStream(&stream_)); | 50 | + GE_CHK_ACL_RET(aclrtCreateStream(&stream_)); |
| 51 | - GE_CHK_RT_RET(aclrtCreateStream(&hccl_stream_)); | 51 | + GE_CHK_ACL_RET(aclrtCreateStream(&hccl_stream_)); |
| 52 | context_.stream = stream_; | 52 | context_.stream = stream_; |
| 53 | context_.hccl_stream = hccl_stream_; | 53 | context_.hccl_stream = hccl_stream_; |
| 54 | 54 | ||
| @@ -90,7 +90,7 @@ void StageExecutor::ExecuteEndTaskAndReleae() { | |||
| 90 | Status StageExecutor::Start(const std::vector<TensorValue> &inputs, const std::vector<ConstGeTensorDescPtr> &input_desc, | 90 | Status StageExecutor::Start(const std::vector<TensorValue> &inputs, const std::vector<ConstGeTensorDescPtr> &input_desc, |
| 91 | const int32_t iteration_count) { | 91 | const int32_t iteration_count) { |
| 92 | GELOGD("[Executor: %d] thread start", id_); | 92 | GELOGD("[Executor: %d] thread start", id_); |
| 93 | - GE_CHK_RT_RET(aclrtSetCurrentContext(context_.rt_context)); | 93 | + GE_CHK_ACL_RET(aclrtSetCurrentContext(context_.rt_context)); |
| 94 | int32_t num_loops = iteration_count / pipe_config_->num_executors; | 94 | int32_t num_loops = iteration_count / pipe_config_->num_executors; |
| 95 | if (id_ < (iteration_count % iteration_count)) { | 95 | if (id_ < (iteration_count % iteration_count)) { |
| 96 | num_loops += 1; | 96 | num_loops += 1; |
| @@ -119,7 +119,7 @@ Status StageExecutor::Start(const std::vector<TensorValue> &inputs, const std::v | |||
| 119 | 119 | ||
| 120 | if (task_info.event != nullptr) { | 120 | if (task_info.event != nullptr) { |
| 121 | GELOGD("[%d] Add StreamWaitEvent", id_); | 121 | GELOGD("[%d] Add StreamWaitEvent", id_); |
| 122 | - GE_CHK_RT_RET(aclrtStreamWaitEvent(stream_, task_info.event)); | 122 | + GE_CHK_ACL_RET(aclrtStreamWaitEvent(stream_, task_info.event)); |
| 123 | RECORD_MODEL_EXECUTION_EVENT(&context_, "[iteration = %ld] [Stage = %d] EventWait End", task_info.iteration, | 123 | RECORD_MODEL_EXECUTION_EVENT(&context_, "[iteration = %ld] [Stage = %d] EventWait End", task_info.iteration, |
| 124 | task_info.stage); | 124 | task_info.stage); |
| 125 | } | 125 | } |
| @@ -152,8 +152,8 @@ Status StageExecutor::Start(const std::vector<TensorValue> &inputs, const std::v | |||
| 152 | } | 152 | } |
| 153 | }); | 153 | }); |
| 154 | if (((task_info.iteration + 1) % iteration_count) > 0) { | 154 | if (((task_info.iteration + 1) % iteration_count) > 0) { |
| 155 | - GE_CHK_RT_RET(aclrtCreateEvent(&next_task.event)); | 155 | + GE_CHK_ACL_RET(aclrtCreateEvent(&next_task.event)); |
| 156 | - GE_CHK_RT_RET(aclrtRecordEvent(next_task.event, context_.hccl_stream)); | 156 | + GE_CHK_ACL_RET(aclrtRecordEvent(next_task.event, context_.hccl_stream)); |
| 157 | } | 157 | } |
| 158 | 158 | ||
| 159 | const auto sync_result = Synchronize(); | 159 | const auto sync_result = Synchronize(); |
| @@ -170,7 +170,7 @@ Status StageExecutor::Start(const std::vector<TensorValue> &inputs, const std::v | |||
| 170 | } | 170 | } |
| 171 | stage_subject_->Release(task_info.stage); | 171 | stage_subject_->Release(task_info.stage); |
| 172 | if (task_info.event != nullptr) { | 172 | if (task_info.event != nullptr) { |
| 173 | - GE_CHK_RT_RET(aclrtDestroyEvent(task_info.event)); | 173 | + GE_CHK_ACL_RET(aclrtDestroyEvent(task_info.event)); |
| 174 | RECORD_MODEL_EXECUTION_EVENT(&context_, "[iteration = %ld] [Stage = %d] EventDestroy End", task_info.iteration, | 174 | RECORD_MODEL_EXECUTION_EVENT(&context_, "[iteration = %ld] [Stage = %d] EventDestroy End", task_info.iteration, |
| 175 | task_info.stage); | 175 | task_info.stage); |
| 176 | } | 176 | } |
| @@ -255,7 +255,7 @@ HybridModelPipelineExecutor::HybridModelPipelineExecutor(HybridModel *const mode | |||
| 255 | } | 255 | } |
| 256 | 256 | ||
| 257 | Status StageExecutor::InitExecutionContext() { | 257 | Status StageExecutor::InitExecutionContext() { |
| 258 | - GE_CHK_RT_RET(aclrtSetCurrentContext(context_.rt_context)); | 258 | + GE_CHK_ACL_RET(aclrtSetCurrentContext(context_.rt_context)); |
| 259 | 259 | ||
| 260 | context_.model = model_; | 260 | context_.model = model_; |
| 261 | context_.session_id = ::ge::GetContext().SessionId(); | 261 | context_.session_id = ::ge::GetContext().SessionId(); |
| @@ -296,7 +296,7 @@ Status HybridModelPipelineExecutor::Init(CallbackManager *const callback_manager | |||
| 296 | GE_CHK_STATUS_RET_NOLOG(context_.InitProfiler()); | 296 | GE_CHK_STATUS_RET_NOLOG(context_.InitProfiler()); |
| 297 | model_id_ = model_->GetModelId(); | 297 | model_id_ = model_->GetModelId(); |
| 298 | GELOGD("Number of stages = %d, number of executors = %d", config_.num_stages, config_.num_executors); | 298 | GELOGD("Number of stages = %d, number of executors = %d", config_.num_stages, config_.num_executors); |
| 299 | - GE_CHK_RT_RET(aclrtGetCurrentContext(&config_.rt_context)); | 299 | + GE_CHK_ACL_RET(aclrtGetCurrentContext(&config_.rt_context)); |
| 300 | GE_CHK_STATUS_RET_NOLOG(InitStageExecutors()); | 300 | GE_CHK_STATUS_RET_NOLOG(InitStageExecutors()); |
| 301 | GE_CHK_STATUS_RET(InitInputDesc(), "[Init][InputDesc] failed, model_id:%u.", model_->GetModelId()); | 301 | GE_CHK_STATUS_RET(InitInputDesc(), "[Init][InputDesc] failed, model_id:%u.", model_->GetModelId()); |
| 302 | return SUCCESS; | 302 | return SUCCESS; |
| @@ -222,7 +222,7 @@ Status HybridModelRtV1Executor::Execute(ExecuteArgs &args) { | |||
| 222 | // In heterogeneous executor, gloabl_step is updated by markStep task | 222 | // In heterogeneous executor, gloabl_step is updated by markStep task |
| 223 | if (!ExecutionRuntimeUtils::IsInHeterogeneousExecutor()) { | 223 | if (!ExecutionRuntimeUtils::IsInHeterogeneousExecutor()) { |
| 224 | if (context_.global_step != nullptr) { | 224 | if (context_.global_step != nullptr) { |
| 225 | - GE_CHK_RT_RET(aclrtMemcpyAsync(context_.global_step, sizeof(uint64_t), &context_.iteration, | 225 | + GE_CHK_ACL_RET(aclrtMemcpyAsync(context_.global_step, sizeof(uint64_t), &context_.iteration, |
| 226 | sizeof(uint64_t), ACL_MEMCPY_HOST_TO_BUF_TO_DEVICE, context_.stream)); | 226 | sizeof(uint64_t), ACL_MEMCPY_HOST_TO_BUF_TO_DEVICE, context_.stream)); |
| 227 | } | 227 | } |
| 228 | } | 228 | } |
| @@ -286,8 +286,8 @@ Status HybridModelRtV1Executor::Cleanup() { | |||
| 286 | } | 286 | } |
| 287 | 287 | ||
| 288 | Status HybridModelRtV1Executor::InitExecutionContext(CallbackManager *const callback_manager) { | 288 | Status HybridModelRtV1Executor::InitExecutionContext(CallbackManager *const callback_manager) { |
| 289 | - GE_CHK_RT_RET(aclrtGetCurrentContext(&context_.rt_context)); | 289 | + GE_CHK_ACL_RET(aclrtGetCurrentContext(&context_.rt_context)); |
| 290 | - GE_CHK_RT_RET(aclrtSetCurrentContext(context_.rt_context)); | 290 | + GE_CHK_ACL_RET(aclrtSetCurrentContext(context_.rt_context)); |
| 291 | 291 | ||
| 292 | context_.is_host_cpu = ::ge::GetContext().GetHostExecFlag(); | 292 | context_.is_host_cpu = ::ge::GetContext().GetHostExecFlag(); |
| 293 | context_.global_step = model_->GetGlobalStep(); | 293 | context_.global_step = model_->GetGlobalStep(); |
| @@ -135,9 +135,9 @@ ge::Status DoRtStreamSyncWithTimeout(aclrtStream stream) { | |||
| 135 | auto timeout = ge::GetContext().StreamSyncTimeout(); | 135 | auto timeout = ge::GetContext().StreamSyncTimeout(); |
| 136 | auto rt_ret = aclrtSynchronizeStreamWithTimeout(stream, timeout); | 136 | auto rt_ret = aclrtSynchronizeStreamWithTimeout(stream, timeout); |
| 137 | if (rt_ret == ACL_ERROR_RT_STREAM_SYNC_TIMEOUT) { | 137 | if (rt_ret == ACL_ERROR_RT_STREAM_SYNC_TIMEOUT) { |
| 138 | - GELOGE(rt_ret, "[Invoke][rtStreamSynchronizeWithTimeout] failed, stream synchronize timeout:%d, ret:%d.", timeout, | 138 | + GELOGE(rt_ret, "[Invoke][aclrtSynchronizeStreamWithTimeout] failed, stream synchronize timeout:%d, ret:%d.", timeout, |
| 139 | rt_ret); | 139 | rt_ret); |
| 140 | - REPORT_INNER_ERR_MSG("E19999", "rtStreamSynchronizeWithTimeout failed, stream synchronize timeout:%d, ret:%d.", | 140 | + REPORT_INNER_ERR_MSG("E19999", "aclrtSynchronizeStreamWithTimeout failed, stream synchronize timeout:%d, ret:%d.", |
| 141 | timeout, rt_ret); | 141 | timeout, rt_ret); |
| 142 | return ge::FAILED; | 142 | return ge::FAILED; |
| 143 | } else if (rt_ret == ACL_ERROR_RT_END_OF_SEQUENCE) { | 143 | } else if (rt_ret == ACL_ERROR_RT_END_OF_SEQUENCE) { |
| @@ -343,7 +343,7 @@ Status GraphVarVisitor::AssembleDeviceSharedConstants(const vector<ge::NodePtr> | |||
| 343 | Status GraphVarVisitor::CopySharedConstant(const std::shared_ptr<ge::VarManager> &var_manager, uint32_t device_id, | 343 | Status GraphVarVisitor::CopySharedConstant(const std::shared_ptr<ge::VarManager> &var_manager, uint32_t device_id, |
| 344 | const std::vector<SharedConstantCopyHelper> &helpers) const { | 344 | const std::vector<SharedConstantCopyHelper> &helpers) const { |
| 345 | // every thread needs to aclrtSetDevice | 345 | // every thread needs to aclrtSetDevice |
| 346 | - GE_CHK_RT_RET(aclrtSetDevice(static_cast<int32_t>(device_id))); | 346 | + GE_CHK_ACL_RET(aclrtSetDevice(static_cast<int32_t>(device_id))); |
| 347 | GE_MAKE_GUARD(reset_device, [device_id]() { | 347 | GE_MAKE_GUARD(reset_device, [device_id]() { |
| 348 | GE_CHK_RT(aclrtResetDevice(static_cast<int32_t>(device_id))); | 348 | GE_CHK_RT(aclrtResetDevice(static_cast<int32_t>(device_id))); |
| 349 | }); | 349 | }); |
| @@ -509,7 +509,7 @@ Status GraphVarVisitor::PreLoadFileConstant(const ge::OpDescPtr &op_desc, const | |||
| 509 | Status GraphVarVisitor::LoadFileConstantToDevice(const ExternalWeightManagerPtr &manager, const uint32_t device_id, | 509 | Status GraphVarVisitor::LoadFileConstantToDevice(const ExternalWeightManagerPtr &manager, const uint32_t device_id, |
| 510 | std::vector<H2DCopyHelper> &node_infos) const { | 510 | std::vector<H2DCopyHelper> &node_infos) const { |
| 511 | // every thread needs to aclrtSetDevice | 511 | // every thread needs to aclrtSetDevice |
| 512 | - GE_CHK_RT_RET(aclrtSetDevice(static_cast<int32_t>(device_id))); | 512 | + GE_CHK_ACL_RET(aclrtSetDevice(static_cast<int32_t>(device_id))); |
| 513 | GE_MAKE_GUARD(reset_device, [device_id]() { | 513 | GE_MAKE_GUARD(reset_device, [device_id]() { |
| 514 | GE_CHK_RT(aclrtResetDevice(static_cast<int32_t>(device_id))); | 514 | GE_CHK_RT(aclrtResetDevice(static_cast<int32_t>(device_id))); |
| 515 | }); | 515 | }); |
| @@ -1076,7 +1076,7 @@ Status HybridModelRtV2Executor::TryUpdateStreamCoreLimits(const aclrtStream stre | |||
| 1076 | if (!run_ctx_.aicore_num_str_.empty()) { | 1076 | if (!run_ctx_.aicore_num_str_.empty()) { |
| 1077 | GE_CHK_STATUS_RET(CoreNumUtils::ParseAndValidateCoreNum(ge::GetContext().GetReadableName(AICORE_NUM), run_ctx_.aicore_num_str_, 0, INT32_MAX, aicore_num)); | 1077 | GE_CHK_STATUS_RET(CoreNumUtils::ParseAndValidateCoreNum(ge::GetContext().GetReadableName(AICORE_NUM), run_ctx_.aicore_num_str_, 0, INT32_MAX, aicore_num)); |
| 1078 | if (aicore_num > 0) { | 1078 | if (aicore_num > 0) { |
| 1079 | - GE_CHK_RT_RET(aclrtSetStreamResLimit(stream, ACL_RT_DEV_RES_CUBE_CORE, static_cast<uint32_t>(aicore_num))); | 1079 | + GE_CHK_ACL_RET(aclrtSetStreamResLimit(stream, ACL_RT_DEV_RES_CUBE_CORE, static_cast<uint32_t>(aicore_num))); |
| 1080 | update_stream_core_num = true; | 1080 | update_stream_core_num = true; |
| 1081 | } | 1081 | } |
| 1082 | } | 1082 | } |
| @@ -1084,13 +1084,13 @@ Status HybridModelRtV2Executor::TryUpdateStreamCoreLimits(const aclrtStream stre | |||
| 1084 | if (!run_ctx_.vectorcore_num_str_.empty()) { | 1084 | if (!run_ctx_.vectorcore_num_str_.empty()) { |
| 1085 | GE_CHK_STATUS_RET(CoreNumUtils::ParseAndValidateCoreNum(ge::GetContext().GetReadableName(kVectorcoreNum), run_ctx_.vectorcore_num_str_, 0, INT32_MAX, vectorcore_num)); | 1085 | GE_CHK_STATUS_RET(CoreNumUtils::ParseAndValidateCoreNum(ge::GetContext().GetReadableName(kVectorcoreNum), run_ctx_.vectorcore_num_str_, 0, INT32_MAX, vectorcore_num)); |
| 1086 | if (vectorcore_num > 0) { | 1086 | if (vectorcore_num > 0) { |
| 1087 | - GE_CHK_RT_RET(aclrtSetStreamResLimit(stream, ACL_RT_DEV_RES_VECTOR_CORE, static_cast<uint32_t>(vectorcore_num))); | 1087 | + GE_CHK_ACL_RET(aclrtSetStreamResLimit(stream, ACL_RT_DEV_RES_VECTOR_CORE, static_cast<uint32_t>(vectorcore_num))); |
| 1088 | update_stream_core_num = true; | 1088 | update_stream_core_num = true; |
| 1089 | } | 1089 | } |
| 1090 | } | 1090 | } |
| 1091 | 1091 | ||
| 1092 | if (update_stream_core_num) { | 1092 | if (update_stream_core_num) { |
| 1093 | - GE_CHK_RT_RET(aclrtUseStreamResInCurrentThread(stream)); | 1093 | + GE_CHK_ACL_RET(aclrtUseStreamResInCurrentThread(stream)); |
| 1094 | GELOGI("Bind stream resource limit in caller thread success, configured(cube=%d, vector=%d).", | 1094 | GELOGI("Bind stream resource limit in caller thread success, configured(cube=%d, vector=%d).", |
| 1095 | aicore_num, vectorcore_num); | 1095 | aicore_num, vectorcore_num); |
| 1096 | } | 1096 | } |
| @@ -1307,7 +1307,7 @@ Status HybridModelRtV2Executor::Execute(const InputData &input_data, ExecuteArgs | |||
| 1307 | int32_t cur_device_id = -1; | 1307 | int32_t cur_device_id = -1; |
| 1308 | if (run_ctx_.enable_input_batch_cpy_) { | 1308 | if (run_ctx_.enable_input_batch_cpy_) { |
| 1309 | ResetMemcpyBatchParams(); | 1309 | ResetMemcpyBatchParams(); |
| 1310 | - GE_CHK_RT_RET(aclrtGetDevice(&cur_device_id)); | 1310 | + GE_CHK_ACL_RET(aclrtGetDevice(&cur_device_id)); |
| 1311 | } | 1311 | } |
| 1312 | size_t idx = 0; | 1312 | size_t idx = 0; |
| 1313 | for (size_t i = 0U; i < num_inputs_; ++i) { | 1313 | for (size_t i = 0U; i < num_inputs_; ++i) { |
| @@ -1453,7 +1453,7 @@ Status HybridModelRtV2Executor::Execute(const std::vector<gert::Tensor> &inputs, | |||
| 1453 | int32_t cur_device_id = -1; | 1453 | int32_t cur_device_id = -1; |
| 1454 | if (run_ctx_.enable_input_batch_cpy_) { | 1454 | if (run_ctx_.enable_input_batch_cpy_) { |
| 1455 | ResetMemcpyBatchParams(); | 1455 | ResetMemcpyBatchParams(); |
| 1456 | - GE_CHK_RT_RET(aclrtGetDevice(&cur_device_id)); | 1456 | + GE_CHK_ACL_RET(aclrtGetDevice(&cur_device_id)); |
| 1457 | } | 1457 | } |
| 1458 | size_t idx = 0; | 1458 | size_t idx = 0; |
| 1459 | for (size_t i = 0U; i < num_inputs_; ++i) { | 1459 | for (size_t i = 0U; i < num_inputs_; ++i) { |
| @@ -11,8 +11,8 @@ | |||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | -#include "runtime/base.h" | 14 | +#include "rt_external_base.h" |
| 15 | -#include "runtime/dev.h" | 15 | +#include "rt_external_device.h" |
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | namespace ge { | 18 | namespace ge { |
| @@ -33,7 +33,7 @@ Status RtCallbackManager::RegisterCallback(const rtStream_t stream, | |||
| 33 | GELOGD("To register callback"); | 33 | GELOGD("To register callback"); |
| 34 | aclrtEvent event = nullptr; | 34 | aclrtEvent event = nullptr; |
| 35 | GE_PROFILING_START(kRtEventCreateRecord); | 35 | GE_PROFILING_START(kRtEventCreateRecord); |
| 36 | - GE_CHK_RT_RET(aclrtCreateEventWithFlag(&event, ACL_EVENT_CAPTURE_STREAM_PROGRESS)); | 36 | + GE_CHK_ACL_RET(aclrtCreateEventWithFlag(&event, ACL_EVENT_CAPTURE_STREAM_PROGRESS)); |
| 37 | const auto rt_ret = aclrtRecordEvent(event, stream); | 37 | const auto rt_ret = aclrtRecordEvent(event, stream); |
| 38 | GE_PROFILING_END(gert::profiling::kUnknownName, gert::profiling::kRtEventCreateRecord, kRtEventCreateRecord); | 38 | GE_PROFILING_END(gert::profiling::kUnknownName, gert::profiling::kRtEventCreateRecord, kRtEventCreateRecord); |
| 39 | if (rt_ret != ACL_SUCCESS) { | 39 | if (rt_ret != ACL_SUCCESS) { |
| @@ -56,7 +56,7 @@ Status RtCallbackManager::RegisterCallback(const rtStream_t stream, | |||
| 56 | 56 | ||
| 57 | Status RtCallbackManager::Init() { | 57 | Status RtCallbackManager::Init() { |
| 58 | aclrtContext ctx = nullptr; | 58 | aclrtContext ctx = nullptr; |
| 59 | - GE_CHK_RT_RET(aclrtGetCurrentContext(&ctx)); | 59 | + GE_CHK_ACL_RET(aclrtGetCurrentContext(&ctx)); |
| 60 | ret_future_ = std::async(std::launch::async, [this](const aclrtContext context, | 60 | ret_future_ = std::async(std::launch::async, [this](const aclrtContext context, |
| 61 | const struct error_message::ErrorManagerContext &error_context) ->Status { | 61 | const struct error_message::ErrorManagerContext &error_context) ->Status { |
| 62 | error_message::SetErrMgrContext(error_context); | 62 | error_message::SetErrMgrContext(error_context); |
| @@ -72,7 +72,7 @@ Status RtCallbackManager::Init() { | |||
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | Status RtCallbackManager::CallbackProcess(const aclrtContext context) { | 74 | Status RtCallbackManager::CallbackProcess(const aclrtContext context) { |
| 75 | - GE_CHK_RT_RET(aclrtSetCurrentContext(context)); | 75 | + GE_CHK_ACL_RET(aclrtSetCurrentContext(context)); |
| 76 | std::pair<aclrtEvent, std::pair<rtCallback_t, void *>> entry; | 76 | std::pair<aclrtEvent, std::pair<rtCallback_t, void *>> entry; |
| 77 | bool rt_timeout = false; | 77 | bool rt_timeout = false; |
| 78 | while (true) { | 78 | while (true) { |
| @@ -18,7 +18,8 @@ | |||
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | -#include "runtime/rt.h" | 21 | +#include "rt_external.h" |
| 22 | + | ||
| 22 | 23 | ||
| 23 | namespace ge { | 24 | namespace ge { |
| 24 | namespace hybrid { | 25 | namespace hybrid { |
| @@ -446,7 +446,7 @@ Status SubgraphExecutor::InitCallback(NodeState *const node_state, std::function | |||
| 446 | 446 | ||
| 447 | Status SubgraphExecutor::PrepareForExecution(const GraphExecutionContext *const ctx, NodeState &node_state) const { | 447 | Status SubgraphExecutor::PrepareForExecution(const GraphExecutionContext *const ctx, NodeState &node_state) const { |
| 448 | const auto &task = node_state.GetKernelTask(); // checked not null outside | 448 | const auto &task = node_state.GetKernelTask(); // checked not null outside |
| 449 | - GE_CHK_RT_RET(aclrtSetCurrentContext(ctx->rt_context)); | 449 | + GE_CHK_ACL_RET(aclrtSetCurrentContext(ctx->rt_context)); |
| 450 | auto &node_item = node_state.GetNodeItem(); | 450 | auto &node_item = node_state.GetNodeItem(); |
| 451 | if (node_item.IsNoOp()) { | 451 | if (node_item.IsNoOp()) { |
| 452 | GELOGD("[%s] Skipping tiling and selectbin for op with empty outputs.", node_state.GetName().c_str()); | 452 | GELOGD("[%s] Skipping tiling and selectbin for op with empty outputs.", node_state.GetName().c_str()); |
| @@ -96,7 +96,7 @@ Status NodeDoneCallback::PrepareConstInputs(const NodeItem &node_item) const { | |||
| 96 | GELOGD("[%s] To cache output[%d] to host, size = %zu", node_item.NodeName().c_str(), | 96 | GELOGD("[%s] To cache output[%d] to host, size = %zu", node_item.NodeName().c_str(), |
| 97 | output_idx, output_tensor->GetSize()); | 97 | output_idx, output_tensor->GetSize()); |
| 98 | if (tensor_size > 0) { | 98 | if (tensor_size > 0) { |
| 99 | - GE_CHK_RT_RET(aclrtMemcpy(host_buffer.data(), static_cast<uint64_t>(tensor_size), | 99 | + GE_CHK_ACL_RET(aclrtMemcpy(host_buffer.data(), static_cast<uint64_t>(tensor_size), |
| 100 | output_tensor->GetData(), static_cast<uint64_t>(tensor_size), ACL_MEMCPY_DEVICE_TO_HOST)); | 100 | output_tensor->GetData(), static_cast<uint64_t>(tensor_size), ACL_MEMCPY_DEVICE_TO_HOST)); |
| 101 | } | 101 | } |
| 102 | (void)ge_tensor->SetData(std::move(host_buffer)); | 102 | (void)ge_tensor->SetData(std::move(host_buffer)); |
| @@ -194,13 +194,13 @@ Status NodeDoneCallback::DumpDynamicNode() { | |||
| 194 | : kDefaultTimeOut; | 194 | : kDefaultTimeOut; |
| 195 | const auto rt_ret = aclrtSynchronizeStreamWithTimeout(stream, timeout); | 195 | const auto rt_ret = aclrtSynchronizeStreamWithTimeout(stream, timeout); |
| 196 | if (rt_ret == ACL_ERROR_RT_STREAM_SYNC_TIMEOUT) { | 196 | if (rt_ret == ACL_ERROR_RT_STREAM_SYNC_TIMEOUT) { |
| 197 | - GELOGE(rt_ret, "[Invoke][rtStreamSynchronizeWithTimeout] failed, ret:%d.", rt_ret); | 197 | + GELOGE(rt_ret, "[Invoke][aclrtSynchronizeStreamWithTimeout] failed, ret:%d.", rt_ret); |
| 198 | - REPORT_INNER_ERR_MSG("E19999", "rtStreamSynchronizeWithTimeout failed, ret:%d.", rt_ret); | 198 | + REPORT_INNER_ERR_MSG("E19999", "aclrtSynchronizeStreamWithTimeout failed, ret:%d.", rt_ret); |
| 199 | return FAILED; | 199 | return FAILED; |
| 200 | } | 200 | } |
| 201 | if (rt_ret != RT_ERROR_NONE) { | 201 | if (rt_ret != RT_ERROR_NONE) { |
| 202 | GELOGE(RT_FAILED, "[Call][RtStreamSynchronize] failed, ret = %d.", rt_ret); | 202 | GELOGE(RT_FAILED, "[Call][RtStreamSynchronize] failed, ret = %d.", rt_ret); |
| 203 | - REPORT_INNER_ERR_MSG("E19999", "call rtStreamSynchronize failed, ret = %d.", rt_ret); | 203 | + REPORT_INNER_ERR_MSG("E19999", "call aclrtSynchronizeStream failed, ret = %d.", rt_ret); |
| 204 | return static_cast<uint32_t>(rt_ret); | 204 | return static_cast<uint32_t>(rt_ret); |
| 205 | } | 205 | } |
| 206 | return SUCCESS; | 206 | return SUCCESS; |
| @@ -1168,7 +1168,7 @@ Status HybridModelBuilder::CopyConstantData(const NodePtr &node, const GeTensor | |||
| 1168 | 1168 | ||
| 1169 | GELOGI("[IMAS]InitConstant memcpy graph_%u type[V] name[%s] output[%d] memaddr[%p] mem_size[%zu] datasize[%zu]", | 1169 | GELOGI("[IMAS]InitConstant memcpy graph_%u type[V] name[%s] output[%d] memaddr[%p] mem_size[%zu] datasize[%zu]", |
| 1170 | runtime_param_.graph_id, node->GetName().c_str(), 0, output_addr, output_size, tensor.GetData().size()); | 1170 | runtime_param_.graph_id, node->GetName().c_str(), 0, output_addr, output_size, tensor.GetData().size()); |
| 1171 | - GE_CHK_RT_RET(aclrtMemcpy(output_addr, output_size, tensor.GetData().data(), tensor.GetData().size(), | 1171 | + GE_CHK_ACL_RET(aclrtMemcpy(output_addr, output_size, tensor.GetData().data(), tensor.GetData().size(), |
| 1172 | ACL_MEMCPY_HOST_TO_DEVICE)); | 1172 | ACL_MEMCPY_HOST_TO_DEVICE)); |
| 1173 | 1173 | ||
| 1174 | return SUCCESS; | 1174 | return SUCCESS; |
| @@ -1441,7 +1441,7 @@ Status HybridModelBuilder::InitWeights() const { | |||
| 1441 | weight_data, weight_size), | 1441 | weight_data, weight_size), |
| 1442 | "Copy weight data failed."); | 1442 | "Copy weight data failed."); |
| 1443 | } else { | 1443 | } else { |
| 1444 | - GE_CHK_RT_RET(aclrtMemcpy(sub_weight_buffer->GetData(), sub_weight_buffer->GetSize(), weight_data, | 1444 | + GE_CHK_ACL_RET(aclrtMemcpy(sub_weight_buffer->GetData(), sub_weight_buffer->GetSize(), weight_data, |
| 1445 | weight_size, ACL_MEMCPY_HOST_TO_DEVICE)); | 1445 | weight_size, ACL_MEMCPY_HOST_TO_DEVICE)); |
| 1446 | } | 1446 | } |
| 1447 | 1447 | ||
| @@ -2596,7 +2596,7 @@ Status HybridModelBuilder::Convert2HostTensor(const NodePtr &node, const int64_t | |||
| 2596 | const auto copy_size = static_cast<size_t>(tensor_size); | 2596 | const auto copy_size = static_cast<size_t>(tensor_size); |
| 2597 | GE_CHECK_GE(tensor_value->GetSize(), copy_size); | 2597 | GE_CHECK_GE(tensor_value->GetSize(), copy_size); |
| 2598 | std::vector<uint8_t> buffer(copy_size); | 2598 | std::vector<uint8_t> buffer(copy_size); |
| 2599 | - GE_CHK_RT_RET(aclrtMemcpy(buffer.data(), copy_size, tensor_value->GetData(), copy_size, | 2599 | + GE_CHK_ACL_RET(aclrtMemcpy(buffer.data(), copy_size, tensor_value->GetData(), copy_size, |
| 2600 | ACL_MEMCPY_DEVICE_TO_HOST)); | 2600 | ACL_MEMCPY_DEVICE_TO_HOST)); |
| 2601 | (void)ge_tensor->SetData(std::move(buffer)); | 2601 | (void)ge_tensor->SetData(std::move(buffer)); |
| 2602 | GELOGD("[%s] Copy constant tensor to host successfully, size = %zu", node->GetName().c_str(), copy_size); | 2602 | GELOGD("[%s] Copy constant tensor to host successfully, size = %zu", node->GetName().c_str(), copy_size); |
| @@ -15,7 +15,8 @@ | |||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | - | 18 | +#include "rt_external_stream.h" |
| 19 | + | ||
| 19 | 20 | ||
| 20 | namespace ge { | 21 | namespace ge { |
| 21 | namespace hybrid { | 22 | namespace hybrid { |
| @@ -302,12 +303,12 @@ Status AiCoreNodeTask::CheckOverflow(TaskContext &context) const { | |||
| 302 | GELOGW("Dynamic shape op %s is over flow", context.GetNodeName()); | 303 | GELOGW("Dynamic shape op %s is over flow", context.GetNodeName()); |
| 303 | return SUCCESS; | 304 | return SUCCESS; |
| 304 | } else if (rt_ret == ACL_ERROR_RT_STREAM_SYNC_TIMEOUT) { | 305 | } else if (rt_ret == ACL_ERROR_RT_STREAM_SYNC_TIMEOUT) { |
| 305 | - GELOGE(rt_ret, "[Invoke][rtStreamSynchronizeWithTimeout] failed, ret:%d.", rt_ret); | 306 | + GELOGE(rt_ret, "[Invoke][aclrtSynchronizeStreamWithTimeout] failed, ret:%d.", rt_ret); |
| 306 | - REPORT_INNER_ERR_MSG("E19999", "rtStreamSynchronizeWithTimeout failed, ret:%d.", rt_ret); | 307 | + REPORT_INNER_ERR_MSG("E19999", "aclrtSynchronizeStreamWithTimeout failed, ret:%d.", rt_ret); |
| 307 | return FAILED; | 308 | return FAILED; |
| 308 | } else if (rt_ret != RT_ERROR_NONE) { | 309 | } else if (rt_ret != RT_ERROR_NONE) { |
| 309 | GELOGE(RT_FAILED, "[Invoke][RtStreamSynchronize] failed, ret:%d.", rt_ret); | 310 | GELOGE(RT_FAILED, "[Invoke][RtStreamSynchronize] failed, ret:%d.", rt_ret); |
| 310 | - REPORT_INNER_ERR_MSG("E19999", "rtStreamSynchronize failed, ret:%d.", rt_ret); | 311 | + REPORT_INNER_ERR_MSG("E19999", "aclrtSynchronizeStream failed, ret:%d.", rt_ret); |
| 311 | return RT_ERROR_TO_GE_STATUS(rt_ret); | 312 | return RT_ERROR_TO_GE_STATUS(rt_ret); |
| 312 | } else { | 313 | } else { |
| 313 | // add for misra rule 6-4-2 | 314 | // add for misra rule 6-4-2 |
| @@ -60,7 +60,7 @@ Status AiCoreOpTask::Init(const NodePtr &node, const domi::TaskDef &task_def) { | |||
| 60 | shape_buffer_ = TensorBuffer::Create(npu_mem_allocator, size); | 60 | shape_buffer_ = TensorBuffer::Create(npu_mem_allocator, size); |
| 61 | GE_CHECK_NOTNULL(shape_buffer_); | 61 | GE_CHECK_NOTNULL(shape_buffer_); |
| 62 | GELOGD("Op [%s] allocate memory for outputs shape success, size=%zu", op_desc->GetName().c_str(), size); | 62 | GELOGD("Op [%s] allocate memory for outputs shape success, size=%zu", op_desc->GetName().c_str(), size); |
| 63 | - GE_CHK_RT_RET(aclrtMemset(shape_buffer_->GetData(), shape_buffer_->GetSize(), 0U, shape_buffer_->GetSize())); | 63 | + GE_CHK_ACL_RET(aclrtMemset(shape_buffer_->GetData(), shape_buffer_->GetSize(), 0U, shape_buffer_->GetSize())); |
| 64 | host_shape_buffer_ = MakeUnique<uint8_t[]>(shape_buffer_->GetSize()); | 64 | host_shape_buffer_ = MakeUnique<uint8_t[]>(shape_buffer_->GetSize()); |
| 65 | GE_CHECK_NOTNULL(host_shape_buffer_); | 65 | GE_CHECK_NOTNULL(host_shape_buffer_); |
| 66 | } | 66 | } |
| @@ -12,7 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | -#include "runtime/rt.h" | 15 | +#include "rt_external.h" |
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | namespace ge { | 18 | namespace ge { |
| @@ -16,8 +16,7 @@ | |||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | -#include "runtime/mem.h" | 19 | +#include "common/ge_rts_decl.h" |
| 20 | - | ||
| 21 | 20 | ||
| 22 | 21 | ||
| 23 | namespace ge { | 22 | namespace ge { |
| @@ -16,11 +16,13 @@ | |||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | -#include "runtime/rt.h" | 19 | +#include "rt_external.h" |
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | + | ||
| 25 | + | ||
| 24 | 26 | ||
| 25 | namespace ge { | 27 | namespace ge { |
| 26 | namespace hybrid { | 28 | namespace hybrid { |
| @@ -110,7 +112,7 @@ Status AicpuNodeTaskBase::InitExtInfo(const std::string &kernel_ext_info, const | |||
| 110 | node_name_.c_str(), node_type_.c_str(), aicpu_ext_handle_.GetExtInfoLen()); | 112 | node_name_.c_str(), node_type_.c_str(), aicpu_ext_handle_.GetExtInfoLen()); |
| 111 | 113 | ||
| 112 | // copy default ext info | 114 | // copy default ext info |
| 113 | - GE_CHK_RT_RET(aclrtMemcpy(ext_info_addr_dev_->GetData(), ext_info_addr_dev_->GetSize(), | 115 | + GE_CHK_ACL_RET(aclrtMemcpy(ext_info_addr_dev_->GetData(), ext_info_addr_dev_->GetSize(), |
| 114 | aicpu_ext_handle_.GetExtInfo(), aicpu_ext_handle_.GetExtInfoLen(), memcpy_kind_)); | 116 | aicpu_ext_handle_.GetExtInfo(), aicpu_ext_handle_.GetExtInfoLen(), memcpy_kind_)); |
| 115 | 117 | ||
| 116 | (void)ge::GetContext().GetOption(OPTION_EXEC_STREAM_SYNC_TIMEOUT, stream_sync_timeout_); | 118 | (void)ge::GetContext().GetOption(OPTION_EXEC_STREAM_SYNC_TIMEOUT, stream_sync_timeout_); |
| @@ -123,7 +125,7 @@ Status AicpuNodeTaskBase::UpdateOutputShapeFromExtInfo(TaskContext &context) { | |||
| 123 | return SUCCESS; | 125 | return SUCCESS; |
| 124 | } | 126 | } |
| 125 | // copy to host buf | 127 | // copy to host buf |
| 126 | - GE_CHK_RT_RET(aclrtMemcpy(aicpu_ext_handle_.GetExtInfo(), aicpu_ext_handle_.GetExtInfoLen(), | 128 | + GE_CHK_ACL_RET(aclrtMemcpy(aicpu_ext_handle_.GetExtInfo(), aicpu_ext_handle_.GetExtInfoLen(), |
| 127 | ext_info_addr_dev_->GetData(), ext_info_addr_dev_->GetSize(), callback_memcpy_kind_)); | 129 | ext_info_addr_dev_->GetData(), ext_info_addr_dev_->GetSize(), callback_memcpy_kind_)); |
| 128 | for (int32_t i = 0; i < node_item_->num_outputs; ++i) { | 130 | for (int32_t i = 0; i < node_item_->num_outputs; ++i) { |
| 129 | GeShape shape; | 131 | GeShape shape; |
| @@ -197,7 +199,7 @@ Status AicpuNodeTaskBase::UpdateExtInfo() { | |||
| 197 | } | 199 | } |
| 198 | } | 200 | } |
| 199 | // copy input and output shapes to device | 201 | // copy input and output shapes to device |
| 200 | - GE_CHK_RT_RET(aclrtMemcpy(ext_info_addr_dev_->GetData(), ext_info_addr_dev_->GetSize(), | 202 | + GE_CHK_ACL_RET(aclrtMemcpy(ext_info_addr_dev_->GetData(), ext_info_addr_dev_->GetSize(), |
| 201 | aicpu_ext_handle_.GetExtInfo(), aicpu_ext_handle_.GetExtInfoLen(), memcpy_kind_)); | 203 | aicpu_ext_handle_.GetExtInfo(), aicpu_ext_handle_.GetExtInfoLen(), memcpy_kind_)); |
| 202 | 204 | ||
| 203 | GELOGD("Node[%s] update ext info end.", node_name_.c_str()); | 205 | GELOGD("Node[%s] update ext info end.", node_name_.c_str()); |
| @@ -477,7 +479,7 @@ Status AicpuTfNodeTask::InitForDependComputeTask() { | |||
| 477 | GE_CHK_STATUS_RET(AllocTensorBuffer(copy_io_addr_size, copy_ioaddr_dev_), | 479 | GE_CHK_STATUS_RET(AllocTensorBuffer(copy_io_addr_size, copy_ioaddr_dev_), |
| 478 | "[Alloc][TensorBuffer] failed for Node[%s(%s)] to copy task ioaddr, size = %zu", | 480 | "[Alloc][TensorBuffer] failed for Node[%s(%s)] to copy task ioaddr, size = %zu", |
| 479 | node_name_.c_str(), node_type_.c_str(), copy_io_addr_size); | 481 | node_name_.c_str(), node_type_.c_str(), copy_io_addr_size); |
| 480 | - GE_CHK_RT_RET(aclrtMemcpy(copy_ioaddr_dev_->GetData(), copy_io_addr_size, | 482 | + GE_CHK_ACL_RET(aclrtMemcpy(copy_ioaddr_dev_->GetData(), copy_io_addr_size, |
| 481 | ©_io_addr[0U], copy_io_addr_size, memcpy_kind_)); | 483 | ©_io_addr[0U], copy_io_addr_size, memcpy_kind_)); |
| 482 | return SUCCESS; | 484 | return SUCCESS; |
| 483 | } | 485 | } |
| @@ -523,7 +525,7 @@ Status AicpuTfNodeTask::AssembleWorkSpaceAddr(const domi::KernelExDef &kernel_ex | |||
| 523 | GE_CHK_STATUS_RET(AllocTensorBuffer(kernel_workspace_size, kernel_workspace_), | 525 | GE_CHK_STATUS_RET(AllocTensorBuffer(kernel_workspace_size, kernel_workspace_), |
| 524 | "[Alloc][TensorBuffer] failed for Node[%s(%s)] to copy kernel workspace, size = %zu.", | 526 | "[Alloc][TensorBuffer] failed for Node[%s(%s)] to copy kernel workspace, size = %zu.", |
| 525 | node_name_.c_str(), node_type_.c_str(), kernel_workspace_size); | 527 | node_name_.c_str(), node_type_.c_str(), kernel_workspace_size); |
| 526 | - GE_CHK_RT_RET(aclrtMemcpy(kernel_workspace_->GetData(), kernel_workspace_size, kernel_ex_def.task_info().data(), | 528 | + GE_CHK_ACL_RET(aclrtMemcpy(kernel_workspace_->GetData(), kernel_workspace_size, kernel_ex_def.task_info().data(), |
| 527 | kernel_workspace_size, memcpy_kind_)); | 529 | kernel_workspace_size, memcpy_kind_)); |
| 528 | GELOGI("op %s use %s mem %p for workspace with flag %d", node_name_.c_str(), | 530 | GELOGI("op %s use %s mem %p for workspace with flag %d", node_name_.c_str(), |
| 529 | deploy_type_flag_ == RT_KERNEL_HOST_ONLY ? "host" : "device", kernel_workspace_->GetData(), deploy_type_flag_); | 531 | deploy_type_flag_ == RT_KERNEL_HOST_ONLY ? "host" : "device", kernel_workspace_->GetData(), deploy_type_flag_); |
| @@ -534,7 +536,7 @@ Status AicpuTfNodeTask::AssembleKernelBuffer(STR_FWK_OP_KERNEL *fwk_op_kernel) { | |||
| 534 | GE_CHK_STATUS_RET(AllocTensorBuffer(sizeof(STR_FWK_OP_KERNEL), kernel_buf_), | 536 | GE_CHK_STATUS_RET(AllocTensorBuffer(sizeof(STR_FWK_OP_KERNEL), kernel_buf_), |
| 535 | "[Alloc][TensorBuffer] for Node[%s(%s)] to copy kernel_buf, size=%zu.", node_name_.c_str(), | 537 | "[Alloc][TensorBuffer] for Node[%s(%s)] to copy kernel_buf, size=%zu.", node_name_.c_str(), |
| 536 | node_type_.c_str(), sizeof(STR_FWK_OP_KERNEL)); | 538 | node_type_.c_str(), sizeof(STR_FWK_OP_KERNEL)); |
| 537 | - GE_CHK_RT_RET(aclrtMemcpy(kernel_buf_->GetData(), sizeof(STR_FWK_OP_KERNEL), | 539 | + GE_CHK_ACL_RET(aclrtMemcpy(kernel_buf_->GetData(), sizeof(STR_FWK_OP_KERNEL), |
| 538 | fwk_op_kernel, sizeof(STR_FWK_OP_KERNEL), memcpy_kind_)); | 540 | fwk_op_kernel, sizeof(STR_FWK_OP_KERNEL), memcpy_kind_)); |
| 539 | GELOGI("op %s use %s mem %p for kernel buffer with flag %d", node_name_.c_str(), | 541 | GELOGI("op %s use %s mem %p for kernel buffer with flag %d", node_name_.c_str(), |
| 540 | deploy_type_flag_ == RT_KERNEL_HOST_ONLY ? "host" : "device", kernel_buf_->GetData(), deploy_type_flag_); | 542 | deploy_type_flag_ == RT_KERNEL_HOST_ONLY ? "host" : "device", kernel_buf_->GetData(), deploy_type_flag_); |
| @@ -653,13 +655,13 @@ Status AicpuTfNodeTask::SetMemCopyTask(const domi::TaskDef &task_def) { | |||
| 653 | "[Alloc][TensorBuffer] for Node[%s(%s)] to copy task workspace buf, size=%u.", node_name_.c_str(), | 655 | "[Alloc][TensorBuffer] for Node[%s(%s)] to copy task workspace buf, size=%u.", node_name_.c_str(), |
| 654 | node_type_.c_str(), kernel_def.task_info_size()); | 656 | node_type_.c_str(), kernel_def.task_info_size()); |
| 655 | 657 | ||
| 656 | - GE_CHK_RT_RET(aclrtMemcpy(copy_workspace_buf_->GetData(), static_cast<uint64_t>(kernel_def.task_info_size()), | 658 | + GE_CHK_ACL_RET(aclrtMemcpy(copy_workspace_buf_->GetData(), static_cast<uint64_t>(kernel_def.task_info_size()), |
| 657 | kernel_def.task_info().data(), static_cast<uint64_t>(kernel_def.task_info_size()), memcpy_kind_)); | 659 | kernel_def.task_info().data(), static_cast<uint64_t>(kernel_def.task_info_size()), memcpy_kind_)); |
| 658 | aicpu_task.fwkKernelBase.fwk_kernel.inputOutputAddr = PtrToValue(copy_ioaddr_dev_->GetData()); | 660 | aicpu_task.fwkKernelBase.fwk_kernel.inputOutputAddr = PtrToValue(copy_ioaddr_dev_->GetData()); |
| 659 | aicpu_task.fwkKernelBase.fwk_kernel.workspaceBaseAddr = PtrToValue(copy_workspace_buf_->GetData()); | 661 | aicpu_task.fwkKernelBase.fwk_kernel.workspaceBaseAddr = PtrToValue(copy_workspace_buf_->GetData()); |
| 660 | aicpu_task.fwkKernelBase.fwk_kernel.extInfoAddr = 0U; | 662 | aicpu_task.fwkKernelBase.fwk_kernel.extInfoAddr = 0U; |
| 661 | aicpu_task.fwkKernelBase.fwk_kernel.extInfoLen = 0U; | 663 | aicpu_task.fwkKernelBase.fwk_kernel.extInfoLen = 0U; |
| 662 | - GE_CHK_RT_RET(aclrtMemcpy(copy_task_args_buf_->GetData(), sizeof(STR_FWK_OP_KERNEL), &aicpu_task, | 664 | + GE_CHK_ACL_RET(aclrtMemcpy(copy_task_args_buf_->GetData(), sizeof(STR_FWK_OP_KERNEL), &aicpu_task, |
| 663 | sizeof(STR_FWK_OP_KERNEL), memcpy_kind_)); | 665 | sizeof(STR_FWK_OP_KERNEL), memcpy_kind_)); |
| 664 | GELOGD("Set memcpy task for node[%s] successfully.", node_name_.c_str()); | 666 | GELOGD("Set memcpy task for node[%s] successfully.", node_name_.c_str()); |
| 665 | return SUCCESS; | 667 | return SUCCESS; |
| @@ -717,7 +719,7 @@ Status AicpuNodeTaskBase::ReadResultSummaryAndPrepareMemory(const TaskContext &c | |||
| 717 | std::vector<std::unique_ptr<TensorBuffer>> &out_shape_hbm) { | 719 | std::vector<std::unique_ptr<TensorBuffer>> &out_shape_hbm) { |
| 718 | for (int32_t i = 0; i < node_item_->num_outputs; ++i) { | 720 | for (int32_t i = 0; i < node_item_->num_outputs; ++i) { |
| 719 | auto &result_summary = output_summary_host_[static_cast<size_t>(i)]; | 721 | auto &result_summary = output_summary_host_[static_cast<size_t>(i)]; |
| 720 | - GE_CHK_RT_RET(aclrtMemcpy(&result_summary, sizeof(aicpu::FWKAdapter::ResultSummary), | 722 | + GE_CHK_ACL_RET(aclrtMemcpy(&result_summary, sizeof(aicpu::FWKAdapter::ResultSummary), |
| 721 | output_summary_[static_cast<size_t>(i)]->GetData(), | 723 | output_summary_[static_cast<size_t>(i)]->GetData(), |
| 722 | output_summary_[static_cast<size_t>(i)]->GetSize(), callback_memcpy_kind_)); | 724 | output_summary_[static_cast<size_t>(i)]->GetSize(), callback_memcpy_kind_)); |
| 723 | const auto raw_data_size = result_summary.raw_data_size; | 725 | const auto raw_data_size = result_summary.raw_data_size; |
| @@ -824,13 +826,13 @@ Status AicpuNodeTaskBase::PrepareCopyInputs(const TaskContext &context, | |||
| 824 | 826 | ||
| 825 | // copy task need copy all output_data and output_shape, len is 2 * output_num | 827 | // copy task need copy all output_data and output_shape, len is 2 * output_num |
| 826 | const size_t copy_input_buf_len = static_cast<size_t>(node_item_->num_outputs) * 2U * sizeof(uint64_t); | 828 | const size_t copy_input_buf_len = static_cast<size_t>(node_item_->num_outputs) * 2U * sizeof(uint64_t); |
| 827 | - GE_CHK_RT_RET(aclrtMemcpy(copy_input_release_flag_dev_->GetData(), copy_input_release_flag_dev_->GetSize(), | 829 | + GE_CHK_ACL_RET(aclrtMemcpy(copy_input_release_flag_dev_->GetData(), copy_input_release_flag_dev_->GetSize(), |
| 828 | ©_input_release_flag[0U], copy_input_buf_len, memcpy_kind_)); | 830 | ©_input_release_flag[0U], copy_input_buf_len, memcpy_kind_)); |
| 829 | - GE_CHK_RT_RET(aclrtMemcpy(copy_input_data_size_dev_->GetData(), copy_input_data_size_dev_->GetSize(), | 831 | + GE_CHK_ACL_RET(aclrtMemcpy(copy_input_data_size_dev_->GetData(), copy_input_data_size_dev_->GetSize(), |
| 830 | ©_input_data_size[0U], copy_input_buf_len, memcpy_kind_)); | 832 | ©_input_data_size[0U], copy_input_buf_len, memcpy_kind_)); |
| 831 | - GE_CHK_RT_RET(aclrtMemcpy(copy_input_src_dev_->GetData(), copy_input_src_dev_->GetSize(), ©_input_src[0U], | 833 | + GE_CHK_ACL_RET(aclrtMemcpy(copy_input_src_dev_->GetData(), copy_input_src_dev_->GetSize(), ©_input_src[0U], |
| 832 | copy_input_buf_len, memcpy_kind_)); | 834 | copy_input_buf_len, memcpy_kind_)); |
| 833 | - GE_CHK_RT_RET(aclrtMemcpy(copy_input_dst_dev_->GetData(), copy_input_dst_dev_->GetSize(), ©_input_dst[0U], | 835 | + GE_CHK_ACL_RET(aclrtMemcpy(copy_input_dst_dev_->GetData(), copy_input_dst_dev_->GetSize(), ©_input_dst[0U], |
| 834 | copy_input_buf_len, memcpy_kind_)); | 836 | copy_input_buf_len, memcpy_kind_)); |
| 835 | 837 | ||
| 836 | return SUCCESS; | 838 | return SUCCESS; |
| @@ -855,7 +857,7 @@ Status AicpuNodeTaskBase::UpdateShapeByHbmBuffer(const TaskContext &context, | |||
| 855 | GELOGD("Node[%s] [%d]th output dim num=%zu.", node_name_.c_str(), i, dim_num); | 857 | GELOGD("Node[%s] [%d]th output dim num=%zu.", node_name_.c_str(), i, dim_num); |
| 856 | const std::unique_ptr<int64_t[]> shape_addr = MakeUnique<int64_t[]>(dim_num); | 858 | const std::unique_ptr<int64_t[]> shape_addr = MakeUnique<int64_t[]>(dim_num); |
| 857 | GE_CHECK_NOTNULL(shape_addr); | 859 | GE_CHECK_NOTNULL(shape_addr); |
| 858 | - GE_CHK_RT_RET(aclrtMemcpy(shape_addr.get(), result_summary.shape_data_size, shape_hbm->GetData(), | 860 | + GE_CHK_ACL_RET(aclrtMemcpy(shape_addr.get(), result_summary.shape_data_size, shape_hbm->GetData(), |
| 859 | shape_hbm->GetSize(), callback_memcpy_kind_)); | 861 | shape_hbm->GetSize(), callback_memcpy_kind_)); |
| 860 | for (size_t dim_idx = 0U; dim_idx < dim_num; ++dim_idx) { | 862 | for (size_t dim_idx = 0U; dim_idx < dim_num; ++dim_idx) { |
| 861 | shape_dims.emplace_back(shape_addr[dim_idx]); | 863 | shape_dims.emplace_back(shape_addr[dim_idx]); |
| @@ -964,7 +966,7 @@ Status AicpuTfNodeTask::UpdateIoAddr(TaskContext &context) { | |||
| 964 | // if has input and output, need copy to ioaddr | 966 | // if has input and output, need copy to ioaddr |
| 965 | if (io_num > 0U) { | 967 | if (io_num > 0U) { |
| 966 | // copy input and output | 968 | // copy input and output |
| 967 | - GE_CHK_RT_RET(aclrtMemcpy(input_output_addr_->GetData(), input_output_addr_->GetSize(), | 969 | + GE_CHK_ACL_RET(aclrtMemcpy(input_output_addr_->GetData(), input_output_addr_->GetSize(), |
| 968 | PtrToPtr<uint8_t, void>(args.get()), input_output_addr_->GetSize(), memcpy_kind_)); | 970 | PtrToPtr<uint8_t, void>(args.get()), input_output_addr_->GetSize(), memcpy_kind_)); |
| 969 | } | 971 | } |
| 970 | 972 | ||
| @@ -144,7 +144,7 @@ Status KnownNodeTask::Init(TaskContext &context) { | |||
| 144 | Status KnownNodeTask::InitDavinciModel(const HybridModel &model, const TensorBuffer *const weight_buffer) { | 144 | Status KnownNodeTask::InitDavinciModel(const HybridModel &model, const TensorBuffer *const weight_buffer) { |
| 145 | GELOGD("[Init][DavinciModel] start"); | 145 | GELOGD("[Init][DavinciModel] start"); |
| 146 | int32_t device_id = 0; | 146 | int32_t device_id = 0; |
| 147 | - GE_CHK_RT_RET(aclrtGetDevice(&device_id)); | 147 | + GE_CHK_ACL_RET(aclrtGetDevice(&device_id)); |
| 148 | davinci_model_->SetDeviceId(static_cast<uint32_t>(device_id)); | 148 | davinci_model_->SetDeviceId(static_cast<uint32_t>(device_id)); |
| 149 | davinci_model_->InitRuntimeParams(); | 149 | davinci_model_->InitRuntimeParams(); |
| 150 | GE_CHK_STATUS_RET(davinci_model_->InitVariableMem(), "[Init][VariableMem] failed"); | 150 | GE_CHK_STATUS_RET(davinci_model_->InitVariableMem(), "[Init][VariableMem] failed"); |
| @@ -66,7 +66,7 @@ Status DataFlowStack::Compute(TaskContext &context, const int64_t handle) { | |||
| 66 | const auto tensor_value = context.MutableOutput(0); | 66 | const auto tensor_value = context.MutableOutput(0); |
| 67 | GE_CHECK_NOTNULL(tensor_value); | 67 | GE_CHECK_NOTNULL(tensor_value); |
| 68 | // Has set dependent_for_execution before, the input is ready when get here. | 68 | // Has set dependent_for_execution before, the input is ready when get here. |
| 69 | - GE_CHK_RT_RET(aclrtMemcpyAsync(tensor_value->MutableData(), tensor_value->GetSize(), &handle, sizeof(int64_t), | 69 | + GE_CHK_ACL_RET(aclrtMemcpyAsync(tensor_value->MutableData(), tensor_value->GetSize(), &handle, sizeof(int64_t), |
| 70 | ACL_MEMCPY_HOST_TO_DEVICE, context.GetStream())); | 70 | ACL_MEMCPY_HOST_TO_DEVICE, context.GetStream())); |
| 71 | res->SetClosed(false); | 71 | res->SetClosed(false); |
| 72 | GELOGD("Stack[%s] compute successfully, handle[%ld].", context.GetNodeName(), handle); | 72 | GELOGD("Stack[%s] compute successfully, handle[%ld].", context.GetNodeName(), handle); |
| @@ -101,7 +101,7 @@ Status DataFlowStackPush::Compute(TaskContext &context, const int64_t handle) { | |||
| 101 | if (copy_size != 0) { | 101 | if (copy_size != 0) { |
| 102 | const auto out_tensor_value = context.MutableOutput(0); | 102 | const auto out_tensor_value = context.MutableOutput(0); |
| 103 | GE_CHECK_NOTNULL(out_tensor_value); | 103 | GE_CHECK_NOTNULL(out_tensor_value); |
| 104 | - GE_CHK_RT_RET(aclrtMemcpyAsync(out_tensor_value->MutableData(), out_tensor_value->GetSize(), | 104 | + GE_CHK_ACL_RET(aclrtMemcpyAsync(out_tensor_value->MutableData(), out_tensor_value->GetSize(), |
| 105 | data_tensor_value->GetData(), static_cast<uint64_t>(copy_size), | 105 | data_tensor_value->GetData(), static_cast<uint64_t>(copy_size), |
| 106 | ACL_MEMCPY_DEVICE_TO_DEVICE, context.GetStream())); | 106 | ACL_MEMCPY_DEVICE_TO_DEVICE, context.GetStream())); |
| 107 | } | 107 | } |
| @@ -109,7 +109,7 @@ Status RefInputTask::RefOneByOne(const TaskContext &context) const { | |||
| 109 | std::vector<const char_t *>({reason.c_str()})); | 109 | std::vector<const char_t *>({reason.c_str()})); |
| 110 | return GRAPH_PARAM_INVALID; | 110 | return GRAPH_PARAM_INVALID; |
| 111 | } | 111 | } |
| 112 | - GE_CHK_RT_RET(aclrtMemcpyAsync(output->MutableData(), output->GetSize(), input->GetData(), | 112 | + GE_CHK_ACL_RET(aclrtMemcpyAsync(output->MutableData(), output->GetSize(), input->GetData(), |
| 113 | static_cast<uint64_t>(expected_size), ACL_MEMCPY_DEVICE_TO_DEVICE, context.GetStream())); | 113 | static_cast<uint64_t>(expected_size), ACL_MEMCPY_DEVICE_TO_DEVICE, context.GetStream())); |
| 114 | } else { | 114 | } else { |
| 115 | GE_CHK_STATUS_RET(context.SetOutput(out_index, *input)); | 115 | GE_CHK_STATUS_RET(context.SetOutput(out_index, *input)); |
| @@ -191,7 +191,7 @@ Status DependInputShapeTask::CopyDataToOutput(const size_t output_num, | |||
| 191 | tensor_value_out->GetData(), tensor_value_out->GetSize(), tensor_data_out.GetSize()); | 191 | tensor_value_out->GetData(), tensor_value_out->GetSize(), tensor_data_out.GetSize()); |
| 192 | 192 | ||
| 193 | if (tensor_data_out.GetSize() > 0UL) { | 193 | if (tensor_data_out.GetSize() > 0UL) { |
| 194 | - GE_CHK_RT_RET(aclrtMemcpyAsync(tensor_value_out->MutableData(), | 194 | + GE_CHK_ACL_RET(aclrtMemcpyAsync(tensor_value_out->MutableData(), |
| 195 | tensor_value_out->GetSize(), | 195 | tensor_value_out->GetSize(), |
| 196 | tensor_data_out.GetData(), | 196 | tensor_data_out.GetData(), |
| 197 | tensor_data_out.GetSize(), | 197 | tensor_data_out.GetSize(), |
| @@ -356,9 +356,9 @@ Status RdmaNodeTask::ExecuteAsync(TaskContext &context, const std::function<void | |||
| 356 | 356 | ||
| 357 | aclrtEvent evt = nullptr; | 357 | aclrtEvent evt = nullptr; |
| 358 | if (context.GetExecutionContext()->hccl_stream != nullptr) { | 358 | if (context.GetExecutionContext()->hccl_stream != nullptr) { |
| 359 | - GE_CHK_RT_RET(aclrtCreateEventWithFlag( | 359 | + GE_CHK_ACL_RET(aclrtCreateEventWithFlag( |
| 360 | &evt, ACL_EVENT_SYNC | ACL_EVENT_CAPTURE_STREAM_PROGRESS | ACL_EVENT_TIME_LINE)); | 360 | &evt, ACL_EVENT_SYNC | ACL_EVENT_CAPTURE_STREAM_PROGRESS | ACL_EVENT_TIME_LINE)); |
| 361 | - GE_CHK_RT_RET(aclrtStreamWaitEvent(context.GetExecutionContext()->hccl_stream, evt)); | 361 | + GE_CHK_ACL_RET(aclrtStreamWaitEvent(context.GetExecutionContext()->hccl_stream, evt)); |
| 362 | } | 362 | } |
| 363 | TaskContext *const p_ctx = &context; | 363 | TaskContext *const p_ctx = &context; |
| 364 | const auto callback = [p_ctx, done_callback, evt](const HcclResult stat) { | 364 | const auto callback = [p_ctx, done_callback, evt](const HcclResult stat) { |
| @@ -371,8 +371,8 @@ Status RdmaNodeTask::ExecuteAsync(TaskContext &context, const std::function<void | |||
| 371 | done_callback(); | 371 | done_callback(); |
| 372 | } | 372 | } |
| 373 | if (evt != nullptr) { | 373 | if (evt != nullptr) { |
| 374 | - GE_CHK_RT_RET(aclrtRecordEvent(evt, nullptr)); | 374 | + GE_CHK_ACL_RET(aclrtRecordEvent(evt, nullptr)); |
| 375 | - GE_CHK_RT_RET(aclrtDestroyEvent(evt)); | 375 | + GE_CHK_ACL_RET(aclrtDestroyEvent(evt)); |
| 376 | } | 376 | } |
| 377 | GELOGI("rdma callback success."); | 377 | GELOGI("rdma callback success."); |
| 378 | return SUCCESS; | 378 | return SUCCESS; |
| @@ -55,7 +55,7 @@ Status IdentityNodeTask::DoCopyTensor(const TaskContext &context, const int32_t | |||
| 55 | const auto output = context.MutableOutput(index); | 55 | const auto output = context.MutableOutput(index); |
| 56 | GE_CHECK_NOTNULL(input); | 56 | GE_CHECK_NOTNULL(input); |
| 57 | GE_CHECK_NOTNULL(output); | 57 | GE_CHECK_NOTNULL(output); |
| 58 | - GE_CHK_RT_RET(aclrtMemcpyAsync(output->MutableData(), | 58 | + GE_CHK_ACL_RET(aclrtMemcpyAsync(output->MutableData(), |
| 59 | output->GetSize(), | 59 | output->GetSize(), |
| 60 | input->GetData(), | 60 | input->GetData(), |
| 61 | static_cast<uint64_t>(copy_size), | 61 | static_cast<uint64_t>(copy_size), |
| @@ -78,9 +78,9 @@ Status NpuGetFloatStatusTask::ExecuteAsync(TaskContext &context, const std::func | |||
| 78 | const auto output_addr = output->MutableData(); | 78 | const auto output_addr = output->MutableData(); |
| 79 | const size_t args_size = sizeof(uint8_t *); | 79 | const size_t args_size = sizeof(uint8_t *); |
| 80 | if (args_ == nullptr) { | 80 | if (args_ == nullptr) { |
| 81 | - GE_CHK_RT_RET(ge::AclrtMalloc(&args_, args_size, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 81 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&args_, args_size, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 82 | } | 82 | } |
| 83 | - GE_CHK_RT_RET(aclrtMemcpyAsync(args_, args_size, &output_addr, args_size, ACL_MEMCPY_HOST_TO_BUF_TO_DEVICE, | 83 | + GE_CHK_ACL_RET(aclrtMemcpyAsync(args_, args_size, &output_addr, args_size, ACL_MEMCPY_HOST_TO_BUF_TO_DEVICE, |
| 84 | context.GetStream())); | 84 | context.GetStream())); |
| 85 | 85 | ||
| 86 | const uint32_t mode = 0U; | 86 | const uint32_t mode = 0U; |
| @@ -148,7 +148,7 @@ Status StreamMergeNodeTask::ExecuteAsync(TaskContext &context, const std::functi | |||
| 148 | const auto out_y = context.MutableOutput(MERGE_INDEX_OUTPUT); // value_index | 148 | const auto out_y = context.MutableOutput(MERGE_INDEX_OUTPUT); // value_index |
| 149 | GE_CHECK_NOTNULL(out_y); | 149 | GE_CHECK_NOTNULL(out_y); |
| 150 | if (out_y->GetSize() > 0UL) { | 150 | if (out_y->GetSize() > 0UL) { |
| 151 | - GE_CHK_RT_RET(aclrtMemcpyAsync(out_y->MutableData(), out_y->GetSize(), &idx, sizeof(idx), | 151 | + GE_CHK_ACL_RET(aclrtMemcpyAsync(out_y->MutableData(), out_y->GetSize(), &idx, sizeof(idx), |
| 152 | ACL_MEMCPY_HOST_TO_BUF_TO_DEVICE, context.GetStream())); | 152 | ACL_MEMCPY_HOST_TO_BUF_TO_DEVICE, context.GetStream())); |
| 153 | } | 153 | } |
| 154 | 154 | ||
| @@ -18,6 +18,8 @@ | |||
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | + | ||
| 22 | + | ||
| 21 | 23 | ||
| 22 | namespace ge { | 24 | namespace ge { |
| 23 | namespace hybrid { | 25 | namespace hybrid { |
| @@ -589,8 +591,8 @@ Status TaskContext::SaveProfilingTaskDescInfo(const std::string &task_type, cons | |||
| 589 | const std::string &op_type) { | 591 | const std::string &op_type) { |
| 590 | if (DumpManager::GetInstance().IsDumpExceptionOpen() || ProfilingManager::Instance().ProfilingModelLoadOn() || | 592 | if (DumpManager::GetInstance().IsDumpExceptionOpen() || ProfilingManager::Instance().ProfilingModelLoadOn() || |
| 591 | ProfilingProperties::Instance().ProfilingSubscribeOn()) { | 593 | ProfilingProperties::Instance().ProfilingSubscribeOn()) { |
| 592 | - GE_CHK_RT_RET(aclrtGetThreadLastTaskId(&task_id_)); | 594 | + GE_CHK_ACL_RET(aclrtGetThreadLastTaskId(&task_id_)); |
| 593 | - GE_CHK_RT_RET(aclrtStreamGetId(GetStream(), reinterpret_cast<int32_t*>(&stream_id_))); | 595 | + GE_CHK_ACL_RET(aclrtStreamGetId(GetStream(), reinterpret_cast<int32_t*>(&stream_id_))); |
| 594 | GELOGD("Get Node[%s] task id: %u, stream id: %u.", GetNodeName(), task_id_, stream_id_); | 596 | GELOGD("Get Node[%s] task id: %u, stream id: %u.", GetNodeName(), task_id_, stream_id_); |
| 595 | } | 597 | } |
| 596 | if (ProfilingManager::Instance().ProfilingModelLoadOn() || ProfilingManager::Instance().ProfilingSubscribeOn()) { | 598 | if (ProfilingManager::Instance().ProfilingModelLoadOn() || ProfilingManager::Instance().ProfilingSubscribeOn()) { |
| @@ -88,7 +88,7 @@ Status UpdateInputsBufferAddr(const StreamResource *const stream_resource, const | |||
| 88 | } | 88 | } |
| 89 | GELOGD("Do h2d for %zu input, dst size is %zu, src length is %" PRIu64 ".", | 89 | GELOGD("Do h2d for %zu input, dst size is %zu, src length is %" PRIu64 ".", |
| 90 | input_index, size, update_buffers[input_index].length); | 90 | input_index, size, update_buffers[input_index].length); |
| 91 | - GE_CHK_RT_RET(aclrtMemcpyAsync(dst_addr, size, update_buffers[input_index].data, | 91 | + GE_CHK_ACL_RET(aclrtMemcpyAsync(dst_addr, size, update_buffers[input_index].data, |
| 92 | update_buffers[input_index].length, ACL_MEMCPY_HOST_TO_BUF_TO_DEVICE, stream)); | 92 | update_buffers[input_index].length, ACL_MEMCPY_HOST_TO_BUF_TO_DEVICE, stream)); |
| 93 | update_buffers[input_index].data = dst_addr; | 93 | update_buffers[input_index].data = dst_addr; |
| 94 | dst_addr = PtrToPtr<void, uint8_t>(ValueToPtr(PtrToValue(dst_addr) + size)); | 94 | dst_addr = PtrToPtr<void, uint8_t>(ValueToPtr(PtrToValue(dst_addr) + size)); |
| @@ -15,7 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | -#include "runtime/stream.h" | 18 | +#include "rt_external_stream.h" |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | namespace ge { | 21 | namespace ge { |
| @@ -144,7 +144,7 @@ Status SingleOpManager::GetResourceId(aclrtStream const stream, uintptr_t &resou | |||
| 144 | if (stream == nullptr) { | 144 | if (stream == nullptr) { |
| 145 | // get current context default stream | 145 | // get current context default stream |
| 146 | rtStream_t curCtxDefaultStream = nullptr; | 146 | rtStream_t curCtxDefaultStream = nullptr; |
| 147 | - GE_CHK_RT_RET(aclrtCtxGetCurrentDefaultStream(&curCtxDefaultStream)); | 147 | + GE_CHK_ACL_RET(aclrtCtxGetCurrentDefaultStream(&curCtxDefaultStream)); |
| 148 | GELOGI("use current context default stream as resource index"); | 148 | GELOGI("use current context default stream as resource index"); |
| 149 | resource_id = static_cast<uintptr_t>(PtrToValue(curCtxDefaultStream)); | 149 | resource_id = static_cast<uintptr_t>(PtrToValue(curCtxDefaultStream)); |
| 150 | } else { | 150 | } else { |
| @@ -181,7 +181,7 @@ Status SingleOpModel::InitModel() { | |||
| 181 | 181 | ||
| 182 | Status SingleOpModel::ParseOpModelParams() { | 182 | Status SingleOpModel::ParseOpModelParams() { |
| 183 | int32_t device_id = 0; | 183 | int32_t device_id = 0; |
| 184 | - GE_CHK_RT_RET(aclrtGetDevice(&device_id)); | 184 | + GE_CHK_ACL_RET(aclrtGetDevice(&device_id)); |
| 185 | GE_ASSERT_SUCCESS( | 185 | GE_ASSERT_SUCCESS( |
| 186 | ModelUtils::InitRuntimeParams(root_ge_model_, model_params_.runtime_param, static_cast<uint32_t>(device_id))); | 186 | ModelUtils::InitRuntimeParams(root_ge_model_, model_params_.runtime_param, static_cast<uint32_t>(device_id))); |
| 187 | model_params_.runtime_param.session_id = UINT64_MAX; | 187 | model_params_.runtime_param.session_id = UINT64_MAX; |
| @@ -222,7 +222,7 @@ Status SingleOpModel::MallocWeight(StreamResource &resource) { | |||
| 222 | return ACL_ERROR_GE_DEVICE_MEMORY_OPERATE_FAILED; | 222 | return ACL_ERROR_GE_DEVICE_MEMORY_OPERATE_FAILED; |
| 223 | } | 223 | } |
| 224 | GELOGI("To copy weight to device. weight size = %zu.", root_ge_model_->GetWeightSize()); | 224 | GELOGI("To copy weight to device. weight size = %zu.", root_ge_model_->GetWeightSize()); |
| 225 | - GE_CHK_RT_RET(aclrtMemcpy(weight_base, model_params_.runtime_param.weight_size, root_ge_model_->GetWeightData(), | 225 | + GE_CHK_ACL_RET(aclrtMemcpy(weight_base, model_params_.runtime_param.weight_size, root_ge_model_->GetWeightData(), |
| 226 | root_ge_model_->GetWeightSize(), ACL_MEMCPY_HOST_TO_DEVICE)); | 226 | root_ge_model_->GetWeightSize(), ACL_MEMCPY_HOST_TO_DEVICE)); |
| 227 | model_params_.runtime_param.weight_base = reinterpret_cast<uintptr_t>(weight_base); | 227 | model_params_.runtime_param.weight_base = reinterpret_cast<uintptr_t>(weight_base); |
| 228 | } | 228 | } |
| @@ -877,7 +877,7 @@ Status SingleOpModel::BuildDynamicOp(StreamResource &resource, DynamicSingleOpIm | |||
| 877 | "[Set][OverflowAddr]failed."); | 877 | "[Set][OverflowAddr]failed."); |
| 878 | GE_CHK_STATUS_RET(single_op.hybrid_model_->Init(true), "[Init][HybridModel]Failed."); | 878 | GE_CHK_STATUS_RET(single_op.hybrid_model_->Init(true), "[Init][HybridModel]Failed."); |
| 879 | int32_t device_id = 0; | 879 | int32_t device_id = 0; |
| 880 | - GE_CHK_RT_RET(aclrtGetDevice(&device_id)); | 880 | + GE_CHK_ACL_RET(aclrtGetDevice(&device_id)); |
| 881 | ThreadPool *thread_pool = nullptr; | 881 | ThreadPool *thread_pool = nullptr; |
| 882 | GE_CHK_STATUS_RET_NOLOG(resource.GetThreadPool(&thread_pool)); | 882 | GE_CHK_STATUS_RET_NOLOG(resource.GetThreadPool(&thread_pool)); |
| 883 | single_op.hybrid_model_executor_ = MakeUnique<hybrid::HybridModelRtV1Executor>(single_op.hybrid_model_.get(), | 883 | single_op.hybrid_model_executor_ = MakeUnique<hybrid::HybridModelRtV1Executor>(single_op.hybrid_model_.get(), |
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | -#include "runtime/rt.h" | 14 | +#include "rt_external.h" |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| @@ -119,7 +119,7 @@ Status StreamResource::DeleteOperator(const uint64_t key) { | |||
| 119 | if (it != op_map_.end()) { | 119 | if (it != op_map_.end()) { |
| 120 | // need to stream sync before erase | 120 | // need to stream sync before erase |
| 121 | GELOGI("static op %" PRIu64 " need to be deleted, start to sync stream %p", key, stream_); | 121 | GELOGI("static op %" PRIu64 " need to be deleted, start to sync stream %p", key, stream_); |
| 122 | - GE_CHK_RT_RET(aclrtSynchronizeStream(stream_)); | 122 | + GE_CHK_ACL_RET(aclrtSynchronizeStream(stream_)); |
| 123 | (void)op_map_.erase(it); | 123 | (void)op_map_.erase(it); |
| 124 | GELOGI("static op %" PRIu64 " delete success", key); | 124 | GELOGI("static op %" PRIu64 " delete success", key); |
| 125 | } | 125 | } |
| @@ -132,7 +132,7 @@ Status StreamResource::DeleteDynamicOperator(const uint64_t key) { | |||
| 132 | if (it != dynamic_op_map_.end()) { | 132 | if (it != dynamic_op_map_.end()) { |
| 133 | // need to stream sync before erase | 133 | // need to stream sync before erase |
| 134 | GELOGI("dynamic op %" PRIu64 " need to be deleted, start to sync stream %p", key, stream_); | 134 | GELOGI("dynamic op %" PRIu64 " need to be deleted, start to sync stream %p", key, stream_); |
| 135 | - GE_CHK_RT_RET(aclrtSynchronizeStream(stream_)); | 135 | + GE_CHK_ACL_RET(aclrtSynchronizeStream(stream_)); |
| 136 | (void)dynamic_op_map_.erase(it); | 136 | (void)dynamic_op_map_.erase(it); |
| 137 | GELOGI("dynamic op %" PRIu64 " delete success", key); | 137 | GELOGI("dynamic op %" PRIu64 " delete success", key); |
| 138 | } | 138 | } |
| @@ -17,7 +17,7 @@ | |||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | -#include "runtime/stream.h" | 20 | +#include "rt_external_stream.h" |
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | 23 | ||
| @@ -15,7 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | -#include "runtime/mem.h" | 18 | +#include "rt_external_mem.h" |
| 19 | 19 | ||
| 20 | namespace ge { | 20 | namespace ge { |
| 21 | class AiCpuCCTaskBuilder { | 21 | class AiCpuCCTaskBuilder { |
| @@ -36,10 +36,10 @@ Status AiCpuTaskBuilder::SetFmkOpKernel(const void *const io_addr, const void *c | |||
| 36 | 36 | ||
| 37 | Status AiCpuTaskBuilder::InitWorkspaceAndIO(AiCpuTask &task, const SingleOpModelParam ¶m) const { | 37 | Status AiCpuTaskBuilder::InitWorkspaceAndIO(AiCpuTask &task, const SingleOpModelParam ¶m) const { |
| 38 | GE_CHECK_GE(kernel_def_.task_info().size(), kernel_def_.task_info_size()); | 38 | GE_CHECK_GE(kernel_def_.task_info().size(), kernel_def_.task_info_size()); |
| 39 | - GE_CHK_RT_RET(ge::AclrtMalloc(&task.workspace_addr_, | 39 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&task.workspace_addr_, |
| 40 | static_cast<uint64_t>(kernel_def_.task_info_size()), | 40 | static_cast<uint64_t>(kernel_def_.task_info_size()), |
| 41 | task.mem_type_, GE_MODULE_NAME_U16)); | 41 | task.mem_type_, GE_MODULE_NAME_U16)); |
| 42 | - GE_CHK_RT_RET(aclrtMemcpy(task.workspace_addr_, static_cast<uint64_t>(kernel_def_.task_info_size()), | 42 | + GE_CHK_ACL_RET(aclrtMemcpy(task.workspace_addr_, static_cast<uint64_t>(kernel_def_.task_info_size()), |
| 43 | kernel_def_.task_info().data(), static_cast<uint64_t>(kernel_def_.task_info_size()), | 43 | kernel_def_.task_info().data(), static_cast<uint64_t>(kernel_def_.task_info_size()), |
| 44 | task.memcpy_kind_)); | 44 | task.memcpy_kind_)); |
| 45 | 45 | ||
| @@ -61,7 +61,7 @@ Status AiCpuTaskBuilder::InitWorkspaceAndIO(AiCpuTask &task, const SingleOpModel | |||
| 61 | task.host_mem_input_data_offset_); | 61 | task.host_mem_input_data_offset_); |
| 62 | } | 62 | } |
| 63 | task.io_addr_size_ = task.io_addr_host_.size() * sizeof(void *); | 63 | task.io_addr_size_ = task.io_addr_host_.size() * sizeof(void *); |
| 64 | - GE_CHK_RT_RET(ge::AclrtMalloc(&task.io_addr_, task.io_addr_size_, task.mem_type_, | 64 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&task.io_addr_, task.io_addr_size_, task.mem_type_, |
| 65 | GE_MODULE_NAME_U16)); | 65 | GE_MODULE_NAME_U16)); |
| 66 | return SUCCESS; | 66 | return SUCCESS; |
| 67 | } | 67 | } |
| @@ -93,9 +93,9 @@ Status AiCpuTaskBuilder::BuildTask(ge::AiCpuTask &task, const SingleOpModelParam | |||
| 93 | fwk_op_kernel.fwkKernelBase.fwk_kernel.sessionID = std::numeric_limits<uint64_t>::max(); | 93 | fwk_op_kernel.fwkKernelBase.fwk_kernel.sessionID = std::numeric_limits<uint64_t>::max(); |
| 94 | fwk_op_kernel.fwkKernelBase.fwk_kernel.kernelID = kernel_id; | 94 | fwk_op_kernel.fwkKernelBase.fwk_kernel.kernelID = kernel_id; |
| 95 | fwk_op_kernel.fwkKernelBase.fwk_kernel.opType = aicpu::FWKAdapter::FWKOperateType::FWK_ADPT_KERNEL_RUN_NO_SESS; | 95 | fwk_op_kernel.fwkKernelBase.fwk_kernel.opType = aicpu::FWKAdapter::FWKOperateType::FWK_ADPT_KERNEL_RUN_NO_SESS; |
| 96 | - GE_CHK_RT_RET(ge::AclrtMalloc(&task.args_, sizeof(STR_FWK_OP_KERNEL), task.mem_type_, | 96 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&task.args_, sizeof(STR_FWK_OP_KERNEL), task.mem_type_, |
| 97 | GE_MODULE_NAME_U16)); | 97 | GE_MODULE_NAME_U16)); |
| 98 | - GE_CHK_RT_RET(aclrtMemcpy(task.args_, sizeof(STR_FWK_OP_KERNEL), | 98 | + GE_CHK_ACL_RET(aclrtMemcpy(task.args_, sizeof(STR_FWK_OP_KERNEL), |
| 99 | &fwk_op_kernel, sizeof(STR_FWK_OP_KERNEL), task.memcpy_kind_)); | 99 | &fwk_op_kernel, sizeof(STR_FWK_OP_KERNEL), task.memcpy_kind_)); |
| 100 | 100 | ||
| 101 | task.arg_size_ = sizeof(STR_FWK_OP_KERNEL); | 101 | task.arg_size_ = sizeof(STR_FWK_OP_KERNEL); |
| @@ -10,7 +10,7 @@ | |||
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | -#include "runtime/rt.h" | 13 | +#include "rt_external.h" |
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | 16 | ||
| @@ -26,12 +26,11 @@ | |||
| 26 | 26 | ||
| 27 | 27 | ||
| 28 | 28 | ||
| 29 | -#include "runtime/kernel.h" | 29 | +#include "rt_external_kernel.h" |
| 30 | 30 | ||
| 31 | 31 | ||
| 32 | 32 | ||
| 33 | 33 | ||
| 34 | - | ||
| 35 | namespace ge { | 34 | namespace ge { |
| 36 | namespace { | 35 | namespace { |
| 37 | constexpr size_t kMemcpyArgCount = 2U; | 36 | constexpr size_t kMemcpyArgCount = 2U; |
| @@ -85,7 +84,7 @@ Status OpTask::SaveExceptionDumpInfo() { | |||
| 85 | gert::PrintHex(reinterpret_cast<void **>(extra_op_info.args), extra_op_info.args_size / sizeof(void *), ss); | 84 | gert::PrintHex(reinterpret_cast<void **>(extra_op_info.args), extra_op_info.args_size / sizeof(void *), ss); |
| 86 | extra_op_info.args_before_execute = ss.str(); | 85 | extra_op_info.args_before_execute = ss.str(); |
| 87 | int32_t dev_id = 0; | 86 | int32_t dev_id = 0; |
| 88 | - GE_CHK_RT_RET(aclrtGetDevice(&dev_id)); | 87 | + GE_CHK_ACL_RET(aclrtGetDevice(&dev_id)); |
| 89 | ge::OpDescInfoId id(task_id_, stream_id_, dev_id); | 88 | ge::OpDescInfoId id(task_id_, stream_id_, dev_id); |
| 90 | gert::GlobalDumper::GetInstance()->MutableExceptionDumper()->SaveDumpOpInfo(op_desc_, extra_op_info, id, true); | 89 | gert::GlobalDumper::GetInstance()->MutableExceptionDumper()->SaveDumpOpInfo(op_desc_, extra_op_info, id, true); |
| 91 | } | 90 | } |
| @@ -139,8 +138,8 @@ Status OpTask::OpenDump(aclrtStream const stream) { | |||
| 139 | 138 | ||
| 140 | Status OpTask::GetTaskIdAndStreamId(aclrtStream const stream) { | 139 | Status OpTask::GetTaskIdAndStreamId(aclrtStream const stream) { |
| 141 | if (ProfilingManager::Instance().ProfilingModelLoadOn()) { | 140 | if (ProfilingManager::Instance().ProfilingModelLoadOn()) { |
| 142 | - GE_CHK_RT_RET(aclrtGetThreadLastTaskId(&task_id_)); | 141 | + GE_CHK_ACL_RET(aclrtGetThreadLastTaskId(&task_id_)); |
| 143 | - GE_CHK_RT_RET(aclrtStreamGetId(stream, reinterpret_cast<int32_t*>(&stream_id_))); | 142 | + GE_CHK_ACL_RET(aclrtStreamGetId(stream, reinterpret_cast<int32_t*>(&stream_id_))); |
| 144 | } | 143 | } |
| 145 | return SUCCESS; | 144 | return SUCCESS; |
| 146 | } | 145 | } |
| @@ -975,8 +974,8 @@ Status AiCpuBaseTask::SetExtInfoAndType(const std::string &kernel_ext_info, cons | |||
| 975 | } | 974 | } |
| 976 | } | 975 | } |
| 977 | 976 | ||
| 978 | - GE_CHK_RT_RET(ge::AclrtMalloc(&ext_info_addr_dev_, aicpu_ext_handle_->GetExtInfoLen(), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 977 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&ext_info_addr_dev_, aicpu_ext_handle_->GetExtInfoLen(), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 979 | - GE_CHK_RT_RET(aclrtMemcpy(ext_info_addr_dev_, aicpu_ext_handle_->GetExtInfoLen(), | 978 | + GE_CHK_ACL_RET(aclrtMemcpy(ext_info_addr_dev_, aicpu_ext_handle_->GetExtInfoLen(), |
| 980 | aicpu_ext_handle_->GetExtInfo(), aicpu_ext_handle_->GetExtInfoLen(), | 979 | aicpu_ext_handle_->GetExtInfo(), aicpu_ext_handle_->GetExtInfoLen(), |
| 981 | ACL_MEMCPY_HOST_TO_DEVICE)); | 980 | ACL_MEMCPY_HOST_TO_DEVICE)); |
| 982 | return SUCCESS; | 981 | return SUCCESS; |
| @@ -1046,7 +1045,7 @@ Status AiCpuBaseTask::UpdateExtInfo(const std::vector<GeTensorDesc> &input_desc, | |||
| 1046 | } | 1045 | } |
| 1047 | } | 1046 | } |
| 1048 | // aicpu_ext_handle_->GetExtInfoLen() 已校验过非空 | 1047 | // aicpu_ext_handle_->GetExtInfoLen() 已校验过非空 |
| 1049 | - GE_CHK_RT_RET(aclrtMemcpyAsync(ext_info_addr_dev_, aicpu_ext_handle_->GetExtInfoLen(), // check size | 1048 | + GE_CHK_ACL_RET(aclrtMemcpyAsync(ext_info_addr_dev_, aicpu_ext_handle_->GetExtInfoLen(), // check size |
| 1050 | aicpu_ext_handle_->GetExtInfo(), aicpu_ext_handle_->GetExtInfoLen(), | 1049 | aicpu_ext_handle_->GetExtInfo(), aicpu_ext_handle_->GetExtInfoLen(), |
| 1051 | ACL_MEMCPY_HOST_TO_BUF_TO_DEVICE, stream)); | 1050 | ACL_MEMCPY_HOST_TO_BUF_TO_DEVICE, stream)); |
| 1052 | 1051 | ||
| @@ -1061,7 +1060,7 @@ Status AiCpuBaseTask::UpdateOutputShape(std::vector<GeTensorDesc> &output_desc) | |||
| 1061 | } | 1060 | } |
| 1062 | GELOGD("Start to update DEPEND_SHAPE_RANGE AiCpuBaseTask outputshape."); | 1061 | GELOGD("Start to update DEPEND_SHAPE_RANGE AiCpuBaseTask outputshape."); |
| 1063 | 1062 | ||
| 1064 | - GE_CHK_RT_RET(aclrtMemcpy(aicpu_ext_handle_->GetExtInfo(), aicpu_ext_handle_->GetExtInfoLen(), | 1063 | + GE_CHK_ACL_RET(aclrtMemcpy(aicpu_ext_handle_->GetExtInfo(), aicpu_ext_handle_->GetExtInfoLen(), |
| 1065 | ext_info_addr_dev_, aicpu_ext_handle_->GetExtInfoLen(), ACL_MEMCPY_DEVICE_TO_HOST)); | 1064 | ext_info_addr_dev_, aicpu_ext_handle_->GetExtInfoLen(), ACL_MEMCPY_DEVICE_TO_HOST)); |
| 1066 | 1065 | ||
| 1067 | for (size_t i = 0U; i < num_outputs_; ++i) { | 1066 | for (size_t i = 0U; i < num_outputs_; ++i) { |
| @@ -1286,13 +1285,13 @@ Status AiCpuBaseTask::PrepareCopyInputs(const std::vector<DataBuffer> &outputs) | |||
| 1286 | 1285 | ||
| 1287 | const size_t copy_input_buf_len = num_outputs_ * kCopyNum * sizeof(uint64_t); | 1286 | const size_t copy_input_buf_len = num_outputs_ * kCopyNum * sizeof(uint64_t); |
| 1288 | 1287 | ||
| 1289 | - GE_CHK_RT_RET(aclrtMemcpy(copy_input_release_flag_dev_, copy_input_buf_len, | 1288 | + GE_CHK_ACL_RET(aclrtMemcpy(copy_input_release_flag_dev_, copy_input_buf_len, |
| 1290 | copy_input_release_flag.data(), copy_input_buf_len, ACL_MEMCPY_HOST_TO_DEVICE)); | 1289 | copy_input_release_flag.data(), copy_input_buf_len, ACL_MEMCPY_HOST_TO_DEVICE)); |
| 1291 | - GE_CHK_RT_RET(aclrtMemcpy(copy_input_data_size_dev_, copy_input_buf_len, | 1290 | + GE_CHK_ACL_RET(aclrtMemcpy(copy_input_data_size_dev_, copy_input_buf_len, |
| 1292 | copy_input_data_size.data(), copy_input_buf_len, ACL_MEMCPY_HOST_TO_DEVICE)); | 1291 | copy_input_data_size.data(), copy_input_buf_len, ACL_MEMCPY_HOST_TO_DEVICE)); |
| 1293 | - GE_CHK_RT_RET(aclrtMemcpy(copy_input_src_dev_, copy_input_buf_len, | 1292 | + GE_CHK_ACL_RET(aclrtMemcpy(copy_input_src_dev_, copy_input_buf_len, |
| 1294 | copy_input_src.data(), copy_input_buf_len, ACL_MEMCPY_HOST_TO_DEVICE)); | 1293 | copy_input_src.data(), copy_input_buf_len, ACL_MEMCPY_HOST_TO_DEVICE)); |
| 1295 | - GE_CHK_RT_RET(aclrtMemcpy(copy_input_dst_dev_, copy_input_buf_len, | 1294 | + GE_CHK_ACL_RET(aclrtMemcpy(copy_input_dst_dev_, copy_input_buf_len, |
| 1296 | copy_input_dst.data(), copy_input_buf_len, ACL_MEMCPY_HOST_TO_DEVICE)); | 1295 | copy_input_dst.data(), copy_input_buf_len, ACL_MEMCPY_HOST_TO_DEVICE)); |
| 1297 | return SUCCESS; | 1296 | return SUCCESS; |
| 1298 | } | 1297 | } |
| @@ -1301,13 +1300,13 @@ Status AiCpuBaseTask::ReadResultSummaryAndPrepareMemory() { | |||
| 1301 | for (size_t i = 0U; i < num_outputs_; ++i) { | 1300 | for (size_t i = 0U; i < num_outputs_; ++i) { |
| 1302 | auto &result_summary = output_summary_host_[i]; | 1301 | auto &result_summary = output_summary_host_[i]; |
| 1303 | 1302 | ||
| 1304 | - GE_CHK_RT_RET(aclrtMemcpy(&result_summary, sizeof(aicpu::FWKAdapter::ResultSummary), | 1303 | + GE_CHK_ACL_RET(aclrtMemcpy(&result_summary, sizeof(aicpu::FWKAdapter::ResultSummary), |
| 1305 | output_summary_[i], sizeof(aicpu::FWKAdapter::ResultSummary), | 1304 | output_summary_[i], sizeof(aicpu::FWKAdapter::ResultSummary), |
| 1306 | ACL_MEMCPY_DEVICE_TO_HOST)); | 1305 | ACL_MEMCPY_DEVICE_TO_HOST)); |
| 1307 | const size_t shape_data_size = result_summary.shape_data_size; | 1306 | const size_t shape_data_size = result_summary.shape_data_size; |
| 1308 | void *shape_buffer = nullptr; | 1307 | void *shape_buffer = nullptr; |
| 1309 | if (shape_data_size > 0U) { | 1308 | if (shape_data_size > 0U) { |
| 1310 | - GE_CHK_RT_RET(ge::AclrtMalloc(&shape_buffer, shape_data_size, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 1309 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&shape_buffer, shape_data_size, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 1311 | } | 1310 | } |
| 1312 | out_shape_hbm_.emplace_back(shape_buffer); | 1311 | out_shape_hbm_.emplace_back(shape_buffer); |
| 1313 | } | 1312 | } |
| @@ -1325,7 +1324,7 @@ Status AiCpuCCTask::CopyDataToHbm(std::vector<DataBuffer> &outputs, | |||
| 1325 | block_dim_, &args_ex, | 1324 | block_dim_, &args_ex, |
| 1326 | nullptr, stream, RT_KERNEL_DEFAULT); | 1325 | nullptr, stream, RT_KERNEL_DEFAULT); |
| 1327 | GE_CHK_RT_RET(ret); | 1326 | GE_CHK_RT_RET(ret); |
| 1328 | - GE_CHK_RT_RET(aclrtSynchronizeStream(stream)); | 1327 | + GE_CHK_ACL_RET(aclrtSynchronizeStream(stream)); |
| 1329 | return SUCCESS; | 1328 | return SUCCESS; |
| 1330 | } | 1329 | } |
| 1331 | 1330 | ||
| @@ -1335,7 +1334,7 @@ Status AiCpuTask::CopyDataToHbm(std::vector<DataBuffer> &outputs, | |||
| 1335 | 1334 | ||
| 1336 | GE_CHK_RT_RET(rtKernelLaunchEx(copy_task_args_buf_, static_cast<uint32_t>(sizeof(STR_FWK_OP_KERNEL)), | 1335 | GE_CHK_RT_RET(rtKernelLaunchEx(copy_task_args_buf_, static_cast<uint32_t>(sizeof(STR_FWK_OP_KERNEL)), |
| 1337 | RT_KERNEL_DEFAULT, stream)); | 1336 | RT_KERNEL_DEFAULT, stream)); |
| 1338 | - GE_CHK_RT_RET(aclrtSynchronizeStream(stream)); | 1337 | + GE_CHK_ACL_RET(aclrtSynchronizeStream(stream)); |
| 1339 | return SUCCESS; | 1338 | return SUCCESS; |
| 1340 | } | 1339 | } |
| 1341 | 1340 | ||
| @@ -1349,7 +1348,7 @@ Status AiCpuBaseTask::UpdateShapeByHbmBuffer(std::vector<GeTensorDesc> &output_d | |||
| 1349 | const uint32_t dim_num = static_cast<uint32_t>(result_summary.shape_data_size / sizeof(int64_t)); | 1348 | const uint32_t dim_num = static_cast<uint32_t>(result_summary.shape_data_size / sizeof(int64_t)); |
| 1350 | const std::unique_ptr<int64_t[]> shape_addr = MakeUnique<int64_t[]>(static_cast<size_t>(dim_num)); | 1349 | const std::unique_ptr<int64_t[]> shape_addr = MakeUnique<int64_t[]>(static_cast<size_t>(dim_num)); |
| 1351 | GE_CHECK_NOTNULL(shape_addr); | 1350 | GE_CHECK_NOTNULL(shape_addr); |
| 1352 | - GE_CHK_RT_RET(aclrtMemcpy(shape_addr.get(), result_summary.shape_data_size, shape_hbm, | 1351 | + GE_CHK_ACL_RET(aclrtMemcpy(shape_addr.get(), result_summary.shape_data_size, shape_hbm, |
| 1353 | result_summary.shape_data_size, ACL_MEMCPY_DEVICE_TO_HOST)); | 1352 | result_summary.shape_data_size, ACL_MEMCPY_DEVICE_TO_HOST)); |
| 1354 | 1353 | ||
| 1355 | for (size_t dim_idx = 0U; dim_idx < dim_num; ++dim_idx) { | 1354 | for (size_t dim_idx = 0U; dim_idx < dim_num; ++dim_idx) { |
| @@ -1410,17 +1409,17 @@ Status AiCpuTask::InitForSummaryAndCopy() { | |||
| 1410 | output_summary_.resize(num_outputs_); | 1409 | output_summary_.resize(num_outputs_); |
| 1411 | for (size_t i = 0U; i < num_outputs_; ++i) { | 1410 | for (size_t i = 0U; i < num_outputs_; ++i) { |
| 1412 | constexpr size_t result_summary_size = sizeof(aicpu::FWKAdapter::ResultSummary); | 1411 | constexpr size_t result_summary_size = sizeof(aicpu::FWKAdapter::ResultSummary); |
| 1413 | - GE_CHK_RT_RET(ge::AclrtMalloc(&output_summary_[i], result_summary_size, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 1412 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&output_summary_[i], result_summary_size, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 1414 | } | 1413 | } |
| 1415 | output_summary_host_.resize(num_outputs_); | 1414 | output_summary_host_.resize(num_outputs_); |
| 1416 | 1415 | ||
| 1417 | const size_t copy_input_buf_len = num_outputs_ * kCopyNum * sizeof(uint64_t); | 1416 | const size_t copy_input_buf_len = num_outputs_ * kCopyNum * sizeof(uint64_t); |
| 1418 | 1417 | ||
| 1419 | - GE_CHK_RT_RET(ge::AclrtMalloc(©_input_release_flag_dev_, copy_input_buf_len, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 1418 | + GE_CHK_ACL_RET(ge::AclrtMalloc(©_input_release_flag_dev_, copy_input_buf_len, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 1420 | - GE_CHK_RT_RET(ge::AclrtMalloc(©_input_data_size_dev_, copy_input_buf_len, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 1419 | + GE_CHK_ACL_RET(ge::AclrtMalloc(©_input_data_size_dev_, copy_input_buf_len, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 1421 | - GE_CHK_RT_RET(ge::AclrtMalloc(©_input_src_dev_, copy_input_buf_len, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 1420 | + GE_CHK_ACL_RET(ge::AclrtMalloc(©_input_src_dev_, copy_input_buf_len, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 1422 | - GE_CHK_RT_RET(ge::AclrtMalloc(©_input_dst_dev_, copy_input_buf_len, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 1421 | + GE_CHK_ACL_RET(ge::AclrtMalloc(©_input_dst_dev_, copy_input_buf_len, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 1423 | - GE_CHK_RT_RET(ge::AclrtMalloc(©_task_args_buf_, sizeof(STR_FWK_OP_KERNEL), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 1422 | + GE_CHK_ACL_RET(ge::AclrtMalloc(©_task_args_buf_, sizeof(STR_FWK_OP_KERNEL), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 1424 | 1423 | ||
| 1425 | std::vector<uint64_t> copy_io_addr; | 1424 | std::vector<uint64_t> copy_io_addr; |
| 1426 | copy_io_addr.emplace_back(PtrToValue(copy_input_release_flag_dev_)); | 1425 | copy_io_addr.emplace_back(PtrToValue(copy_input_release_flag_dev_)); |
| @@ -1430,9 +1429,9 @@ Status AiCpuTask::InitForSummaryAndCopy() { | |||
| 1430 | 1429 | ||
| 1431 | const uint64_t copy_io_addr_size = sizeof(uint64_t) * static_cast<uint64_t>(copy_io_addr.size()); | 1430 | const uint64_t copy_io_addr_size = sizeof(uint64_t) * static_cast<uint64_t>(copy_io_addr.size()); |
| 1432 | 1431 | ||
| 1433 | - GE_CHK_RT_RET(ge::AclrtMalloc(©_ioaddr_dev_, copy_io_addr_size, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 1432 | + GE_CHK_ACL_RET(ge::AclrtMalloc(©_ioaddr_dev_, copy_io_addr_size, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 1434 | 1433 | ||
| 1435 | - GE_CHK_RT_RET(aclrtMemcpy(copy_ioaddr_dev_, copy_io_addr_size, | 1434 | + GE_CHK_ACL_RET(aclrtMemcpy(copy_ioaddr_dev_, copy_io_addr_size, |
| 1436 | copy_io_addr.data(), copy_io_addr_size, ACL_MEMCPY_HOST_TO_DEVICE)); | 1435 | copy_io_addr.data(), copy_io_addr_size, ACL_MEMCPY_HOST_TO_DEVICE)); |
| 1437 | return SUCCESS; | 1436 | return SUCCESS; |
| 1438 | } | 1437 | } |
| @@ -1445,9 +1444,9 @@ Status AiCpuTask::SetMemCopyTask(const domi::KernelExDef &kernel_def) { | |||
| 1445 | static_cast<uint64_t>(sizeof(STR_FWK_OP_KERNEL)), kernel_def.args_size()); | 1444 | static_cast<uint64_t>(sizeof(STR_FWK_OP_KERNEL)), kernel_def.args_size()); |
| 1446 | return ACL_ERROR_GE_PARAM_INVALID; | 1445 | return ACL_ERROR_GE_PARAM_INVALID; |
| 1447 | } | 1446 | } |
| 1448 | - GE_CHK_RT_RET(ge::AclrtMalloc(©_workspace_buf_, static_cast<uint64_t>(kernel_def.task_info_size()), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 1447 | + GE_CHK_ACL_RET(ge::AclrtMalloc(©_workspace_buf_, static_cast<uint64_t>(kernel_def.task_info_size()), RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 1449 | GE_CHECK_GE(kernel_def.task_info().size(), static_cast<size_t>(kernel_def.task_info_size())); | 1448 | GE_CHECK_GE(kernel_def.task_info().size(), static_cast<size_t>(kernel_def.task_info_size())); |
| 1450 | - GE_CHK_RT_RET(aclrtMemcpy(copy_workspace_buf_, static_cast<uint64_t>(kernel_def.task_info_size()), | 1449 | + GE_CHK_ACL_RET(aclrtMemcpy(copy_workspace_buf_, static_cast<uint64_t>(kernel_def.task_info_size()), |
| 1451 | kernel_def.task_info().data(), static_cast<uint64_t>(kernel_def.task_info_size()), | 1450 | kernel_def.task_info().data(), static_cast<uint64_t>(kernel_def.task_info_size()), |
| 1452 | ACL_MEMCPY_HOST_TO_DEVICE)); | 1451 | ACL_MEMCPY_HOST_TO_DEVICE)); |
| 1453 | 1452 | ||
| @@ -1465,7 +1464,7 @@ Status AiCpuTask::SetMemCopyTask(const domi::KernelExDef &kernel_def) { | |||
| 1465 | aicpu_task.fwkKernelBase.fwk_kernel.extInfoAddr = 0U; | 1464 | aicpu_task.fwkKernelBase.fwk_kernel.extInfoAddr = 0U; |
| 1466 | aicpu_task.fwkKernelBase.fwk_kernel.extInfoLen = 0U; | 1465 | aicpu_task.fwkKernelBase.fwk_kernel.extInfoLen = 0U; |
| 1467 | 1466 | ||
| 1468 | - GE_CHK_RT_RET(aclrtMemcpy(copy_task_args_buf_, sizeof(STR_FWK_OP_KERNEL), | 1467 | + GE_CHK_ACL_RET(aclrtMemcpy(copy_task_args_buf_, sizeof(STR_FWK_OP_KERNEL), |
| 1469 | &aicpu_task, sizeof(STR_FWK_OP_KERNEL), ACL_MEMCPY_HOST_TO_DEVICE)); | 1468 | &aicpu_task, sizeof(STR_FWK_OP_KERNEL), ACL_MEMCPY_HOST_TO_DEVICE)); |
| 1470 | return SUCCESS; | 1469 | return SUCCESS; |
| 1471 | } | 1470 | } |
| @@ -1488,10 +1487,10 @@ Status AiCpuTask::LaunchKernel(const std::vector<GeTensorDesc> &input_desc, | |||
| 1488 | 1487 | ||
| 1489 | GE_CHK_STATUS_RET_NOLOG(LaunchKernel(stream)); | 1488 | GE_CHK_STATUS_RET_NOLOG(LaunchKernel(stream)); |
| 1490 | if (unknown_type_ == DEPEND_SHAPE_RANGE) { | 1489 | if (unknown_type_ == DEPEND_SHAPE_RANGE) { |
| 1491 | - GE_CHK_RT_RET(aclrtSynchronizeStream(stream)); | 1490 | + GE_CHK_ACL_RET(aclrtSynchronizeStream(stream)); |
| 1492 | GE_CHK_STATUS_RET_NOLOG(UpdateOutputShape(output_desc)); | 1491 | GE_CHK_STATUS_RET_NOLOG(UpdateOutputShape(output_desc)); |
| 1493 | } else if (unknown_type_ == DEPEND_COMPUTE) { | 1492 | } else if (unknown_type_ == DEPEND_COMPUTE) { |
| 1494 | - GE_CHK_RT_RET(aclrtSynchronizeStream(stream)); | 1493 | + GE_CHK_ACL_RET(aclrtSynchronizeStream(stream)); |
| 1495 | GE_CHK_STATUS_RET_NOLOG(UpdateShapeAndDataByResultSummary(output_desc, output_buffers, stream)); | 1494 | GE_CHK_STATUS_RET_NOLOG(UpdateShapeAndDataByResultSummary(output_desc, output_buffers, stream)); |
| 1496 | } else { | 1495 | } else { |
| 1497 | // something else | 1496 | // something else |
| @@ -1518,10 +1517,10 @@ Status AiCpuCCTask::LaunchKernel(const std::vector<GeTensorDesc> &input_desc, | |||
| 1518 | 1517 | ||
| 1519 | GE_CHK_STATUS_RET_NOLOG(LaunchKernel(stream)); | 1518 | GE_CHK_STATUS_RET_NOLOG(LaunchKernel(stream)); |
| 1520 | if (unknown_type_ == DEPEND_SHAPE_RANGE) { | 1519 | if (unknown_type_ == DEPEND_SHAPE_RANGE) { |
| 1521 | - GE_CHK_RT_RET(aclrtSynchronizeStream(stream)); | 1520 | + GE_CHK_ACL_RET(aclrtSynchronizeStream(stream)); |
| 1522 | GE_CHK_STATUS_RET_NOLOG(UpdateOutputShape(output_desc)); | 1521 | GE_CHK_STATUS_RET_NOLOG(UpdateOutputShape(output_desc)); |
| 1523 | } else if (unknown_type_ == DEPEND_COMPUTE) { | 1522 | } else if (unknown_type_ == DEPEND_COMPUTE) { |
| 1524 | - GE_CHK_RT_RET(aclrtSynchronizeStream(stream)); | 1523 | + GE_CHK_ACL_RET(aclrtSynchronizeStream(stream)); |
| 1525 | GE_CHK_STATUS_RET_NOLOG(UpdateShapeAndDataByResultSummary(output_desc, output_buffers, stream)); | 1524 | GE_CHK_STATUS_RET_NOLOG(UpdateShapeAndDataByResultSummary(output_desc, output_buffers, stream)); |
| 1526 | } else { | 1525 | } else { |
| 1527 | // something else | 1526 | // something else |
| @@ -1539,16 +1538,16 @@ Status AiCpuCCTask::InitForSummaryAndCopy() { | |||
| 1539 | output_summary_.resize(num_outputs_); | 1538 | output_summary_.resize(num_outputs_); |
| 1540 | for (size_t i = 0U; i < num_outputs_; ++i) { | 1539 | for (size_t i = 0U; i < num_outputs_; ++i) { |
| 1541 | constexpr size_t result_summary_size = sizeof(aicpu::FWKAdapter::ResultSummary); | 1540 | constexpr size_t result_summary_size = sizeof(aicpu::FWKAdapter::ResultSummary); |
| 1542 | - GE_CHK_RT_RET(ge::AclrtMalloc(&output_summary_[i], result_summary_size, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 1541 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&output_summary_[i], result_summary_size, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 1543 | } | 1542 | } |
| 1544 | output_summary_host_.resize(num_outputs_); | 1543 | output_summary_host_.resize(num_outputs_); |
| 1545 | 1544 | ||
| 1546 | const size_t copy_input_buf_len = num_outputs_ * kCopyNum * sizeof(uint64_t); | 1545 | const size_t copy_input_buf_len = num_outputs_ * kCopyNum * sizeof(uint64_t); |
| 1547 | 1546 | ||
| 1548 | - GE_CHK_RT_RET(ge::AclrtMalloc(©_input_release_flag_dev_, copy_input_buf_len, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 1547 | + GE_CHK_ACL_RET(ge::AclrtMalloc(©_input_release_flag_dev_, copy_input_buf_len, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 1549 | - GE_CHK_RT_RET(ge::AclrtMalloc(©_input_data_size_dev_, copy_input_buf_len, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 1548 | + GE_CHK_ACL_RET(ge::AclrtMalloc(©_input_data_size_dev_, copy_input_buf_len, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 1550 | - GE_CHK_RT_RET(ge::AclrtMalloc(©_input_src_dev_, copy_input_buf_len, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 1549 | + GE_CHK_ACL_RET(ge::AclrtMalloc(©_input_src_dev_, copy_input_buf_len, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 1551 | - GE_CHK_RT_RET(ge::AclrtMalloc(©_input_dst_dev_, copy_input_buf_len, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 1550 | + GE_CHK_ACL_RET(ge::AclrtMalloc(©_input_dst_dev_, copy_input_buf_len, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 1552 | 1551 | ||
| 1553 | copy_io_addr_.emplace_back(PtrToValue(copy_input_release_flag_dev_)); | 1552 | copy_io_addr_.emplace_back(PtrToValue(copy_input_release_flag_dev_)); |
| 1554 | copy_io_addr_.emplace_back(PtrToValue(copy_input_data_size_dev_)); | 1553 | copy_io_addr_.emplace_back(PtrToValue(copy_input_data_size_dev_)); |
| @@ -1899,7 +1898,7 @@ MixL2OpTask::~MixL2OpTask() noexcept { | |||
| 1899 | 1898 | ||
| 1900 | Status NpuGetFloatStatusTask::LaunchKernel(aclrtStream const stream) { | 1899 | Status NpuGetFloatStatusTask::LaunchKernel(aclrtStream const stream) { |
| 1901 | GELOGD("NpuGetFloatStatusTask launch in."); | 1900 | GELOGD("NpuGetFloatStatusTask launch in."); |
| 1902 | - GE_CHK_RT_RET(aclrtMemcpyAsync(args_, args_size_, &output_addr_, | 1901 | + GE_CHK_ACL_RET(aclrtMemcpyAsync(args_, args_size_, &output_addr_, |
| 1903 | args_size_, ACL_MEMCPY_HOST_TO_BUF_TO_DEVICE, stream)); | 1902 | args_size_, ACL_MEMCPY_HOST_TO_BUF_TO_DEVICE, stream)); |
| 1904 | GE_CHK_RT_RET(ge::rtNpuGetFloatStatus(args_, output_size_, mode_, stream)); | 1903 | GE_CHK_RT_RET(ge::rtNpuGetFloatStatus(args_, output_size_, mode_, stream)); |
| 1905 | return SUCCESS; | 1904 | return SUCCESS; |
| @@ -1924,7 +1923,7 @@ Status NpuClearFloatStatusTask::LaunchKernel(aclrtStream const stream) { | |||
| 1924 | 1923 | ||
| 1925 | Status NpuGetFloatDebugStatusTask::LaunchKernel(aclrtStream const stream) { | 1924 | Status NpuGetFloatDebugStatusTask::LaunchKernel(aclrtStream const stream) { |
| 1926 | GELOGD("NpuGetFloatDebugStatusTask launch in."); | 1925 | GELOGD("NpuGetFloatDebugStatusTask launch in."); |
| 1927 | - GE_CHK_RT_RET(aclrtMemcpyAsync(args_, args_size_, &output_addr_, | 1926 | + GE_CHK_ACL_RET(aclrtMemcpyAsync(args_, args_size_, &output_addr_, |
| 1928 | args_size_, ACL_MEMCPY_HOST_TO_BUF_TO_DEVICE, stream)); | 1927 | args_size_, ACL_MEMCPY_HOST_TO_BUF_TO_DEVICE, stream)); |
| 1929 | GE_CHK_RT_RET(ge::rtNpuGetFloatDebugStatus(args_, output_size_, mode_, stream)); | 1928 | GE_CHK_RT_RET(ge::rtNpuGetFloatDebugStatus(args_, output_size_, mode_, stream)); |
| 1930 | return SUCCESS; | 1929 | return SUCCESS; |
| @@ -1984,13 +1983,13 @@ Status DsaTask::UpdateDsaSqe(aclrtStream const stream) { | |||
| 1984 | workspace_input_addr, sizeof(uint64_t) * 2U, input_addr.data(), sizeof(uint64_t) * input_addr.size(), | 1983 | workspace_input_addr, sizeof(uint64_t) * 2U, input_addr.data(), sizeof(uint64_t) * input_addr.size(), |
| 1985 | stream); | 1984 | stream); |
| 1986 | // 此处无需校验,可以保证原地址非空且src_size > 0 | 1985 | // 此处无需校验,可以保证原地址非空且src_size > 0 |
| 1987 | - GE_CHK_RT_RET(aclrtMemcpyAsync(ValueToPtr(workspace_input_addr), sizeof(uint64_t) * 2U, input_addr.data(), | 1986 | + GE_CHK_ACL_RET(aclrtMemcpyAsync(ValueToPtr(workspace_input_addr), sizeof(uint64_t) * 2U, input_addr.data(), |
| 1988 | sizeof(uint64_t) * input_addr.size(), ACL_MEMCPY_HOST_TO_BUF_TO_DEVICE, stream)); | 1987 | sizeof(uint64_t) * input_addr.size(), ACL_MEMCPY_HOST_TO_BUF_TO_DEVICE, stream)); |
| 1989 | } else { | 1988 | } else { |
| 1990 | GELOGD("Try to do async memory copy, dst_addr = %p, dst_size = %zu, src_addr = %d, src_size = %zu, stream = %p", | 1989 | GELOGD("Try to do async memory copy, dst_addr = %p, dst_size = %zu, src_addr = %d, src_size = %zu, stream = %p", |
| 1991 | workspace_input_addr, sizeof(uint64_t) * 2U, input_data_, sizeof(input_data_), stream); | 1990 | workspace_input_addr, sizeof(uint64_t) * 2U, input_data_, sizeof(input_data_), stream); |
| 1992 | // 此处无需校验,可以保证原地址非空且src_size > 0 | 1991 | // 此处无需校验,可以保证原地址非空且src_size > 0 |
| 1993 | - GE_CHK_RT_RET(aclrtMemcpyAsync(ValueToPtr(workspace_input_addr), sizeof(uint64_t) * 2U, input_data_, | 1992 | + GE_CHK_ACL_RET(aclrtMemcpyAsync(ValueToPtr(workspace_input_addr), sizeof(uint64_t) * 2U, input_data_, |
| 1994 | sizeof(input_data_), ACL_MEMCPY_HOST_TO_BUF_TO_DEVICE, stream)); | 1993 | sizeof(input_data_), ACL_MEMCPY_HOST_TO_BUF_TO_DEVICE, stream)); |
| 1995 | } | 1994 | } |
| 1996 | 1995 | ||
| @@ -21,7 +21,9 @@ | |||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | -#include "runtime/stream.h" | 24 | +#include "rt_external_stream.h" |
| 25 | + | ||
| 26 | + | ||
| 25 | 27 | ||
| 26 | 28 | ||
| 27 | 29 | ||
| @@ -30,7 +32,7 @@ | |||
| 30 | 32 | ||
| 31 | 33 | ||
| 32 | 34 | ||
| 33 | -#include "runtime/rt.h" | 35 | +#include "rt_external.h" |
| 34 | 36 | ||
| 35 | 37 | ||
| 36 | 38 | ||
| @@ -77,7 +77,7 @@ Status RtsKernelTaskBuilder::BuildNpuGetFloatStatusTask(const GetOpDescFunc &get | |||
| 77 | task->mode_ = kernel_def.mode(); | 77 | task->mode_ = kernel_def.mode(); |
| 78 | task->output_size_ = kernel_def.output_size(); | 78 | task->output_size_ = kernel_def.output_size(); |
| 79 | task->args_size_ = sizeof(uint8_t *); | 79 | task->args_size_ = sizeof(uint8_t *); |
| 80 | - GE_CHK_RT_RET(ge::AclrtMalloc(&task->args_, task->args_size_, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 80 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&task->args_, task->args_size_, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 81 | GE_CHK_STATUS_RET(ModelUtils::GetRtAddress(param.runtime_param, static_cast<uintptr_t>(kernel_def.output_addr()), | 81 | GE_CHK_STATUS_RET(ModelUtils::GetRtAddress(param.runtime_param, static_cast<uintptr_t>(kernel_def.output_addr()), |
| 82 | task->output_addr_)); | 82 | task->output_addr_)); |
| 83 | OpDescPtr op_desc = nullptr; | 83 | OpDescPtr op_desc = nullptr; |
| @@ -113,7 +113,7 @@ Status RtsKernelTaskBuilder::BuildNpuGetFloatDebugStatusTask(const GetOpDescFunc | |||
| 113 | task->mode_ = kernel_def.mode(); | 113 | task->mode_ = kernel_def.mode(); |
| 114 | task->output_size_ = kernel_def.output_size(); | 114 | task->output_size_ = kernel_def.output_size(); |
| 115 | task->args_size_ = sizeof(uint8_t *); | 115 | task->args_size_ = sizeof(uint8_t *); |
| 116 | - GE_CHK_RT_RET(ge::AclrtMalloc(&task->args_, task->args_size_, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 116 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&task->args_, task->args_size_, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 117 | GE_CHK_STATUS_RET(ModelUtils::GetRtAddress(param.runtime_param, static_cast<uintptr_t>(kernel_def.output_addr()), | 117 | GE_CHK_STATUS_RET(ModelUtils::GetRtAddress(param.runtime_param, static_cast<uintptr_t>(kernel_def.output_addr()), |
| 118 | task->output_addr_)); | 118 | task->output_addr_)); |
| 119 | OpDescPtr op_desc = nullptr; | 119 | OpDescPtr op_desc = nullptr; |
| @@ -21,7 +21,7 @@ | |||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | -#include "runtime/rt.h" | 24 | +#include "rt_external.h" |
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | 27 | ||
| @@ -236,7 +236,7 @@ Status TbeTaskBuilder::InitKernelArgs(void *const args_addr, const size_t arg_si | |||
| 236 | if (!tensor_device_addr_vec.empty()) { | 236 | if (!tensor_device_addr_vec.empty()) { |
| 237 | void *const src_addr = reinterpret_cast<void *>(tensor_device_addr_vec.data()); | 237 | void *const src_addr = reinterpret_cast<void *>(tensor_device_addr_vec.data()); |
| 238 | const size_t src_len = sizeof(void *) * tensor_device_addr_vec.size(); | 238 | const size_t src_len = sizeof(void *) * tensor_device_addr_vec.size(); |
| 239 | - GE_CHK_RT_RET(aclrtMemcpy(args_addr, arg_size, src_addr, src_len, ACL_MEMCPY_HOST_TO_HOST)); | 239 | + GE_CHK_ACL_RET(aclrtMemcpy(args_addr, arg_size, src_addr, src_len, ACL_MEMCPY_HOST_TO_HOST)); |
| 240 | } | 240 | } |
| 241 | return SUCCESS; | 241 | return SUCCESS; |
| 242 | } | 242 | } |
| @@ -288,12 +288,12 @@ Status TbeTaskBuilder::SetKernelArgs(TbeOpTask &task, const SingleOpModelParam & | |||
| 288 | REQUIRE_COMPAT_UINT16(arg_size); | 288 | REQUIRE_COMPAT_UINT16(arg_size); |
| 289 | args = MakeUnique<uint8_t[]>(arg_size); | 289 | args = MakeUnique<uint8_t[]>(arg_size); |
| 290 | GE_CHECK_NOTNULL(args); | 290 | GE_CHECK_NOTNULL(args); |
| 291 | - GE_CHK_RT_RET(aclrtMemcpy(args.get(), arg_size, kernel_def_args, kernel_def_arg_size, | 291 | + GE_CHK_ACL_RET(aclrtMemcpy(args.get(), arg_size, kernel_def_args, kernel_def_arg_size, |
| 292 | ACL_MEMCPY_HOST_TO_HOST)); | 292 | ACL_MEMCPY_HOST_TO_HOST)); |
| 293 | if (task.has_overflow_attr_) { | 293 | if (task.has_overflow_attr_) { |
| 294 | GE_CHECK_GE(kernel_def_arg_size, sizeof(void *)); | 294 | GE_CHECK_GE(kernel_def_arg_size, sizeof(void *)); |
| 295 | const size_t argsize_idx_with_overflow = kernel_def_arg_size - sizeof(void *); | 295 | const size_t argsize_idx_with_overflow = kernel_def_arg_size - sizeof(void *); |
| 296 | - GE_CHK_RT_RET(aclrtMemcpy(args.get() + argsize_idx_with_overflow, sizeof(void *), &(task.overflow_addr_), | 296 | + GE_CHK_ACL_RET(aclrtMemcpy(args.get() + argsize_idx_with_overflow, sizeof(void *), &(task.overflow_addr_), |
| 297 | sizeof(void *), ACL_MEMCPY_HOST_TO_HOST)); | 297 | sizeof(void *), ACL_MEMCPY_HOST_TO_HOST)); |
| 298 | } | 298 | } |
| 299 | const domi::KernelContext &context = (task_type == ModelTaskType::MODEL_TASK_ALL_KERNEL) ? | 299 | const domi::KernelContext &context = (task_type == ModelTaskType::MODEL_TASK_ALL_KERNEL) ? |
| @@ -304,8 +304,8 @@ Status TbeTaskBuilder::SetKernelArgs(TbeOpTask &task, const SingleOpModelParam & | |||
| 304 | // add ffts_addr after offset | 304 | // add ffts_addr after offset |
| 305 | if (task.ffts_addr_num_ == 1UL) { | 305 | if (task.ffts_addr_num_ == 1UL) { |
| 306 | void *mode_addr_ptr = nullptr; | 306 | void *mode_addr_ptr = nullptr; |
| 307 | - GE_CHK_RT_RET(aclrtGetHardwareSyncAddr(&mode_addr_ptr)); | 307 | + GE_CHK_ACL_RET(aclrtGetHardwareSyncAddr(&mode_addr_ptr)); |
| 308 | - GE_CHK_RT_RET(aclrtMemcpy(args.get() + offset, sizeof(uint64_t), &mode_addr_ptr, | 308 | + GE_CHK_ACL_RET(aclrtMemcpy(args.get() + offset, sizeof(uint64_t), &mode_addr_ptr, |
| 309 | sizeof(uint64_t), ACL_MEMCPY_HOST_TO_HOST)); | 309 | sizeof(uint64_t), ACL_MEMCPY_HOST_TO_HOST)); |
| 310 | offset += sizeof(uint64_t); | 310 | offset += sizeof(uint64_t); |
| 311 | } | 311 | } |
| @@ -486,7 +486,7 @@ Status MixL2TaskBuilder::BuildMixL2Task(MixL2OpTask &task, SingleOpModelParam &p | |||
| 486 | task.arg_size_ = kernel_def_arg_size + task.max_tiling_size_ + len; | 486 | task.arg_size_ = kernel_def_arg_size + task.max_tiling_size_ + len; |
| 487 | if (task.arg_size_ > 0UL) { | 487 | if (task.arg_size_ > 0UL) { |
| 488 | task.host_args_.resize(task.arg_size_ / sizeof(uintptr_t)); | 488 | task.host_args_.resize(task.arg_size_ / sizeof(uintptr_t)); |
| 489 | - GE_CHK_RT_RET(ge::AclrtMalloc(&task.device_args_, task.arg_size_, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); | 489 | + GE_CHK_ACL_RET(ge::AclrtMalloc(&task.device_args_, task.arg_size_, RT_MEMORY_HBM, GE_MODULE_NAME_U16)); |
| 490 | } | 490 | } |
| 491 | 491 | ||
| 492 | // Init Mode addr | 492 | // Init Mode addr |
| @@ -532,7 +532,7 @@ Status MixL2TaskBuilder::InitTilingDataAddrToArgs(MixL2OpTask &task) const { | |||
| 532 | const size_t tiling_data_idx = op_desc_->GetAllInputsDescPtr().size() + op_desc_->GetWorkspaceBytes().size() + | 532 | const size_t tiling_data_idx = op_desc_->GetAllInputsDescPtr().size() + op_desc_->GetWorkspaceBytes().size() + |
| 533 | static_cast<size_t>(op_desc_->GetAllOutputsDescSize()); | 533 | static_cast<size_t>(op_desc_->GetAllOutputsDescSize()); |
| 534 | GE_CHECK_GE(task.host_args_.size(), (task.args_addr_base_idx_ + tiling_data_idx + 1U)); | 534 | GE_CHECK_GE(task.host_args_.size(), (task.args_addr_base_idx_ + tiling_data_idx + 1U)); |
| 535 | - GE_CHK_RT_RET(aclrtMemcpy(&task.host_args_[task.args_addr_base_idx_ + tiling_data_idx], sizeof(uintptr_t), | 535 | + GE_CHK_ACL_RET(aclrtMemcpy(&task.host_args_[task.args_addr_base_idx_ + tiling_data_idx], sizeof(uintptr_t), |
| 536 | &tiling_data_addr_, sizeof(uintptr_t), ACL_MEMCPY_HOST_TO_HOST)); | 536 | &tiling_data_addr_, sizeof(uintptr_t), ACL_MEMCPY_HOST_TO_HOST)); |
| 537 | GELOGI("Init tiling data addr of %s, tiling_data_idx: %zu.", op_desc_->GetName().c_str(), tiling_data_idx); | 537 | GELOGI("Init tiling data addr of %s, tiling_data_idx: %zu.", op_desc_->GetName().c_str(), tiling_data_idx); |
| 538 | return SUCCESS; | 538 | return SUCCESS; |
| @@ -21,7 +21,7 @@ | |||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | -#include "runtime/mem.h" | 24 | +#include "rt_external_mem.h" |
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | 27 | ||
| @@ -21,7 +21,7 @@ | |||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | -#include "runtime/rt.h" | 24 | +#include "rt_external.h" |
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | 27 | ||
| @@ -29,6 +29,7 @@ | |||
| 29 | 29 | ||
| 30 | 30 | ||
| 31 | 31 | ||
| 32 | + | ||
| 32 | 33 | ||
| 33 | namespace gert { | 34 | namespace gert { |
| 34 | namespace { | 35 | namespace { |
| @@ -12,7 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | -#include "runtime/rt_model.h" | 15 | +#include "rt_external_model.h" |
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| @@ -22,7 +22,7 @@ | |||
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | -#include "runtime/rt_model.h" | 25 | +#include "rt_external_model.h" |
| 26 | 26 | ||
| 27 | 27 | ||
| 28 | 28 | ||
| @@ -42,15 +42,15 @@ ge::graphStatus SetStreamCoreNumLimit(const rtStream stream, const int64_t op_ai | |||
| 42 | need_set_stream_aicore_num = false; | 42 | need_set_stream_aicore_num = false; |
| 43 | need_set_stream_vec_core_num = false; | 43 | need_set_stream_vec_core_num = false; |
| 44 | if (op_aicore_num > 0) { | 44 | if (op_aicore_num > 0) { |
| 45 | - GE_CHK_RT_RET(aclrtSetStreamResLimit(stream, ACL_RT_DEV_RES_CUBE_CORE, static_cast<uint32_t>(op_aicore_num))); | 45 | + GE_CHK_ACL_RET(aclrtSetStreamResLimit(stream, ACL_RT_DEV_RES_CUBE_CORE, static_cast<uint32_t>(op_aicore_num))); |
| 46 | need_set_stream_aicore_num = true; | 46 | need_set_stream_aicore_num = true; |
| 47 | } | 47 | } |
| 48 | if (op_vec_core_num > 0) { | 48 | if (op_vec_core_num > 0) { |
| 49 | - GE_CHK_RT_RET(aclrtSetStreamResLimit(stream, ACL_RT_DEV_RES_VECTOR_CORE, static_cast<uint32_t>(op_vec_core_num))); | 49 | + GE_CHK_ACL_RET(aclrtSetStreamResLimit(stream, ACL_RT_DEV_RES_VECTOR_CORE, static_cast<uint32_t>(op_vec_core_num))); |
| 50 | need_set_stream_vec_core_num = true; | 50 | need_set_stream_vec_core_num = true; |
| 51 | } | 51 | } |
| 52 | if (need_set_stream_aicore_num || need_set_stream_vec_core_num) { | 52 | if (need_set_stream_aicore_num || need_set_stream_vec_core_num) { |
| 53 | - GE_CHK_RT_RET(aclrtUseStreamResInCurrentThread(stream)); | 53 | + GE_CHK_ACL_RET(aclrtUseStreamResInCurrentThread(stream)); |
| 54 | } | 54 | } |
| 55 | return ge::GRAPH_SUCCESS; | 55 | return ge::GRAPH_SUCCESS; |
| 56 | } | 56 | } |
| @@ -59,11 +59,11 @@ ge::graphStatus ResetStreamCoreNumLimit(const rtStream stream, const int64_t glo | |||
| 59 | const bool need_set_stream_aicore_num, const bool need_set_stream_vec_core_num) { | 59 | const bool need_set_stream_aicore_num, const bool need_set_stream_vec_core_num) { |
| 60 | if (need_set_stream_aicore_num) { | 60 | if (need_set_stream_aicore_num) { |
| 61 | GE_ASSERT_TRUE(global_aicore_num >= 0); | 61 | GE_ASSERT_TRUE(global_aicore_num >= 0); |
| 62 | - GE_CHK_RT_RET(aclrtSetStreamResLimit(stream, ACL_RT_DEV_RES_CUBE_CORE, static_cast<uint32_t>(global_aicore_num))); | 62 | + GE_CHK_ACL_RET(aclrtSetStreamResLimit(stream, ACL_RT_DEV_RES_CUBE_CORE, static_cast<uint32_t>(global_aicore_num))); |
| 63 | } | 63 | } |
| 64 | if (need_set_stream_vec_core_num) { | 64 | if (need_set_stream_vec_core_num) { |
| 65 | GE_ASSERT_TRUE(global_vec_core_num >= 0); | 65 | GE_ASSERT_TRUE(global_vec_core_num >= 0); |
| 66 | - GE_CHK_RT_RET(aclrtSetStreamResLimit(stream, ACL_RT_DEV_RES_VECTOR_CORE, static_cast<uint32_t>(global_vec_core_num))); | 66 | + GE_CHK_ACL_RET(aclrtSetStreamResLimit(stream, ACL_RT_DEV_RES_VECTOR_CORE, static_cast<uint32_t>(global_vec_core_num))); |
| 67 | } | 67 | } |
| 68 | return ge::GRAPH_SUCCESS; | 68 | return ge::GRAPH_SUCCESS; |
| 69 | } | 69 | } |
| @@ -13,9 +13,9 @@ | |||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | -#include "runtime/rt_ffts_plus_define.h" | 16 | +#include "rt_external_ffts_define.h" |
| 17 | -#include "runtime/rt_ffts_plus.h" | 17 | +#include "rt_external_ffts.h" |
| 18 | -#include "runtime/mem.h" | 18 | +#include "rt_external_mem.h" |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | 21 | ||
| @@ -20,9 +20,9 @@ | |||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | -#include "runtime/rt_ffts_plus_define.h" | 23 | +#include "rt_external_ffts_define.h" |
| 24 | -#include "runtime/rt_ffts_plus.h" | 24 | +#include "rt_external_ffts.h" |
| 25 | -#include "runtime/mem.h" | 25 | +#include "rt_external_mem.h" |
| 26 | 26 | ||
| 27 | 27 | ||
| 28 | 28 | ||
| @@ -22,9 +22,9 @@ | |||
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | -#include "runtime/rt_ffts_plus_define.h" | 25 | +#include "rt_external_ffts_define.h" |
| 26 | -#include "runtime/rt_ffts_plus.h" | 26 | +#include "rt_external_ffts.h" |
| 27 | -#include "runtime/mem.h" | 27 | +#include "rt_external_mem.h" |
| 28 | 28 | ||
| 29 | 29 | ||
| 30 | 30 | ||
| @@ -310,7 +310,7 @@ ge::graphStatus FFTSUpdateMixL2Args(KernelContext *context) { | |||
| 310 | size_t arg_index = 0; | 310 | size_t arg_index = 0; |
| 311 | if (need_mode_addr == 1U) { | 311 | if (need_mode_addr == 1U) { |
| 312 | void *mode_addr_ptr = nullptr; | 312 | void *mode_addr_ptr = nullptr; |
| 313 | - GE_CHK_RT_RET(aclrtGetHardwareSyncAddr(&mode_addr_ptr)); | 313 | + GE_CHK_ACL_RET(aclrtGetHardwareSyncAddr(&mode_addr_ptr)); |
| 314 | InitMixL2Addrs(arg_index++, mode_addr_ptr, args_host_data); | 314 | InitMixL2Addrs(arg_index++, mode_addr_ptr, args_host_data); |
| 315 | } | 315 | } |
| 316 | 316 | ||
| @@ -12,7 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | -#include "runtime/mem.h" | 15 | +#include "rt_external_mem.h" |
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| @@ -15,7 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | -#include "runtime/kernel.h" | 18 | +#include "rt_external_kernel.h" |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | 21 | ||
| @@ -13,9 +13,9 @@ | |||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | -#include "runtime/rt_ffts_plus_define.h" | 16 | +#include "rt_external_mem.h" |
| 17 | -#include "runtime/rt_ffts_plus.h" | 17 | +#include "rt_external_ffts_define.h" |
| 18 | -#include "runtime/mem.h" | 18 | +#include "rt_external_ffts.h" |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | 21 | ||
| @@ -17,8 +17,8 @@ | |||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | -#include "runtime/rt_ffts_plus_define.h" | 20 | +#include "rt_external_ffts_define.h" |
| 21 | -#include "runtime/rt_ffts_plus.h" | 21 | +#include "rt_external_ffts.h" |
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | 24 | ||
| @@ -11,9 +11,9 @@ | |||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | -#include "runtime/kernel.h" | 14 | +#include "rt_external_kernel.h" |
| 15 | -#include "runtime/mem.h" | 15 | +#include "rt_external_mem.h" |
| 16 | -#include "runtime/rt.h" | 16 | +#include "rt_external.h" |
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | 19 | ||
| @@ -28,8 +28,7 @@ | |||
| 28 | 28 | ||
| 29 | 29 | ||
| 30 | 30 | ||
| 31 | -#include "runtime/mem.h" | 31 | +#include "common/ge_rts_decl.h" |
| 32 | - | ||
| 33 | 32 | ||
| 34 | 33 | ||
| 35 | 34 | ||
| @@ -37,8 +36,7 @@ | |||
| 37 | 36 | ||
| 38 | 37 | ||
| 39 | 38 | ||
| 40 | -#include "runtime/rts/rts_stream.h" | 39 | +#include "rt_external_stream.h" |
| 41 | - | ||
| 42 | 40 | ||
| 43 | 41 | ||
| 44 | 42 | ||
| @@ -362,7 +360,7 @@ static ge::graphStatus UpdateEachArgsInfo(const KernelContext *context, const ge | |||
| 362 | FE_ASSERT_NOTNULL(io_arg); | 360 | FE_ASSERT_NOTNULL(io_arg); |
| 363 | if (io_arg->start_index == 0xFFFF) { | 361 | if (io_arg->start_index == 0xFFFF) { |
| 364 | void *mode_addr_ptr = nullptr; | 362 | void *mode_addr_ptr = nullptr; |
| 365 | - GE_CHK_RT_RET(aclrtGetHardwareSyncAddr(&mode_addr_ptr)); | 363 | + GE_CHK_ACL_RET(aclrtGetHardwareSyncAddr(&mode_addr_ptr)); |
| 366 | GELOGD("Mix set sync addr: [%ld].", reinterpret_cast<uint64_t>(mode_addr_ptr)); | 364 | GELOGD("Mix set sync addr: [%ld].", reinterpret_cast<uint64_t>(mode_addr_ptr)); |
| 367 | GE_RETURN_IF_ERROR(args.SetIoAddr(io_arg->arg_offset, mode_addr_ptr)); | 365 | GE_RETURN_IF_ERROR(args.SetIoAddr(io_arg->arg_offset, mode_addr_ptr)); |
| 368 | continue; | 366 | continue; |
| @@ -12,7 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | -#include "runtime/rt_ffts_plus.h" | 15 | +#include "rt_external_ffts.h" |
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| @@ -14,7 +14,7 @@ | |||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | -#include "runtime/kernel.h" | 17 | +#include "rt_external_kernel.h" |
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | 20 | ||
| @@ -29,7 +29,7 @@ | |||
| 29 | 29 | ||
| 30 | 30 | ||
| 31 | 31 | ||
| 32 | -#include "runtime/mem.h" | 32 | +#include "rt_external_mem.h" |
| 33 | 33 | ||
| 34 | 34 | ||
| 35 | namespace gert { | 35 | namespace gert { |
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | -#include "runtime/kernel.h" | 14 | +#include "rt_external_kernel.h" |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| @@ -21,7 +21,7 @@ | |||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | -#include "runtime/mem.h" | 24 | +#include "rt_external_mem.h" |
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | 27 | ||
| @@ -88,7 +88,7 @@ ge::graphStatus AicpuArgsHandler::MallocMem() { | |||
| 88 | host_buffer_ = ge::MakeUnique<uint8_t[]>(buffer_size_); | 88 | host_buffer_ = ge::MakeUnique<uint8_t[]>(buffer_size_); |
| 89 | GE_ASSERT_NOTNULL(host_buffer_); | 89 | GE_ASSERT_NOTNULL(host_buffer_); |
| 90 | if (need_device_ext_) { | 90 | if (need_device_ext_) { |
| 91 | - GE_ASSERT_RT_OK(ge::AclrtMalloc(&ext_info_device_buffer_, ext_info_size_, RT_MEMORY_HBM, | 91 | + GE_ASSERT_ACL_OK(ge::AclrtMalloc(&ext_info_device_buffer_, ext_info_size_, RT_MEMORY_HBM, |
| 92 | GE_MODULE_NAME_U16)); | 92 | GE_MODULE_NAME_U16)); |
| 93 | } | 93 | } |
| 94 | args_.args = host_buffer_.get(); | 94 | args_.args = host_buffer_.get(); |
| @@ -13,7 +13,7 @@ | |||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | -#include "runtime/kernel.h" | 16 | +#include "rt_external_kernel.h" |
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | 19 | ||
| @@ -16,8 +16,8 @@ | |||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | -#include "runtime/dev.h" | 19 | +#include "rt_external_device.h" |
| 20 | -#include "runtime/context.h" | 20 | +#include "common/ge_rts_decl.h" |
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | using namespace ge; | 23 | using namespace ge; |
| @@ -131,8 +131,8 @@ ge::graphStatus CustBinHandlerManager::LoadAndGetBinHandle(const std::string &so | |||
| 131 | return ge::FAILED; | 131 | return ge::FAILED; |
| 132 | } | 132 | } |
| 133 | 133 | ||
| 134 | - rtContext_t current_ctx = nullptr; | 134 | + aclrtContext current_ctx = nullptr; |
| 135 | - GE_CHK_RT_RET(aclrtGetCurrentContext(¤t_ctx)); | 135 | + GE_CHK_ACL_RET(aclrtGetCurrentContext(¤t_ctx)); |
| 136 | const uintptr_t resource_id = reinterpret_cast<uintptr_t>(current_ctx); | 136 | const uintptr_t resource_id = reinterpret_cast<uintptr_t>(current_ctx); |
| 137 | 137 | ||
| 138 | const std::lock_guard<std::recursive_mutex> lk(mutex_); | 138 | const std::lock_guard<std::recursive_mutex> lk(mutex_); |
| @@ -174,8 +174,8 @@ ge::graphStatus CustBinHandlerManager::GetBinHandle(const std::string &so_name, | |||
| 174 | return ge::FAILED; | 174 | return ge::FAILED; |
| 175 | } | 175 | } |
| 176 | 176 | ||
| 177 | - rtContext_t current_ctx = nullptr; | 177 | + aclrtContext current_ctx = nullptr; |
| 178 | - GE_CHK_RT_RET(aclrtGetCurrentContext(¤t_ctx)); | 178 | + GE_CHK_ACL_RET(aclrtGetCurrentContext(¤t_ctx)); |
| 179 | const uintptr_t resource_id = reinterpret_cast<uintptr_t>(current_ctx); | 179 | const uintptr_t resource_id = reinterpret_cast<uintptr_t>(current_ctx); |
| 180 | 180 | ||
| 181 | const std::lock_guard<std::recursive_mutex> lk(mutex_); | 181 | const std::lock_guard<std::recursive_mutex> lk(mutex_); |
| @@ -17,7 +17,7 @@ | |||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | -#include "runtime/base.h" | 20 | +#include "rt_external_kernel.h" |
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | namespace gert { | 23 | namespace gert { |
| @@ -27,6 +27,7 @@ | |||
| 27 | 27 | ||
| 28 | 28 | ||
| 29 | 29 | ||
| 30 | + | ||
| 30 | 31 | ||
| 31 | namespace gert { | 32 | namespace gert { |
| 32 | namespace { | 33 | namespace { |
Mtests/engines/nn_engine/ut/testcase/fusion_engine/l2_optimizer/fusion_engine_l2_optimzer_unittest.cc+1-1
Mtests/engines/nn_engine/ut/testcase/fusion_engine/task_builder/superkernel_task_builder_ut.cc+11-10