|
|
|
@@ -25,15 +25,15 @@ |
|
|
|
|
|
|
|
namespace { |
|
|
|
const uint32_t kDeviceListIndex = 3; |
|
|
|
const std::string kDeviceNums = "devNums"; |
|
|
|
const std::string kDeviceIdList = "devIdList"; |
|
|
|
const std::string kProfilingInit = "prof_init"; |
|
|
|
const std::string kProfilingFinalize = "prof_finalize"; |
|
|
|
const std::string kProfilingStart = "prof_start"; |
|
|
|
const std::string kProfilingStop = "prof_stop"; |
|
|
|
const std::string kProfModelSubscribe = "prof_model_subscribe"; |
|
|
|
const std::string kProfModelUnsubscribe = "prof_model_cancel_subscribe"; |
|
|
|
const std::string kRtSetDeviceRegName = "profiling"; |
|
|
|
const char *const kDeviceNums = "devNums"; |
|
|
|
const char *const kDeviceIdList = "devIdList"; |
|
|
|
const char *const kProfilingInit = "prof_init"; |
|
|
|
const char *const kProfilingFinalize = "prof_finalize"; |
|
|
|
const char *const kProfilingStart = "prof_start"; |
|
|
|
const char *const kProfilingStop = "prof_stop"; |
|
|
|
const char *const kProfModelSubscribe = "prof_model_subscribe"; |
|
|
|
const char *const kProfModelUnsubscribe = "prof_model_cancel_subscribe"; |
|
|
|
const char *const kRtSetDeviceRegName = "profiling"; |
|
|
|
|
|
|
|
const std::map<ProfCommandHandleType, std::string> kProfCommandTypeMap = { |
|
|
|
{kProfCommandhandleInit, kProfilingInit}, |
|
|
|
@@ -216,6 +216,28 @@ ge::Status ProfCommandHandle(ProfCommandHandleType type, void *data, uint32_t le |
|
|
|
return ge::SUCCESS; |
|
|
|
} |
|
|
|
|
|
|
|
GE_FUNC_VISIBILITY ge::Status ProfSetStepInfo(uint64_t index_id, uint16_t tag_id, rtStream_t stream) { |
|
|
|
return ge::SUCCESS; |
|
|
|
ge::Status ProfSetStepInfo(uint64_t index_id, uint16_t tag_id, rtStream_t stream) { |
|
|
|
static int32_t is_first_run = 1; |
|
|
|
int32_t device_id = 0; |
|
|
|
constexpr uint64_t kModelId = 4294967295; |
|
|
|
ge::Status rt_ret = rtGetDevice(&device_id); |
|
|
|
if (rt_ret != RT_ERROR_NONE) { |
|
|
|
GELOGE(rt_ret, "[Get][LogicDeviceId]Failed, ret 0x%X", rt_ret); |
|
|
|
REPORT_CALL_ERROR("E19999", "Get logic device id failed, ret 0x%X", rt_ret); |
|
|
|
return ge::FAILED; |
|
|
|
} |
|
|
|
if (is_first_run && tag_id == 0) { |
|
|
|
GE_CHK_STATUS_RET_NOLOG( |
|
|
|
ge::ProfilingManager::Instance().ProfileStepInfo(index_id, kModelId, tag_id, stream, device_id)); |
|
|
|
is_first_run = 0; |
|
|
|
return ge::SUCCESS; |
|
|
|
} |
|
|
|
if (!is_first_run && tag_id == 1) { |
|
|
|
GE_CHK_STATUS_RET_NOLOG( |
|
|
|
ge::ProfilingManager::Instance().ProfileStepInfo(index_id, kModelId, tag_id, stream, device_id)); |
|
|
|
is_first_run = 1; |
|
|
|
return ge::SUCCESS; |
|
|
|
} |
|
|
|
|
|
|
|
return ge::FAILED; |
|
|
|
} |