| @@ -64,49 +64,54 @@ static const int32_t ACL_ERROR_RT_QUEUE_EMPTY = 207013; // queue is emp | |||||
| static const int32_t ACL_ERROR_RT_QUEUE_FULL = 207014; // queue is full | static const int32_t ACL_ERROR_RT_QUEUE_FULL = 207014; // queue is full | ||||
| static const int32_t ACL_ERROR_RT_REPEATED_INIT = 207015; // repeated init | static const int32_t ACL_ERROR_RT_REPEATED_INIT = 207015; // repeated init | ||||
| static const int32_t ACL_ERROR_RT_AIVEC_OVER_FLOW = 207016; // aivec over flow | static const int32_t ACL_ERROR_RT_AIVEC_OVER_FLOW = 207016; // aivec over flow | ||||
| static const int32_t ACL_ERROR_RT_OVER_FLOW = 207017; // common over flow | |||||
| static const int32_t ACL_ERROR_RT_INTERNAL_ERROR = 507000; // runtime internal error | |||||
| static const int32_t ACL_ERROR_RT_TS_ERROR = 507001; // ts internel error | |||||
| static const int32_t ACL_ERROR_RT_STREAM_TASK_FULL = 507002; // task full in stream | |||||
| static const int32_t ACL_ERROR_RT_STREAM_TASK_EMPTY = 507003; // task empty in stream | |||||
| static const int32_t ACL_ERROR_RT_STREAM_NOT_COMPLETE = 507004; // stream not complete | |||||
| static const int32_t ACL_ERROR_RT_END_OF_SEQUENCE = 507005; // end of sequence | |||||
| static const int32_t ACL_ERROR_RT_EVENT_NOT_COMPLETE = 507006; // event not complete | |||||
| static const int32_t ACL_ERROR_RT_CONTEXT_RELEASE_ERROR = 507007; // context release error | |||||
| static const int32_t ACL_ERROR_RT_SOC_VERSION = 507008; // soc version error | |||||
| static const int32_t ACL_ERROR_RT_TASK_TYPE_NOT_SUPPORT = 507009; // task type not support | |||||
| static const int32_t ACL_ERROR_RT_LOST_HEARTBEAT = 507010; // ts lost heartbeat | |||||
| static const int32_t ACL_ERROR_RT_MODEL_EXECUTE = 507011; // model execute failed | |||||
| static const int32_t ACL_ERROR_RT_REPORT_TIMEOUT = 507012; // report timeout | |||||
| static const int32_t ACL_ERROR_RT_SYS_DMA = 507013; // sys dma error | |||||
| static const int32_t ACL_ERROR_RT_AICORE_TIMEOUT = 507014; // aicore timeout | |||||
| static const int32_t ACL_ERROR_RT_AICORE_EXCEPTION = 507015; // aicore exception | |||||
| static const int32_t ACL_ERROR_RT_AICORE_TRAP_EXCEPTION = 507016; // aicore trap exception | |||||
| static const int32_t ACL_ERROR_RT_AICPU_TIMEOUT = 507017; // aicpu timeout | |||||
| static const int32_t ACL_ERROR_RT_AICPU_EXCEPTION = 507018; // aicpu exception | |||||
| static const int32_t ACL_ERROR_RT_AICPU_DATADUMP_RSP_ERR = 507019; // aicpu datadump response error | |||||
| static const int32_t ACL_ERROR_RT_AICPU_MODEL_RSP_ERR = 507020; // aicpu model operate response error | |||||
| static const int32_t ACL_ERROR_RT_PROFILING_ERROR = 507021; // profiling error | |||||
| static const int32_t ACL_ERROR_RT_IPC_ERROR = 507022; // ipc error | |||||
| static const int32_t ACL_ERROR_RT_MODEL_ABORT_NORMAL = 507023; // model abort normal | |||||
| static const int32_t ACL_ERROR_RT_KERNEL_UNREGISTERING = 507024; // kernel unregistering | |||||
| static const int32_t ACL_ERROR_RT_RINGBUFFER_NOT_INIT = 507025; // ringbuffer not init | |||||
| static const int32_t ACL_ERROR_RT_RINGBUFFER_NO_DATA = 507026; // ringbuffer no data | |||||
| static const int32_t ACL_ERROR_RT_KERNEL_LOOKUP = 507027; // kernel lookup error | |||||
| static const int32_t ACL_ERROR_RT_KERNEL_DUPLICATE = 507028; // kernel register duplicate | |||||
| static const int32_t ACL_ERROR_RT_DEBUG_REGISTER_FAIL = 507029; // debug register failed | |||||
| static const int32_t ACL_ERROR_RT_DEBUG_UNREGISTER_FAIL = 507030; // debug unregister failed | |||||
| static const int32_t ACL_ERROR_RT_LABEL_CONTEXT = 507031; // label not in current context | |||||
| static const int32_t ACL_ERROR_RT_PROGRAM_USE_OUT = 507032; // program register num use out | |||||
| static const int32_t ACL_ERROR_RT_DEV_SETUP_ERROR = 507033; // device setup error | |||||
| static const int32_t ACL_ERROR_RT_VECTOR_CORE_TIMEOUT = 507034; // vector core timeout | |||||
| static const int32_t ACL_ERROR_RT_VECTOR_CORE_EXCEPTION = 507035; // vector core exception | |||||
| static const int32_t ACL_ERROR_RT_VECTOR_CORE_TRAP_EXCEPTION = 507036; // vector core trap exception | |||||
| static const int32_t ACL_ERROR_RT_CDQ_BATCH_ABNORMAL = 507037; // cdq alloc batch abnormal | |||||
| static const int32_t ACL_ERROR_RT_DIE_MODE_CHANGE_ERROR = 507038; // can not change die mode | |||||
| static const int32_t ACL_ERROR_RT_DIE_SET_ERROR = 507039; // single die mode can not set die | |||||
| static const int32_t ACL_ERROR_RT_INVALID_DIEID = 507040; // invalid die id | |||||
| static const int32_t ACL_ERROR_RT_DIE_MODE_NOT_SET = 507041; // die mode not set | |||||
| static const int32_t ACL_ERROR_RT_INTERNAL_ERROR = 507000; // runtime internal error | |||||
| static const int32_t ACL_ERROR_RT_TS_ERROR = 507001; // ts internel error | |||||
| static const int32_t ACL_ERROR_RT_STREAM_TASK_FULL = 507002; // task full in stream | |||||
| static const int32_t ACL_ERROR_RT_STREAM_TASK_EMPTY = 507003; // task empty in stream | |||||
| static const int32_t ACL_ERROR_RT_STREAM_NOT_COMPLETE = 507004; // stream not complete | |||||
| static const int32_t ACL_ERROR_RT_END_OF_SEQUENCE = 507005; // end of sequence | |||||
| static const int32_t ACL_ERROR_RT_EVENT_NOT_COMPLETE = 507006; // event not complete | |||||
| static const int32_t ACL_ERROR_RT_CONTEXT_RELEASE_ERROR = 507007; // context release error | |||||
| static const int32_t ACL_ERROR_RT_SOC_VERSION = 507008; // soc version error | |||||
| static const int32_t ACL_ERROR_RT_TASK_TYPE_NOT_SUPPORT = 507009; // task type not support | |||||
| static const int32_t ACL_ERROR_RT_LOST_HEARTBEAT = 507010; // ts lost heartbeat | |||||
| static const int32_t ACL_ERROR_RT_MODEL_EXECUTE = 507011; // model execute failed | |||||
| static const int32_t ACL_ERROR_RT_REPORT_TIMEOUT = 507012; // report timeout | |||||
| static const int32_t ACL_ERROR_RT_SYS_DMA = 507013; // sys dma error | |||||
| static const int32_t ACL_ERROR_RT_AICORE_TIMEOUT = 507014; // aicore timeout | |||||
| static const int32_t ACL_ERROR_RT_AICORE_EXCEPTION = 507015; // aicore exception | |||||
| static const int32_t ACL_ERROR_RT_AICORE_TRAP_EXCEPTION = 507016; // aicore trap exception | |||||
| static const int32_t ACL_ERROR_RT_AICPU_TIMEOUT = 507017; // aicpu timeout | |||||
| static const int32_t ACL_ERROR_RT_AICPU_EXCEPTION = 507018; // aicpu exception | |||||
| static const int32_t ACL_ERROR_RT_AICPU_DATADUMP_RSP_ERR = 507019; // aicpu datadump response error | |||||
| static const int32_t ACL_ERROR_RT_AICPU_MODEL_RSP_ERR = 507020; // aicpu model operate response error | |||||
| static const int32_t ACL_ERROR_RT_PROFILING_ERROR = 507021; // profiling error | |||||
| static const int32_t ACL_ERROR_RT_IPC_ERROR = 507022; // ipc error | |||||
| static const int32_t ACL_ERROR_RT_MODEL_ABORT_NORMAL = 507023; // model abort normal | |||||
| static const int32_t ACL_ERROR_RT_KERNEL_UNREGISTERING = 507024; // kernel unregistering | |||||
| static const int32_t ACL_ERROR_RT_RINGBUFFER_NOT_INIT = 507025; // ringbuffer not init | |||||
| static const int32_t ACL_ERROR_RT_RINGBUFFER_NO_DATA = 507026; // ringbuffer no data | |||||
| static const int32_t ACL_ERROR_RT_KERNEL_LOOKUP = 507027; // kernel lookup error | |||||
| static const int32_t ACL_ERROR_RT_KERNEL_DUPLICATE = 507028; // kernel register duplicate | |||||
| static const int32_t ACL_ERROR_RT_DEBUG_REGISTER_FAIL = 507029; // debug register failed | |||||
| static const int32_t ACL_ERROR_RT_DEBUG_UNREGISTER_FAIL = 507030; // debug unregister failed | |||||
| static const int32_t ACL_ERROR_RT_LABEL_CONTEXT = 507031; // label not in current context | |||||
| static const int32_t ACL_ERROR_RT_PROGRAM_USE_OUT = 507032; // program register num use out | |||||
| static const int32_t ACL_ERROR_RT_DEV_SETUP_ERROR = 507033; // device setup error | |||||
| static const int32_t ACL_ERROR_RT_VECTOR_CORE_TIMEOUT = 507034; // vector core timeout | |||||
| static const int32_t ACL_ERROR_RT_VECTOR_CORE_EXCEPTION = 507035; // vector core exception | |||||
| static const int32_t ACL_ERROR_RT_VECTOR_CORE_TRAP_EXCEPTION = 507036; // vector core trap exception | |||||
| static const int32_t ACL_ERROR_RT_CDQ_BATCH_ABNORMAL = 507037; // cdq alloc batch abnormal | |||||
| static const int32_t ACL_ERROR_RT_DIE_MODE_CHANGE_ERROR = 507038; // can not change die mode | |||||
| static const int32_t ACL_ERROR_RT_DIE_SET_ERROR = 507039; // single die mode can not set die | |||||
| static const int32_t ACL_ERROR_RT_INVALID_DIEID = 507040; // invalid die id | |||||
| static const int32_t ACL_ERROR_RT_DIE_MODE_NOT_SET = 507041; // die mode not set | |||||
| static const int32_t ACL_ERROR_RT_AICORE_TRAP_READ_OVERFLOW = 507042; // aic trap read overflow | |||||
| static const int32_t ACL_ERROR_RT_AICORE_TRAP_WRITE_OVERFLOW = 507043; // aic trap write overflow | |||||
| static const int32_t ACL_ERROR_RT_VECTOR_CORE_TRAP_READ_OVERFLOW = 507044; // aiv trap read overflow | |||||
| static const int32_t ACL_ERROR_RT_VECTOR_CORE_TRAP_WRITE_OVERFLOW = 507045; // aiv trap write overflow | |||||
| static const int32_t ACL_ERROR_RT_DRV_INTERNAL_ERROR = 507899; // drv internal error | static const int32_t ACL_ERROR_RT_DRV_INTERNAL_ERROR = 507899; // drv internal error | ||||
| static const int32_t ACL_ERROR_RT_AICPU_INTERNAL_ERROR = 507900; // aicpu internal error | static const int32_t ACL_ERROR_RT_AICPU_INTERNAL_ERROR = 507900; // aicpu internal error | ||||
| @@ -71,13 +71,15 @@ const char_t *const OPTION_EXEC_DYNAMIC_EXECUTE_MODE = "ge.exec.dynamicGraphExec | |||||
| const char_t *const OPTION_EXEC_DATA_INPUTS_SHAPE_RANGE = "ge.exec.dataInputsShapeRange"; | const char_t *const OPTION_EXEC_DATA_INPUTS_SHAPE_RANGE = "ge.exec.dataInputsShapeRange"; | ||||
| const char_t *const OPTION_EXEC_ENABLE_COPY_OUTPUT_ADDR = "ge.exec.enableCopyOutputAddr"; | const char_t *const OPTION_EXEC_ENABLE_COPY_OUTPUT_ADDR = "ge.exec.enableCopyOutputAddr"; | ||||
| const char_t *const OPTION_EXEC_GRAPH_EXEC_TIMEOUT = "ge.exec.graphExecTimeout"; | const char_t *const OPTION_EXEC_GRAPH_EXEC_TIMEOUT = "ge.exec.graphExecTimeout"; | ||||
| const char_t *const OPTION_EXEC_MODEL_EXEC_TIMEOUT = "ge.exec.modelExecTimeout"; | |||||
| // Option key: memory init | // Option key: memory init | ||||
| const char_t *const GRAPH_MEMORY_MAX_SIZE = "ge.graphMemoryMaxSize"; | const char_t *const GRAPH_MEMORY_MAX_SIZE = "ge.graphMemoryMaxSize"; | ||||
| const char_t *const VARIABLE_MEMORY_MAX_SIZE = "ge.variableMemoryMaxSize"; | const char_t *const VARIABLE_MEMORY_MAX_SIZE = "ge.variableMemoryMaxSize"; | ||||
| const char_t *const OPTION_EXEC_REUSE_ZERO_COPY_MEMORY = "ge.exec.reuseZeroCopyMemory"; | const char_t *const OPTION_EXEC_REUSE_ZERO_COPY_MEMORY = "ge.exec.reuseZeroCopyMemory"; | ||||
| const char_t *const OPTION_EXEC_LOGICAL_DEVICE_CLUSTER_DEPLOY_MODE = "ge.exec.logicalDeviceClusterDeployMode"; | |||||
| const char_t *const OPTION_EXEC_LOGICAL_DEVICE_ID = "ge.exec.logicalDeviceId"; | |||||
| namespace configure_option { | namespace configure_option { | ||||
| const char_t *const STREAM_NUM = "ge.streamNum"; | const char_t *const STREAM_NUM = "ge.streamNum"; | ||||
| const char_t *const HEAD_STREAM = "ge.headStream"; | const char_t *const HEAD_STREAM = "ge.headStream"; | ||||
| @@ -107,6 +109,7 @@ const char_t *const OPTYPELIST_FOR_IMPLMODE = "ge.optypelistForImplmode"; | |||||
| const char_t *const HCOM_PARALLEL = "ge.hcomParallel"; | const char_t *const HCOM_PARALLEL = "ge.hcomParallel"; | ||||
| const char_t *const AUTO_TUNE_MODE = "ge.autoTuneMode"; | const char_t *const AUTO_TUNE_MODE = "ge.autoTuneMode"; | ||||
| const char_t *const SOC_VERSION = "ge.socVersion"; | const char_t *const SOC_VERSION = "ge.socVersion"; | ||||
| const char_t *const VIRTUAL_TYPE = "ge.virtual_type"; | |||||
| const char_t *const CORE_TYPE = "ge.engineType"; | const char_t *const CORE_TYPE = "ge.engineType"; | ||||
| const char_t *const AICORE_NUM = "ge.aicoreNum"; | const char_t *const AICORE_NUM = "ge.aicoreNum"; | ||||
| const char_t *const L1_FUSION = "ge.l1Fusion"; | const char_t *const L1_FUSION = "ge.l1Fusion"; | ||||
| @@ -254,9 +257,16 @@ const std::string AUTO_TUNE_MODE = "ge.autoTuneMode"; | |||||
| // Configure soc version , example: "Ascend310" | // Configure soc version , example: "Ascend310" | ||||
| const std::string SOC_VERSION = "ge.socVersion"; | const std::string SOC_VERSION = "ge.socVersion"; | ||||
| // configure whether to enable virtualization, | |||||
| // its value should be "0" or "1", default value is "0" | |||||
| const std::string VIRTUAL_TYPE = "ge.virtual_type"; | |||||
| // Configure core type "VectorEngine", default value is "AIcoreEngine" | // Configure core type "VectorEngine", default value is "AIcoreEngine" | ||||
| const std::string CORE_TYPE = "ge.engineType"; | const std::string CORE_TYPE = "ge.engineType"; | ||||
| // Configure graph exclude one or more engines | |||||
| const std::string EXCLUDE_ENGINES = "ge.exec.exclude_engines"; | |||||
| // Configure AICORE NUM | // Configure AICORE NUM | ||||
| const std::string AICORE_NUM = "ge.aicoreNum"; | const std::string AICORE_NUM = "ge.aicoreNum"; | ||||
| @@ -420,6 +430,7 @@ static const char_t *const EXEC_DISABLE_REUSED_MEMORY = ge::OPTION_EXEC_DISABLE_ | |||||
| static const char_t *const AUTO_TUNE_MODE = ge::AUTO_TUNE_MODE.c_str(); | static const char_t *const AUTO_TUNE_MODE = ge::AUTO_TUNE_MODE.c_str(); | ||||
| static const char_t *const CORE_TYPE = ge::CORE_TYPE.c_str(); | static const char_t *const CORE_TYPE = ge::CORE_TYPE.c_str(); | ||||
| static const char_t *const SOC_VERSION = ge::SOC_VERSION.c_str(); | static const char_t *const SOC_VERSION = ge::SOC_VERSION.c_str(); | ||||
| static const char_t *const VIRTUAL_TYPE = ge::VIRTUAL_TYPE.c_str(); | |||||
| static const char_t *const ENABLE_SINGLE_STREAM = ge::ENABLE_SINGLE_STREAM; | static const char_t *const ENABLE_SINGLE_STREAM = ge::ENABLE_SINGLE_STREAM; | ||||
| static const char_t *const AICORE_NUM = ge::AICORE_NUM.c_str(); | static const char_t *const AICORE_NUM = ge::AICORE_NUM.c_str(); | ||||
| static const char_t *const FUSION_SWITCH_FILE = ge::FUSION_SWITCH_FILE.c_str(); | static const char_t *const FUSION_SWITCH_FILE = ge::FUSION_SWITCH_FILE.c_str(); | ||||
| @@ -487,6 +498,7 @@ const std::set<std::string> ir_parser_suppported_options = { | |||||
| // for interface: aclgrphBuildInitialize | // for interface: aclgrphBuildInitialize | ||||
| const std::set<std::string> global_options = {CORE_TYPE, | const std::set<std::string> global_options = {CORE_TYPE, | ||||
| SOC_VERSION, | SOC_VERSION, | ||||
| VIRTUAL_TYPE, | |||||
| BUFFER_OPTIMIZE, | BUFFER_OPTIMIZE, | ||||
| ENABLE_COMPRESS_WEIGHT, | ENABLE_COMPRESS_WEIGHT, | ||||
| COMPRESS_WEIGHT_CONF, | COMPRESS_WEIGHT_CONF, | ||||
| @@ -64,49 +64,54 @@ static const int32_t ACL_ERROR_RT_QUEUE_EMPTY = 207013; // queue is emp | |||||
| static const int32_t ACL_ERROR_RT_QUEUE_FULL = 207014; // queue is full | static const int32_t ACL_ERROR_RT_QUEUE_FULL = 207014; // queue is full | ||||
| static const int32_t ACL_ERROR_RT_REPEATED_INIT = 207015; // repeated init | static const int32_t ACL_ERROR_RT_REPEATED_INIT = 207015; // repeated init | ||||
| static const int32_t ACL_ERROR_RT_AIVEC_OVER_FLOW = 207016; // aivec over flow | static const int32_t ACL_ERROR_RT_AIVEC_OVER_FLOW = 207016; // aivec over flow | ||||
| static const int32_t ACL_ERROR_RT_OVER_FLOW = 207017; // common over flow | |||||
| static const int32_t ACL_ERROR_RT_INTERNAL_ERROR = 507000; // runtime internal error | |||||
| static const int32_t ACL_ERROR_RT_TS_ERROR = 507001; // ts internel error | |||||
| static const int32_t ACL_ERROR_RT_STREAM_TASK_FULL = 507002; // task full in stream | |||||
| static const int32_t ACL_ERROR_RT_STREAM_TASK_EMPTY = 507003; // task empty in stream | |||||
| static const int32_t ACL_ERROR_RT_STREAM_NOT_COMPLETE = 507004; // stream not complete | |||||
| static const int32_t ACL_ERROR_RT_END_OF_SEQUENCE = 507005; // end of sequence | |||||
| static const int32_t ACL_ERROR_RT_EVENT_NOT_COMPLETE = 507006; // event not complete | |||||
| static const int32_t ACL_ERROR_RT_CONTEXT_RELEASE_ERROR = 507007; // context release error | |||||
| static const int32_t ACL_ERROR_RT_SOC_VERSION = 507008; // soc version error | |||||
| static const int32_t ACL_ERROR_RT_TASK_TYPE_NOT_SUPPORT = 507009; // task type not support | |||||
| static const int32_t ACL_ERROR_RT_LOST_HEARTBEAT = 507010; // ts lost heartbeat | |||||
| static const int32_t ACL_ERROR_RT_MODEL_EXECUTE = 507011; // model execute failed | |||||
| static const int32_t ACL_ERROR_RT_REPORT_TIMEOUT = 507012; // report timeout | |||||
| static const int32_t ACL_ERROR_RT_SYS_DMA = 507013; // sys dma error | |||||
| static const int32_t ACL_ERROR_RT_AICORE_TIMEOUT = 507014; // aicore timeout | |||||
| static const int32_t ACL_ERROR_RT_AICORE_EXCEPTION = 507015; // aicore exception | |||||
| static const int32_t ACL_ERROR_RT_AICORE_TRAP_EXCEPTION = 507016; // aicore trap exception | |||||
| static const int32_t ACL_ERROR_RT_AICPU_TIMEOUT = 507017; // aicpu timeout | |||||
| static const int32_t ACL_ERROR_RT_AICPU_EXCEPTION = 507018; // aicpu exception | |||||
| static const int32_t ACL_ERROR_RT_AICPU_DATADUMP_RSP_ERR = 507019; // aicpu datadump response error | |||||
| static const int32_t ACL_ERROR_RT_AICPU_MODEL_RSP_ERR = 507020; // aicpu model operate response error | |||||
| static const int32_t ACL_ERROR_RT_PROFILING_ERROR = 507021; // profiling error | |||||
| static const int32_t ACL_ERROR_RT_IPC_ERROR = 507022; // ipc error | |||||
| static const int32_t ACL_ERROR_RT_MODEL_ABORT_NORMAL = 507023; // model abort normal | |||||
| static const int32_t ACL_ERROR_RT_KERNEL_UNREGISTERING = 507024; // kernel unregistering | |||||
| static const int32_t ACL_ERROR_RT_RINGBUFFER_NOT_INIT = 507025; // ringbuffer not init | |||||
| static const int32_t ACL_ERROR_RT_RINGBUFFER_NO_DATA = 507026; // ringbuffer no data | |||||
| static const int32_t ACL_ERROR_RT_KERNEL_LOOKUP = 507027; // kernel lookup error | |||||
| static const int32_t ACL_ERROR_RT_KERNEL_DUPLICATE = 507028; // kernel register duplicate | |||||
| static const int32_t ACL_ERROR_RT_DEBUG_REGISTER_FAIL = 507029; // debug register failed | |||||
| static const int32_t ACL_ERROR_RT_DEBUG_UNREGISTER_FAIL = 507030; // debug unregister failed | |||||
| static const int32_t ACL_ERROR_RT_LABEL_CONTEXT = 507031; // label not in current context | |||||
| static const int32_t ACL_ERROR_RT_PROGRAM_USE_OUT = 507032; // program register num use out | |||||
| static const int32_t ACL_ERROR_RT_DEV_SETUP_ERROR = 507033; // device setup error | |||||
| static const int32_t ACL_ERROR_RT_VECTOR_CORE_TIMEOUT = 507034; // vector core timeout | |||||
| static const int32_t ACL_ERROR_RT_VECTOR_CORE_EXCEPTION = 507035; // vector core exception | |||||
| static const int32_t ACL_ERROR_RT_VECTOR_CORE_TRAP_EXCEPTION = 507036; // vector core trap exception | |||||
| static const int32_t ACL_ERROR_RT_CDQ_BATCH_ABNORMAL = 507037; // cdq alloc batch abnormal | |||||
| static const int32_t ACL_ERROR_RT_DIE_MODE_CHANGE_ERROR = 507038; // can not change die mode | |||||
| static const int32_t ACL_ERROR_RT_DIE_SET_ERROR = 507039; // single die mode can not set die | |||||
| static const int32_t ACL_ERROR_RT_INVALID_DIEID = 507040; // invalid die id | |||||
| static const int32_t ACL_ERROR_RT_DIE_MODE_NOT_SET = 507041; // die mode not set | |||||
| static const int32_t ACL_ERROR_RT_INTERNAL_ERROR = 507000; // runtime internal error | |||||
| static const int32_t ACL_ERROR_RT_TS_ERROR = 507001; // ts internel error | |||||
| static const int32_t ACL_ERROR_RT_STREAM_TASK_FULL = 507002; // task full in stream | |||||
| static const int32_t ACL_ERROR_RT_STREAM_TASK_EMPTY = 507003; // task empty in stream | |||||
| static const int32_t ACL_ERROR_RT_STREAM_NOT_COMPLETE = 507004; // stream not complete | |||||
| static const int32_t ACL_ERROR_RT_END_OF_SEQUENCE = 507005; // end of sequence | |||||
| static const int32_t ACL_ERROR_RT_EVENT_NOT_COMPLETE = 507006; // event not complete | |||||
| static const int32_t ACL_ERROR_RT_CONTEXT_RELEASE_ERROR = 507007; // context release error | |||||
| static const int32_t ACL_ERROR_RT_SOC_VERSION = 507008; // soc version error | |||||
| static const int32_t ACL_ERROR_RT_TASK_TYPE_NOT_SUPPORT = 507009; // task type not support | |||||
| static const int32_t ACL_ERROR_RT_LOST_HEARTBEAT = 507010; // ts lost heartbeat | |||||
| static const int32_t ACL_ERROR_RT_MODEL_EXECUTE = 507011; // model execute failed | |||||
| static const int32_t ACL_ERROR_RT_REPORT_TIMEOUT = 507012; // report timeout | |||||
| static const int32_t ACL_ERROR_RT_SYS_DMA = 507013; // sys dma error | |||||
| static const int32_t ACL_ERROR_RT_AICORE_TIMEOUT = 507014; // aicore timeout | |||||
| static const int32_t ACL_ERROR_RT_AICORE_EXCEPTION = 507015; // aicore exception | |||||
| static const int32_t ACL_ERROR_RT_AICORE_TRAP_EXCEPTION = 507016; // aicore trap exception | |||||
| static const int32_t ACL_ERROR_RT_AICPU_TIMEOUT = 507017; // aicpu timeout | |||||
| static const int32_t ACL_ERROR_RT_AICPU_EXCEPTION = 507018; // aicpu exception | |||||
| static const int32_t ACL_ERROR_RT_AICPU_DATADUMP_RSP_ERR = 507019; // aicpu datadump response error | |||||
| static const int32_t ACL_ERROR_RT_AICPU_MODEL_RSP_ERR = 507020; // aicpu model operate response error | |||||
| static const int32_t ACL_ERROR_RT_PROFILING_ERROR = 507021; // profiling error | |||||
| static const int32_t ACL_ERROR_RT_IPC_ERROR = 507022; // ipc error | |||||
| static const int32_t ACL_ERROR_RT_MODEL_ABORT_NORMAL = 507023; // model abort normal | |||||
| static const int32_t ACL_ERROR_RT_KERNEL_UNREGISTERING = 507024; // kernel unregistering | |||||
| static const int32_t ACL_ERROR_RT_RINGBUFFER_NOT_INIT = 507025; // ringbuffer not init | |||||
| static const int32_t ACL_ERROR_RT_RINGBUFFER_NO_DATA = 507026; // ringbuffer no data | |||||
| static const int32_t ACL_ERROR_RT_KERNEL_LOOKUP = 507027; // kernel lookup error | |||||
| static const int32_t ACL_ERROR_RT_KERNEL_DUPLICATE = 507028; // kernel register duplicate | |||||
| static const int32_t ACL_ERROR_RT_DEBUG_REGISTER_FAIL = 507029; // debug register failed | |||||
| static const int32_t ACL_ERROR_RT_DEBUG_UNREGISTER_FAIL = 507030; // debug unregister failed | |||||
| static const int32_t ACL_ERROR_RT_LABEL_CONTEXT = 507031; // label not in current context | |||||
| static const int32_t ACL_ERROR_RT_PROGRAM_USE_OUT = 507032; // program register num use out | |||||
| static const int32_t ACL_ERROR_RT_DEV_SETUP_ERROR = 507033; // device setup error | |||||
| static const int32_t ACL_ERROR_RT_VECTOR_CORE_TIMEOUT = 507034; // vector core timeout | |||||
| static const int32_t ACL_ERROR_RT_VECTOR_CORE_EXCEPTION = 507035; // vector core exception | |||||
| static const int32_t ACL_ERROR_RT_VECTOR_CORE_TRAP_EXCEPTION = 507036; // vector core trap exception | |||||
| static const int32_t ACL_ERROR_RT_CDQ_BATCH_ABNORMAL = 507037; // cdq alloc batch abnormal | |||||
| static const int32_t ACL_ERROR_RT_DIE_MODE_CHANGE_ERROR = 507038; // can not change die mode | |||||
| static const int32_t ACL_ERROR_RT_DIE_SET_ERROR = 507039; // single die mode can not set die | |||||
| static const int32_t ACL_ERROR_RT_INVALID_DIEID = 507040; // invalid die id | |||||
| static const int32_t ACL_ERROR_RT_DIE_MODE_NOT_SET = 507041; // die mode not set | |||||
| static const int32_t ACL_ERROR_RT_AICORE_TRAP_READ_OVERFLOW = 507042; // aic trap read overflow | |||||
| static const int32_t ACL_ERROR_RT_AICORE_TRAP_WRITE_OVERFLOW = 507043; // aic trap write overflow | |||||
| static const int32_t ACL_ERROR_RT_VECTOR_CORE_TRAP_READ_OVERFLOW = 507044; // aiv trap read overflow | |||||
| static const int32_t ACL_ERROR_RT_VECTOR_CORE_TRAP_WRITE_OVERFLOW = 507045; // aiv trap write overflow | |||||
| static const int32_t ACL_ERROR_RT_DRV_INTERNAL_ERROR = 507899; // drv internal error | static const int32_t ACL_ERROR_RT_DRV_INTERNAL_ERROR = 507899; // drv internal error | ||||
| static const int32_t ACL_ERROR_RT_AICPU_INTERNAL_ERROR = 507900; // aicpu internal error | static const int32_t ACL_ERROR_RT_AICPU_INTERNAL_ERROR = 507900; // aicpu internal error | ||||
| @@ -17,6 +17,7 @@ | |||||
| #ifndef INC_FRAMEWORK_COMMON_DEBUG_GE_LOG_H_ | #ifndef INC_FRAMEWORK_COMMON_DEBUG_GE_LOG_H_ | ||||
| #define INC_FRAMEWORK_COMMON_DEBUG_GE_LOG_H_ | #define INC_FRAMEWORK_COMMON_DEBUG_GE_LOG_H_ | ||||
| #include <cinttypes> | |||||
| #include <cstdint> | #include <cstdint> | ||||
| #include "framework/common/ge_inner_error_codes.h" | #include "framework/common/ge_inner_error_codes.h" | ||||
| @@ -56,63 +57,64 @@ inline bool IsLogEnable(const int32_t module_name, const int32_t log_level) { | |||||
| return (enable == 1); | return (enable == 1); | ||||
| } | } | ||||
| #define GELOGE(ERROR_CODE, fmt, ...) \ | |||||
| do { \ | |||||
| dlog_error(GE_MODULE_NAME, "%lu %s: ErrorNo: %u(%s) %s" fmt, GeLog::GetTid(), &__FUNCTION__[0], (ERROR_CODE), \ | |||||
| ((GE_GET_ERRORNO_STR(ERROR_CODE)).c_str()), ErrorManager::GetInstance().GetLogHeader().c_str(), \ | |||||
| ##__VA_ARGS__); \ | |||||
| #define GELOGE(ERROR_CODE, fmt, ...) \ | |||||
| do { \ | |||||
| dlog_error(GE_MODULE_NAME, "%" PRIu64 " %s: ErrorNo: %" PRIuLEAST8 "(%s) %s" fmt, GeLog::GetTid(), \ | |||||
| &__FUNCTION__[0], (ERROR_CODE), ((GE_GET_ERRORNO_STR(ERROR_CODE)).c_str()), \ | |||||
| ErrorManager::GetInstance().GetLogHeader().c_str(), ##__VA_ARGS__); \ | |||||
| } while (false) | } while (false) | ||||
| #define GELOGW(fmt, ...) \ | |||||
| do { \ | |||||
| if (IsLogEnable(GE_MODULE_NAME, DLOG_WARN)) { \ | |||||
| dlog_warn(GE_MODULE_NAME, "%lu %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0], ##__VA_ARGS__); \ | |||||
| } \ | |||||
| #define GELOGW(fmt, ...) \ | |||||
| do { \ | |||||
| if (IsLogEnable(GE_MODULE_NAME, DLOG_WARN)) { \ | |||||
| dlog_warn(GE_MODULE_NAME, "%" PRIu64 " %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0], ##__VA_ARGS__); \ | |||||
| } \ | |||||
| } while (false) | } while (false) | ||||
| #define GELOGI(fmt, ...) \ | |||||
| do { \ | |||||
| if (IsLogEnable(GE_MODULE_NAME, DLOG_INFO)) { \ | |||||
| dlog_info(GE_MODULE_NAME, "%lu %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0], ##__VA_ARGS__); \ | |||||
| } \ | |||||
| #define GELOGI(fmt, ...) \ | |||||
| do { \ | |||||
| if (IsLogEnable(GE_MODULE_NAME, DLOG_INFO)) { \ | |||||
| dlog_info(GE_MODULE_NAME, "%" PRIu64 " %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0], ##__VA_ARGS__); \ | |||||
| } \ | |||||
| } while (false) | } while (false) | ||||
| #define GELOGD(fmt, ...) \ | |||||
| do { \ | |||||
| if (IsLogEnable(GE_MODULE_NAME, DLOG_DEBUG)) { \ | |||||
| dlog_debug(GE_MODULE_NAME, "%lu %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0], ##__VA_ARGS__); \ | |||||
| } \ | |||||
| #define GELOGD(fmt, ...) \ | |||||
| do { \ | |||||
| if (IsLogEnable(GE_MODULE_NAME, DLOG_DEBUG)) { \ | |||||
| dlog_debug(GE_MODULE_NAME, "%" PRIu64 " %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0], ##__VA_ARGS__); \ | |||||
| } \ | |||||
| } while (false) | } while (false) | ||||
| #define GEEVENT(fmt, ...) \ | |||||
| do { \ | |||||
| dlog_event(GE_MODULE_NAME, "%lu %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0], ##__VA_ARGS__); \ | |||||
| #define GEEVENT(fmt, ...) \ | |||||
| do { \ | |||||
| dlog_event(GE_MODULE_NAME, "%" PRIu64 " %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0], ##__VA_ARGS__); \ | |||||
| } while (false) | } while (false) | ||||
| #define GELOGT(VALUE, fmt, ...) \ | |||||
| do { \ | |||||
| TraceStatus stat = (VALUE); \ | |||||
| const char_t *const TraceStatStr[] = {"INIT", "RUNNING", "WAITING", "STOP"}; \ | |||||
| const int32_t idx = static_cast<int32_t>(stat); \ | |||||
| char_t *k = const_cast<char_t *>("status"); \ | |||||
| char_t *v = const_cast<char_t *>(TraceStatStr[idx]); \ | |||||
| KeyValue kv = {k, v}; \ | |||||
| DlogWithKV(GE_MODULE_NAME, DLOG_TRACE, &kv, 1, "%lu %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0], ##__VA_ARGS__); \ | |||||
| #define GELOGT(VALUE, fmt, ...) \ | |||||
| do { \ | |||||
| TraceStatus stat = (VALUE); \ | |||||
| const char_t *const TraceStatStr[] = {"INIT", "RUNNING", "WAITING", "STOP"}; \ | |||||
| const int32_t idx = static_cast<int32_t>(stat); \ | |||||
| char_t *k = const_cast<char_t *>("status"); \ | |||||
| char_t *v = const_cast<char_t *>(TraceStatStr[idx]); \ | |||||
| KeyValue kv = {k, v}; \ | |||||
| DlogWithKV(GE_MODULE_NAME, DLOG_TRACE, &kv, 1, "%" PRIu64 " %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0], \ | |||||
| ##__VA_ARGS__); \ | |||||
| } while (false) | } while (false) | ||||
| #define GE_LOG_ERROR(MOD_NAME, ERROR_CODE, fmt, ...) \ | |||||
| do { \ | |||||
| dlog_error((MOD_NAME), "%lu %s: ErrorNo: %u(%s) %s" fmt, GeLog::GetTid(), &__FUNCTION__[0], (ERROR_CODE), \ | |||||
| ((GE_GET_ERRORNO_STR(ERROR_CODE)).c_str()), ErrorManager::GetInstance().GetLogHeader().c_str(), \ | |||||
| ##__VA_ARGS__); \ | |||||
| #define GE_LOG_ERROR(MOD_NAME, ERROR_CODE, fmt, ...) \ | |||||
| do { \ | |||||
| dlog_error((MOD_NAME), "%" PRIu64 " %s: ErrorNo: %" PRIuLEAST8 "(%s) %s" fmt, GeLog::GetTid(), &__FUNCTION__[0], \ | |||||
| (ERROR_CODE), ((GE_GET_ERRORNO_STR(ERROR_CODE)).c_str()), \ | |||||
| ErrorManager::GetInstance().GetLogHeader().c_str(), ##__VA_ARGS__); \ | |||||
| } while (false) | } while (false) | ||||
| // print memory when it is greater than 1KB. | // print memory when it is greater than 1KB. | ||||
| #define GE_PRINT_DYNAMIC_MEMORY(FUNC, PURPOSE, SIZE) \ | |||||
| do { \ | |||||
| if (static_cast<size_t>(SIZE) > 1024UL) { \ | |||||
| GELOGI("MallocMemory, func=%s, size=%zu, purpose=%s", (#FUNC), static_cast<size_t>(SIZE), (PURPOSE)); \ | |||||
| } \ | |||||
| #define GE_PRINT_DYNAMIC_MEMORY(FUNC, PURPOSE, SIZE) \ | |||||
| do { \ | |||||
| if (static_cast<size_t>(SIZE) > 1024UL) { \ | |||||
| GELOGI("MallocMemory, func=%s, size=%" PRIu64 ", purpose=%s", (#FUNC), static_cast<size_t>(SIZE), (PURPOSE)); \ | |||||
| } \ | |||||
| } while (false) | } while (false) | ||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| } | } | ||||
| @@ -180,13 +180,13 @@ | |||||
| #define GE_ERRORLOG_AND_ERRORMSG(_status, errormsg) \ | #define GE_ERRORLOG_AND_ERRORMSG(_status, errormsg) \ | ||||
| { \ | { \ | ||||
| GELOGE((_status), "[Check][InnerData]%s", (errormsg)); \ | GELOGE((_status), "[Check][InnerData]%s", (errormsg)); \ | ||||
| REPORT_INNER_ERROR("E19999", "%s", (errormsg)); \ | |||||
| REPORT_INNER_ERROR("E10052", "%s", (errormsg)); \ | |||||
| } | } | ||||
| #define GE_WARNINGLOG_AND_ERRORMSG(errormsg) \ | #define GE_WARNINGLOG_AND_ERRORMSG(errormsg) \ | ||||
| { \ | { \ | ||||
| GELOGW("%s", (errormsg)); \ | GELOGW("%s", (errormsg)); \ | ||||
| ErrorManager::GetInstance().ATCReportErrMessage("E19021", {"reason"}, {(errormsg)}); \ | |||||
| ErrorManager::GetInstance().ATCReportErrMessage("E10052", {"reason"}, {(errormsg)}); \ | |||||
| } | } | ||||
| #define GE_CHK_LOG_AND_ERRORMSG(expr, _status, errormsg) \ | #define GE_CHK_LOG_AND_ERRORMSG(expr, _status, errormsg) \ | ||||
| @@ -194,7 +194,7 @@ | |||||
| const bool b = (expr); \ | const bool b = (expr); \ | ||||
| if (!b) { \ | if (!b) { \ | ||||
| GELOGE((_status), "%s", (errormsg)); \ | GELOGE((_status), "%s", (errormsg)); \ | ||||
| ErrorManager::GetInstance().ATCReportErrMessage("E19021", {"reason"}, {(errormsg)}); \ | |||||
| ErrorManager::GetInstance().ATCReportErrMessage("E10052", {"reason"}, {(errormsg)}); \ | |||||
| return (_status); \ | return (_status); \ | ||||
| } \ | } \ | ||||
| } while (false) | } while (false) | ||||
| @@ -31,8 +31,8 @@ class GE_FUNC_VISIBILITY OpTypeContainer { | |||||
| } | } | ||||
| ~OpTypeContainer() = default; | ~OpTypeContainer() = default; | ||||
| void Register(const std::string &op_type) { | |||||
| static_cast<void>(op_type_list_.insert(op_type)); | |||||
| bool Register(const std::string &op_type) { | |||||
| return op_type_list_.insert(op_type).second; | |||||
| } | } | ||||
| bool IsExisting(const std::string &op_type) { | bool IsExisting(const std::string &op_type) { | ||||
| @@ -52,7 +52,7 @@ class GE_FUNC_VISIBILITY OpTypeContainer { | |||||
| #define REGISTER_OPTYPE_DEFINE(var_name, str_name) \ | #define REGISTER_OPTYPE_DEFINE(var_name, str_name) \ | ||||
| const char_t *var_name = str_name; \ | const char_t *var_name = str_name; \ | ||||
| const bool g_##var_name##_reg = (static_cast<void>(OpTypeContainer::Instance()->Register(str_name)), true); | |||||
| const bool g_##var_name##_reg = OpTypeContainer::Instance()->Register(str_name); | |||||
| #define IS_OPTYPE_EXISTING(str_name) (ge::OpTypeContainer::Instance()->IsExisting(str_name)) | #define IS_OPTYPE_EXISTING(str_name) (ge::OpTypeContainer::Instance()->IsExisting(str_name)) | ||||
| #endif // INC_FRAMEWORK_COMMON_OP_TYPES_H_ | #endif // INC_FRAMEWORK_COMMON_OP_TYPES_H_ | ||||
| @@ -162,6 +162,7 @@ REGISTER_OPTYPE_DECLARE(_IF, "_If"); | |||||
| REGISTER_OPTYPE_DECLARE(STATELESSIF, "StatelessIf"); | REGISTER_OPTYPE_DECLARE(STATELESSIF, "StatelessIf"); | ||||
| REGISTER_OPTYPE_DECLARE(IF, "If"); | REGISTER_OPTYPE_DECLARE(IF, "If"); | ||||
| REGISTER_OPTYPE_DECLARE(CASE, "Case"); | REGISTER_OPTYPE_DECLARE(CASE, "Case"); | ||||
| REGISTER_OPTYPE_DECLARE(STATELESSCASE, "StatelessCase"); | |||||
| REGISTER_OPTYPE_DECLARE(_WHILE, "_While"); | REGISTER_OPTYPE_DECLARE(_WHILE, "_While"); | ||||
| REGISTER_OPTYPE_DECLARE(WHILE, "While"); | REGISTER_OPTYPE_DECLARE(WHILE, "While"); | ||||
| REGISTER_OPTYPE_DECLARE(STATELESSWHILE, "StatelessWhile"); | REGISTER_OPTYPE_DECLARE(STATELESSWHILE, "StatelessWhile"); | ||||
| @@ -626,8 +627,8 @@ struct ModelFileHeader { | |||||
| uint32_t version = MODEL_VERSION; // version 1.0 | uint32_t version = MODEL_VERSION; // version 1.0 | ||||
| uint8_t checksum[MODEL_FILE_CHECKSUM_LENGTH] = {0U}; // signature | uint8_t checksum[MODEL_FILE_CHECKSUM_LENGTH] = {0U}; // signature | ||||
| uint32_t length = 0U; // Ciphertext length. In the non-encryption model, the length is the plaintext length. | uint32_t length = 0U; // Ciphertext length. In the non-encryption model, the length is the plaintext length. | ||||
| uint8_t is_encrypt = | |||||
| static_cast<uint8_t>(ModelEncryptType::UNENCRYPTED); // whether encrypted 0:not encrypt, 1:encrypt | |||||
| // whether encrypted 0:not encrypt, 1:encrypt | |||||
| uint8_t is_encrypt = static_cast<uint8_t>(ModelEncryptType::UNENCRYPTED); | |||||
| uint8_t is_checksum = static_cast<uint8_t>(ModelCheckType::CHECK); // whether to check the checksum | uint8_t is_checksum = static_cast<uint8_t>(ModelCheckType::CHECK); // whether to check the checksum | ||||
| uint8_t modeltype = 0U; // 0:IR model 1:standard model 2: OM Tiny model | uint8_t modeltype = 0U; // 0:IR model 1:standard model 2: OM Tiny model | ||||
| uint8_t genmode = 0U; // 0:offline generate 1:online generate | uint8_t genmode = 0U; // 0:offline generate 1:online generate | ||||
| @@ -31,6 +31,7 @@ enum class PriorityEnum { | |||||
| COST_1 = 1, | COST_1 = 1, | ||||
| COST_2 = 2, | COST_2 = 2, | ||||
| COST_3 = 3, | COST_3 = 3, | ||||
| COST_4 = 4, | |||||
| COST_9 = 9, | COST_9 = 9, | ||||
| COST_10 = 10, | COST_10 = 10, | ||||
| }; | }; | ||||
| @@ -178,7 +178,7 @@ class GE_FUNC_VISIBILITY GeExecutor { | |||||
| Status GetAippType(const uint32_t model_id, const uint32_t index, InputAippType &type, size_t &aipp_index); | Status GetAippType(const uint32_t model_id, const uint32_t index, InputAippType &type, size_t &aipp_index); | ||||
| Status CommandHandle(const Command &command); | |||||
| Status CommandHandle(const Command &command) const; | |||||
| Status SetDump(const DumpConfig &dump_config); | Status SetDump(const DumpConfig &dump_config); | ||||
| @@ -133,6 +133,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const char *_IF; | |||||
| FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const char *STATELESSIF; | FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const char *STATELESSIF; | ||||
| FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const char *IF; | FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const char *IF; | ||||
| FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const char *CASE; | FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const char *CASE; | ||||
| FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const char *STATELESSCASE; | |||||
| FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const char *_WHILE; | FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const char *_WHILE; | ||||
| FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const char *WHILE; | FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const char *WHILE; | ||||
| FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const char *STATELESSWHILE; | FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const char *STATELESSWHILE; | ||||
| @@ -1 +1 @@ | |||||
| Subproject commit 002617852e22767bd864db3c01595630e23f5496 | |||||
| Subproject commit 58412ad7aed08cd1c01cc070d80706e4253c9075 | |||||
| @@ -18,31 +18,38 @@ | |||||
| #define AICPU_OP_TYPE_LIST_H_ | #define AICPU_OP_TYPE_LIST_H_ | ||||
| extern "C" { | extern "C" { | ||||
| enum OpKernelType { TF_KERNEL, CPU_KERNEL }; | |||||
| enum OpKernelType { | |||||
| TF_KERNEL, | |||||
| CPU_KERNEL | |||||
| }; | |||||
| enum ReturnCode { OP_TYPE_NOT_SUPPORT, FORMAT_NOT_SUPPORT, DTYPE_NOT_SUPPORT }; | |||||
| enum ReturnCode { | |||||
| OP_TYPE_NOT_SUPPORT, | |||||
| FORMAT_NOT_SUPPORT, | |||||
| DTYPE_NOT_SUPPORT | |||||
| }; | |||||
| #pragma pack(push, 1) | #pragma pack(push, 1) | ||||
| // One byte alignment | // One byte alignment | ||||
| struct SysOpInfo { | struct SysOpInfo { | ||||
| uint64_t opLen; | |||||
| uint64_t opType; | |||||
| OpKernelType kernelsType; | |||||
| uint64_t opLen; | |||||
| uint64_t opType; | |||||
| OpKernelType kernelsType; | |||||
| }; | }; | ||||
| struct SysOpCheckInfo { | struct SysOpCheckInfo { | ||||
| uint64_t opListNum; | |||||
| uint64_t offSetLen; | |||||
| uint64_t sysOpInfoList; | |||||
| uint64_t opParamInfoList; | |||||
| uint64_t opListNum; | |||||
| uint64_t offSetLen; | |||||
| uint64_t sysOpInfoList; | |||||
| uint64_t opParamInfoList; | |||||
| }; | }; | ||||
| struct SysOpCheckResp { | struct SysOpCheckResp { | ||||
| uint64_t opListNum; | |||||
| bool isWithoutJson; | |||||
| uint64_t returnCodeList; | |||||
| uint64_t sysOpInfoList; | |||||
| uint64_t opParamInfoList; | |||||
| uint64_t opListNum; | |||||
| bool isWithoutJson; | |||||
| uint64_t returnCodeList; | |||||
| uint64_t sysOpInfoList; | |||||
| uint64_t opParamInfoList; | |||||
| }; | }; | ||||
| #pragma pack(pop) | #pragma pack(pop) | ||||
| } | } | ||||
| @@ -24,81 +24,83 @@ namespace aicpu { | |||||
| using char_t = char; | using char_t = char; | ||||
| #pragma pack(push, 1) | #pragma pack(push, 1) | ||||
| struct AicpuParamHead { | |||||
| uint32_t length; // Total length: include cunstom message | |||||
| uint32_t ioAddrNum; // Input and output address number | |||||
| uint32_t extInfoLength; // extInfo struct Length | |||||
| uint64_t extInfoAddr; // extInfo address | |||||
| struct AicpuParamHead | |||||
| { | |||||
| uint32_t length; // Total length: include cunstom message | |||||
| uint32_t ioAddrNum; // Input and output address number | |||||
| uint32_t extInfoLength; // extInfo struct Length | |||||
| uint64_t extInfoAddr; // extInfo address | |||||
| }; | }; | ||||
| enum class AicpuConfigMsgType { | enum class AicpuConfigMsgType { | ||||
| AICPU_CONFIG_MSG_TYPE_BUF_FREE = 0, /* free buf */ | |||||
| AICPU_CONFIG_MSG_TYPE_BUF_RESET = 1, /* reset buf */ | |||||
| AICPU_CONFIG_MSG_TYPE_BUF_SET_ADDR = 2, /* set buf addr to aicpu */ | |||||
| AICPU_CONFIG_MSG_TYPE_BUF_FREE = 0, /* free buf */ | |||||
| AICPU_CONFIG_MSG_TYPE_BUF_RESET = 1, /* reset buf */ | |||||
| AICPU_CONFIG_MSG_TYPE_BUF_SET_ADDR = 2, /* set buf addr to aicpu */ | |||||
| }; | }; | ||||
| enum class AicpuErrMsgType { | enum class AicpuErrMsgType { | ||||
| ERR_MSG_TYPE_NULL = 0, | |||||
| ERR_MSG_TYPE_AICORE = 1, | |||||
| ERR_MSG_TYPE_AICPU = 2, | |||||
| ERR_MSG_TYPE_NULL = 0, | |||||
| ERR_MSG_TYPE_AICORE = 1, | |||||
| ERR_MSG_TYPE_AICPU = 2, | |||||
| }; | }; | ||||
| enum class AicpuExtInfoMsgType { | enum class AicpuExtInfoMsgType { | ||||
| EXT_MODEL_ID_MSG_TYPE = 0, | |||||
| EXT_MODEL_ID_MSG_TYPE = 0, | |||||
| }; | }; | ||||
| struct AicpuConfigMsg { | struct AicpuConfigMsg { | ||||
| uint8_t msgType; | |||||
| uint8_t reserved1; | |||||
| uint16_t bufLen; | |||||
| uint32_t offset; | |||||
| uint64_t bufAddr; | |||||
| uint32_t tsId; | |||||
| uint32_t reserved2; | |||||
| uint8_t msgType; | |||||
| uint8_t reserved1; | |||||
| uint16_t bufLen; | |||||
| uint32_t offset; | |||||
| uint64_t bufAddr; | |||||
| uint32_t tsId; | |||||
| uint32_t reserved2; | |||||
| }; | }; | ||||
| struct AicpuModelIdInfo { | struct AicpuModelIdInfo { | ||||
| uint32_t modelId; | |||||
| uint32_t extendModelId; | |||||
| uint32_t extendInfo[13]; | |||||
| uint32_t modelId; | |||||
| uint32_t extendModelId; | |||||
| uint32_t extendInfo[13]; | |||||
| }; | }; | ||||
| // 64 bytes | // 64 bytes | ||||
| struct AicpuExtendInfo { | struct AicpuExtendInfo { | ||||
| uint8_t msgType; | |||||
| uint8_t version; | |||||
| uint8_t reserved[2]; | |||||
| union { | |||||
| AicpuModelIdInfo modelIdMap; | |||||
| }; | |||||
| uint8_t msgType; | |||||
| uint8_t version; | |||||
| uint8_t reserved[2]; | |||||
| union { | |||||
| AicpuModelIdInfo modelIdMap; | |||||
| }; | |||||
| }; | }; | ||||
| struct AicoreErrMsgInfo { | struct AicoreErrMsgInfo { | ||||
| uint8_t errType; | |||||
| uint8_t version; | |||||
| uint8_t reserved1[2]; /* reserved1, 4 byte alignment */ | |||||
| uint32_t errorCode; | |||||
| uint32_t modelId; | |||||
| uint32_t taskId; | |||||
| uint32_t streamId; | |||||
| uint64_t transactionId; | |||||
| uint8_t reserved2[228]; /* the total byte is 256, reserved2 len = 256 - other lens */ | |||||
| uint8_t errType; | |||||
| uint8_t version; | |||||
| uint8_t reserved1[2]; /* reserved1, 4 byte alignment */ | |||||
| uint32_t errorCode; | |||||
| uint32_t modelId; | |||||
| uint32_t taskId; | |||||
| uint32_t streamId; | |||||
| uint64_t transactionId; | |||||
| uint8_t reserved2[228]; /* the total byte is 256, reserved2 len = 256 - other lens */ | |||||
| }; | }; | ||||
| struct AicpuErrMsgInfo { | struct AicpuErrMsgInfo { | ||||
| uint8_t errType; | |||||
| uint8_t version; | |||||
| uint8_t reserved1[2]; /* reserved1, 4 byte alignment */ | |||||
| uint32_t errorCode; | |||||
| uint32_t modelId; | |||||
| uint32_t streamId; | |||||
| uint64_t transactionId; | |||||
| char_t opName[64]; /* op name str */ | |||||
| char_t errDesc[128]; /* err msg desc info */ | |||||
| uint8_t reserved2[40]; /* the total byte is 256, reserved2 len = 256 - other lens */ | |||||
| uint8_t errType; | |||||
| uint8_t version; | |||||
| uint8_t reserved1[2]; /* reserved1, 4 byte alignment */ | |||||
| uint32_t errorCode; | |||||
| uint32_t modelId; | |||||
| uint32_t streamId; | |||||
| uint64_t transactionId; | |||||
| char_t opName[64]; /* op name str */ | |||||
| char_t errDesc[128]; /* err msg desc info */ | |||||
| uint8_t reserved2[40]; /* the total byte is 256, reserved2 len = 256 - other lens */ | |||||
| }; | }; | ||||
| #pragma pack(pop) | #pragma pack(pop) | ||||
| } // namespace aicpu | } // namespace aicpu | ||||
| #endif // AICPU_TASK_STRUCT_H | #endif // AICPU_TASK_STRUCT_H | ||||
| @@ -1,13 +1,13 @@ | |||||
| /** | /** | ||||
| * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. | |||||
| * | |||||
| * This program is distributed in the hope that it will be useful, | |||||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |||||
| * | |||||
| * Description:interface. | |||||
| * Create: 2021-12-21 | |||||
| */ | |||||
| * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. | |||||
| * | |||||
| * This program is distributed in the hope that it will be useful, | |||||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |||||
| * | |||||
| * Description:interface. | |||||
| * Create: 2021-12-21 | |||||
| */ | |||||
| #ifndef AICPU_TYPE_DEF_H | #ifndef AICPU_TYPE_DEF_H | ||||
| #define AICPU_TYPE_DEF_H | #define AICPU_TYPE_DEF_H | ||||
| @@ -25,24 +25,28 @@ typedef float float32_t; | |||||
| typedef double float64_t; | typedef double float64_t; | ||||
| #endif | #endif | ||||
| inline uint64_t PtrToValue(const void *ptr) { | |||||
| return static_cast<const uint64_t>(reinterpret_cast<const uintptr_t>(ptr)); | |||||
| inline uint64_t PtrToValue(const void *ptr) | |||||
| { | |||||
| return static_cast<const uint64_t>(reinterpret_cast<const uintptr_t>(ptr)); | |||||
| } | } | ||||
| inline void *ValueToPtr(const uint64_t value) { | |||||
| return reinterpret_cast<void *>(static_cast<const uintptr_t>(value)); | |||||
| inline void *ValueToPtr(const uint64_t value) | |||||
| { | |||||
| return reinterpret_cast<void *>(static_cast<const uintptr_t>(value)); | |||||
| } | } | ||||
| template <typename TI, typename TO> | |||||
| inline TO *PtrToPtr(TI *ptr) { | |||||
| return reinterpret_cast<TO *>(ptr); | |||||
| template<typename TI, typename TO> | |||||
| inline TO *PtrToPtr(TI *ptr) | |||||
| { | |||||
| return reinterpret_cast<TO *>(ptr); | |||||
| } | } | ||||
| template <typename T> | |||||
| inline T *PtrAdd(T *const ptr, const size_t maxIdx, const size_t idx) { | |||||
| if ((ptr != nullptr) && (idx < maxIdx)) { | |||||
| return reinterpret_cast<T *>(ptr + idx); | |||||
| } | |||||
| return nullptr; | |||||
| template<typename T> | |||||
| inline T *PtrAdd(T * const ptr, const size_t maxIdx, const size_t idx) | |||||
| { | |||||
| if ((ptr != nullptr) && (idx < maxIdx)) { | |||||
| return reinterpret_cast<T *>(ptr + idx); | |||||
| } | |||||
| return nullptr; | |||||
| } | } | ||||
| #endif // AICPU_TYPE_DEF_H | #endif // AICPU_TYPE_DEF_H | ||||
| @@ -92,6 +92,12 @@ typedef enum tagRtLimitType { | |||||
| RT_LIMIT_TYPE_LOW_POWER_TIMEOUT = 0, // timeout for power down , ms | RT_LIMIT_TYPE_LOW_POWER_TIMEOUT = 0, // timeout for power down , ms | ||||
| } rtLimitType_t; | } rtLimitType_t; | ||||
| typedef enum tagRtFloatOverflowMode { | |||||
| RT_OVERFLOW_MODE_SATURATION = 0, | |||||
| RT_OVERFLOW_MODE_INFNAN, | |||||
| RT_OVERFLOW_MODE_UNDEF, | |||||
| } rtFloatOverflowMode_t; | |||||
| typedef struct rtExceptionInfo { | typedef struct rtExceptionInfo { | ||||
| uint32_t taskid; | uint32_t taskid; | ||||
| uint32_t streamid; | uint32_t streamid; | ||||
| @@ -145,12 +145,6 @@ typedef enum tagRTTaskTimeoutType { | |||||
| RT_TIMEOUT_TYPE_OP_EXECUTE, | RT_TIMEOUT_TYPE_OP_EXECUTE, | ||||
| } rtTaskTimeoutType_t; | } rtTaskTimeoutType_t; | ||||
| typedef enum tagRtFloatOverflowMode { | |||||
| RT_OVERFLOW_MODE_SATURATION = 0, | |||||
| RT_OVERFLOW_MODE_INFNAN, | |||||
| RT_OVERFLOW_MODE_UNDEF, | |||||
| } rtFloatOverflowMode_t; | |||||
| /** | /** | ||||
| * @ingroup | * @ingroup | ||||
| * @brief get AI core count | * @brief get AI core count | ||||
| @@ -433,6 +433,32 @@ RTS_API rtError_t rtGetDevMsg(rtGetDevMsgType_t getMsgType, rtGetMsgCallback cal | |||||
| * @return RT_MEMORY_TS, RT_MEMORY_HBM, RT_MEMORY_TS | RT_MEMORY_POLICY_HUGE_PAGE_ONLY | * @return RT_MEMORY_TS, RT_MEMORY_HBM, RT_MEMORY_TS | RT_MEMORY_POLICY_HUGE_PAGE_ONLY | ||||
| */ | */ | ||||
| RTS_API uint32_t rtGetTsMemType(rtMemRequestFeature_t featureType, uint32_t memSize); | RTS_API uint32_t rtGetTsMemType(rtMemRequestFeature_t featureType, uint32_t memSize); | ||||
| /** | |||||
| * @ingroup | |||||
| * @brief set saturation mode for current device. | |||||
| * @param [in] saturation mode. | |||||
| * @return RT_ERROR_NONE for ok | |||||
| */ | |||||
| RTS_API rtError_t rtSetDeviceSatMode(rtFloatOverflowMode_t floatOverflowMode); | |||||
| /** | |||||
| * @ingroup | |||||
| * @brief get saturation mode for current device. | |||||
| * @param [out] saturation mode. | |||||
| * @return RT_ERROR_NONE for ok | |||||
| */ | |||||
| RTS_API rtError_t rtGetDeviceSatMode(rtFloatOverflowMode_t *floatOverflowMode); | |||||
| /** | |||||
| * @ingroup | |||||
| * @brief get saturation mode for target stream. | |||||
| * @param [in] target stm | |||||
| * @param [out] saturation mode. | |||||
| * @return RT_ERROR_NONE for ok | |||||
| */ | |||||
| RTS_API rtError_t rtGetDeviceSatModeForStream(rtStream_t stm, rtFloatOverflowMode_t *floatOverflowMode); | |||||
| #if defined(__cplusplus) | #if defined(__cplusplus) | ||||
| } | } | ||||
| #endif | #endif | ||||
| @@ -229,6 +229,8 @@ typedef void (*rtCallback_t)(void *fnData); | |||||
| #define RT_KERNEL_DUMPFLAG (0x02U) | #define RT_KERNEL_DUMPFLAG (0x02U) | ||||
| #define RT_FUSION_KERNEL_DUMPFLAG (0x04U) | #define RT_FUSION_KERNEL_DUMPFLAG (0x04U) | ||||
| #define RT_KERNEL_CUSTOM_AICPU (0x08U) | #define RT_KERNEL_CUSTOM_AICPU (0x08U) | ||||
| #define RT_KERNEL_FFTSPLUS_DYNAMIC_SHAPE_DUMPFLAG (0x10U) | |||||
| #define RT_KERNEL_FFTSPLUS_STATIC_SHAPE_DUMPFLAG (0x20U) | |||||
| // STARS topic scheduler sqe : topic_type | // STARS topic scheduler sqe : topic_type | ||||
| #define RT_KERNEL_DEVICE_FIRST (0x10U) | #define RT_KERNEL_DEVICE_FIRST (0x10U) | ||||
| @@ -391,6 +391,18 @@ RTS_API rtError_t rtMemcpyHostTask(void * const dst, const uint64_t destMax, con | |||||
| RTS_API rtError_t rtMemcpyAsync(void *dst, uint64_t destMax, const void *src, uint64_t cnt, rtMemcpyKind_t kind, | RTS_API rtError_t rtMemcpyAsync(void *dst, uint64_t destMax, const void *src, uint64_t cnt, rtMemcpyKind_t kind, | ||||
| rtStream_t stm); | rtStream_t stm); | ||||
| typedef struct rtMemcpyAddrInfo { | |||||
| uint32_t resv0; | |||||
| uint32_t resv1; | |||||
| uint32_t resv2; | |||||
| uint32_t len; | |||||
| uint64_t src; | |||||
| uint64_t dst; | |||||
| } rtMemcpyAddrInfo; | |||||
| RTS_API rtError_t rtMemcpyAsyncPtr(void *memcpyAddrInfo, uint64_t destMax, uint64_t count, | |||||
| rtMemcpyKind_t kind, rtStream_t stream); | |||||
| /** | /** | ||||
| * @ingroup dvrt_mem | * @ingroup dvrt_mem | ||||
| * @brief asynchronized reduce memcpy | * @brief asynchronized reduce memcpy | ||||
| @@ -407,6 +419,23 @@ RTS_API rtError_t rtMemcpyAsync(void *dst, uint64_t destMax, const void *src, ui | |||||
| RTS_API rtError_t rtReduceAsync(void *dst, uint64_t destMax, const void *src, uint64_t cnt, rtRecudeKind_t kind, | RTS_API rtError_t rtReduceAsync(void *dst, uint64_t destMax, const void *src, uint64_t cnt, rtRecudeKind_t kind, | ||||
| rtDataType_t type, rtStream_t stm); | rtDataType_t type, rtStream_t stm); | ||||
| /** | |||||
| * @ingroup dvrt_mem | |||||
| * @brief asynchronized reduce memcpy | |||||
| * @param [in] dst destination address pointer | |||||
| * @param [in] Max length of destination address memory | |||||
| * @param [in] src source address pointer | |||||
| * @param [in] count the number of byte to copy | |||||
| * @param [in] kind memcpy type | |||||
| * @param [in] type data type | |||||
| * @param [in] stm asynchronized task stream | |||||
| * @param [in] overflowAddr addr of overflow flag | |||||
| * @return RT_ERROR_NONE for ok | |||||
| * @return RT_ERROR_INVALID_VALUE for error input | |||||
| */ | |||||
| RTS_API rtError_t rtReduceAsyncV2(void *dst, uint64_t destMax, const void *src, uint64_t count, rtRecudeKind_t kind, | |||||
| rtDataType_t type, rtStream_t stm, void *overflowAddr); | |||||
| /** | /** | ||||
| * @ingroup dvrt_mem | * @ingroup dvrt_mem | ||||
| * @brief synchronized memcpy2D | * @brief synchronized memcpy2D | ||||
| @@ -17,10 +17,19 @@ extern "C" { | |||||
| #pragma pack(push) | #pragma pack(push) | ||||
| #pragma pack (1) | #pragma pack (1) | ||||
| typedef struct tagFftsPlusDumpInfo { | |||||
| const void *loadDumpInfo; | |||||
| const void *unloadDumpInfo; | |||||
| uint32_t loadDumpInfolen; | |||||
| uint32_t unloadDumpInfolen; | |||||
| } rtFftsPlusDumpInfo_t; | |||||
| typedef struct tagFftsPlusTaskInfo { | typedef struct tagFftsPlusTaskInfo { | ||||
| const rtFftsPlusSqe_t *fftsPlusSqe; | const rtFftsPlusSqe_t *fftsPlusSqe; | ||||
| const void *descBuf; // include total context | const void *descBuf; // include total context | ||||
| size_t descBufLen; // the length of descBuf | size_t descBufLen; // the length of descBuf | ||||
| rtFftsPlusDumpInfo_t fftsPlusDumpInfo; // used only in the dynamic shape | |||||
| } rtFftsPlusTaskInfo_t; | } rtFftsPlusTaskInfo_t; | ||||
| #pragma pack(pop) | #pragma pack(pop) | ||||
| @@ -110,7 +110,8 @@ typedef struct tagFftsPlusAicAivCtx { | |||||
| // 0-3 bytes | // 0-3 bytes | ||||
| uint16_t contextType; | uint16_t contextType; | ||||
| uint8_t successorNum; | uint8_t successorNum; | ||||
| uint8_t resv : 7; | |||||
| uint8_t resv : 6; | |||||
| uint8_t dumpSwitch : 1; | |||||
| uint8_t aten : 1; | uint8_t aten : 1; | ||||
| // 4-7 | // 4-7 | ||||
| uint8_t prefetchConfig; | uint8_t prefetchConfig; | ||||
| @@ -172,7 +173,8 @@ typedef struct tagFftsPlusMixAicAivCtx { | |||||
| // 0-3 bytes | // 0-3 bytes | ||||
| uint16_t contextType; | uint16_t contextType; | ||||
| uint8_t successorNum; | uint8_t successorNum; | ||||
| uint8_t reserved1 : 7; | |||||
| uint8_t reserved1 : 6; | |||||
| uint8_t dumpSwitch : 1; | |||||
| uint8_t aten : 1; | uint8_t aten : 1; | ||||
| // 4-7 | // 4-7 | ||||
| uint8_t prefetchConfig; | uint8_t prefetchConfig; | ||||
| @@ -236,7 +238,8 @@ typedef struct tagFftsPlusSdmaCtx { | |||||
| // 0-3 bytes | // 0-3 bytes | ||||
| uint16_t contextType; | uint16_t contextType; | ||||
| uint8_t successorNum; | uint8_t successorNum; | ||||
| uint8_t res1 : 7; | |||||
| uint8_t res1 : 6; | |||||
| uint8_t dumpSwitch : 1; | |||||
| uint8_t aten : 1; | uint8_t aten : 1; | ||||
| // 4-7 | // 4-7 | ||||
| uint8_t res2; | uint8_t res2; | ||||
| @@ -376,7 +379,8 @@ typedef struct tagFftsPlusAiCpuCtx { | |||||
| // 0-3 bytes | // 0-3 bytes | ||||
| uint16_t contextType; | uint16_t contextType; | ||||
| uint8_t successorNum; | uint8_t successorNum; | ||||
| uint8_t res1 : 7; | |||||
| uint8_t res1 : 6; | |||||
| uint8_t dumpSwitch : 1; | |||||
| uint8_t aten : 1; | uint8_t aten : 1; | ||||
| // 4-7 | // 4-7 | ||||
| uint8_t res2; | uint8_t res2; | ||||
| @@ -70,10 +70,27 @@ typedef enum tagFftsPlusType { | |||||
| RT_FFTS_PLUS_TYPE = 4, // FFTS+ mode | RT_FFTS_PLUS_TYPE = 4, // FFTS+ mode | ||||
| } rtFftsPlusType_t; | } rtFftsPlusType_t; | ||||
| typedef struct tagStarsFftsPlusHeader { | |||||
| uint8_t type : 6; | |||||
| uint8_t l1Lock : 1; | |||||
| uint8_t l1Unlock : 1; | |||||
| uint8_t ie : 2; | |||||
| uint8_t preP : 2; | |||||
| uint8_t postP : 2; | |||||
| uint8_t wrCqe : 1; | |||||
| /* tell mcu if this subgraph is overflow-enabled and mcu will send this flag to aicpu when aicpu ctx is excuted */ | |||||
| uint8_t overflowEn : 1; | |||||
| uint16_t blockDim; | |||||
| uint16_t rtStreamId; | |||||
| uint16_t taskId; | |||||
| } rtStarsFftsPlusHeader_t; | |||||
| // ffts+ sqe | // ffts+ sqe | ||||
| typedef struct tagFftsPlusSqe { | typedef struct tagFftsPlusSqe { | ||||
| // 0-7 bytes | // 0-7 bytes | ||||
| rtStarsSqeHeader_t sqeHeader; | |||||
| rtStarsSqeHeader_t sqeHeader; // use rtStarsFftsPlusHeader_t instead | |||||
| // 8-11 bytes | // 8-11 bytes | ||||
| uint16_t fftsType : 3; | uint16_t fftsType : 3; | ||||
| uint16_t reserved1 : 9; | uint16_t reserved1 : 9; | ||||
| @@ -27,6 +27,7 @@ extern "C" { | |||||
| #define RT_STREAM_HEAD (0x20U) | #define RT_STREAM_HEAD (0x20U) | ||||
| #define RT_STREAM_PRIMARY_DEFAULT (0x40U) | #define RT_STREAM_PRIMARY_DEFAULT (0x40U) | ||||
| #define RT_STREAM_PRIMARY_FIRST_DEFAULT (0x80U) | #define RT_STREAM_PRIMARY_FIRST_DEFAULT (0x80U) | ||||
| #define RT_STREAM_OVERFLOW (0x100U) | |||||
| /** | /** | ||||
| * @ingroup stream_type | * @ingroup stream_type | ||||
| @@ -212,6 +213,26 @@ RTS_API rtError_t rtDebugRegisterForStream(rtStream_t stm, uint32_t flag, const | |||||
| */ | */ | ||||
| RTS_API rtError_t rtDebugUnRegisterForStream(rtStream_t stm); | RTS_API rtError_t rtDebugUnRegisterForStream(rtStream_t stm); | ||||
| /* | |||||
| * @ingroup dvrt_stream | |||||
| * @brief enable or disable stream overflow | |||||
| * @param [in] stm: stream handle | |||||
| * @param [in] flag: 0:disable others:enable | |||||
| * @return RT_ERROR_NONE for ok | |||||
| * @return RT_ERROR_INVALID_VALUE for error input | |||||
| */ | |||||
| RTS_API rtError_t rtSetStreamOverflowSwitch(rtStream_t stm, uint32_t flags); | |||||
| /* | |||||
| * @ingroup dvrt_stream | |||||
| * @brief get whether overflow of the stream is enable or disable | |||||
| * @param [in] stm: stream handle | |||||
| * @param [out] flag: 0:disable others:enable | |||||
| * @return RT_ERROR_NONE for ok | |||||
| * @return RT_ERROR_INVALID_VALUE for error input | |||||
| */ | |||||
| RTS_API rtError_t rtGetStreamOverflowSwitch(rtStream_t stm, uint32_t *flags); | |||||
| #if defined(__cplusplus) | #if defined(__cplusplus) | ||||
| } | } | ||||
| #endif | #endif | ||||
| @@ -41,6 +41,10 @@ struct InitFlowGwInfo { | |||||
| char_t rsv[128]; | char_t rsv[128]; | ||||
| }; | }; | ||||
| typedef enum { | |||||
| TSD_CAPABILITY_PIDQOS = 0, | |||||
| TSD_CAPABILITY_BUT | |||||
| } TsdCapabilityType; | |||||
| /** | /** | ||||
| * @ingroup Open | * @ingroup Open | ||||
| * @brief Used for the Framework process to communicate with the TSDDaemon process, | * @brief Used for the Framework process to communicate with the TSDDaemon process, | ||||
| @@ -198,6 +202,36 @@ TDT_LIB_EXPORT uint32_t TsdSetMsprofReporterCallback(const MsprofReporterCallbac | |||||
| * @retval OtherValues Failure | * @retval OtherValues Failure | ||||
| */ | */ | ||||
| TDT_LIB_EXPORT uint32_t TsdSetAttr(const char * const attrKey, const char * const attrValue); | TDT_LIB_EXPORT uint32_t TsdSetAttr(const char * const attrKey, const char * const attrValue); | ||||
| /** | |||||
| * @ingroup TsdCapabilityGet | |||||
| * @brief use tsd to get some capability | |||||
| * | |||||
| * @par type | |||||
| * capability type | |||||
| * | |||||
| * @par ptr | |||||
| * the result | |||||
| * @retval TDT_OK Success | |||||
| * @retval OtherValues Failure | |||||
| */ | |||||
| TDT_LIB_EXPORT uint32_t TsdCapabilityGet(const uint32_t logicDeviceId, const int32_t type, const uint64_t ptr); | |||||
| /** | |||||
| * @ingroup GetHdcConctStatus | |||||
| * @brief used to get hdc connection status | |||||
| * | |||||
| * @par logicDeviceId | |||||
| * logic device id | |||||
| * | |||||
| * @par hdcSessStat | |||||
| * hdc session status, DRV_ERROR_SOCKET_CONNECT or DRV_ERROR_SOCKET_CLOSE | |||||
| * @retval TDT_OK Success | |||||
| * @retval OtherValues Failure | |||||
| */ | |||||
| TDT_LIB_EXPORT uint32_t GetHdcConctStatus(const uint32_t logicDeviceId, int32_t *hdcSessStat); | |||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| } | } | ||||
| #endif // __cplusplus | #endif // __cplusplus | ||||
| @@ -19,11 +19,11 @@ | |||||
| #include "common/type_def.h" | #include "common/type_def.h" | ||||
| namespace tsd { | namespace tsd { | ||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| using TSD_StatusT = uint32_t; | |||||
| using TSD_StatusT = uint32_t; | |||||
| #else | #else | ||||
| typedef uint32_t TSD_StatusT; | |||||
| typedef uint32_t TSD_StatusT; | |||||
| #endif | #endif | ||||
| // success code | |||||
| constexpr TSD_StatusT TSD_OK = 0U; | |||||
| } // namespace tsd | |||||
| // success code | |||||
| constexpr TSD_StatusT TSD_OK = 0U; | |||||
| } | |||||
| #endif // INC_TDT_STATUS_H | #endif // INC_TDT_STATUS_H | ||||