已合并
【PR】: fix alarm #2884
【PR】: fix alarm #2884
已合并
houyanbao创建于 6月16日
3 个文件变更+6-6
@@ -25,8 +25,8 @@
25namespace ge {25namespace ge {
26using Status = uint32_t;26using Status = uint32_t;
27 27
28-static const uint32_t GE_PROF_SUCCESS = 0U;28+static constexpr uint32_t GE_PROF_SUCCESS = 0U;
29-static const uint32_t GE_PROF_FAILED = 405091711U;29+static constexpr uint32_t GE_PROF_FAILED = 405091711U;
30 30 
31enum ProfDataTypeConfig {31enum ProfDataTypeConfig {
32 kProfTaskTime = 0x0002,32 kProfTaskTime = 0x0002,
@@ -1196,7 +1196,7 @@ void RawDevice::ProfSwitchDisable()
1196 return;1196 return;
1197 }1197 }
1198 1198 
1199- uint64_t profSwitch = 0UL;1199+ constexpr uint64_t profSwitch = 0UL;
1200 (void)driver_->MemCopySync(RtValueToPtr<void *>(profSwitchAddr_), sizeof(uint64_t), static_cast<const void *>(&profSwitch),1200 (void)driver_->MemCopySync(RtValueToPtr<void *>(profSwitchAddr_), sizeof(uint64_t), static_cast<const void *>(&profSwitch),
1201 sizeof(uint64_t), RT_MEMCPY_HOST_TO_DEVICE);1201 sizeof(uint64_t), RT_MEMCPY_HOST_TO_DEVICE);
1202 RT_LOG(RT_LOG_INFO, "profiling disabled, device_id=%u", deviceId_);1202 RT_LOG(RT_LOG_INFO, "profiling disabled, device_id=%u", deviceId_);
@@ -1209,7 +1209,7 @@ void RawDevice::ProfSwitchEnable()
1209 return;1209 return;
1210 }1210 }
1211 1211 
1212- uint64_t profSwitch = 1UL;1212+ constexpr uint64_t profSwitch = 1UL;
1213 (void)driver_->MemCopySync(RtValueToPtr<void *>(profSwitchAddr_), sizeof(uint64_t), static_cast<const void *>(&profSwitch),1213 (void)driver_->MemCopySync(RtValueToPtr<void *>(profSwitchAddr_), sizeof(uint64_t), static_cast<const void *>(&profSwitch),
1214 sizeof(uint64_t), RT_MEMCPY_HOST_TO_DEVICE);1214 sizeof(uint64_t), RT_MEMCPY_HOST_TO_DEVICE);
1215 RT_LOG(RT_LOG_INFO, "profiling enabled, device_id=%u", deviceId_);1215 RT_LOG(RT_LOG_INFO, "profiling enabled, device_id=%u", deviceId_);
@@ -2306,7 +2306,7 @@ rtError_t RawDevice::StoreEndGraphNotifyInfo(const uint32_t streamId, Model* cap
2306 auto it = captureModelExeInfoMap_.find(key);2306 auto it = captureModelExeInfoMap_.find(key);
2307 if (it == captureModelExeInfoMap_.end()) {2307 if (it == captureModelExeInfoMap_.end()) {
2308 numOfPos = 1;2308 numOfPos = 1;
2309- captureModelExeInfoMap_.emplace(key, std::list<uint32_t>(numOfPos, endGraphNotifyPos));2309+ (void)captureModelExeInfoMap_.emplace(key, std::list<uint32_t>(numOfPos, endGraphNotifyPos));
2310 } else {2310 } else {
2311 std::list<uint32_t>& posList = captureModelExeInfoMap_[key];2311 std::list<uint32_t>& posList = captureModelExeInfoMap_[key];
2312 (void)posList.emplace_back(endGraphNotifyPos);2312 (void)posList.emplace_back(endGraphNotifyPos);
@@ -515,7 +515,7 @@ static void GetMteDeviceFaultEvent(
515 const std::function<void()> releaseFunc = [&faultEventInfo]() { DELETE_A(faultEventInfo); };515 const std::function<void()> releaseFunc = [&faultEventInfo]() { DELETE_A(faultEventInfo); };
516 ScopeGuard faultEventInfoRelease(releaseFunc);516 ScopeGuard faultEventInfoRelease(releaseFunc);
517 uint32_t eventCount = 0U;517 uint32_t eventCount = 0U;
518- rtError_t error = GetDeviceFaultEvents(dev->Id_(), faultEventInfo, eventCount, maxFaultNum);518+ const rtError_t error = GetDeviceFaultEvents(dev->Id_(), faultEventInfo, eventCount, maxFaultNum);
519 if (error != RT_ERROR_NONE) {519 if (error != RT_ERROR_NONE) {
520 return;520 return;
521 }521 }