From 8011e1ea9a82a42c0dd907b5cd929c60e428b882 Mon Sep 17 00:00:00 2001 From: yanghaoran Date: Sat, 5 Dec 2020 14:16:55 +0800 Subject: [PATCH 1/5] update headers --- inc/external/acl/acl_base.h | 1 + inc/external/acl/acl_op.h | 1 + inc/external/acl/acl_op_compiler.h | 1 + inc/external/acl/error_codes/ge_error_codes.h | 4 +- inc/external/acl/error_codes/rt_error_codes.h | 182 +++++----- inc/external/acl/ops/acl_cblas.h | 1 + inc/external/runtime/rt_error_codes.h | 182 +++++----- .../inc/aicpu/common/aicpu_task_struct.h | 4 +- third_party/fwkacllib/inc/cce/aicpu_engine.h | 15 +- third_party/fwkacllib/inc/hccl/hccl_types.h | 101 ------ third_party/fwkacllib/inc/hccl/hcom.h | 145 -------- .../fwkacllib/inc/mmpa/sub_inc/mmpa_linux.h | 46 ++- .../inc/mmpa/sub_inc/mmpa_typedef_win.h | 2 +- .../fwkacllib/inc/mmpa/sub_inc/mmpa_win.h | 3 +- third_party/fwkacllib/inc/runtime/base.h | 315 +----------------- third_party/fwkacllib/inc/runtime/config.h | 18 +- third_party/fwkacllib/inc/runtime/context.h | 10 +- third_party/fwkacllib/inc/runtime/dev.h | 14 +- .../fwkacllib/inc/runtime/dvfsprofile.h | 10 +- third_party/fwkacllib/inc/runtime/event.h | 10 +- third_party/fwkacllib/inc/runtime/kernel.h | 10 +- third_party/fwkacllib/inc/runtime/mem.h | 10 +- third_party/fwkacllib/inc/runtime/rt.h | 10 +- third_party/fwkacllib/inc/runtime/rt_model.h | 10 +- third_party/fwkacllib/inc/runtime/stream.h | 10 +- .../fwkacllib/inc/tdt/index_transform.h | 20 +- third_party/fwkacllib/inc/tdt/status.h | 9 +- .../inc/toolchain/adx_datadump_server.h | 22 +- .../fwkacllib/inc/toolchain/prof_acl_api.h | 250 +++++++++++++- .../fwkacllib/inc/toolchain/prof_mgr_core.h | 9 + .../fwkacllib/inc/toolchain/prof_reporter.h | 10 +- third_party/fwkacllib/inc/toolchain/slog.h | 25 ++ .../inc/toolchain/tuning_tool/tune_api.h | 18 +- 33 files changed, 634 insertions(+), 844 deletions(-) delete mode 100644 third_party/fwkacllib/inc/hccl/hccl_types.h diff --git a/inc/external/acl/acl_base.h b/inc/external/acl/acl_base.h index 224a8ef0..debadcfd 100644 --- a/inc/external/acl/acl_base.h +++ b/inc/external/acl/acl_base.h @@ -110,6 +110,7 @@ static const int ACL_ERROR_DUMP_ALREADY_RUN = 100044; static const int ACL_ERROR_DUMP_NOT_RUN = 100045; static const int ACL_ERROR_PROF_REPEAT_SUBSCRIBE = 148046; static const int ACL_ERROR_PROF_API_CONFLICT = 148047; +static const int ACL_ERROR_INVALID_MAX_OPQUEUE_NUM_CONFIG = 148048; static const int ACL_ERROR_BAD_ALLOC = 200000; static const int ACL_ERROR_API_NOT_SUPPORT = 200001; diff --git a/inc/external/acl/acl_op.h b/inc/external/acl/acl_op.h index 882c6ae6..d2e59bfb 100644 --- a/inc/external/acl/acl_op.h +++ b/inc/external/acl/acl_op.h @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + #ifndef INC_EXTERNAL_ACL_ACL_OP_H_ #define INC_EXTERNAL_ACL_ACL_OP_H_ diff --git a/inc/external/acl/acl_op_compiler.h b/inc/external/acl/acl_op_compiler.h index 9bf5adf0..adae90c7 100644 --- a/inc/external/acl/acl_op_compiler.h +++ b/inc/external/acl/acl_op_compiler.h @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + #ifndef INC_EXTERNAL_ACL_ACL_OP_COMPILER_H_ #define INC_EXTERNAL_ACL_ACL_OP_COMPILER_H_ diff --git a/inc/external/acl/error_codes/ge_error_codes.h b/inc/external/acl/error_codes/ge_error_codes.h index 6f82a897..20a7e0f9 100644 --- a/inc/external/acl/error_codes/ge_error_codes.h +++ b/inc/external/acl/error_codes/ge_error_codes.h @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + #ifndef INC_EXTERNAL_GE_GE_ERROR_CODES_H_ #define INC_EXTERNAL_GE_GE_ERROR_CODES_H_ @@ -25,13 +26,10 @@ static const uint32_t ACL_ERROR_GE_PARAM_INVALID = 145000; static const uint32_t ACL_ERROR_GE_EXEC_NOT_INIT = 145001; static const uint32_t ACL_ERROR_GE_EXEC_MODEL_PATH_INVALID = 145002; static const uint32_t ACL_ERROR_GE_EXEC_MODEL_ID_INVALID = 145003; -static const uint32_t ACL_ERROR_GE_EXEC_MODEL_KEY_PATH_INVALID = 145004; -static const uint32_t ACL_ERROR_GE_EXEC_MODEL_NOT_SUPPORT_ENCRYPTION = 145005; static const uint32_t ACL_ERROR_GE_EXEC_MODEL_DATA_SIZE_INVALID = 145006; static const uint32_t ACL_ERROR_GE_EXEC_MODEL_ADDR_INVALID = 145007; static const uint32_t ACL_ERROR_GE_EXEC_MODEL_QUEUE_ID_INVALID = 145008; static const uint32_t ACL_ERROR_GE_EXEC_LOAD_MODEL_REPEATED = 145009; -static const uint32_t ACL_ERROR_GE_EXEC_MODEL_PARTITION_NUM_INVALID = 145010; static const uint32_t ACL_ERROR_GE_DYNAMIC_INPUT_ADDR_INVALID = 145011; static const uint32_t ACL_ERROR_GE_DYNAMIC_INPUT_LENGTH_INVALID = 145012; static const uint32_t ACL_ERROR_GE_DYNAMIC_BATCH_SIZE_INVALID = 145013; diff --git a/inc/external/acl/error_codes/rt_error_codes.h b/inc/external/acl/error_codes/rt_error_codes.h index 0ae5303d..2dd2c70c 100644 --- a/inc/external/acl/error_codes/rt_error_codes.h +++ b/inc/external/acl/error_codes/rt_error_codes.h @@ -1,91 +1,91 @@ -/** - * Copyright 2019-2020 Huawei Technologies Co., Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __INC_EXTERNEL_RT_ERROR_CODES_H__ -#define __INC_EXTERNEL_RT_ERROR_CODES_H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -static const int32_t ACL_RT_SUCCESS = 0; // success - -static const int32_t ACL_ERROR_RT_PARAM_INVALID = 107000; // param invalid -static const int32_t ACL_ERROR_RT_INVALID_DEVICEID = 107001; // invalid device id -static const int32_t ACL_ERROR_RT_CONTEXT_NULL = 107002; // current context null -static const int32_t ACL_ERROR_RT_STREAM_CONTEXT = 107003; // stream not in current context -static const int32_t ACL_ERROR_RT_MODEL_CONTEXT = 107004; // model not in current context -static const int32_t ACL_ERROR_RT_STREAM_MODEL = 107005; // stream not in model -static const int32_t ACL_ERROR_RT_EVENT_TIMESTAMP_INVALID = 107006; // event timestamp invalid -static const int32_t ACL_ERROR_RT_EVENT_TIMESTAMP_REVERSAL = 107007; // event timestamp reversal -static const int32_t ACL_ERROR_RT_ADDR_UNALIGNED = 107008; // memory address unaligned -static const int32_t ACL_ERROR_RT_FILE_OPEN = 107009; // open file failed -static const int32_t ACL_ERROR_RT_FILE_WRITE = 107010; // write file failed -static const int32_t ACL_ERROR_RT_STREAM_SUBSCRIBE = 107011; // error subscribe stream -static const int32_t ACL_ERROR_RT_THREAD_SUBSCRIBE = 107012; // error subscribe thread -static const int32_t ACL_ERROR_RT_GROUP_NOT_SET = 107013; // group not set -static const int32_t ACL_ERROR_RT_GROUP_NOT_CREATE = 107014; // group not create -static const int32_t ACL_ERROR_RT_STREAM_NO_CB_REG = 107015; // callback not register to stream -static const int32_t ACL_ERROR_RT_INVALID_MEMORY_TYPE = 107016; // invalid memory type - -static const int32_t ACL_ERROR_RT_FEATURE_NOT_SUPPROT = 207000; // feature not support -static const int32_t ACL_ERROR_RT_MEMORY_ALLOCATION = 207001; // memory allocation error -static const int32_t ACL_ERROR_RT_MEMORY_FREE = 207002; // memory free error - -static const int32_t ACL_ERROR_RT_INTERNEL_ERROR = 507000; // runtime internel 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_DRV_INTERNEL_ERROR = 507899; // drv internel error - -#ifdef __cplusplus -} -#endif - -#endif // __INC_EXTERNEL_RT_ERROR_CODES_H__ +/** + * Copyright 2019-2020 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __INC_EXTERNEL_RT_ERROR_CODES_H__ +#define __INC_EXTERNEL_RT_ERROR_CODES_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +static const int32_t ACL_RT_SUCCESS = 0; // success + +static const int32_t ACL_ERROR_RT_PARAM_INVALID = 107000; // param invalid +static const int32_t ACL_ERROR_RT_INVALID_DEVICEID = 107001; // invalid device id +static const int32_t ACL_ERROR_RT_CONTEXT_NULL = 107002; // current context null +static const int32_t ACL_ERROR_RT_STREAM_CONTEXT = 107003; // stream not in current context +static const int32_t ACL_ERROR_RT_MODEL_CONTEXT = 107004; // model not in current context +static const int32_t ACL_ERROR_RT_STREAM_MODEL = 107005; // stream not in model +static const int32_t ACL_ERROR_RT_EVENT_TIMESTAMP_INVALID = 107006; // event timestamp invalid +static const int32_t ACL_ERROR_RT_EVENT_TIMESTAMP_REVERSAL = 107007; // event timestamp reversal +static const int32_t ACL_ERROR_RT_ADDR_UNALIGNED = 107008; // memory address unaligned +static const int32_t ACL_ERROR_RT_FILE_OPEN = 107009; // open file failed +static const int32_t ACL_ERROR_RT_FILE_WRITE = 107010; // write file failed +static const int32_t ACL_ERROR_RT_STREAM_SUBSCRIBE = 107011; // error subscribe stream +static const int32_t ACL_ERROR_RT_THREAD_SUBSCRIBE = 107012; // error subscribe thread +static const int32_t ACL_ERROR_RT_GROUP_NOT_SET = 107013; // group not set +static const int32_t ACL_ERROR_RT_GROUP_NOT_CREATE = 107014; // group not create +static const int32_t ACL_ERROR_RT_STREAM_NO_CB_REG = 107015; // callback not register to stream +static const int32_t ACL_ERROR_RT_INVALID_MEMORY_TYPE = 107016; // invalid memory type + +static const int32_t ACL_ERROR_RT_FEATURE_NOT_SUPPROT = 207000; // feature not support +static const int32_t ACL_ERROR_RT_MEMORY_ALLOCATION = 207001; // memory allocation error +static const int32_t ACL_ERROR_RT_MEMORY_FREE = 207002; // memory free error + +static const int32_t ACL_ERROR_RT_INTERNEL_ERROR = 507000; // runtime internel 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_DRV_INTERNEL_ERROR = 507899; // drv internel error + +#ifdef __cplusplus +} +#endif + +#endif // __INC_EXTERNEL_RT_ERROR_CODES_H__ diff --git a/inc/external/acl/ops/acl_cblas.h b/inc/external/acl/ops/acl_cblas.h index 571a1183..3d81eb2b 100644 --- a/inc/external/acl/ops/acl_cblas.h +++ b/inc/external/acl/ops/acl_cblas.h @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + #ifndef INC_EXTERNAL_ACL_OPS_ACL_CBLAS_H_ #define INC_EXTERNAL_ACL_OPS_ACL_CBLAS_H_ diff --git a/inc/external/runtime/rt_error_codes.h b/inc/external/runtime/rt_error_codes.h index 0ae5303d..2dd2c70c 100644 --- a/inc/external/runtime/rt_error_codes.h +++ b/inc/external/runtime/rt_error_codes.h @@ -1,91 +1,91 @@ -/** - * Copyright 2019-2020 Huawei Technologies Co., Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __INC_EXTERNEL_RT_ERROR_CODES_H__ -#define __INC_EXTERNEL_RT_ERROR_CODES_H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -static const int32_t ACL_RT_SUCCESS = 0; // success - -static const int32_t ACL_ERROR_RT_PARAM_INVALID = 107000; // param invalid -static const int32_t ACL_ERROR_RT_INVALID_DEVICEID = 107001; // invalid device id -static const int32_t ACL_ERROR_RT_CONTEXT_NULL = 107002; // current context null -static const int32_t ACL_ERROR_RT_STREAM_CONTEXT = 107003; // stream not in current context -static const int32_t ACL_ERROR_RT_MODEL_CONTEXT = 107004; // model not in current context -static const int32_t ACL_ERROR_RT_STREAM_MODEL = 107005; // stream not in model -static const int32_t ACL_ERROR_RT_EVENT_TIMESTAMP_INVALID = 107006; // event timestamp invalid -static const int32_t ACL_ERROR_RT_EVENT_TIMESTAMP_REVERSAL = 107007; // event timestamp reversal -static const int32_t ACL_ERROR_RT_ADDR_UNALIGNED = 107008; // memory address unaligned -static const int32_t ACL_ERROR_RT_FILE_OPEN = 107009; // open file failed -static const int32_t ACL_ERROR_RT_FILE_WRITE = 107010; // write file failed -static const int32_t ACL_ERROR_RT_STREAM_SUBSCRIBE = 107011; // error subscribe stream -static const int32_t ACL_ERROR_RT_THREAD_SUBSCRIBE = 107012; // error subscribe thread -static const int32_t ACL_ERROR_RT_GROUP_NOT_SET = 107013; // group not set -static const int32_t ACL_ERROR_RT_GROUP_NOT_CREATE = 107014; // group not create -static const int32_t ACL_ERROR_RT_STREAM_NO_CB_REG = 107015; // callback not register to stream -static const int32_t ACL_ERROR_RT_INVALID_MEMORY_TYPE = 107016; // invalid memory type - -static const int32_t ACL_ERROR_RT_FEATURE_NOT_SUPPROT = 207000; // feature not support -static const int32_t ACL_ERROR_RT_MEMORY_ALLOCATION = 207001; // memory allocation error -static const int32_t ACL_ERROR_RT_MEMORY_FREE = 207002; // memory free error - -static const int32_t ACL_ERROR_RT_INTERNEL_ERROR = 507000; // runtime internel 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_DRV_INTERNEL_ERROR = 507899; // drv internel error - -#ifdef __cplusplus -} -#endif - -#endif // __INC_EXTERNEL_RT_ERROR_CODES_H__ +/** + * Copyright 2019-2020 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __INC_EXTERNEL_RT_ERROR_CODES_H__ +#define __INC_EXTERNEL_RT_ERROR_CODES_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +static const int32_t ACL_RT_SUCCESS = 0; // success + +static const int32_t ACL_ERROR_RT_PARAM_INVALID = 107000; // param invalid +static const int32_t ACL_ERROR_RT_INVALID_DEVICEID = 107001; // invalid device id +static const int32_t ACL_ERROR_RT_CONTEXT_NULL = 107002; // current context null +static const int32_t ACL_ERROR_RT_STREAM_CONTEXT = 107003; // stream not in current context +static const int32_t ACL_ERROR_RT_MODEL_CONTEXT = 107004; // model not in current context +static const int32_t ACL_ERROR_RT_STREAM_MODEL = 107005; // stream not in model +static const int32_t ACL_ERROR_RT_EVENT_TIMESTAMP_INVALID = 107006; // event timestamp invalid +static const int32_t ACL_ERROR_RT_EVENT_TIMESTAMP_REVERSAL = 107007; // event timestamp reversal +static const int32_t ACL_ERROR_RT_ADDR_UNALIGNED = 107008; // memory address unaligned +static const int32_t ACL_ERROR_RT_FILE_OPEN = 107009; // open file failed +static const int32_t ACL_ERROR_RT_FILE_WRITE = 107010; // write file failed +static const int32_t ACL_ERROR_RT_STREAM_SUBSCRIBE = 107011; // error subscribe stream +static const int32_t ACL_ERROR_RT_THREAD_SUBSCRIBE = 107012; // error subscribe thread +static const int32_t ACL_ERROR_RT_GROUP_NOT_SET = 107013; // group not set +static const int32_t ACL_ERROR_RT_GROUP_NOT_CREATE = 107014; // group not create +static const int32_t ACL_ERROR_RT_STREAM_NO_CB_REG = 107015; // callback not register to stream +static const int32_t ACL_ERROR_RT_INVALID_MEMORY_TYPE = 107016; // invalid memory type + +static const int32_t ACL_ERROR_RT_FEATURE_NOT_SUPPROT = 207000; // feature not support +static const int32_t ACL_ERROR_RT_MEMORY_ALLOCATION = 207001; // memory allocation error +static const int32_t ACL_ERROR_RT_MEMORY_FREE = 207002; // memory free error + +static const int32_t ACL_ERROR_RT_INTERNEL_ERROR = 507000; // runtime internel 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_DRV_INTERNEL_ERROR = 507899; // drv internel error + +#ifdef __cplusplus +} +#endif + +#endif // __INC_EXTERNEL_RT_ERROR_CODES_H__ diff --git a/third_party/fwkacllib/inc/aicpu/common/aicpu_task_struct.h b/third_party/fwkacllib/inc/aicpu/common/aicpu_task_struct.h index c3672663..72e21f6f 100644 --- a/third_party/fwkacllib/inc/aicpu/common/aicpu_task_struct.h +++ b/third_party/fwkacllib/inc/aicpu/common/aicpu_task_struct.h @@ -21,13 +21,15 @@ namespace aicpu { +#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 -} __attribute__ ((packed)); +}; +#pragma pack(pop) } // namespace aicpu diff --git a/third_party/fwkacllib/inc/cce/aicpu_engine.h b/third_party/fwkacllib/inc/cce/aicpu_engine.h index 740f1200..8bf0bdb6 100644 --- a/third_party/fwkacllib/inc/cce/aicpu_engine.h +++ b/third_party/fwkacllib/inc/cce/aicpu_engine.h @@ -17,6 +17,8 @@ #ifndef AICPU_ENGINE_H__ #define AICPU_ENGINE_H__ +#include + #ifdef __cplusplus extern "C" { #endif @@ -36,12 +38,23 @@ typedef enum { /** * @ingroup aicpu engine * @brief aeCallInterface: - * a interface to call a function in a op kernfel lib + * a interface to call a function in a op kernfel lib * @param [in] addr void *, should be STR_KERNEL * format * @return aeStatus_t */ aeStatus_t aeCallInterface(void *addr); +/** + * @ingroup aicpu engine + * @brief aeBatchLoadKernelSo: + * a interface to load kernel so + * @param [in] loadSoNum load so number + * @param [in] soPaths load so paths + * @param [in] soNames load so names + * @return aeStatus_t + */ +aeStatus_t aeBatchLoadKernelSo(const uint32_t loadSoNum, const char *soPaths[], const char *soNames[]); + #ifdef __cplusplus } #endif diff --git a/third_party/fwkacllib/inc/hccl/hccl_types.h b/third_party/fwkacllib/inc/hccl/hccl_types.h deleted file mode 100644 index 50a64795..00000000 --- a/third_party/fwkacllib/inc/hccl/hccl_types.h +++ /dev/null @@ -1,101 +0,0 @@ -/** - * Copyright 2019-2020 Huawei Technologies Co., Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file hccl_types.h - * @brief HCCL data type definition - * - */ - -#ifndef HCCL_TYPES_H_ -#define HCCL_TYPES_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus - -/** - * @brief HCCL functions return value definition - */ -typedef enum { - HCCL_SUCCESS = 0, /**< success */ - HCCL_E_PARA = 1, /**< parameter error */ - HCCL_E_PTR = 2, /**< empty pointer */ - HCCL_E_MEMORY = 3, /**< memory error */ - HCCL_E_INTERNAL = 4, /**< internal error */ - HCCL_E_NOT_SUPPORT = 5, /**< not support feature */ - HCCL_E_NOT_FOUND = 6, /**< not found specific resource */ - HCCL_E_UNAVAIL = 7, /**< resource unavailable */ - HCCL_E_SYSCALL = 8, /**< call system interface error */ - HCCL_E_TIMEOUT = 9, /**< timeout */ - HCCL_E_OPEN_FILE_FAILURE = 10, /**< open file fail */ - HCCL_E_TCP_CONNECT = 11, /**< tcp connect fail */ - HCCL_E_ROCE_CONNECT = 12, /**< roce connect fail */ - HCCL_E_TCP_TRANSFER = 13, /**< tcp transfer fail */ - HCCL_E_ROCE_TRANSFER = 14, /**< roce transfer fail */ - HCCL_E_RUNTIME = 15, /**< call runtime api fail */ - HCCL_E_DRV = 16, /**< call driver api fail */ - HCCL_E_PROFILING = 17, /**< call profiling api fail */ - HCCL_E_CCE = 18, /**< call cce api fail */ - HCCL_E_NETWORK = 19, /**< call network api fail */ - HCCL_E_RESERVED /**< reserved */ -} HcclResult; - -/** - * @brief handle to HCCL communicator - */ -typedef void *HcclComm; - -/** - * @brief HCCL Reduction opperation - */ -typedef enum { - HCCL_REDUCE_SUM = 0, /**< sum */ - HCCL_REDUCE_PROD = 1, /**< prod */ - HCCL_REDUCE_MAX = 2, /**< max */ - HCCL_REDUCE_MIN = 3, /**< min */ - HCCL_REDUCE_RESERVED /**< reserved */ -} HcclReduceOp; - -/** - * @brief HCCL data type - */ -typedef enum { - HCCL_DATA_TYPE_INT8 = 0, /**< int8 */ - HCCL_DATA_TYPE_INT16 = 1, /**< int16 */ - HCCL_DATA_TYPE_INT32 = 2, /**< int32 */ - HCCL_DATA_TYPE_FP16 = 3, /**< fp16 */ - HCCL_DATA_TYPE_FP32 = 4, /**< fp32 */ - HCCL_DATA_TYPE_INT64 = 5, /**< int64 */ - HCCL_DATA_TYPE_UINT64 = 6, /**< uint64 */ - HCCL_DATA_TYPE_RESERVED /**< reserved */ -} HcclDataType; - -const uint32_t HCCL_ROOT_INFO_BYTES = 4108; // 4108: root info length - -/** - * @brief HCCL root info - */ -typedef struct HcclRootInfoDef { - char internal[HCCL_ROOT_INFO_BYTES]; -} HcclRootInfo; - -#ifdef __cplusplus -} -#endif // __cplusplus -#endif // HCCL_TYPES_H_ diff --git a/third_party/fwkacllib/inc/hccl/hcom.h b/third_party/fwkacllib/inc/hccl/hcom.h index 90b96ac7..de140b4b 100644 --- a/third_party/fwkacllib/inc/hccl/hcom.h +++ b/third_party/fwkacllib/inc/hccl/hcom.h @@ -29,104 +29,7 @@ extern "C" { #endif // __cplusplus -/** - * @brief Initialize HCOM. - * - * @param rank_table A string identifying the rank table file path, include file name. - * @param identify A string identifying the identify for the rank. - * @return HcclResult - * @see hcom_destroy() - */ -extern HcclResult hcom_init(const char *rank_table, const char *identify); - -/** - * @brief Destroy HCOM - * - * @return HcclResult - * @see hcom_init() - */ -extern HcclResult hcom_destroy(void); - -/** - * @brief Bind the model. - * - * @param model A pointer identifying the model information. - * @param stream A pointer identifying the stream information. - * @return HcclResult - * @see hcom_unbind_model() - */ -extern HcclResult hcom_bind_model(rtModel_t model, rtStream_t stream); - -/** - * @brief Unbind the model. - * - * @param model An pointer identifying the model information. - * @return HcclResult - * @see hcom_unbind_model() - */ -extern HcclResult hcom_unbind_model(rtModel_t model); - -/** - * @brief All-gather operator. - * - * @param tag A string identifying the tag of the operator. - * @param inputPtr A pointer identifying the input data address of the operator. - * @param outputPtr A pointer identifying the output data address of the operator. - * @param inputCount An integer(u64) identifying the number of the input data. - * @param dataType The data type of the operator, must be one of the following types: int8, int32, float16, float32. - * @param group A string identifying the group name of ranks participating in the operator. - * @param stream A pointer identifying the stream information. - * @return HcclResult - */ -extern HcclResult hcom_all_gather(const char *tag, void *inputPtr, void *outputPtr, u64 inputCount, - HcclDataType dataType, const char *group, rtStream_t stream); - -/** - * @brief All-reduce operator. - * - * @param tag A string identifying the tag of the operator. - * @param inputPtr A pointer identifying the input data address of the operator. - * @param outputPtr A pointer identifying the output data address of the operator. - * @param count An integer(u64) identifying the number of the output data. - * @param dataType The data type of the operator, must be one of the following types: int8, int32, float16, float32. - * @param op The reduction type of the operator, must be one of the following types: sum, min, max, prod. - * @param group A string identifying the group name of ranks participating in the operator. - * @param stream A pointer identifying the stream information. - * @return HcclResult - */ -extern HcclResult hcom_all_reduce(const char *tag, void *inputPtr, void *outputPtr, u64 count, - HcclDataType dataType, HcclReduceOp op, const char *group, rtStream_t stream); - -/** - * @brief Broadcast operator. - * - * @param tag A string identifying the tag of the operator. - * @param ptr A pointer identifying the data address of the operator. - * @param count An integer(u64) identifying the number of the data. - * @param dataType The data type of the operator, must be one of the following types: int8, int32, float16, float32. - * @param root An integer(u32) identifying the the root rank in the operator. - * @param group A string identifying the group name of ranks participating in the operator. - * @param stream A pointer identifying the stream information. - * @return HcclResult - */ -extern HcclResult hcom_broadcast(const char *tag, void *ptr, u64 count, HcclDataType dataType, u32 root, - const char *group, rtStream_t stream); -/** - * @brief Reduce-scatter operator. - * - * @param tag A string identifying the tag of the operator. - * @param inputPtr A pointer identifying the input data address of the operator. - * @param outputPtr A pointer identifying the output data address of the operator. - * @param count An integer(u64) identifying the number of the data. - * @param dataType The data type of the operator, must be one of the following types: int8, int32, float16, float32. - * @param op The reduction type of the operator, must be one of the following types: sum, min, max, prod. - * @param group A string identifying the group name of ranks participating in the operator. - * @param stream A pointer identifying the stream information. - * @return HcclResult - */ -extern HcclResult hcom_reduce_scatter(const char *tag, void *inputPtr, void *outputPtr, u64 count, - HcclDataType dataType, HcclReduceOp op, const char *group, rtStream_t stream); /** * @brief Get the rank number in the group. @@ -202,54 +105,6 @@ HcclResult hcom_create_group(const char *group, u32 rankNum, u32 *rankIds); */ HcclResult hcom_destroy_group(const char *group); -/** - * @brief Send operator. - * - * @param tag A string identifying the tag of the operator. - * @param inputPtr A pointer identifying the input data address of the operator. - * @param count An integer(u64) identifying the number of the data. - * @param dataType The data type of the operator, must be one of the following types: int8, int32, float16, float32. - * @param destRank An integer identifying the destination rank. - * @param srTag An integer identifying the send/recv message tag. - * The message will be send by the receive operator with the same "sr_tag". - * @param group A string identifying the group name of ranks participating in the operator. - * @param stream A pointer identifying the stream information. - * @return HcclResult - */ -HcclResult hcom_send(const char *tag, void *inputPtr, u64 count, HcclDataType dataType, - u32 destRank, u32 srTag, const char *group, rtStream_t stream); - -/** - * @brief Receive operator. - * - * @param tag A string identifying the tag of the operator. - * @param outputPtr A pointer identifying the output data address of the operator. - * @param count An integer(u64) identifying the number of the data. - * @param dataType The data type of the operator, must be one of the following types: int8, int32, float16, float32. - * @param srcRank An integer identifying the source rank. - * @param srTag An integer identifying the send/recv message tag. - * The message will be send by the send operator with the same "sr_tag". - * @param group A string identifying the group name of ranks participating in the operator. - * @param stream A pointer identifying the stream information. - * @return HcclResult - */ -HcclResult hcom_receive(const char *tag, void *outputPtr, u64 count, HcclDataType dataType, - u32 srcRank, u32 srTag, const char *group, rtStream_t stream); - -/** - * @brief Get the gradient split strategy with in the group. - * - * @param group A string identifying the group name. - * @param feature A pointer identifying the feature of the model. - * @param maxSegmentNum An integer(u32) identifying the max segments of gradients. - * @param segmentNum A pointer identifying the segments number of gradients. - * @param segmentIdx A list identifying the index of end gradient in each segment. - * @return HcclResult - */ -HcclResult hcom_get_split_strategy(const char *group, const struct model_feature *feature, u32 maxSegmentNum, - u32 *segmentNum, u32 *segmentIdx, GradSplitForceMode force = FORCE_NONE, - OriginalGraphShapeType shapeType = KNOWN_SHAPE); - /** * @brief Set the gradient split strategy with in the group, according to gradient index. * diff --git a/third_party/fwkacllib/inc/mmpa/sub_inc/mmpa_linux.h b/third_party/fwkacllib/inc/mmpa/sub_inc/mmpa_linux.h index ea51f497..c74f95ac 100644 --- a/third_party/fwkacllib/inc/mmpa/sub_inc/mmpa_linux.h +++ b/third_party/fwkacllib/inc/mmpa/sub_inc/mmpa_linux.h @@ -227,6 +227,7 @@ typedef struct { #define M_BINARY O_RDONLY #define M_TRUNC O_TRUNC #define M_IRWXU S_IRWXU +#define M_APPEND O_APPEND #define M_IN_CREATE IN_CREATE #define M_IN_CLOSE_WRITE IN_CLOSE_WRITE @@ -342,17 +343,17 @@ MMPA_FUNC_VISIBILITY INT32 mmCloseSocket(mmSockHandle sockFd); MMPA_FUNC_VISIBILITY mmSsize_t mmSocketSend(mmSockHandle sockFd, VOID *sendBuf, INT32 sendLen, INT32 sendFlag); MMPA_FUNC_VISIBILITY mmSsize_t mmSocketRecv(mmSockHandle sockFd, VOID *recvBuf, INT32 recvLen, INT32 recvFlag); MMPA_FUNC_VISIBILITY INT32 mmSocketSendTo(mmSockHandle sockFd, - VOID *sendMsg, - INT32 sendLen, - UINT32 sendFlag, - const mmSockAddr* addr, - INT32 tolen); + VOID *sendMsg, + INT32 sendLen, + UINT32 sendFlag, + const mmSockAddr* addr, + INT32 tolen); MMPA_FUNC_VISIBILITY mmSsize_t mmSocketRecvFrom(mmSockHandle sockFd, - VOID *recvBuf, - mmSize recvLen, - UINT32 recvFlag, - mmSockAddr* addr, - mmSocklen_t *FromLen); + VOID *recvBuf, + mmSize recvLen, + UINT32 recvFlag, + mmSockAddr* addr, + mmSocklen_t *FromLen); MMPA_FUNC_VISIBILITY INT32 mmSAStartup(); MMPA_FUNC_VISIBILITY INT32 mmSACleanup(); MMPA_FUNC_VISIBILITY VOID *mmDlopen(const CHAR *fileName, INT32 mode); @@ -360,7 +361,10 @@ MMPA_FUNC_VISIBILITY INT32 mmDladdr(VOID *addr, mmDlInfo *info); MMPA_FUNC_VISIBILITY VOID *mmDlsym(VOID *handle, const CHAR *funcName); MMPA_FUNC_VISIBILITY INT32 mmDlclose(VOID *handle); MMPA_FUNC_VISIBILITY CHAR *mmDlerror(); -MMPA_FUNC_VISIBILITY INT32 mmCreateAndSetTimer(mmTimer *timerHandle, mmUserBlock_t *timerBlock, UINT milliSecond, UINT period); +MMPA_FUNC_VISIBILITY INT32 mmCreateAndSetTimer(mmTimer *timerHandle, + mmUserBlock_t *timerBlock, + UINT milliSecond, + UINT period); MMPA_FUNC_VISIBILITY INT32 mmDeleteTimer(mmTimer timerHandle); MMPA_FUNC_VISIBILITY INT32 mmStatGet(const CHAR *path, mmStat_t *buffer); MMPA_FUNC_VISIBILITY INT32 mmStat64Get(const CHAR *path, mmStat64_t *buffer); @@ -454,8 +458,11 @@ MMPA_FUNC_VISIBILITY VOID mmSetOpOpt(INT32 mmOptOpt); MMPA_FUNC_VISIBILITY CHAR *mmGetOptArg(); MMPA_FUNC_VISIBILITY VOID mmSetOptArg(CHAR *mmOptArg); MMPA_FUNC_VISIBILITY INT32 mmGetOpt(INT32 argc, char *const *argv, const char *opts); -MMPA_FUNC_VISIBILITY INT32 mmGetOptLong(INT32 argc, char *const *argv, const char *opts, const mmStructOption *longOpts, - INT32 *longIndex); +MMPA_FUNC_VISIBILITY INT32 mmGetOptLong(INT32 argc, + char *const *argv, + const char *opts, + const mmStructOption *longOpts, + INT32 *longIndex); MMPA_FUNC_VISIBILITY LONG mmLseek(INT32 fd, INT64 offset, INT32 seekFlag); MMPA_FUNC_VISIBILITY INT32 mmFtruncate(mmProcess fd, UINT32 length); @@ -521,11 +528,14 @@ MMPA_FUNC_VISIBILITY INT32 mmGetMac(mmMacInfo **list, INT32 *count); MMPA_FUNC_VISIBILITY INT32 mmGetMacFree(mmMacInfo *list, INT32 count); MMPA_FUNC_VISIBILITY INT32 mmGetCpuInfo(mmCpuDesc **cpuInfo, INT32 *count); MMPA_FUNC_VISIBILITY INT32 mmCpuInfoFree(mmCpuDesc *cpuInfo, INT32 count); -MMPA_FUNC_VISIBILITY INT32 mmCreateProcess(const CHAR *fileName, const mmArgvEnv *env, const char *stdoutRedirectFile, - mmProcess *id); - -MMPA_FUNC_VISIBILITY INT32 mmCreateTaskWithThreadAttr(mmThread *threadHandle, const mmUserBlock_t *funcBlock, - const mmThreadAttr *threadAttr); +MMPA_FUNC_VISIBILITY INT32 mmCreateProcess(const CHAR *fileName, + const mmArgvEnv *env, + const char *stdoutRedirectFile, + mmProcess *id); + +MMPA_FUNC_VISIBILITY INT32 mmCreateTaskWithThreadAttr(mmThread *threadHandle, + const mmUserBlock_t *funcBlock, + const mmThreadAttr *threadAttr); MMPA_FUNC_VISIBILITY mmFileHandle mmShmOpen(const CHAR *name, INT32 oflag, mmMode_t mode); MMPA_FUNC_VISIBILITY INT32 mmShmUnlink(const CHAR *name); MMPA_FUNC_VISIBILITY VOID *mmMmap(mmFd_t fd, mmSize_t size, mmOfft_t offset, mmFd_t *extra, INT32 prot, INT32 flags); diff --git a/third_party/fwkacllib/inc/mmpa/sub_inc/mmpa_typedef_win.h b/third_party/fwkacllib/inc/mmpa/sub_inc/mmpa_typedef_win.h index 8200bea6..1627d7a9 100644 --- a/third_party/fwkacllib/inc/mmpa/sub_inc/mmpa_typedef_win.h +++ b/third_party/fwkacllib/inc/mmpa/sub_inc/mmpa_typedef_win.h @@ -1,4 +1,4 @@ -/** +/** * Copyright 2019-2020 Huawei Technologies Co., Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/third_party/fwkacllib/inc/mmpa/sub_inc/mmpa_win.h b/third_party/fwkacllib/inc/mmpa/sub_inc/mmpa_win.h index 5db6bbf8..a5a22b4f 100644 --- a/third_party/fwkacllib/inc/mmpa/sub_inc/mmpa_win.h +++ b/third_party/fwkacllib/inc/mmpa/sub_inc/mmpa_win.h @@ -1,4 +1,4 @@ -/** +/** * Copyright 2019-2020 Huawei Technologies Co., Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -249,6 +249,7 @@ typedef VOID (*mmPf)(VOID); #define M_CREAT _O_CREAT #define M_BINARY _O_BINARY #define M_TRUNC _O_TRUNC +#define M_APPEND _O_APPEND #define M_IREAD _S_IREAD #define M_IRUSR _S_IREAD diff --git a/third_party/fwkacllib/inc/runtime/base.h b/third_party/fwkacllib/inc/runtime/base.h index 4e735438..85f16cc5 100644 --- a/third_party/fwkacllib/inc/runtime/base.h +++ b/third_party/fwkacllib/inc/runtime/base.h @@ -1,18 +1,18 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd - + * Copyright 2019-2020 Huawei Technologies Co., Ltd + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - + * * http://www.apache.org/licenses/LICENSE-2.0 - + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. -*/ + */ #ifndef __CCE_RUNTIME_BASE_H__ #define __CCE_RUNTIME_BASE_H__ @@ -32,309 +32,8 @@ extern "C" { #endif #endif -/** - * @ingroup dvrt_base - * @brief runtime error numbers. - */ -typedef enum tagRtError { - RT_ERROR_NONE = 0x0, // success - - RT_ERROR_DEVICE_BASE = 0x07010000, - RT_ERROR_DEVICE_NULL, - RT_ERROR_DEVICE_NEW, - RT_ERROR_DEVICE_ID, - RT_ERROR_DEVICE_CHIPTYPE, - RT_ERROR_DEVICE_DEPLOY, - RT_ERROR_DEVICE_RETAIN, - RT_ERROR_DEVICE_PLATFORM, - RT_ERROR_DEVICE_LOADER, - RT_ERROR_DEVICE_LIMIT, - RT_ERROR_DEVICE_PROC_HANG_OUT, - RT_ERROR_DEVICE_POWER_UP_FAIL, - RT_ERROR_DEVICE_POWER_DOWN_FAIL, - RT_ERROR_DEVICE_INVALID, - - RT_ERROR_DRV_BASE = 0x07020000, - RT_ERROR_DRV_NULL, - RT_ERROR_DRV_NEW, - RT_ERROR_DRV_MEMORY, - RT_ERROR_DRV_INPUT, - RT_ERROR_DRV_PTRNULL, - RT_ERROR_DRV_OPEN_AICPU, - RT_ERROR_DRV_CLOSE_AICPU, - RT_ERROR_DRV_SYM_AICPU, - RT_ERROR_DRV_OPEN_TSD, - RT_ERROR_DRV_CLOSE_TSD, - RT_ERROR_DRV_SYM_TSD, - RT_ERROR_DRV_SOURCE, - RT_ERROR_DRV_REPORT, - RT_ERROR_DRV_COMMAND, - RT_ERROR_DRV_OCCUPY, - RT_ERROR_DRV_ERR, - - RT_ERROR_STREAM_BASE = 0x07030000, - RT_ERROR_STREAM_NULL, - RT_ERROR_STREAM_NEW, - RT_ERROR_STREAM_CONTEXT, - RT_ERROR_STREAM_INVALID, - RT_ERROR_STREAM_MODEL, - RT_ERROR_STREAM_FUSION, - RT_ERROR_STREAM_FULL, - RT_ERROR_STREAM_EMPTY, - RT_ERROR_STREAM_NOT_COMPLETE, - RT_ERROR_STREAM_SYNC, - RT_ERROR_STREAM_NO_CB_REG, - RT_ERROR_STREAM_DUPLICATE, - RT_ERROR_STREAM_NOT_EXIST, - RT_ERROR_SQ_NO_EXIST_SQ_TO_REUSE, - RT_ERROR_SQID_FULL, - - RT_ERROR_MODEL_BASE = 0x07040000, - RT_ERROR_MODEL_NULL, - RT_ERROR_MODEL_NEW, - RT_ERROR_MODEL_CONTEXT, - RT_ERROR_MODEL_ENDGRAPH, - RT_ERROR_MODEL_STREAM, - RT_ERROR_MODEL_EXCUTOR, - RT_ERROR_MODEL_SETUP, - RT_ERROR_MODEL_ID, - RT_ERROR_MODEL_EXE_FAILED, - RT_ERROR_END_OF_SEQUENCE, // end of sequence - RT_ERROR_MODEL_EXIT, - RT_ERROR_MODEL_EXIT_STREAM_UNBIND, - RT_ERROR_MODEL_EXIT_ID, - RT_ERROR_MODEL_ABORT_NORMAL, - - RT_ERROR_EVENT_BASE = 0x07050000, - RT_ERROR_EVENT_NULL, - RT_ERROR_EVENT_NEW, - RT_ERROR_EVENT_RECORDER_NULL, - RT_ERROR_EVENT_TIMESTAMP_INVALID, - RT_ERROR_EVENT_TIMESTAMP_REVERSAL, - RT_ERROR_EVENT_NOT_COMPLETE, - - RT_ERROR_NOTIFY_BASE = 0x07060000, - RT_ERROR_NOTIFY_NULL, - RT_ERROR_NOTIFY_NEW, - RT_ERROR_NOTIFY_TYPE, - RT_ERROR_NOTIFY_NOT_COMPLETE, - - RT_ERROR_CONTEXT_BASE = 0x07070000, - RT_ERROR_CONTEXT_NULL, - RT_ERROR_CONTEXT_NEW, - RT_ERROR_CONTEXT_DEL, - RT_ERROR_CONTEXT_DEFAULT_STREAM_NULL, - RT_ERROR_CONTEXT_ONLINE_STREAM_NULL, - - RT_ERROR_KERNEL_BASE = 0x07080000, - RT_ERROR_KERNEL_NULL, - RT_ERROR_KERNEL_NEW, - RT_ERROR_KERNEL_LOOKUP, - RT_ERROR_KERNEL_NAME, - RT_ERROR_KERNEL_TYPE, - RT_ERROR_KERNEL_OFFSET, - RT_ERROR_KERNEL_DUPLICATE, - RT_ERROR_KERNEL_UNREGISTERING, - - RT_ERROR_PROGRAM_BASE = 0x07090000, - RT_ERROR_PROGRAM_NULL, - RT_ERROR_PROGRAM_NEW, - RT_ERROR_PROGRAM_DATA, - RT_ERROR_PROGRAM_SIZE, - RT_ERROR_PROGRAM_MEM_TYPE, - RT_ERROR_PROGRAM_MACHINE_TYPE, - RT_ERROR_PROGRAM_USEOUT, - - RT_ERROR_MODULE_BASE = 0x070a0000, - RT_ERROR_MODULE_NULL, - RT_ERROR_MODULE_NEW, - - RT_ERROR_INSTANCE_BASE = 0x070b0000, - RT_ERROR_INSTANCE_NULL, - RT_ERROR_INSTANCE_NEW, - RT_ERROR_INSTANCE_VERSION, - - RT_ERROR_API_BASE = 0x070c0000, - RT_ERROR_API_NULL, - RT_ERROR_API_NEW, - - RT_ERROR_DATADUMP_BASE = 0x070d0000, - RT_ERROR_DATADUMP_NULL, - RT_ERROR_DATADUMP_NEW, - RT_ERROR_DATADUMP_TIME, - RT_ERROR_DATADUMP_FILE, - RT_ERROR_DATADUMP_ADDRESS, - RT_ERROR_DATADUMP_LOAD_FAILED, - RT_ERROR_DUMP_ADDR_SET_FAILED, - - RT_ERROR_PROF_BASE = 0x070e0000, - RT_ERROR_PROF_NULL, - RT_ERROR_PROF_NEW, - RT_ERROR_PROF_START, - RT_ERROR_PROF_DEVICE_MEM, - RT_ERROR_PROF_HOST_MEM, - RT_ERROR_PROF_SET_DIR, - RT_ERROR_PROF_OPER, - RT_ERROR_PROF_FULL, - RT_ERROR_PROF_NAME, - - RT_ERROR_PCTRACE_BASE = 0x070f0000, - RT_ERROR_PCTRACE_NULL, - RT_ERROR_PCTRACE_NEW, - RT_ERROR_PCTRACE_TIME, - RT_ERROR_PCTRACE_FILE, - - RT_ERROR_TASK_BASE = 0x07100000, - RT_ERROR_TASK_NULL, - RT_ERROR_TASK_NEW, - RT_ERROR_TASK_TYPE, - RT_ERROR_TASK_ALLOCATOR, - - RT_ERROR_COMMON_BASE = 0x07110000, - RT_ERROR_INVALID_VALUE, // RT_ERROR_INPUT_INVALID - RT_ERROR_MEMORY_ADDRESS_UNALIGNED, - RT_ERROR_SEC_HANDLE, - RT_ERROR_OS_HANDLE, - RT_ERROR_MUTEX_LOCK, - RT_ERROR_MUTEX_UNLOCK, - RT_ERROR_CALLOC, - RT_ERROR_POOL_RESOURCE, - RT_ERROR_TRANS_ARGS, - RT_ERROR_METADATA, - RT_ERROR_LOST_HEARTBEAT, - RT_ERROR_REPORT_TIMEOUT, - RT_ERROR_FEATURE_NOT_SUPPROT, - RT_ERROR_MEMORY_ALLOCATION, - RT_ERROR_MEMORY_FREE, - RT_ERROR_INVALID_MEMORY_TYPE, - - RT_ERROR_DEBUG_BASE = 0x07120000, - RT_ERROR_DEBUG_NULL, - RT_ERROR_DEBUG_NEW, - RT_ERROR_DEBUG_SIGNAL, - RT_ERROR_DEBUG_OPEN, - RT_ERROR_DEBUG_WRITE, - RT_ERROR_DEBUG_REGISTER_FAILED, - RT_ERROR_DEBUG_UNREGISTER_FAILED, - - RT_ERROR_ENGINE_BASE = 0x07130000, - RT_ERROR_ENGINE_NULL, - RT_ERROR_ENGINE_NEW, - RT_ERROR_ENGINE_THREAD, - - RT_ERROR_LABEL_BASE = 0x07140000, - RT_ERROR_LABEL_NULL, - RT_ERROR_LABEL_NEW, - RT_ERROR_LABEL_CONTEXT, - RT_ERROR_LABEL_STREAM, - RT_ERROR_LABEL_MODEL, - RT_ERROR_LABEL_ALLOCATOR, - RT_ERROR_LABEL_FREE, - RT_ERROR_LABEL_SET, - RT_ERROR_LABEL_ID, - - RT_ERROR_TSFW_BASE = 0x07150000, - RT_ERROR_TSFW_UNKNOWN, - RT_ERROR_TSFW_NULL_PTR, - RT_ERROR_TSFW_ILLEGAL_AI_CORE_ID, - RT_ERROR_TSFW_ILLEGAL_PARAM, - RT_ERROR_TSFW_TASK_CMD_QUEUE_FULL, - RT_ERROR_TSFW_TASK_CMD_QUEUE_EMPTY, - RT_ERROR_TSFW_TASK_REPORT_QUEUE_FULL, - RT_ERROR_TSFW_TASK_REPORT_QUEUE_EMPTY, - RT_ERROR_TSFW_TASK_NODE_BUFF_ALL_OCCUPYED, - RT_ERROR_TSFW_TASK_NODE_BUFF_ALL_FREED, - RT_ERROR_TSFW_L2_MEM_INSUFFICIENT_SPACE, - RT_ERROR_TSFW_L2_MALLOC_FAILED, - RT_ERROR_TSFW_DMA_CHANNEL_ALL_OCCUPYED, - RT_ERROR_TSFW_MEMCPY_OP_FAILED, - RT_ERROR_TSFW_BS_SLOT_ALL_OCCUPYED, - RT_ERROR_TSFW_TBS_SLOT_REPEAT_FREE, - RT_ERROR_TSFW_PRIORITY_TASK_LIST_FULL, - RT_ERROR_TSFW_PRIORITY_TASK_LIST_EMPTY, - RT_ERROR_TSFW_NO_STREAM_LIST_NEED_TO_BE_PROCESSED, - RT_ERROR_TSFW_REPEAT_MARK_STREAM_NEED_SERVICE, - RT_ERROR_TSFW_SYS_DMA_CHANNEL_ALL_OCCUPAPYED, - RT_ERROR_TSFW_NO_HBML2TASKNODE_FOUND, - RT_ERROR_TSFW_SQNODE_NODE_SLOT_ALL_OCCUPAPYED, - RT_ERROR_TSFW_CQNODE_NODE_SLOT_ALL_OCCUPAPYED, - RT_ERROR_TSFW_SQNODE_NOT_ENOUGH, - RT_ERROR_TSFW_SQNODE_SLOT_REPEAT_FREE, - RT_ERROR_TSFW_CQNODE_SLOT_REPEAT_FREE, - RT_ERROR_TSFW_CQ_REPORT_FAILED, - RT_ERROR_TSFW_SYS_DMA_RESET_SUCCESS, - RT_ERROR_TSFW_SYS_DMA_RESET_FAILED, - RT_ERROR_TSFW_SYS_DMA_TRNSFER_FAILED, - RT_ERROR_TSFW_SYS_DMA_MEMADDRALIGN_FAILED, - RT_ERROR_TSFW_SYS_DMA_ERROR_QUEUE_FULL, - RT_ERROR_TSFW_SYS_DMA_ERROR_QUEUE_EMPTY, - RT_ERROR_TSFW_TIMER_EVENT_FULL, - RT_ERROR_TSFW_TASK_L2_DESC_ENTRY_NOT_ENOUGH, - RT_ERROR_TSFW_AICORE_TIMEOUT, - RT_ERROR_TSFW_AICORE_EXCEPTION, - RT_ERROR_TSFW_AICORE_TRAP_EXCEPTION, - RT_ERROR_TSFW_AICPU_TIMEOUT, - RT_ERROR_TSFW_SDMA_L2_TO_DDR_MALLOC_FAIL, - RT_ERROR_TSFW_AICPU_EXCEPTION, - RT_ERROR_TSFW_AICPU_DATADUMP_RSP_ERR, - RT_ERROR_TSFW_AICPU_MODEL_RSP_ERR, - RT_ERROR_TSFW_REPEAT_ACTIVE_MODEL_STREAM, - RT_ERROR_TSFW_REPEAT_NOTIFY_WAIT, - RT_ERROR_TSFW_DEBUG_INVALID_SQCQ, - RT_ERROR_TSFW_DEBUG_WRONG_COMMAND_TYPE, - RT_ERROR_TSFW_DEBUG_CMD_PROCESS, - RT_ERROR_TSFW_DEBUG_INVALID_DEVICE_STATUS, - RT_ERROR_TSFW_DEBUG_NOT_IN_DEBUG_STATUS, - RT_ERROR_TSFW_DEBUG_INVALID_TASK_STATUS, - RT_ERROR_TSFW_DEBUG_TASK_EMPTY, - RT_ERROR_TSFW_DEBUG_TASK_FULL, - RT_ERROR_TSFW_DEBUG_TASK_NOT_EXIST, - RT_ERROR_TSFW_DEBUG_AI_CORE_FULL, - RT_ERROR_TSFW_DEBUG_AI_CORE_NOT_EXIST, - RT_ERROR_TSFW_DEBUG_AI_CORE_EXCEPTION, - RT_ERROR_TSFW_DEBUG_AI_CORE_TIMEOUT, - RT_ERROR_TSFW_DEBUG_BREAKPOINT_FULL, - RT_ERROR_TSFW_DEBUG_READ_ERROR, - RT_ERROR_TSFW_DEBUG_WRITE_FAIL, - RT_ERROR_TSFW_QUEUE_FULL, - RT_ERROR_TSFW_QUEUE_EMPTY, - RT_ERROR_TSFW_QUEUE_ALLOC_MEM_FAIL, - RT_ERROR_TSFW_QUEUE_DATA_SIZE_UNMATCH, - RT_ERROR_TSFW_PCIE_DMA_INVLD_CPY_TYPE, - RT_ERROR_TSFW_INVLD_CPY_DIR, - RT_ERROR_TSFW_PCIE_DMA_INVLD_CQ_DES, - RT_ERROR_TSFW_PCIE_DMA_CPY_ERR, - RT_ERROR_TSFW_PCIE_DMA_LNK_CHN_BUSY, - RT_ERROR_TSFW_PROFILE_BUFF_FULL, - RT_ERROR_TSFW_PROFILE_MODE_CONFLICT, - RT_ERROR_TSFW_PROFILE_OTHER_PID_ON, - RT_ERROR_TSFW_SCHD_AIC_TASK_PRELOAD_FAILED, - RT_ERROR_TSFW_TSCPU_CLOSE_FAILED, - RT_ERROR_TSFW_EXPECT_FAIL, - RT_ERROR_TSFW_REPEAT_MODEL_STREAM, - RT_ERROR_TSFW_STREAM_MODEL_UNBIND, - RT_ERROR_TSFW_MODEL_EXE_FAILED, - RT_ERROR_TSFW_IPC_SEND_FAILED, - RT_ERROR_TSFW_IPC_PROC_REG_FAILED, - RT_ERROR_TSFW_STREAM_FULL, - RT_ERROR_TSFW_END_OF_SEQUENCE, - RT_ERROR_TSFW_SWITCH_STREAM_LABEL, - RT_ERROR_TSFW_TRANS_SQE_FAIL, - RT_ERROR_TSFW_RESERVED, - - RT_ERROR_SUBSCRIBE_BASE = 0x07160000, - RT_ERROR_SUBSCRIBE_NULL, - RT_ERROR_SUBSCRIBE_NEW, - RT_ERROR_SUBSCRIBE_STREAM, - RT_ERROR_SUBSCRIBE_THREAD, - RT_ERROR_SUBSCRIBE_GROUP, - - RT_ERROR_GROUP_BASE = 0x07170000, - RT_ERROR_GROUP_NOT_SET, - RT_ERROR_GROUP_NOT_CREATE, - - RT_ERROR_RESERVED = 0x07ff0000, - }rtError_t; +typedef int32_t rtError_t; +static const int32_t RT_ERROR_NONE = 0; // success /** * @ingroup dvrt_base diff --git a/third_party/fwkacllib/inc/runtime/config.h b/third_party/fwkacllib/inc/runtime/config.h index f1a70eaa..c471f128 100644 --- a/third_party/fwkacllib/inc/runtime/config.h +++ b/third_party/fwkacllib/inc/runtime/config.h @@ -1,18 +1,18 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd - + * Copyright 2019-2020 Huawei Technologies Co., Ltd + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - + * * http://www.apache.org/licenses/LICENSE-2.0 - + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. -*/ + */ #ifndef __CCE_RUNTIME_CONFIG_H__ #define __CCE_RUNTIME_CONFIG_H__ @@ -185,6 +185,14 @@ RTS_API rtError_t rtSetPlatformType(rtPlatformType_t platformType); */ RTS_API rtError_t rtMemGetL2Info(rtStream_t stream, void **ptr, uint32_t *size); +/** + * @ingroup + * @brief get runtime version. The version is returned as (1000 major + 10 minor). For example, RUNTIME 9.2 would be represented by 9020. + * @param [out] runtimeVersion + * @return RT_ERROR_NONE for ok + * @return RT_ERROR_INVALID_VALUE for error input + */ +RTS_API rtError_t rtGetRuntimeVersion(uint32_t *runtimeVersion); #if defined(__cplusplus) && !defined(COMPILE_OMG_PACKAGE) } #endif diff --git a/third_party/fwkacllib/inc/runtime/context.h b/third_party/fwkacllib/inc/runtime/context.h index 4be49a8c..3346ff75 100644 --- a/third_party/fwkacllib/inc/runtime/context.h +++ b/third_party/fwkacllib/inc/runtime/context.h @@ -1,18 +1,18 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd - + * Copyright 2019-2020 Huawei Technologies Co., Ltd + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - + * * http://www.apache.org/licenses/LICENSE-2.0 - + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. -*/ + */ #ifndef __CCE_RUNTIME_CONTEXT_H__ #define __CCE_RUNTIME_CONTEXT_H__ diff --git a/third_party/fwkacllib/inc/runtime/dev.h b/third_party/fwkacllib/inc/runtime/dev.h index b378e3b0..c70a2372 100644 --- a/third_party/fwkacllib/inc/runtime/dev.h +++ b/third_party/fwkacllib/inc/runtime/dev.h @@ -1,18 +1,18 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd - + * Copyright 2019-2020 Huawei Technologies Co., Ltd + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - + * * http://www.apache.org/licenses/LICENSE-2.0 - + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. -*/ + */ #ifndef __CCE_RUNTIME_DEVICE_H__ #define __CCE_RUNTIME_DEVICE_H__ @@ -330,12 +330,12 @@ RTS_API rtError_t rtGetPairDevicesInfo(uint32_t devId, uint32_t otherDevId, int3 FEATURE_TYPE_MEMCPY = 0, FEATURE_TYPE_RSV, } rtFeatureType_t; - * @param [in] infoType info type + * @param [in] featureInfo info type typedef enum tagMemcpyInfo { MEMCPY_INFO_SUPPORT_ZEROCOPY = 0, MEMCPY_INFO _RSV, } rtMemcpyInfo_t; - * @param [out] value the capability info + * @param [out] value the capability info RT_CAPABILITY_SUPPORT or RT_CAPABILITY_NOT_SUPPORT * @return RT_ERROR_NONE for ok */ RTS_API rtError_t rtGetRtCapability(rtFeatureType_t featureType, int32_t featureInfo, int64_t *value); diff --git a/third_party/fwkacllib/inc/runtime/dvfsprofile.h b/third_party/fwkacllib/inc/runtime/dvfsprofile.h index 6e451695..e27cd832 100644 --- a/third_party/fwkacllib/inc/runtime/dvfsprofile.h +++ b/third_party/fwkacllib/inc/runtime/dvfsprofile.h @@ -1,18 +1,18 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd - + * Copyright 2019-2020 Huawei Technologies Co., Ltd + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - + * * http://www.apache.org/licenses/LICENSE-2.0 - + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. -*/ + */ #ifndef __CCE_RUNTIME_DVFSPROFILE_H__ #define __CCE_RUNTIME_DVFSPROFILE_H__ diff --git a/third_party/fwkacllib/inc/runtime/event.h b/third_party/fwkacllib/inc/runtime/event.h index 41e611ea..f9d2eae2 100644 --- a/third_party/fwkacllib/inc/runtime/event.h +++ b/third_party/fwkacllib/inc/runtime/event.h @@ -1,18 +1,18 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd - + * Copyright 2019-2020 Huawei Technologies Co., Ltd + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - + * * http://www.apache.org/licenses/LICENSE-2.0 - + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. -*/ + */ #ifndef __CCE_RUNTIME_EVENT_H__ #define __CCE_RUNTIME_EVENT_H__ diff --git a/third_party/fwkacllib/inc/runtime/kernel.h b/third_party/fwkacllib/inc/runtime/kernel.h index 5f519442..98862ad4 100644 --- a/third_party/fwkacllib/inc/runtime/kernel.h +++ b/third_party/fwkacllib/inc/runtime/kernel.h @@ -1,18 +1,18 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd - + * Copyright 2019-2020 Huawei Technologies Co., Ltd + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - + * * http://www.apache.org/licenses/LICENSE-2.0 - + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. -*/ + */ #ifndef __CCE_RUNTIME_KERNEL_H__ #define __CCE_RUNTIME_KERNEL_H__ diff --git a/third_party/fwkacllib/inc/runtime/mem.h b/third_party/fwkacllib/inc/runtime/mem.h index e65d8604..f175cd45 100644 --- a/third_party/fwkacllib/inc/runtime/mem.h +++ b/third_party/fwkacllib/inc/runtime/mem.h @@ -1,18 +1,18 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd - + * Copyright 2019-2020 Huawei Technologies Co., Ltd + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - + * * http://www.apache.org/licenses/LICENSE-2.0 - + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. -*/ + */ #ifndef __CCE_RUNTIME_MEM_H__ #define __CCE_RUNTIME_MEM_H__ diff --git a/third_party/fwkacllib/inc/runtime/rt.h b/third_party/fwkacllib/inc/runtime/rt.h index d3d5956f..c1872941 100644 --- a/third_party/fwkacllib/inc/runtime/rt.h +++ b/third_party/fwkacllib/inc/runtime/rt.h @@ -1,18 +1,18 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd - + * Copyright 2019-2020 Huawei Technologies Co., Ltd + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - + * * http://www.apache.org/licenses/LICENSE-2.0 - + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. -*/ + */ #ifndef __CCE_RUNTIME_RT_H__ #define __CCE_RUNTIME_RT_H__ diff --git a/third_party/fwkacllib/inc/runtime/rt_model.h b/third_party/fwkacllib/inc/runtime/rt_model.h index b72b142d..c96349a0 100644 --- a/third_party/fwkacllib/inc/runtime/rt_model.h +++ b/third_party/fwkacllib/inc/runtime/rt_model.h @@ -1,18 +1,18 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd - + * Copyright 2019-2020 Huawei Technologies Co., Ltd + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - + * * http://www.apache.org/licenses/LICENSE-2.0 - + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. -*/ + */ #ifndef __CCE_RUNTIME_MODEL_H__ #define __CCE_RUNTIME_MODEL_H__ diff --git a/third_party/fwkacllib/inc/runtime/stream.h b/third_party/fwkacllib/inc/runtime/stream.h index 388fd3c2..631c8083 100644 --- a/third_party/fwkacllib/inc/runtime/stream.h +++ b/third_party/fwkacllib/inc/runtime/stream.h @@ -1,18 +1,18 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd - + * Copyright 2019-2020 Huawei Technologies Co., Ltd + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - + * * http://www.apache.org/licenses/LICENSE-2.0 - + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. -*/ + */ #ifndef __CCE_RUNTIME_STREAM_H__ #define __CCE_RUNTIME_STREAM_H__ diff --git a/third_party/fwkacllib/inc/tdt/index_transform.h b/third_party/fwkacllib/inc/tdt/index_transform.h index a5af2c83..a62e0185 100644 --- a/third_party/fwkacllib/inc/tdt/index_transform.h +++ b/third_party/fwkacllib/inc/tdt/index_transform.h @@ -1,10 +1,18 @@ /** -* @file index_transform.h -* -* Copyright (C) Huawei Technologies Co., Ltd. 2018-2019. All Rights Reserved. -* -* This program is used to get logical device id by phy device id. -*/ + * Copyright 2019-2020 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #ifndef INC_TDT_INDEX_TRANSFORM_H #define INC_TDT_INDEX_TRANSFORM_H diff --git a/third_party/fwkacllib/inc/tdt/status.h b/third_party/fwkacllib/inc/tdt/status.h index d30564b8..dc9e670f 100644 --- a/third_party/fwkacllib/inc/tdt/status.h +++ b/third_party/fwkacllib/inc/tdt/status.h @@ -1,4 +1,4 @@ -/** +/** * Copyright 2019-2020 Huawei Technologies Co., Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -34,9 +34,16 @@ using TDT_StatusT = uint32_t; typedef uint32_t TDT_StatusT; #endif +#define LINUX 0 +#define WINDOWS 1 + #ifndef TDT_LIB_EXPORT +#if(TARGET_SYSTEM_NAME == WINDOWS) +#define TDT_LIB_EXPORT __declspec(dllexport) +#else #define TDT_LIB_EXPORT __attribute__((visibility("default"))) #endif +#endif /** * @ingroup tdt status. * diff --git a/third_party/fwkacllib/inc/toolchain/adx_datadump_server.h b/third_party/fwkacllib/inc/toolchain/adx_datadump_server.h index a1c39a51..67adecd9 100644 --- a/third_party/fwkacllib/inc/toolchain/adx_datadump_server.h +++ b/third_party/fwkacllib/inc/toolchain/adx_datadump_server.h @@ -1,12 +1,18 @@ /** -* @file adx_datadump_server.h -* -* Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. 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. -*/ + * Copyright 2019-2020 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #ifndef ADX_DATADUMP_SERVER_H #define ADX_DATADUMP_SERVER_H diff --git a/third_party/fwkacllib/inc/toolchain/prof_acl_api.h b/third_party/fwkacllib/inc/toolchain/prof_acl_api.h index c8715041..430ed14d 100644 --- a/third_party/fwkacllib/inc/toolchain/prof_acl_api.h +++ b/third_party/fwkacllib/inc/toolchain/prof_acl_api.h @@ -14,11 +14,20 @@ * limitations under the License. */ -#ifndef MSPROF_ENGINE_PROF_ACL_API_H_ -#define MSPROF_ENGINE_PROF_ACL_API_H_ +#ifndef MSPROFILER_API_PROF_ACL_API_H_ +#define MSPROFILER_API_PROF_ACL_API_H_ #define MSVP_MAX_DEV_NUM 64 +#ifndef OS_TYPE +#define OS_TYPE 0 +#endif // OS_TYPE + + +#if (OS_TYPE != LINUX) +#define MSVP_PROF_API __declspec(dllexport) +#else #define MSVP_PROF_API __attribute__((visibility("default"))) +#endif // DataTypeConfig #define PROF_ACL_API 0x0001 @@ -78,6 +87,9 @@ enum ProfErrorCode { PROF_ERROR_UNSUPPORTED, // unsupported data type or ai core metrics PROF_ERROR_REPEAT_START, // profiilng has already been started PROF_ERROR_NOT_STARTED, // profiling has not been started + PROF_ERROR_REPEAT_SUBSCRIBE, // same model id has already been subscribed + PROF_ERROR_MODEL_ID_INVALID, // model id does not exist or has not been subscribed + PROF_ERROR_API_CONFLICT, // prof ctrl api mode conflicts with subscribe mode }; /** @@ -107,7 +119,8 @@ enum ProfAicoreMetrics { PROF_AICORE_MEMORY = 3, PROF_AICORE_INTERNAL_MEMORY = 4, PROF_AICORE_STALL = 5, - PROF_AICORE_EVENT = 255 + PROF_AICORE_METRICS_COUNT, + PROF_AICORE_NONE = 0xff, }; /** @@ -130,12 +143,54 @@ struct ProfConfig { MSVP_PROF_API int32_t ProfStartProfiling(const ProfConfig *profStartCfg); /** - * @name ProfStopConfig - * @brief struct of ProfStop + * @name ProfStopProfiling + * @brief stop profiling + * @param profStopCfg [IN] config to stop profiling + * @return ProfErrorCode */ -struct ProfStopConfig { - uint64_t padding; -}; +MSVP_PROF_API int32_t ProfStopProfiling(const ProfConfig *profStopCfg); + +/** + * @name ProfFinalize + * @brief finalize profiling task + * @return ProfErrorCode + */ +MSVP_PROF_API int32_t ProfFinalize(); + +/** + * @name ProfGetDataTypeConfig + * @brief get dataTypeConfig started with of one device + * @param deviceId [IN] deviceId to get dataTypeConfig + * @param dataTypeConfig [OUT] result get + * @return ProfErrorCode + */ +MSVP_PROF_API int32_t ProfGetDataTypeConfig(uint32_t deviceId, uint64_t &dataTypeConfig); + +namespace Msprofiler { +namespace Api { +/** + * @brief transfer profiling config in acl.json to sample config + * @param aclCfg [IN] profiling json string from acl.json as {"switch":"on", "result_path":"/home",...} + * @param sampleCfg [OUT] json string for GE as {"startCfg":[{"deviceID":"all","jobID":"1234",...}]} + * @return ProfErrorCode + */ +MSVP_PROF_API int32_t ProfAclCfgToSampleCfg(const std::string &aclCfg, std::string &sampleCfg); + +/** + * @name ProfInit + * @brief init profiling + * @param profInitCfg [IN] config of init profiling of json format + * @return ProfErrorCode + */ +MSVP_PROF_API int32_t ProfInit(const std::string &profInitCfg); + +/** + * @name ProfStartProfiling + * @brief start profiling + * @param profStartCfg [IN] config to start profiling + * @return ProfErrorCode + */ +MSVP_PROF_API int32_t ProfStartProfiling(const ProfConfig *profStartCfg); /** * @name ProfStopProfiling @@ -161,4 +216,181 @@ MSVP_PROF_API int32_t ProfFinalize(); */ MSVP_PROF_API int32_t ProfGetDataTypeConfig(uint32_t deviceId, uint64_t &dataTypeConfig); -#endif // MSPROF_ENGINE_PROF_ACL_API_H_ +/** + * @name WorkMode + * @brief profiling api work mode + */ +enum WorkMode { + WORK_MODE_OFF, // profiling not at work + WORK_MODE_API_CTRL, // profiling work on api ctrl mode, (ProfInit) + WORK_MODE_SUBSCRIBE, // profiling work on subscribe mode +}; + +/** + * @name ProfGetApiWorkMode + * @brief get profiling api work mode + * @return WorkMode + */ +MSVP_PROF_API WorkMode ProfGetApiWorkMode(); + +/** + * @name ProfSubscribeConfig + * @brief config of subscribe api + */ +struct ProfSubscribeConfig { + bool timeInfo; // subscribe op time + ProfAicoreMetrics aicoreMetrics; // subscribe ai core metrics + void* fd; // pipe fd +}; + +/** + * @name ProfGetDataTypeConfig + * @brief get DataTypeConfig of subscribe + * @param profSubscribeConfig [IN] config to subscribe data + * @return DataTypeConfig + */ +MSVP_PROF_API uint64_t ProfGetDataTypeConfig(const ProfSubscribeConfig *profSubscribeConfig); + +/** + * @name ProfModelSubscribe + * @brief subscribe data of one model id + * @param modelId [IN] model id to subscribe data + * @param devId [IN] device id of model + * @param profSubscribeConfig [IN] config to subscribe data + * @return ProfErrorCode + */ +MSVP_PROF_API int32_t ProfModelSubscribe(uint32_t modelId, uint32_t devId, + const ProfSubscribeConfig *profSubscribeConfig); + +/** + * @name ProfIsModelSubscribed + * @brief check if a model id is subscribed + * @param modeiId [IN] modei id to check + * @return true: subscribed, false: not + */ +MSVP_PROF_API bool ProfIsModelSubscribed(uint32_t modelId); + +/** + * @name ProfModelUnSubscribe + * @brief unsubscribe a model id + * @param modeiId [IN] modei id to unsubscribe + * @return ProfErrorCode + */ +MSVP_PROF_API int32_t ProfModelUnSubscribe(uint32_t modelId); + +/** + * @name ProfGetOpDescSize + * @brief get profiling data struct size + * @param opDescSize [OUT] bytes of profiling subscribe data struct + * @return ProfErrorCode + */ +MSVP_PROF_API int32_t ProfGetOpDescSize(uint32_t *opDescSize); + +/** + * @name ProfGetOpNum + * @brief get how many op data there are in data + * @param data [IN] data read from pipe + * @param len [IN] data length + * @param opNum [OUT] number of op in data + * @return ProfErrorCode + */ +MSVP_PROF_API int32_t ProfGetOpNum(const void *data, uint32_t len, uint32_t *opNum); + +/** + * @name ProfGetModelId + * @brief get model id of specific part of data + * @param data [IN] data read from pipe + * @param len [IN] data length + * @param index [IN] index of part(op) + * @return model id + */ +MSVP_PROF_API uint32_t ProfGetModelId(const void *data, uint32_t len, uint32_t index); + +/** + * @name ProfGetOpType + * @brief get op type of specific part of data + * @param data [IN] data read from pipe + * @param len [IN] data length + * @param opType [OUT] op type buffer + * @param opTypeLen [IN] buffer size of param opType + * @param index [IN] index of part(op) + * @return ProfErrorCode + */ +MSVP_PROF_API int32_t ProfGetOpType(const void *data, uint32_t len, char *opType, uint32_t opTypeLen, uint32_t index); + +/** + * @name ProfGetOpName + * @brief get op name of specific part of data + * @param data [IN] data read from pipe + * @param len [IN] data length + * @param opType [OUT] op name buffer + * @param opTypeLen [IN] buffer size of param opName + * @param index [IN] index of part(op) + * @return ProfErrorCode + */ +MSVP_PROF_API int32_t ProfGetOpName(const void *data, uint32_t len, char *opName, uint32_t opNameLen, uint32_t index); + +/** + * @name ProfGetOpStart + * @brief get op start timestamp of specific part of data + * @param data [IN] data read from pipe + * @param len [IN] data length + * @param index [IN] index of part(op) + * @return op start timestamp (us) + */ +MSVP_PROF_API uint64_t ProfGetOpStart(const void *data, uint32_t len, uint32_t index); + +/** + * @name ProfGetOpEnd + * @brief get op end timestamp of specific part of data + * @param data [IN] data read from pipe + * @param len [IN] data length + * @param index [IN] index of part(op) + * @return op end timestamp (us) + */ +MSVP_PROF_API uint64_t ProfGetOpEnd(const void *data, uint32_t len, uint32_t index); + +/** + * @name ProfGetOpDuration + * @brief get op duration of specific part of data + * @param data [IN] data read from pipe + * @param len [IN] data length + * @param index [IN] index of part(op) + * @return op duration (us) + */ +MSVP_PROF_API uint64_t ProfGetOpDuration(const void *data, uint32_t len, uint32_t index); + +/** + * @name ProfGetOpExecutionTime + * @brief get op execution time of specific part of data + * @param data [IN] data read from pipe + * @param len [IN] data length + * @param index [IN] index of part(op) + * @return op execution time (us) + */ +MSVP_PROF_API uint64_t ProfGetOpExecutionTime(const void *data, uint32_t len, uint32_t index); + +/** + * @name ProfGetOpCubeOps + * @brief get op cube fops of specific part of data + * @param data [IN] data read from pipe + * @param len [IN] data length + * @param index [IN] index of part(op) + * @return op cube fops + */ +MSVP_PROF_API uint64_t ProfGetOpCubeOps(const void *data, uint32_t len, uint32_t index); + +/** + * @name ProfGetOpVectorOps + * @brief get op vector fops of specific part of data + * @param data [IN] data read from pipe + * @param len [IN] data length + * @param index [IN] index of part(op) + * @return op vector fops + */ +MSVP_PROF_API uint64_t ProfGetOpVectorOps(const void *data, uint32_t len, uint32_t index); + +} // namespace Api +} // namespace Msprofiler + +#endif // MSPROFILER_API_PROF_ACL_API_H_ diff --git a/third_party/fwkacllib/inc/toolchain/prof_mgr_core.h b/third_party/fwkacllib/inc/toolchain/prof_mgr_core.h index 4f013eef..f8cb1b22 100644 --- a/third_party/fwkacllib/inc/toolchain/prof_mgr_core.h +++ b/third_party/fwkacllib/inc/toolchain/prof_mgr_core.h @@ -16,7 +16,16 @@ #ifndef MSPROF_ENGINE_PROF_MGR_CORE_H_ #define MSPROF_ENGINE_PROF_MGR_CORE_H_ +#ifndef OS_TYPE +#define OS_TYPE 0 +#endif // OS_TYPE + +#if (OS_TYPE != LINUX) +#define MSVP_PROF_API __declspec(dllexport) +#else #define MSVP_PROF_API __attribute__((visibility("default"))) +#endif + #include #include diff --git a/third_party/fwkacllib/inc/toolchain/prof_reporter.h b/third_party/fwkacllib/inc/toolchain/prof_reporter.h index c734380c..949011d3 100644 --- a/third_party/fwkacllib/inc/toolchain/prof_reporter.h +++ b/third_party/fwkacllib/inc/toolchain/prof_reporter.h @@ -16,7 +16,15 @@ #ifndef MSPROF_ENGINE_PROF_REPORTER_H_ #define MSPROF_ENGINE_PROF_REPORTER_H_ +#ifndef OS_TYPE +#define OS_TYPE 0 +#endif // OS_TYPE + +#if (OS_TYPE != LINUX) +#define MSVP_PROF_API __declspec(dllexport) +#else #define MSVP_PROF_API __attribute__((visibility("default"))) +#endif /** * @file prof_reporter.h @@ -86,4 +94,4 @@ class MSVP_PROF_API Reporter { } // namespace Engine } // namespace Msprof -#endif // MSPROF_ENGINE_PROF_REPORTER_H_ \ No newline at end of file +#endif // MSPROF_ENGINE_PROF_REPORTER_H_ diff --git a/third_party/fwkacllib/inc/toolchain/slog.h b/third_party/fwkacllib/inc/toolchain/slog.h index bce58f32..5faca0ae 100644 --- a/third_party/fwkacllib/inc/toolchain/slog.h +++ b/third_party/fwkacllib/inc/toolchain/slog.h @@ -18,7 +18,9 @@ #define D_SYSLOG_H_ #ifdef __cplusplus +#ifndef LOG_CPP extern "C" { +#endif #endif // __cplusplus #ifndef LINUX @@ -105,6 +107,7 @@ extern "C" { #define SECURITY_LOG_MASK (0x00100000) #define RUN_LOG_MASK (0x01000000) #define OPERATION_LOG_MASK (0x10000000) +#define RESERVERD_LENGTH 52 typedef struct tagDCODE { const char *cName; @@ -116,6 +119,18 @@ typedef struct tagKV { char *value; } KeyValue; +typedef enum { + APPLICATION = 0, + SYSTEM +} ProcessType; + +typedef struct { + ProcessType type; + unsigned int pid; + unsigned int deviceId; + char reserved[RESERVERD_LENGTH]; +} LogAttr; + /** * @ingroup slog * @@ -228,6 +243,14 @@ DLL_EXPORT int dlog_setlevel(int moduleId, int level, int enableEvent); */ DLL_EXPORT int CheckLogLevel(int moduleId, int logLevel); +/** + * @ingroup slog + * @brief DlogSetAttr: set log attr, default pid is 0, default device id is 0, default process type is APPLICATION + * @param [in]logAttr: attr info, include pid(must be larger than 0), process type and device id(chip ID) + * @return: 0: SUCCEED, others: FAILED + */ +DLL_EXPORT int DlogSetAttr(LogAttr logAttr); + /** * @ingroup slog * @brief dlog_error: print error log @@ -367,6 +390,8 @@ void DlogInner(int moduleId, int level, const char *fmt, ...); void DlogWithKVInner(int moduleId, int level, KeyValue *pstKVArray, int kvNum, const char *fmt, ...); #ifdef __cplusplus +#ifndef LOG_CPP } +#endif // LOG_CPP #endif // __cplusplus #endif // D_SYSLOG_H_ diff --git a/third_party/fwkacllib/inc/toolchain/tuning_tool/tune_api.h b/third_party/fwkacllib/inc/toolchain/tuning_tool/tune_api.h index 12b6aa1e..87fdcbeb 100644 --- a/third_party/fwkacllib/inc/toolchain/tuning_tool/tune_api.h +++ b/third_party/fwkacllib/inc/toolchain/tuning_tool/tune_api.h @@ -1,13 +1,19 @@ /** - * @file tune_api.h + * Copyright 2019-2020 Huawei Technologies Co., Ltd * - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.\n + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * 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.\n - * 描述:mstune调优接口头文件 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + /** @defgroup mstune mstune调优接口 */ #ifndef TUNE_API_H #define TUNE_API_H From fec2e70eda5bc44ebb6bee001815e8b09b6fd5ec Mon Sep 17 00:00:00 2001 From: yanghaoran Date: Mon, 7 Dec 2020 14:58:44 +0800 Subject: [PATCH 2/5] find libraries from both atc and fwk paths --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a7528f95..6dd5e1e1 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,9 +83,9 @@ if (ENABLE_OPEN_SRC) find_module(msprofiler libmsprofiler.a ${GE_LIB_PATH}) #find_module(ascendcl_static libascendcl.a ${GE_LIB_PATH}) else() - find_module(slog libslog.so ${ASCEND_ATC_DIR}) - find_module(static_mmpa libmmpa.a ${ASCEND_ATC_DIR}) - find_module(error_manager liberror_manager.so ${ASCEND_ATC_DIR}) + find_module(slog libslog.so ${ASCEND_ATC_DIR} ${ASCEND_DRIVER_COMMON_DIR}) + find_module(static_mmpa libmmpa.a ${ASCEND_ATC_DIR} ${ASCEND_RUNTIME_DIR}) + find_module(error_manager liberror_manager.so ${ASCEND_ATC_DIR} ${ASCEND_RUNTIME_DIR}) if(PLATFORM STREQUAL "train") find_module(msprof libmsprof.so ${ASCEND_DRIVER_COMMON_DIR}) find_module(hccl libhccl.so ${ASCEND_RUNTIME_DIR}) From d7319181984e62c43bacbb382e86a4d053ea245d Mon Sep 17 00:00:00 2001 From: yanghaoran Date: Mon, 7 Dec 2020 17:14:14 +0800 Subject: [PATCH 3/5] fix geruntime missing files and error codes --- ge/ge_runtime/CMakeLists.txt | 3 +++ ge/ge_runtime/runtime_model.cc | 4 ++-- ge/ge_runtime/task/task.h | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ge/ge_runtime/CMakeLists.txt b/ge/ge_runtime/CMakeLists.txt index 42d3b344..ce1b89ea 100644 --- a/ge/ge_runtime/CMakeLists.txt +++ b/ge/ge_runtime/CMakeLists.txt @@ -13,6 +13,9 @@ set(GE_SRC_LIST "task/hccl_task.cc" "task/memcpy_async_task.cc" "task/profiler_task.cc" + "task/label_goto_task.cc" + "task/label_set_task.cc" + "task/label_switch_task.cc" ) add_library(ge_runtime SHARED ${GE_SRC_LIST}) diff --git a/ge/ge_runtime/runtime_model.cc b/ge/ge_runtime/runtime_model.cc index 0ff56ef1..fb0f3e85 100644 --- a/ge/ge_runtime/runtime_model.cc +++ b/ge/ge_runtime/runtime_model.cc @@ -307,8 +307,8 @@ bool RuntimeModel::Run() { ret = rtStreamSynchronize(rt_model_stream_); if (ret != RT_ERROR_NONE) { - if (ret == RT_ERROR_END_OF_SEQUENCE) { - GELOGI("Model stream RT_ERROR_END_OF_SEQUENCE signal received, ret = 0x%X", ret); + if (ret == ACL_ERROR_RT_END_OF_SEQUENCE) { + GELOGI("Model stream ACL_ERROR_RT_END_OF_SEQUENCE signal received, ret = 0x%X", ret); return true; } GELOGE(RT_FAILED, "Model stream sync failed, ret = 0x%X", ret); diff --git a/ge/ge_runtime/task/task.h b/ge/ge_runtime/task/task.h index 6c4df248..c255fd22 100644 --- a/ge/ge_runtime/task/task.h +++ b/ge/ge_runtime/task/task.h @@ -24,6 +24,7 @@ #include "runtime/rt_model.h" #include "ge_runtime/model_context.h" #include "ge_runtime/task_info.h" +#include "external/runtime/rt_error_codes.h" namespace ge { namespace model_runner { From d5a82a7f98bb7470fa7684f921e399312f5d5175 Mon Sep 17 00:00:00 2001 From: yanghaoran Date: Wed, 9 Dec 2020 14:40:51 +0800 Subject: [PATCH 4/5] Synchronize latest Ascend software suite 09 Dec 2020 --- inc/external/acl/ops/acl_fv.h | 353 +++++++++++++++++++++++++ third_party/fwkacllib/inc/runtime/rt.h | 2 +- 2 files changed, 354 insertions(+), 1 deletion(-) create mode 100644 inc/external/acl/ops/acl_fv.h diff --git a/inc/external/acl/ops/acl_fv.h b/inc/external/acl/ops/acl_fv.h new file mode 100644 index 00000000..27dc367a --- /dev/null +++ b/inc/external/acl/ops/acl_fv.h @@ -0,0 +1,353 @@ +/** + * Copyright 2019-2020 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef INC_EXTERNAL_ACL_OPS_ACL_RETR_H_ +#define INC_EXTERNAL_ACL_OPS_ACL_RETR_H_ + +#include "acl/acl.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct aclfvInitPara aclfvInitPara; +typedef struct aclfvFeatureInfo aclfvFeatureInfo; +typedef struct aclfvRepoRange aclfvRepoRange; +typedef struct aclfvQueryTable aclfvQueryTable; +typedef struct aclfvSearchInput aclfvSearchInput; +typedef struct aclfvSearchResult aclfvSearchResult; + +// search operation type +enum aclfvSearchType { + SEARCH_1_N, // 1:N operation type + SEARCH_N_M // N:M operation type +}; + +/** + * @ingroup AscendCL + * @brief Create fv init param. + * + * @param fsNum [IN] The feature num + * + * @retval null for failed. + * @retval OtherValues success. + */ +ACL_FUNC_VISIBILITY aclfvInitPara *aclfvCreateInitPara(uint64_t fsNum); + +/** + * @ingroup AscendCL + * @brief Destroy fv init param. + * + * @par Function + * Can only destroy fv init param information created + * through aclfvCreateInitPara interface. + * + * @param initPara [IN] fv init param. + * + * @retval ACL_SUCCESS The function is successfully executed. + * @retval OtherValues Failure + * + * @see aclfvCreateInitPara + */ +ACL_FUNC_VISIBILITY aclError aclfvDestroyInitPara(aclfvInitPara *initPara); + +/** + * @ingroup AscendCL + * @brief set value for maxTopNumFor1N which in fv init param. + * + * @param initPara [IN|OUT] fv init param. + * @param maxTopNumFor1N [IN] maxTopNumFor1N value for init param. + * + * @retval ACL_SUCCESS The function is successfully executed. + * @retval OtherValues Failure + */ +ACL_FUNC_VISIBILITY aclError aclfvSet1NTopNum(aclfvInitPara *initPara, uint32_t maxTopNumFor1N); + +/** + * @ingroup AscendCL + * @brief set value for maxTopNumForNM which in fv init param. + * + * @param initPara [IN|OUT] fv init param. + * @param maxTopNumForNM [IN] maxTopNumForNM value for init param. + * + * @retval ACL_SUCCESS The function is successfully executed. + * @retval OtherValues Failure + */ +ACL_FUNC_VISIBILITY aclError aclfvSetNMTopNum(aclfvInitPara *initPara, uint32_t maxTopNumForNM); + +/** + * @ingroup AscendCL + * @brief Create fv feature info. + * + * @param id0 [IN] The first level library id0 + * @param id1 [IN] Secondary library id1 + * @param offset [IN] The offset of the first feature in the library + * @param featureLen [IN] Single feature length + * @param featureCount [IN] Single feature count + * @param featureData [IN] Feature value list + * @param featureDataLen [IN] Feature value list length + * + * @retval null for failed. + * @retval OtherValues success. + */ +ACL_FUNC_VISIBILITY aclfvFeatureInfo *aclfvCreateFeatureInfo(uint32_t id0, uint32_t id1, uint32_t offset, + uint32_t featureLen, uint32_t featureCount, + uint8_t *featureData, uint32_t featureDataLen); + +/** + * @ingroup AscendCL + * @brief Destroy fv feature info. + * + * @par Function + * Can only destroy fv feature info information created + * through aclfvCreateFeatureInfo interface. + * + * @param featureInfo [IN] fv feature info. + * + * @retval ACL_SUCCESS The function is successfully executed. + * @retval OtherValues Failure + * + * @see aclfvCreateFeatureInfo + */ +ACL_FUNC_VISIBILITY aclError aclfvDestroyFeatureInfo(aclfvFeatureInfo *featureInfo); + +/** + * @ingroup AscendCL + * @brief Create fv repo range. + * + * @param id0Min [IN] id0 start value + * @param id0Min [IN] id0 max + * @param id1Min [IN] id0 start value + * @param id1Max [IN] id1 max + * + * @retval null for failed. OtherValues success + */ +ACL_FUNC_VISIBILITY aclfvRepoRange *aclfvCreateRepoRange(uint32_t id0Min, uint32_t id0Max, uint32_t id1Min, + uint32_t id1Max); + +/** + * @ingroup AscendCL + * @brief Destroy fv repo range. + * + * @par Function + * Can only destroy fv repo range information created + * through aclfvCreateRepoRange interface. + * + * @param repoRange [IN] fv repo range. + * + * @retval ACL_SUCCESS The function is successfully executed. + * @retval OtherValues Failure + * + * @see aclfvCreateRepoRange + */ +ACL_FUNC_VISIBILITY aclError aclfvDestroyRepoRange(aclfvRepoRange *repoRange); + +/** + * @ingroup AscendCL + * @brief Create query table. + * + * @param queryCnt [IN] Number of tables, the maximum number is 6 + * @param tableLen [IN] Single table length, table length is 32KB + * @param tableData [IN] Feature value list + * @param tableDataLen [IN] The length of memory requested by the featureData pointer + * + * @retval null for failed. OtherValues success + */ +ACL_FUNC_VISIBILITY aclfvQueryTable *aclfvCreateQueryTable(uint32_t queryCnt, uint32_t tableLen, uint8_t *tableData, + uint32_t tableDataLen); + +/** + * @ingroup AscendCL + * @brief Destroy query table. + * + * @par Function + * Can only destroy query table information created + * through aclfvCreateQueryTable interface. + * + * @param queryTable [IN] query table. + * + * @retval ACL_SUCCESS The function is successfully executed. + * @retval OtherValues Failure + * + * @see aclfvCreateQueryTable + */ +ACL_FUNC_VISIBILITY aclError aclfvDestroyQueryTable(aclfvQueryTable *queryTable); + +/** + * @ingroup AscendCL + * @brief Create search input. + * + * @param queryTable [IN] query table + * @param repoRange [IN] query repo range + * @param topk [IN] query topk + * + * @retval null for failed. OtherValues success + */ +ACL_FUNC_VISIBILITY aclfvSearchInput *aclfvCreateSearchInput(aclfvQueryTable *queryTable, aclfvRepoRange *repoRange, + uint32_t topk); + +/** + * @ingroup AscendCL + * @brief Destroy search input. + * + * @par Function + * Can only destroy search input information created + * through aclfvCreateSearchInput interface. + * + * @param searchInput [IN] search input. + * + * @retval ACL_SUCCESS The function is successfully executed. + * @retval OtherValues Failure + * + * @see aclfvCreateSearchInput + */ +ACL_FUNC_VISIBILITY aclError aclfvDestroySearchInput(aclfvSearchInput *searchInput); + +/** + * @ingroup AscendCL + * @brief Create search result. + * + * @param queryCnt [IN] Retrieve the number of features + * @param resultNum [IN] The number of search results for each feature, the number is queryCnt + * @param resultNumDataLen [IN] resultNum memory length + * @param id0 [IN] Level 1 library id0 + * @param id1 [IN] Secondary library id1 + * @param resultOffset [IN] The offset of the bottom library corresponding + * to each feature retrieval result, total length topK * queryCnt + * @param resultDistance [IN] Distance, total length topK * queryCnt + * @param dataLen [IN] The memory size requested by + * id0\id1\reslutOffset\resultDistance + * + * @retval null for failed. OtherValues success + */ +ACL_FUNC_VISIBILITY aclfvSearchResult *aclfvCreateSearchResult(uint32_t queryCnt, uint32_t *resultNum, + uint32_t resultNumDataLen, uint32_t *id0, uint32_t *id1, + uint32_t *resultOffset, float *resultDistance, + uint32_t dataLen); + +/** + * @ingroup AscendCL + * @brief Destroy search result. + * + * @par Function + * Can only destroy search result information created + * through aclfvCreateSearchResult interface. + * + * @param searchResult [IN] search result. + * + * @retval ACL_SUCCESS The function is successfully executed. + * @retval OtherValues Failure + * + * @see aclfvCreateSearchResult + */ +ACL_FUNC_VISIBILITY aclError aclfvDestroySearchResult(aclfvSearchResult *searchResult); + +/** + * @ingroup AscendCL + * @brief fv IP initialize. + * + * @param initPara [IN] fv init param. + * + * @retval ACL_SUCCESS The function is successfully executed. + * @retval OtherValues Failure. + */ +ACL_FUNC_VISIBILITY aclError aclfvInit(aclfvInitPara *initPara); + +/** + * @ingroup AscendCL + * @brief release fv resources. + * + * @par Function + * Can only release fv resources created + * through aclfvInit interface. + * + * @retval ACL_SUCCESS The function is successfully executed. + * @retval OtherValues Failure. + * + * @see aclfvInit + */ +ACL_FUNC_VISIBILITY aclError aclfvRelease(); + +/** + * @ingroup AscendCL + * @brief fv repo add. + * + * @param type [IN] repo add type + * @param featureInfo [IN] add feature information + * @param stream [IN] stream of task execute + * + * @retval ACL_SUCCESS The function is successfully executed. + * @retval OtherValues Failure. + */ +ACL_FUNC_VISIBILITY aclError aclfvRepoAdd(aclfvSearchType type, aclfvFeatureInfo *featureInfo, aclrtStream stream); + +/** + * @ingroup AscendCL + * @brief fv repo del. + * + * @param type [IN] repo delete type + * @param repoRange [IN] repo range information + * @param stream [IN] stream of task execute + * + * @retval ACL_SUCCESS The function is successfully executed. + * @retval OtherValues Failure. + */ +ACL_FUNC_VISIBILITY aclError aclfvRepoDel(aclfvSearchType type, aclfvRepoRange *repoRange, aclrtStream stream); + +/** + * @ingroup AscendCL + * @brief fv accurate del. + * + * @param featureInfo [IN] accurate delete feature information + * @param stream [IN] stream of task execute + * + * @retval ACL_SUCCESS The function is successfully executed. + * @retval OtherValues Failure. + */ +ACL_FUNC_VISIBILITY aclError aclfvDel(aclfvFeatureInfo *featureInfo, aclrtStream stream); + +/** + * @ingroup AscendCL + * @brief fv accurate modify. + * + * @param featureInfo [IN] accurate modify feature information + * @param stream [IN] stream of task execute + * + * @retval ACL_SUCCESS The function is successfully executed. + * @retval OtherValues Failure. + */ +ACL_FUNC_VISIBILITY aclError aclfvModify(aclfvFeatureInfo *featureInfo, aclrtStream stream); + +/** + * @ingroup AscendCL + * @brief fv search. + * + * @param type [IN] search type + * @param searchInput [IN] search input + * @param searchRst [OUT] search result + * @param stream [IN] stream of task execute + * + * @retval ACL_SUCCESS The function is successfully executed. + * @retval OtherValues Failure. + */ +ACL_FUNC_VISIBILITY aclError aclfvSearch(aclfvSearchType type, aclfvSearchInput *searchInput, + aclfvSearchResult *searchRst, aclrtStream stream); + +#ifdef __cplusplus +} +#endif + +#endif // INC_EXTERNAL_ACL_OPS_ACL_RETR_H_ diff --git a/third_party/fwkacllib/inc/runtime/rt.h b/third_party/fwkacllib/inc/runtime/rt.h index c1872941..0d39389b 100644 --- a/third_party/fwkacllib/inc/runtime/rt.h +++ b/third_party/fwkacllib/inc/runtime/rt.h @@ -28,4 +28,4 @@ #include "rt_model.h" #include "stream.h" -#endif // __CCE_RUNTIME_RT_H__ \ No newline at end of file +#endif // __CCE_RUNTIME_RT_H__ From d77f36e017931d40609730f787f90a401b71bbd8 Mon Sep 17 00:00:00 2001 From: yanghaoran Date: Wed, 9 Dec 2020 17:09:54 +0800 Subject: [PATCH 5/5] prioritize json downloading from gitee --- cmake/external_libs/json.cmake | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cmake/external_libs/json.cmake b/cmake/external_libs/json.cmake index c4a52843..ce473d4b 100755 --- a/cmake/external_libs/json.cmake +++ b/cmake/external_libs/json.cmake @@ -5,15 +5,15 @@ endif() include(ExternalProject) set(JSON_SRC_DIR ${CMAKE_BINARY_DIR}/opensrc/json/include) -#if (ENABLE_GITEE) -# set(REQ_URL "https://gitee.com/mirrors/JSON-for-Modern-CPP/repository/archive/v3.6.1.zip") -# set(MD5 "5bda78ce308e6cfcf614dcf1d5ff27a7") -# set(JSON_INCLUDE_DIR "${JSON_SRC_DIR}/include") -#else() -set(REQ_URL "https://github.com/nlohmann/json/releases/download/v3.6.1/include.zip") -set(MD5 "0dc903888211db3a0f170304cd9f3a89") -set(JSON_INCLUDE_DIR ${JSON_SRC_DIR}) -#endif () +if (ENABLE_GITEE) + set(REQ_URL "https://gitee.com/mirrors/JSON-for-Modern-CPP/repository/archive/v3.6.1.zip") + set(MD5 "5bda78ce308e6cfcf614dcf1d5ff27a7") + set(JSON_INCLUDE_DIR "${JSON_SRC_DIR}/include") +else() + set(REQ_URL "https://github.com/nlohmann/json/releases/download/v3.6.1/include.zip") + set(MD5 "0dc903888211db3a0f170304cd9f3a89") + set(JSON_INCLUDE_DIR ${JSON_SRC_DIR}) +endif () ExternalProject_Add(json_build URL ${REQ_URL} #URL /home/txd/workspace/cloud_code/pkg/include.zip