adapter profiling with new ascend lib

pull/13259/head
ms_yan 4 years ago committed by caifubi
parent 1217f274f5
commit b4b4577b85

@ -285,7 +285,8 @@ if(ENABLE_D)
${ASCEND_DRIVER_BACK_PATH})
find_library(DATATRANSFER datatransfer HINTS ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}
${ASCEND_DRIVER_BACK_PATH})
find_library(PROFILING msprofiler_fwk ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
find_library(PROFILING msprofiler_fwkacl ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
find_library(ACL ascendcl ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
find_library(REGISTER register ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
find_library(PLATFORM platform ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
find_library(OPTILING optiling ${ASCEND_OPP_PATH} ${ASCEND_TOOLKIT_OPP_PATH})
@ -303,7 +304,7 @@ if(ENABLE_D)
mindspore::protobuf -Wl,--end-group)
target_link_libraries(mindspore ge_runtime ${CCE_LIB} ${RUNTIME_LIB} ${TSDCLIENT} ${HCCL} ${DATATRANSFER}
${HCCL_ADPTER} ${REGISTER} -Wl,--no-as-needed ${OPTILING} ${HCCL_BUILDER}
${HCCL_RA} ${PLATFORM})
${HCCL_RA} ${PLATFORM} ${ACL})
target_link_libraries(mindspore -Wl,--start-group proto_input mindspore::protobuf -Wl,--end-group)
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
target_link_libraries(mindspore -Wl,--start-group proto_input mindspore::protobuf mindspore::sentencepiece

@ -19,9 +19,9 @@
namespace Analysis {
namespace Dvvp {
namespace ProfilerCommon {
namespace ProfilerSpecial {
extern int32_t MsprofilerInit();
} // namespace ProfilerCommon
} // namespace ProfilerSpecial
} // namespace Dvvp
} // namespace Analysis
@ -30,6 +30,42 @@ constexpr Status PROF_SUCCESS = 0;
constexpr Status PROF_FAILED = 0xFFFFFFFF;
} // namespace
int32_t _aclprofGetDeviceByModelId(uint32_t modelId, uint32_t &deviceId) { return 0; }
bool _aclprofGetInitFlag() { return true; }
int32_t _aclprofRegisterCtrlCallback(MsprofCtrlCallback callback) {
if (VMCallbackRegister::GetInstance().registered()) {
return VMCallbackRegister::GetInstance().DoRegProfCtrlCallback(callback);
} else {
return PROF_SUCCESS;
}
}
int32_t _aclprofRegisterSetDeviceCallback(MsprofSetDeviceCallback callback) {
if (VMCallbackRegister::GetInstance().registered()) {
return VMCallbackRegister::GetInstance().DoRegProfSetDeviceCallback(callback);
} else {
return PROF_SUCCESS;
}
}
int32_t _aclprofRegisterReporterCallback(MsprofReporterCallback callback) {
if (VMCallbackRegister::GetInstance().registered()) {
return VMCallbackRegister::GetInstance().DoRegProfReporterCallback(callback);
} else {
return PROF_SUCCESS;
}
}
int32_t _aclprofCommandHandle(uint32_t type, void *data, uint32_t len) {
if (VMCallbackRegister::GetInstance().registered()) {
return VMCallbackRegister::GetInstance().DoProfCommandHandle((ProfCommandHandleType)type, data, len);
} else {
return PROF_SUCCESS;
}
}
Status RegProfCtrlCallback(MsprofCtrlCallback func) {
if (VMCallbackRegister::GetInstance().registered()) {
return VMCallbackRegister::GetInstance().DoRegProfCtrlCallback(func);
@ -87,7 +123,7 @@ bool VMCallbackRegister::Register(Status (*pRegProfCtrlCallback)(MsprofCtrlCallb
void VMCallbackRegister::ForceMsprofilerInit() {
if (!ms_profile_inited_) {
Analysis::Dvvp::ProfilerCommon::MsprofilerInit();
Analysis::Dvvp::ProfilerSpecial::MsprofilerInit();
ms_profile_inited_ = true;
}
}

@ -51,6 +51,6 @@ void* ProfMgrStartUp(const ProfMgrCfg* cfg) { return const_cast<void*>(reinterpr
*/
int ProfMgrStop(void* handle) { return 0; }
namespace Analysis::Dvvp::ProfilerCommon {
namespace Analysis::Dvvp::ProfilerSpecial {
uint32_t MsprofilerInit() { return 0; }
}

Loading…
Cancel
Save