From: @wqtshg Reviewed-by: @xchu42,@ji_chen Signed-off-by: @ji_chentags/v1.2.0
| @@ -1 +1 @@ | |||||
| Subproject commit 848cf412caa9b42ce4e75ab4d0a147ec97dc579b | |||||
| Subproject commit bb86412204fc72fa8fe4063e6044090dfd714321 | |||||
| @@ -1 +1 @@ | |||||
| Subproject commit 756c64c59e451a955e81b59d957ad55f96c27d89 | |||||
| Subproject commit d85b5fc685b9e1f8dbee778c9c7b3ab6f379af79 | |||||
| @@ -18,43 +18,43 @@ | |||||
| #define AICPU_OP_TYPE_LIST_H_ | #define AICPU_OP_TYPE_LIST_H_ | ||||
| enum OpKernelType { | enum OpKernelType { | ||||
| TF_KERNEL, | |||||
| CPU_KERNEL | |||||
| TF_KERNEL, | |||||
| CPU_KERNEL | |||||
| }; | }; | ||||
| enum ReturnCode { | enum ReturnCode { | ||||
| OP_TYPE_NOT_SUPPORT, | |||||
| FORMAT_NOT_SUPPORT, | |||||
| DTYPE_NOT_SUPPORT | |||||
| OP_TYPE_NOT_SUPPORT, | |||||
| FORMAT_NOT_SUPPORT, | |||||
| DTYPE_NOT_SUPPORT | |||||
| }; | }; | ||||
| #pragma pack(push, 1) | #pragma pack(push, 1) | ||||
| //One byte alignment | //One byte alignment | ||||
| struct SysOpInfo { | struct SysOpInfo { | ||||
| uint64_t opLen; | |||||
| uint64_t opType; | |||||
| OpKernelType kernelsType; | |||||
| uint64_t opLen; | |||||
| uint64_t opType; | |||||
| OpKernelType kernelsType; | |||||
| }; | }; | ||||
| struct OpParamInfo { | struct OpParamInfo { | ||||
| uint64_t num; | |||||
| uint64_t dtypeList; | |||||
| uint64_t formatList; | |||||
| uint64_t num; | |||||
| uint64_t dtypeList; | |||||
| uint64_t formatList; | |||||
| }; | }; | ||||
| struct SysOpCheckInfo { | struct SysOpCheckInfo { | ||||
| uint64_t opListNum; | |||||
| uint64_t offSetLen; | |||||
| uint64_t sysOpInfoList; | |||||
| uint64_t opParamInfoList; | |||||
| uint64_t opListNum; | |||||
| uint64_t offSetLen; | |||||
| uint64_t sysOpInfoList; | |||||
| uint64_t opParamInfoList; | |||||
| }; | }; | ||||
| struct SysOpCheckResp { | struct SysOpCheckResp { | ||||
| uint64_t opListNum; | |||||
| bool isWithoutJson; | |||||
| uint64_t returnCodeList; | |||||
| uint64_t sysOpInfoList; | |||||
| uint64_t opParamInfoList; | |||||
| uint64_t opListNum; | |||||
| bool isWithoutJson; | |||||
| uint64_t returnCodeList; | |||||
| uint64_t sysOpInfoList; | |||||
| uint64_t opParamInfoList; | |||||
| }; | }; | ||||
| #pragma pack(pop) | #pragma pack(pop) | ||||
| #endif // AICPU_OP_TYPE_LIST_H_ | #endif // AICPU_OP_TYPE_LIST_H_ | ||||
| @@ -31,6 +31,7 @@ typedef enum { | |||||
| AE_STATUS_KERNEL_API_INNER_ERROR = 5, | AE_STATUS_KERNEL_API_INNER_ERROR = 5, | ||||
| AE_STATUS_END_OF_SEQUENCE = 6, | AE_STATUS_END_OF_SEQUENCE = 6, | ||||
| AE_STATUS_DUMP_FAILED = 7, | AE_STATUS_DUMP_FAILED = 7, | ||||
| AE_STATUS_TASK_WAIT = 101, | |||||
| AE_STATUS_RESERVED | AE_STATUS_RESERVED | ||||
| } aeStatus_t; | } aeStatus_t; | ||||
| @@ -60,6 +60,7 @@ enum FWKTaskExtInfoType { | |||||
| FWK_ADPT_EXT_UPDATE_ADDR, | FWK_ADPT_EXT_UPDATE_ADDR, | ||||
| FWK_ADPT_EXT_OP_NAME, | FWK_ADPT_EXT_OP_NAME, | ||||
| FWK_ADPT_EXT_SESSION_INFO, | FWK_ADPT_EXT_SESSION_INFO, | ||||
| FWK_ADPT_EXT_BITMAP, | |||||
| FWK_ADPT_EXT_INVALID | FWK_ADPT_EXT_INVALID | ||||
| }; | }; | ||||
| @@ -50,7 +50,7 @@ typedef int (*mmFilter)(const mmDirent *entry); | |||||
| typedef int (*mmFilter2)(const mmDirent2 *entry); | typedef int (*mmFilter2)(const mmDirent2 *entry); | ||||
| typedef int (*mmSort)(const mmDirent **a, const mmDirent **b); | typedef int (*mmSort)(const mmDirent **a, const mmDirent **b); | ||||
| typedef int (*mmSort2)(const mmDirent2 **a, const mmDirent2 **b); | typedef int (*mmSort2)(const mmDirent2 **a, const mmDirent2 **b); | ||||
| typedef size_t mmSize_t; | |||||
| typedef size_t mmSize_t; //lint !e410 !e1051 | |||||
| typedef off_t mmOfft_t; | typedef off_t mmOfft_t; | ||||
| typedef pid_t mmPid_t; | typedef pid_t mmPid_t; | ||||
| typedef long MM_LONG; | typedef long MM_LONG; | ||||
| @@ -283,6 +283,7 @@ typedef struct { | |||||
| #define M_W_OK W_OK | #define M_W_OK W_OK | ||||
| #define M_R_OK R_OK | #define M_R_OK R_OK | ||||
| #define MM_DT_DIR DT_DIR | #define MM_DT_DIR DT_DIR | ||||
| #define MM_DT_REG DT_REG | #define MM_DT_REG DT_REG | ||||
| @@ -1,83 +1,83 @@ | |||||
| /** | |||||
| * 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 MMPA_TYPEDEF_WIN_H | |||||
| #define MMPA_TYPEDEF_WIN_H | |||||
| #ifdef __cplusplus | |||||
| #if __cplusplus | |||||
| extern "C" { | |||||
| #endif // __cpluscplus | |||||
| #endif // __cpluscplus | |||||
| #ifndef FALSE | |||||
| #define FALSE 0 | |||||
| #endif | |||||
| #ifndef TRUE | |||||
| #define TRUE 1 | |||||
| #endif | |||||
| #define EN_OK 0 | |||||
| #define EN_ERR 1 | |||||
| #define EN_ERROR (-1) | |||||
| #define EN_INVALID_PARAM (-2) | |||||
| #define EN_TIMEOUT (-3) | |||||
| #define HANDLE_INVALID_VALUE (-1) | |||||
| #define INVALID_SOCKET_HANDLE INVALID_SOCKET | |||||
| #define MMPA_MEM_MAX_LEN (0x7fffffff) | |||||
| #define MMPA_PROCESS_ERROR (0x7fffffff) | |||||
| #define MMPA_ONE_THOUSAND 1000 | |||||
| #define MMPA_COMPUTER_BEGIN_YEAR 1900 | |||||
| #define SUMMER_TIME_OR_NOT (-1) | |||||
| #define MMPA_ZERO 0 | |||||
| #define MMPA_VALUE_ONE 1 | |||||
| #define MMPA_SOCKET_MAIN_EDITION 2 | |||||
| #define MMPA_SOCKET_SECOND_EDITION 0 | |||||
| #define MMPA_PIPE_BUF_SIZE 1024 | |||||
| #define MMPA_MAX_SCANDIR_COUNT 1024 | |||||
| #define MAX_IOVEC_SIZE 32 | |||||
| #define MMPA_PIPE_COUNT 2 | |||||
| #define MMPA_THREADNAME_SIZE 16 | |||||
| #define MMPA_MIN_OS_NAME_SIZE (MAX_COMPUTERNAME_LENGTH + 1) | |||||
| #define MMPA_MIN_OS_VERSION_SIZE 64 | |||||
| #define MMPA_MAX_NI 19 | |||||
| #define MMPA_MIDDLE_NI 5 | |||||
| #define MMPA_LOW_NI (-5) | |||||
| #define MMPA_MIN_NI (-20) | |||||
| #define MMPA_MAX_FILE 128 | |||||
| #define MMPA_MAX_THREAD_PIO 99 | |||||
| #define MMPA_MIDDLE_THREAD_PIO 66 | |||||
| #define MMPA_LOW_THREAD_PIO 33 | |||||
| #define MMPA_MIN_THREAD_PIO 1 | |||||
| #define MMPA_THREAD_SCHED_RR 0 | |||||
| #define MMPA_THREAD_SCHED_FIFO 0 | |||||
| #define MMPA_THREAD_SCHED_OTHER 0 | |||||
| #define MMPA_THREAD_MIN_STACK_SIZE 0 | |||||
| #define MM_MUTEX_INITIALIZER NULL | |||||
| #ifdef __cplusplus | |||||
| #if __cplusplus | |||||
| } | |||||
| #endif // __cpluscplus | |||||
| #endif // __cpluscplus | |||||
| #endif // _MMPA_TYPEDEF_WIN_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 MMPA_TYPEDEF_WIN_H | |||||
| #define MMPA_TYPEDEF_WIN_H | |||||
| #ifdef __cplusplus | |||||
| #if __cplusplus | |||||
| extern "C" { | |||||
| #endif // __cpluscplus | |||||
| #endif // __cpluscplus | |||||
| #ifndef FALSE | |||||
| #define FALSE 0 | |||||
| #endif | |||||
| #ifndef TRUE | |||||
| #define TRUE 1 | |||||
| #endif | |||||
| #define EN_OK 0 | |||||
| #define EN_ERR 1 | |||||
| #define EN_ERROR (-1) | |||||
| #define EN_INVALID_PARAM (-2) | |||||
| #define EN_TIMEOUT (-3) | |||||
| #define HANDLE_INVALID_VALUE (-1) | |||||
| #define INVALID_SOCKET_HANDLE INVALID_SOCKET | |||||
| #define MMPA_MEM_MAX_LEN (0x7fffffff) | |||||
| #define MMPA_PROCESS_ERROR (0x7fffffff) | |||||
| #define MMPA_ONE_THOUSAND 1000 | |||||
| #define MMPA_COMPUTER_BEGIN_YEAR 1900 | |||||
| #define SUMMER_TIME_OR_NOT (-1) | |||||
| #define MMPA_ZERO 0 | |||||
| #define MMPA_VALUE_ONE 1 | |||||
| #define MMPA_SOCKET_MAIN_EDITION 2 | |||||
| #define MMPA_SOCKET_SECOND_EDITION 0 | |||||
| #define MMPA_PIPE_BUF_SIZE 1024 | |||||
| #define MMPA_MAX_SCANDIR_COUNT 1024 | |||||
| #define MAX_IOVEC_SIZE 32 | |||||
| #define MMPA_PIPE_COUNT 2 | |||||
| #define MMPA_THREADNAME_SIZE 16 | |||||
| #define MMPA_MIN_OS_NAME_SIZE (MAX_COMPUTERNAME_LENGTH + 1) | |||||
| #define MMPA_MIN_OS_VERSION_SIZE 64 | |||||
| #define MMPA_MAX_NI 19 | |||||
| #define MMPA_MIDDLE_NI 5 | |||||
| #define MMPA_LOW_NI (-5) | |||||
| #define MMPA_MIN_NI (-20) | |||||
| #define MMPA_MAX_FILE 128 | |||||
| #define MMPA_MAX_THREAD_PIO 99 | |||||
| #define MMPA_MIDDLE_THREAD_PIO 66 | |||||
| #define MMPA_LOW_THREAD_PIO 33 | |||||
| #define MMPA_MIN_THREAD_PIO 1 | |||||
| #define MMPA_THREAD_SCHED_RR 0 | |||||
| #define MMPA_THREAD_SCHED_FIFO 0 | |||||
| #define MMPA_THREAD_SCHED_OTHER 0 | |||||
| #define MMPA_THREAD_MIN_STACK_SIZE 0 | |||||
| #define MM_MUTEX_INITIALIZER NULL | |||||
| #ifdef __cplusplus | |||||
| #if __cplusplus | |||||
| } | |||||
| #endif // __cpluscplus | |||||
| #endif // __cpluscplus | |||||
| #endif // _MMPA_TYPEDEF_WIN_H_ | |||||
| @@ -41,12 +41,12 @@ static const int32_t RT_ERROR_NONE = 0; // success | |||||
| * @brief runtime exception numbers. | * @brief runtime exception numbers. | ||||
| */ | */ | ||||
| typedef enum tagRtExceptionType { | typedef enum tagRtExceptionType { | ||||
| RT_EXCEPTION_NONE = 0, | |||||
| RT_EXCEPTION_TS_DOWN = 1, | |||||
| RT_EXCEPTION_TASK_TIMEOUT = 2, | |||||
| RT_EXCEPTION_TASK_FAILURE = 3, | |||||
| RT_EXCEPTION_DEV_RUNNING_DOWN = 4, | |||||
| RT_EXCEPTION_STREAM_ID_FREE_FAILED = 5 | |||||
| RT_EXCEPTION_NONE = 0, | |||||
| RT_EXCEPTION_TS_DOWN = 1, | |||||
| RT_EXCEPTION_TASK_TIMEOUT = 2, | |||||
| RT_EXCEPTION_TASK_FAILURE = 3, | |||||
| RT_EXCEPTION_DEV_RUNNING_DOWN = 4, | |||||
| RT_EXCEPTION_STREAM_ID_FREE_FAILED = 5 | |||||
| } rtExceptionType; | } rtExceptionType; | ||||
| /** | /** | ||||
| @@ -54,12 +54,12 @@ typedef enum tagRtExceptionType { | |||||
| * @brief Switch type. | * @brief Switch type. | ||||
| */ | */ | ||||
| typedef enum tagRtCondition { | typedef enum tagRtCondition { | ||||
| RT_EQUAL = 0, | |||||
| RT_NOT_EQUAL, | |||||
| RT_GREATER, | |||||
| RT_GREATER_OR_EQUAL, | |||||
| RT_LESS, | |||||
| RT_LESS_OR_EQUAL | |||||
| RT_EQUAL = 0, | |||||
| RT_NOT_EQUAL, | |||||
| RT_GREATER, | |||||
| RT_GREATER_OR_EQUAL, | |||||
| RT_LESS, | |||||
| RT_LESS_OR_EQUAL | |||||
| } rtCondition_t; | } rtCondition_t; | ||||
| /** | /** | ||||
| @@ -67,25 +67,25 @@ typedef enum tagRtCondition { | |||||
| * @brief Data Type of Extensible Switch Task. | * @brief Data Type of Extensible Switch Task. | ||||
| */ | */ | ||||
| typedef enum tagRtSwitchDataType { | typedef enum tagRtSwitchDataType { | ||||
| RT_SWITCH_INT32 = 0, | |||||
| RT_SWITCH_INT64 = 1, | |||||
| RT_SWITCH_INT32 = 0, | |||||
| RT_SWITCH_INT64 = 1, | |||||
| } rtSwitchDataType_t; | } rtSwitchDataType_t; | ||||
| typedef enum tagRtStreamFlagType { | typedef enum tagRtStreamFlagType { | ||||
| RT_HEAD_STREAM = 0, // first stream | |||||
| RT_INVALID_FLAG = 0xFFFFFFFF, | |||||
| RT_HEAD_STREAM = 0, // first stream | |||||
| RT_INVALID_FLAG = 0xFFFFFFFF, | |||||
| } rtStreamFlagType_t; | } rtStreamFlagType_t; | ||||
| typedef enum tagRtLimitType { | typedef enum tagRtLimitType { | ||||
| RT_LIMIT_TYPE_LOW_POWER_TIMEOUT = 0, // timeout for power down , ms | |||||
| RT_LIMIT_TYPE_LOW_POWER_TIMEOUT = 0, // timeout for power down , ms | |||||
| } rtLimitType_t; | } rtLimitType_t; | ||||
| typedef struct rtExceptionInfo { | typedef struct rtExceptionInfo { | ||||
| uint32_t taskid; | |||||
| uint32_t streamid; | |||||
| uint32_t tid; | |||||
| uint32_t deviceid; | |||||
| uint32_t retcode; | |||||
| uint32_t taskid; | |||||
| uint32_t streamid; | |||||
| uint32_t tid; | |||||
| uint32_t deviceid; | |||||
| uint32_t retcode; | |||||
| } rtExceptionInfo; | } rtExceptionInfo; | ||||
| typedef void (*rtErrorCallback)(rtExceptionType); | typedef void (*rtErrorCallback)(rtExceptionType); | ||||
| @@ -112,6 +112,12 @@ typedef void *rtEvent_t; | |||||
| */ | */ | ||||
| typedef void *rtLabel_t; | typedef void *rtLabel_t; | ||||
| /** | |||||
| * @ingroup dvrt_base | |||||
| * @brief model handle. | |||||
| */ | |||||
| typedef void *rtModel_t; | |||||
| /** | /** | ||||
| * @ingroup profiling_base | * @ingroup profiling_base | ||||
| * @brief runtime handle. | * @brief runtime handle. | ||||
| @@ -217,6 +223,16 @@ typedef void *rtNotify_t; | |||||
| */ | */ | ||||
| RTS_API rtError_t rtLabelCreate(rtLabel_t *label); | RTS_API rtError_t rtLabelCreate(rtLabel_t *label); | ||||
| /** | |||||
| * @ingroup dvrt_base | |||||
| * @brief create label instance | |||||
| * @param [out] label created label | |||||
| * @param [in] model label set model | |||||
| * @return RT_ERROR_NONE for ok | |||||
| * @return RT_ERROR_INVALID_VALUE for error input | |||||
| */ | |||||
| RTS_API rtError_t rtLabelCreateV2(rtLabel_t *label, rtModel_t model); | |||||
| /** | /** | ||||
| * @ingroup dvrt_base | * @ingroup dvrt_base | ||||
| * @brief set label and stream instance | * @brief set label and stream instance | ||||
| @@ -314,6 +330,17 @@ RTS_API rtError_t rtLabelListCpy(rtLabel_t *label, uint32_t labelNumber, void *d | |||||
| */ | */ | ||||
| RTS_API rtError_t rtLabelCreateEx(rtLabel_t *label, rtStream_t stream); | RTS_API rtError_t rtLabelCreateEx(rtLabel_t *label, rtStream_t stream); | ||||
| /** | |||||
| * @ingroup dvrt_base | |||||
| * @brief labels to dev info | |||||
| * @param [out] label created label handle | |||||
| * @param [in] model label bind model | |||||
| * @param [in] stream label bind stream | |||||
| * @return RT_ERROR_NONE for ok | |||||
| * @return RT_ERROR_INVALID_VALUE for error input | |||||
| */ | |||||
| rtError_t rtLabelCreateExV2(rtLabel_t *label, rtModel_t model, rtStream_t stream); | |||||
| /** | /** | ||||
| * @ingroup dvrt_base | * @ingroup dvrt_base | ||||
| * @brief get current thread last stream id and task id | * @brief get current thread last stream id and task id | ||||
| @@ -24,105 +24,106 @@ extern "C" { | |||||
| #endif | #endif | ||||
| #define PLAT_COMBINE(arch, chip, ver) ((arch << 16) | (chip << 8) | (ver)) | #define PLAT_COMBINE(arch, chip, ver) ((arch << 16) | (chip << 8) | (ver)) | ||||
| #define PLAT_GET_ARCH(type) ((type >> 16) & 0xffff) | |||||
| #define PLAT_GET_CHIP(type) ((type >> 8) & 0xff) | |||||
| #define PLAT_GET_VER(type) (type & 0xff) | |||||
| #define PLAT_GET_ARCH(type) ((type >> 16) & 0xffff) | |||||
| #define PLAT_GET_CHIP(type) ((type >> 8) & 0xff) | |||||
| #define PLAT_GET_VER(type) (type & 0xff) | |||||
| typedef enum tagRtArchType { | typedef enum tagRtArchType { | ||||
| ARCH_BEGIN = 0, | |||||
| ARCH_V100 = ARCH_BEGIN, | |||||
| ARCH_V200, | |||||
| ARCH_END, | |||||
| ARCH_BEGIN = 0, | |||||
| ARCH_V100 = ARCH_BEGIN, | |||||
| ARCH_V200, | |||||
| ARCH_END, | |||||
| } rtArchType_t; | } rtArchType_t; | ||||
| typedef enum tagRtChipType { | typedef enum tagRtChipType { | ||||
| CHIP_BEGIN = 0, | |||||
| CHIP_MINI = CHIP_BEGIN, | |||||
| CHIP_CLOUD, | |||||
| CHIP_MDC, | |||||
| CHIP_LHISI, | |||||
| CHIP_DC, | |||||
| CHIP_CLOUD_V2, | |||||
| CHIP_END, | |||||
| CHIP_BEGIN = 0, | |||||
| CHIP_MINI = CHIP_BEGIN, | |||||
| CHIP_CLOUD, | |||||
| CHIP_MDC, | |||||
| CHIP_LHISI, | |||||
| CHIP_DC, | |||||
| CHIP_CLOUD_V2, | |||||
| CHIP_END, | |||||
| } rtChipType_t; | } rtChipType_t; | ||||
| typedef enum tagRtVersion { | typedef enum tagRtVersion { | ||||
| VER_BEGIN = 0, | |||||
| VER_NA = VER_BEGIN, | |||||
| VER_ES, | |||||
| VER_CS, | |||||
| VER_END, | |||||
| VER_BEGIN = 0, | |||||
| VER_NA = VER_BEGIN, | |||||
| VER_ES, | |||||
| VER_CS, | |||||
| VER_SD3403, | |||||
| VER_END, | |||||
| } rtVersion_t; | } rtVersion_t; | ||||
| /* match rtChipType_t */ | /* match rtChipType_t */ | ||||
| typedef enum tagRtPlatformType { | typedef enum tagRtPlatformType { | ||||
| PLATFORM_BEGIN = 0, | |||||
| PLATFORM_MINI_V1 = PLATFORM_BEGIN, | |||||
| PLATFORM_CLOUD_V1, | |||||
| PLATFORM_MINI_V2, | |||||
| PLATFORM_LHISI_ES, | |||||
| PLATFORM_LHISI_CS, | |||||
| PLATFORM_DC, | |||||
| PLATFORM_CLOUD_V2, | |||||
| PLATFORM_END, | |||||
| PLATFORM_BEGIN = 0, | |||||
| PLATFORM_MINI_V1 = PLATFORM_BEGIN, | |||||
| PLATFORM_CLOUD_V1, | |||||
| PLATFORM_MINI_V2, | |||||
| PLATFORM_LHISI_ES, | |||||
| PLATFORM_LHISI_CS, | |||||
| PLATFORM_DC, | |||||
| PLATFORM_CLOUD_V2, | |||||
| PLATFORM_END, | |||||
| } rtPlatformType_t; | } rtPlatformType_t; | ||||
| typedef enum tagRtCubeFracMKNFp16 { | typedef enum tagRtCubeFracMKNFp16 { | ||||
| RT_CUBE_MKN_FP16_2_16_16 = 0, | |||||
| RT_CUBE_MKN_FP16_4_16_16, | |||||
| RT_CUBE_MKN_FP16_16_16_16, | |||||
| RT_CUBE_MKN_FP16_Default, | |||||
| RT_CUBE_MKN_FP16_2_16_16 = 0, | |||||
| RT_CUBE_MKN_FP16_4_16_16, | |||||
| RT_CUBE_MKN_FP16_16_16_16, | |||||
| RT_CUBE_MKN_FP16_Default, | |||||
| } rtCubeFracMKNFp16_t; | } rtCubeFracMKNFp16_t; | ||||
| typedef enum tagRtCubeFracMKNInt8 { | typedef enum tagRtCubeFracMKNInt8 { | ||||
| RT_CUBE_MKN_INT8_2_32_16 = 0, | |||||
| RT_CUBE_MKN_INT8_4_32_4, | |||||
| RT_CUBE_MKN_INT8_4_32_16, | |||||
| RT_CUBE_MKN_INT8_16_32_16, | |||||
| RT_CUBE_MKN_INT8_Default, | |||||
| RT_CUBE_MKN_INT8_2_32_16 = 0, | |||||
| RT_CUBE_MKN_INT8_4_32_4, | |||||
| RT_CUBE_MKN_INT8_4_32_16, | |||||
| RT_CUBE_MKN_INT8_16_32_16, | |||||
| RT_CUBE_MKN_INT8_Default, | |||||
| } rtCubeFracMKNInt8_t; | } rtCubeFracMKNInt8_t; | ||||
| typedef enum tagRtVecFracVmulMKNFp16 { | typedef enum tagRtVecFracVmulMKNFp16 { | ||||
| RT_VEC_VMUL_MKN_FP16_1_16_16 = 0, | |||||
| RT_VEC_VMUL_MKN_FP16_Default, | |||||
| RT_VEC_VMUL_MKN_FP16_1_16_16 = 0, | |||||
| RT_VEC_VMUL_MKN_FP16_Default, | |||||
| } rtVecFracVmulMKNFp16_t; | } rtVecFracVmulMKNFp16_t; | ||||
| typedef enum tagRtVecFracVmulMKNInt8 { | typedef enum tagRtVecFracVmulMKNInt8 { | ||||
| RT_VEC_VMUL_MKN_INT8_1_32_16 = 0, | |||||
| RT_VEC_VMUL_MKN_INT8_Default, | |||||
| RT_VEC_VMUL_MKN_INT8_1_32_16 = 0, | |||||
| RT_VEC_VMUL_MKN_INT8_Default, | |||||
| } rtVecFracVmulMKNInt8_t; | } rtVecFracVmulMKNInt8_t; | ||||
| typedef struct tagRtAiCoreSpec { | typedef struct tagRtAiCoreSpec { | ||||
| uint32_t cubeFreq; | |||||
| uint32_t cubeMSize; | |||||
| uint32_t cubeKSize; | |||||
| uint32_t cubeNSize; | |||||
| rtCubeFracMKNFp16_t cubeFracMKNFp16; | |||||
| rtCubeFracMKNInt8_t cubeFracMKNInt8; | |||||
| rtVecFracVmulMKNFp16_t vecFracVmulMKNFp16; | |||||
| rtVecFracVmulMKNInt8_t vecFracVmulMKNInt8; | |||||
| uint32_t cubeFreq; | |||||
| uint32_t cubeMSize; | |||||
| uint32_t cubeKSize; | |||||
| uint32_t cubeNSize; | |||||
| rtCubeFracMKNFp16_t cubeFracMKNFp16; | |||||
| rtCubeFracMKNInt8_t cubeFracMKNInt8; | |||||
| rtVecFracVmulMKNFp16_t vecFracVmulMKNFp16; | |||||
| rtVecFracVmulMKNInt8_t vecFracVmulMKNInt8; | |||||
| } rtAiCoreSpec_t; | } rtAiCoreSpec_t; | ||||
| typedef struct tagRtAiCoreRatesPara { | typedef struct tagRtAiCoreRatesPara { | ||||
| uint32_t ddrRate; | |||||
| uint32_t l2Rate; | |||||
| uint32_t l2ReadRate; | |||||
| uint32_t l2WriteRate; | |||||
| uint32_t l1ToL0ARate; | |||||
| uint32_t l1ToL0BRate; | |||||
| uint32_t l0CToUBRate; | |||||
| uint32_t ubToL2; | |||||
| uint32_t ubToDDR; | |||||
| uint32_t ubToL1; | |||||
| uint32_t ddrRate; | |||||
| uint32_t l2Rate; | |||||
| uint32_t l2ReadRate; | |||||
| uint32_t l2WriteRate; | |||||
| uint32_t l1ToL0ARate; | |||||
| uint32_t l1ToL0BRate; | |||||
| uint32_t l0CToUBRate; | |||||
| uint32_t ubToL2; | |||||
| uint32_t ubToDDR; | |||||
| uint32_t ubToL1; | |||||
| } rtAiCoreMemoryRates_t; | } rtAiCoreMemoryRates_t; | ||||
| typedef struct tagRtMemoryConfig { | typedef struct tagRtMemoryConfig { | ||||
| uint32_t flowtableSize; | |||||
| uint32_t compilerSize; | |||||
| uint32_t flowtableSize; | |||||
| uint32_t compilerSize; | |||||
| } rtMemoryConfig_t; | } rtMemoryConfig_t; | ||||
| typedef struct tagRtPlatformConfig { | typedef struct tagRtPlatformConfig { | ||||
| uint32_t platformConfig; | |||||
| uint32_t platformConfig; | |||||
| } rtPlatformConfig_t; | } rtPlatformConfig_t; | ||||
| /** | /** | ||||
| @@ -165,7 +166,6 @@ RTS_API rtError_t rtGetAiCoreMemoryRates(rtAiCoreMemoryRates_t *aiCoreMemoryRate | |||||
| */ | */ | ||||
| RTS_API rtError_t rtGetMemoryConfig(rtMemoryConfig_t *memoryConfig); | RTS_API rtError_t rtGetMemoryConfig(rtMemoryConfig_t *memoryConfig); | ||||
| /** | /** | ||||
| * @ingroup | * @ingroup | ||||
| * @brief get l2 buffer Info,virtual baseaddr,Size | * @brief get l2 buffer Info,virtual baseaddr,Size | ||||
| @@ -176,14 +176,16 @@ RTS_API rtError_t rtMemGetL2Info(rtStream_t stream, void **ptr, uint32_t *size); | |||||
| /** | /** | ||||
| * @ingroup | * @ingroup | ||||
| * @brief get runtime version. The version is returned as (1000 major + 10 minor). For example, RUNTIME 9.2 would be represented by 9020. | |||||
| * @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 | * @param [out] runtimeVersion | ||||
| * @return RT_ERROR_NONE for ok | * @return RT_ERROR_NONE for ok | ||||
| * @return RT_ERROR_INVALID_VALUE for error input | * @return RT_ERROR_INVALID_VALUE for error input | ||||
| */ | */ | ||||
| RTS_API rtError_t rtGetRuntimeVersion(uint32_t *runtimeVersion); | RTS_API rtError_t rtGetRuntimeVersion(uint32_t *runtimeVersion); | ||||
| #if defined(__cplusplus) && !defined(COMPILE_OMG_PACKAGE) | #if defined(__cplusplus) && !defined(COMPILE_OMG_PACKAGE) | ||||
| } | } | ||||
| #endif | #endif | ||||
| #endif // __CCE_RUNTIME_STREAM_H__ | |||||
| #endif // __CCE_RUNTIME_STREAM_H__ | |||||
| @@ -30,24 +30,24 @@ extern "C" { | |||||
| typedef void *rtContext_t; | typedef void *rtContext_t; | ||||
| typedef enum tagDryRunFlag { | typedef enum tagDryRunFlag { | ||||
| RT_DRYRUN_FLAG_FALSE = 0, | |||||
| RT_DRYRUN_FLAG_TRUE = 1, | |||||
| RT_DRYRUN_FLAG_FALSE = 0, | |||||
| RT_DRYRUN_FLAG_TRUE = 1, | |||||
| } rtDryRunFlag_t; | } rtDryRunFlag_t; | ||||
| typedef enum tagCtxMode { | typedef enum tagCtxMode { | ||||
| RT_CTX_NORMAL_MODE = 0, | |||||
| RT_CTX_GEN_MODE = 1, | |||||
| RT_CTX_NORMAL_MODE = 0, | |||||
| RT_CTX_GEN_MODE = 1, | |||||
| } rtCtxMode_t; | } rtCtxMode_t; | ||||
| typedef struct tagRtGroupInfo { | typedef struct tagRtGroupInfo { | ||||
| int32_t groupId; | |||||
| uint32_t flag; | |||||
| uint32_t aicoreNum; | |||||
| uint32_t aicpuNum; | |||||
| uint32_t aivectorNum; | |||||
| uint32_t sdmaNum; | |||||
| uint32_t activeStreamNum; | |||||
| void *extrPtr; | |||||
| int32_t groupId; | |||||
| uint32_t flag; | |||||
| uint32_t aicoreNum; | |||||
| uint32_t aicpuNum; | |||||
| uint32_t aivectorNum; | |||||
| uint32_t sdmaNum; | |||||
| uint32_t activeStreamNum; | |||||
| void *extrPtr; | |||||
| } rtGroupInfo_t; | } rtGroupInfo_t; | ||||
| /** | /** | ||||
| @@ -156,6 +156,7 @@ RTS_API rtError_t rtGetGroupCount(uint32_t *count); | |||||
| * @return RT_ERROR_NONE for ok | * @return RT_ERROR_NONE for ok | ||||
| */ | */ | ||||
| RTS_API rtError_t rtSetCtxINFMode(bool mode); | RTS_API rtError_t rtSetCtxINFMode(bool mode); | ||||
| #if defined(__cplusplus) && !defined(COMPILE_OMG_PACKAGE) | #if defined(__cplusplus) && !defined(COMPILE_OMG_PACKAGE) | ||||
| } | } | ||||
| #endif | #endif | ||||
| @@ -27,44 +27,44 @@ extern "C" { | |||||
| #define RT_CAPABILITY_NOT_SUPPORT (0x0) | #define RT_CAPABILITY_NOT_SUPPORT (0x0) | ||||
| typedef struct tagRTDeviceInfo { | typedef struct tagRTDeviceInfo { | ||||
| uint8_t env_type; // 0: FPGA 1: EMU 2: ESL | |||||
| uint32_t ctrl_cpu_ip; | |||||
| uint32_t ctrl_cpu_id; | |||||
| uint32_t ctrl_cpu_core_num; | |||||
| uint32_t ctrl_cpu_endian_little; | |||||
| uint32_t ts_cpu_core_num; | |||||
| uint32_t ai_cpu_core_num; | |||||
| uint32_t ai_core_num; | |||||
| uint32_t ai_core_freq; | |||||
| uint32_t ai_cpu_core_id; | |||||
| uint32_t ai_core_id; | |||||
| uint32_t aicpu_occupy_bitmap; | |||||
| uint32_t hardware_version; | |||||
| uint32_t ts_num; | |||||
| uint8_t env_type; // 0: FPGA 1: EMU 2: ESL | |||||
| uint32_t ctrl_cpu_ip; | |||||
| uint32_t ctrl_cpu_id; | |||||
| uint32_t ctrl_cpu_core_num; | |||||
| uint32_t ctrl_cpu_endian_little; | |||||
| uint32_t ts_cpu_core_num; | |||||
| uint32_t ai_cpu_core_num; | |||||
| uint32_t ai_core_num; | |||||
| uint32_t ai_core_freq; | |||||
| uint32_t ai_cpu_core_id; | |||||
| uint32_t ai_core_id; | |||||
| uint32_t aicpu_occupy_bitmap; | |||||
| uint32_t hardware_version; | |||||
| uint32_t ts_num; | |||||
| } rtDeviceInfo_t; | } rtDeviceInfo_t; | ||||
| typedef enum tagRtRunMode { | typedef enum tagRtRunMode { | ||||
| RT_RUN_MODE_OFFLINE = 0, | |||||
| RT_RUN_MODE_ONLINE = 1, | |||||
| RT_RUN_MODE_AICPU_SCHED = 2, | |||||
| RT_RUN_MODE_RESERVED | |||||
| RT_RUN_MODE_OFFLINE = 0, | |||||
| RT_RUN_MODE_ONLINE = 1, | |||||
| RT_RUN_MODE_AICPU_SCHED = 2, | |||||
| RT_RUN_MODE_RESERVED | |||||
| } rtRunMode; | } rtRunMode; | ||||
| typedef enum tagRtAicpuDeployType { | typedef enum tagRtAicpuDeployType { | ||||
| AICPU_DEPLOY_CROSS_OS = 0x0, | |||||
| AICPU_DEPLOY_CROSS_PROCESS = 0x1, | |||||
| AICPU_DEPLOY_CROSS_THREAD = 0x2, | |||||
| AICPU_DEPLOY_RESERVED | |||||
| AICPU_DEPLOY_CROSS_OS = 0x0, | |||||
| AICPU_DEPLOY_CROSS_PROCESS = 0x1, | |||||
| AICPU_DEPLOY_CROSS_THREAD = 0x2, | |||||
| AICPU_DEPLOY_RESERVED | |||||
| } rtAicpuDeployType_t; | } rtAicpuDeployType_t; | ||||
| typedef enum tagRtFeatureType { | typedef enum tagRtFeatureType { | ||||
| FEATURE_TYPE_MEMCPY = 0, | |||||
| FEATURE_TYPE_RSV | |||||
| FEATURE_TYPE_MEMCPY = 0, | |||||
| FEATURE_TYPE_RSV | |||||
| } rtFeatureType_t; | } rtFeatureType_t; | ||||
| typedef enum tagMemcpyInfo { | typedef enum tagMemcpyInfo { | ||||
| MEMCPY_INFO_SUPPORT_ZEROCOPY = 0, | |||||
| MEMCPY_INFO_RSV | |||||
| MEMCPY_INFO_SUPPORT_ZEROCOPY = 0, | |||||
| MEMCPY_INFO_RSV | |||||
| } rtMemcpyInfo_t; | } rtMemcpyInfo_t; | ||||
| /** | /** | ||||
| @@ -356,6 +356,7 @@ RTS_API rtError_t rtSetDeviceWithoutTsd(int32_t device); | |||||
| * @return RT_ERROR_INVALID_VALUE for error input | * @return RT_ERROR_INVALID_VALUE for error input | ||||
| */ | */ | ||||
| RTS_API rtError_t rtDeviceResetWithoutTsd(int32_t device); | RTS_API rtError_t rtDeviceResetWithoutTsd(int32_t device); | ||||
| #if defined(__cplusplus) && !defined(COMPILE_OMG_PACKAGE) | #if defined(__cplusplus) && !defined(COMPILE_OMG_PACKAGE) | ||||
| } | } | ||||
| #endif | #endif | ||||
| @@ -29,15 +29,15 @@ extern "C" { | |||||
| * @brief shared memory data control | * @brief shared memory data control | ||||
| */ | */ | ||||
| typedef struct tagRtSmData { | typedef struct tagRtSmData { | ||||
| uint64_t L2_mirror_addr; // preload or swap source address | |||||
| uint32_t L2_data_section_size; // every data size | |||||
| uint8_t L2_preload; // 1 - preload from mirrorAddr, 0 - no preload | |||||
| uint8_t modified; // 1 - data will be modified by kernel, 0 - no modified | |||||
| uint8_t priority; // data priority | |||||
| int8_t prev_L2_page_offset_base; // remap source section offset | |||||
| uint8_t L2_page_offset_base; // remap destination section offset | |||||
| uint8_t L2_load_to_ddr; // 1 - need load out, 0 - no need | |||||
| uint8_t reserved[2]; // reserved | |||||
| uint64_t L2_mirror_addr; // preload or swap source address | |||||
| uint32_t L2_data_section_size; // every data size | |||||
| uint8_t L2_preload; // 1 - preload from mirrorAddr, 0 - no preload | |||||
| uint8_t modified; // 1 - data will be modified by kernel, 0 - no modified | |||||
| uint8_t priority; // data priority | |||||
| int8_t prev_L2_page_offset_base; // remap source section offset | |||||
| uint8_t L2_page_offset_base; // remap destination section offset | |||||
| uint8_t L2_load_to_ddr; // 1 - need load out, 0 - no need | |||||
| uint8_t reserved[2]; // reserved | |||||
| } rtSmData_t; | } rtSmData_t; | ||||
| /** | /** | ||||
| @@ -45,12 +45,12 @@ typedef struct tagRtSmData { | |||||
| * @brief shared memory description | * @brief shared memory description | ||||
| */ | */ | ||||
| typedef struct tagRtSmCtrl { | typedef struct tagRtSmCtrl { | ||||
| rtSmData_t data[8]; // data description | |||||
| uint64_t size; // max page Num | |||||
| uint8_t remap[64]; /* just using for static remap mode, default:0xFF | |||||
| rtSmData_t data[8]; // data description | |||||
| uint64_t size; // max page Num | |||||
| uint8_t remap[64]; /* just using for static remap mode, default:0xFF | |||||
| array index: virtual l2 page id, array value: physic l2 page id */ | array index: virtual l2 page id, array value: physic l2 page id */ | ||||
| uint8_t l2_in_main; // 0-DDR, 1-L2, default:0xFF | |||||
| uint8_t reserved[3]; | |||||
| uint8_t l2_in_main; // 0-DDR, 1-L2, default:0xFF | |||||
| uint8_t reserved[3]; | |||||
| } rtSmDesc_t; | } rtSmDesc_t; | ||||
| typedef rtSmDesc_t rtL2Ctrl_t; | typedef rtSmDesc_t rtL2Ctrl_t; | ||||
| @@ -60,10 +60,10 @@ typedef rtSmDesc_t rtL2Ctrl_t; | |||||
| * @brief device binary type | * @brief device binary type | ||||
| */ | */ | ||||
| typedef struct tagRtDevBinary { | typedef struct tagRtDevBinary { | ||||
| uint32_t magic; // magic number | |||||
| uint32_t version; // version of binary | |||||
| const void *data; // binary data | |||||
| uint64_t length; // binary length | |||||
| uint32_t magic; // magic number | |||||
| uint32_t version; // version of binary | |||||
| const void *data; // binary data | |||||
| uint64_t length; // binary length | |||||
| } rtDevBinary_t; | } rtDevBinary_t; | ||||
| /** | /** | ||||
| @@ -73,15 +73,15 @@ typedef struct tagRtDevBinary { | |||||
| #define ONLINE_PROF_MAX_PMU_NUM (8) | #define ONLINE_PROF_MAX_PMU_NUM (8) | ||||
| typedef struct ProfilefDataInfo { | typedef struct ProfilefDataInfo { | ||||
| const void *stubFunc; | |||||
| uint32_t blockDim; | |||||
| const void *args; | |||||
| uint32_t argsSize; | |||||
| rtSmDesc_t *smDesc; | |||||
| rtStream_t stream; | |||||
| uint64_t totalcycle; | |||||
| uint64_t ovcycle; | |||||
| uint64_t pmu_cnt[ONLINE_PROF_MAX_PMU_NUM]; | |||||
| const void *stubFunc; | |||||
| uint32_t blockDim; | |||||
| const void *args; | |||||
| uint32_t argsSize; | |||||
| rtSmDesc_t *smDesc; | |||||
| rtStream_t stream; | |||||
| uint64_t totalcycle; | |||||
| uint64_t ovcycle; | |||||
| uint64_t pmu_cnt[ONLINE_PROF_MAX_PMU_NUM]; | |||||
| } rtProfDataInfo_t; | } rtProfDataInfo_t; | ||||
| /** | /** | ||||
| @@ -89,12 +89,12 @@ typedef struct ProfilefDataInfo { | |||||
| * @brief function mode type | * @brief function mode type | ||||
| */ | */ | ||||
| typedef enum { | typedef enum { | ||||
| FUNC_MODE_NORMAL = 0, | |||||
| FUNC_MODE_PCTRACE_USERPROFILE_RECORDLOOP, | |||||
| FUNC_MODE_PCTRACE_USERPROFILE_SKIPLOOP, | |||||
| FUNC_MODE_PCTRACE_CYCLECNT_RECORDLOOP, | |||||
| FUNC_MODE_PCTRACE_CYCLECNT_SKIPLOOP, | |||||
| FUNC_MODE_BUTT | |||||
| FUNC_MODE_NORMAL = 0, | |||||
| FUNC_MODE_PCTRACE_USERPROFILE_RECORDLOOP, | |||||
| FUNC_MODE_PCTRACE_USERPROFILE_SKIPLOOP, | |||||
| FUNC_MODE_PCTRACE_CYCLECNT_RECORDLOOP, | |||||
| FUNC_MODE_PCTRACE_CYCLECNT_SKIPLOOP, | |||||
| FUNC_MODE_BUTT | |||||
| } rtFuncModeType_t; | } rtFuncModeType_t; | ||||
| /** | /** | ||||
| @@ -102,23 +102,23 @@ typedef enum { | |||||
| * @brief kernel info | * @brief kernel info | ||||
| */ | */ | ||||
| typedef struct rtKernelInfo { | typedef struct rtKernelInfo { | ||||
| uint64_t task_offset; // kernel offset in module | |||||
| /* flowtable */ | |||||
| void *arg; // launch kernel arg | |||||
| uint32_t arg_size; | |||||
| /* module */ | |||||
| void *module_addr; // module::baseaddr_ | |||||
| uint32_t module_size; | |||||
| } * rtKernelInfo_t; | |||||
| uint64_t task_offset; // kernel offset in module | |||||
| /* flowtable */ | |||||
| void *arg; // launch kernel arg | |||||
| uint32_t arg_size; | |||||
| /* module */ | |||||
| void *module_addr; // module::baseaddr_ | |||||
| uint32_t module_size; | |||||
| } *rtKernelInfo_t; | |||||
| /** | /** | ||||
| * @ingroup rt_KernelConfigDump | * @ingroup rt_KernelConfigDump | ||||
| * @brief device dump type | * @brief device dump type | ||||
| */ | */ | ||||
| typedef enum tagRtDumpKind { | typedef enum tagRtDumpKind { | ||||
| RT_DATA_DUMP_KIND_INVALID = -1, | |||||
| RT_DATA_DUMP_KIND_DUMP = 0, | |||||
| RT_DATA_DUMP_KIND_RESERVED | |||||
| RT_DATA_DUMP_KIND_INVALID = -1, | |||||
| RT_DATA_DUMP_KIND_DUMP = 0, | |||||
| RT_DATA_DUMP_KIND_RESERVED | |||||
| } rtDumpKind_t; | } rtDumpKind_t; | ||||
| /** | /** | ||||
| @@ -376,7 +376,6 @@ RTS_API rtError_t rtCpuKernelLaunchWithFlag(const void *soName, const void *kern | |||||
| const void *args, uint32_t argsSize, rtSmDesc_t *smDesc, rtStream_t stream, | const void *args, uint32_t argsSize, rtSmDesc_t *smDesc, rtStream_t stream, | ||||
| uint32_t flags); | uint32_t flags); | ||||
| typedef void *rtModel_t; | |||||
| /** | /** | ||||
| * @ingroup rt_kernel | * @ingroup rt_kernel | ||||
| * @brief L1 fusion dump addr transfered to device | * @brief L1 fusion dump addr transfered to device | ||||
| @@ -414,6 +413,7 @@ RTS_API rtError_t rtDatadumpInfoLoad(const void *dumpInfo, uint32_t length); | |||||
| RTS_API rtError_t rtConfigureCall(uint32_t numBlocks, rtSmDesc_t *smDesc = nullptr, rtStream_t stream = nullptr); | RTS_API rtError_t rtConfigureCall(uint32_t numBlocks, rtSmDesc_t *smDesc = nullptr, rtStream_t stream = nullptr); | ||||
| #else | #else | ||||
| RTS_API rtError_t rtConfigureCall(uint32_t numBlocks, rtSmDesc_t *smDesc, rtStream_t stream); | RTS_API rtError_t rtConfigureCall(uint32_t numBlocks, rtSmDesc_t *smDesc, rtStream_t stream); | ||||
| #endif | #endif | ||||
| #endif // __CLANG_CCE_RUNTIME_H__ | #endif // __CLANG_CCE_RUNTIME_H__ | ||||
| @@ -90,40 +90,40 @@ typedef uint32_t rtMemType_t; | |||||
| * @brief memory copy type | * @brief memory copy type | ||||
| */ | */ | ||||
| typedef enum tagRtMemcpyKind { | typedef enum tagRtMemcpyKind { | ||||
| RT_MEMCPY_HOST_TO_HOST = 0, // host to host | |||||
| RT_MEMCPY_HOST_TO_DEVICE, // host to device | |||||
| RT_MEMCPY_DEVICE_TO_HOST, // device to host | |||||
| RT_MEMCPY_DEVICE_TO_DEVICE, // device to device, 1P && P2P | |||||
| RT_MEMCPY_MANAGED, // managed memory | |||||
| RT_MEMCPY_ADDR_DEVICE_TO_DEVICE, | |||||
| RT_MEMCPY_HOST_TO_DEVICE_EX, // host to device ex (only used for 8 bytes) | |||||
| RT_MEMCPY_DEVICE_TO_HOST_EX, // device to host ex | |||||
| RT_MEMCPY_RESERVED, | |||||
| RT_MEMCPY_HOST_TO_HOST = 0, // host to host | |||||
| RT_MEMCPY_HOST_TO_DEVICE, // host to device | |||||
| RT_MEMCPY_DEVICE_TO_HOST, // device to host | |||||
| RT_MEMCPY_DEVICE_TO_DEVICE, // device to device, 1P && P2P | |||||
| RT_MEMCPY_MANAGED, // managed memory | |||||
| RT_MEMCPY_ADDR_DEVICE_TO_DEVICE, | |||||
| RT_MEMCPY_HOST_TO_DEVICE_EX, // host to device ex (only used for 8 bytes) | |||||
| RT_MEMCPY_DEVICE_TO_HOST_EX, // device to host ex | |||||
| RT_MEMCPY_RESERVED, | |||||
| } rtMemcpyKind_t; | } rtMemcpyKind_t; | ||||
| typedef enum tagRtMemInfoType { | typedef enum tagRtMemInfoType { | ||||
| RT_MEMORYINFO_DDR, | |||||
| RT_MEMORYINFO_HBM, | |||||
| RT_MEMORYINFO_DDR_HUGE, // Hugepage memory of DDR | |||||
| RT_MEMORYINFO_DDR_NORMAL, // Normal memory of DDR | |||||
| RT_MEMORYINFO_HBM_HUGE, // Hugepage memory of HBM | |||||
| RT_MEMORYINFO_HBM_NORMAL, // Normal memory of HBM | |||||
| RT_MEMORYINFO_DDR_P2P_HUGE, // Hugepage memory of DDR | |||||
| RT_MEMORYINFO_DDR_P2P_NORMAL, // Normal memory of DDR | |||||
| RT_MEMORYINFO_HBM_P2P_HUGE, // Hugepage memory of HBM | |||||
| RT_MEMORYINFO_HBM_P2P_NORMAL, // Normal memory of HBM | |||||
| RT_MEMORYINFO_DDR, | |||||
| RT_MEMORYINFO_HBM, | |||||
| RT_MEMORYINFO_DDR_HUGE, // Hugepage memory of DDR | |||||
| RT_MEMORYINFO_DDR_NORMAL, // Normal memory of DDR | |||||
| RT_MEMORYINFO_HBM_HUGE, // Hugepage memory of HBM | |||||
| RT_MEMORYINFO_HBM_NORMAL, // Normal memory of HBM | |||||
| RT_MEMORYINFO_DDR_P2P_HUGE, // Hugepage memory of DDR | |||||
| RT_MEMORYINFO_DDR_P2P_NORMAL, // Normal memory of DDR | |||||
| RT_MEMORYINFO_HBM_P2P_HUGE, // Hugepage memory of HBM | |||||
| RT_MEMORYINFO_HBM_P2P_NORMAL, // Normal memory of HBM | |||||
| } rtMemInfoType_t; | } rtMemInfoType_t; | ||||
| typedef enum tagRtRecudeKind { | typedef enum tagRtRecudeKind { | ||||
| RT_MEMCPY_SDMA_AUTOMATIC_ADD = 10, // D2D, SDMA inline reduce, include 1P, and P2P | |||||
| RT_RECUDE_KIND_END | |||||
| RT_MEMCPY_SDMA_AUTOMATIC_ADD = 10, // D2D, SDMA inline reduce, include 1P, and P2P | |||||
| RT_RECUDE_KIND_END | |||||
| } rtRecudeKind_t; | } rtRecudeKind_t; | ||||
| typedef enum tagRtDataType { | typedef enum tagRtDataType { | ||||
| RT_DATA_TYPE_FP32 = 0, // fp32 | |||||
| RT_DATA_TYPE_FP16 = 1, // fp16 | |||||
| RT_DATA_TYPE_INT16 = 2, // int16 | |||||
| RT_DATA_TYPE_END | |||||
| RT_DATA_TYPE_FP32 = 0, // fp32 | |||||
| RT_DATA_TYPE_FP16 = 1, // fp16 | |||||
| RT_DATA_TYPE_INT16 = 2, // int16 | |||||
| RT_DATA_TYPE_END | |||||
| } rtDataType_t; | } rtDataType_t; | ||||
| /** | /** | ||||
| @@ -131,10 +131,10 @@ typedef enum tagRtDataType { | |||||
| * @brief memory copy channel type | * @brief memory copy channel type | ||||
| */ | */ | ||||
| typedef enum tagRtMemcpyChannelType { | typedef enum tagRtMemcpyChannelType { | ||||
| RT_MEMCPY_CHANNEL_TYPE_INNER = 0, // 1P | |||||
| RT_MEMCPY_CHANNEL_TYPE_PCIe, | |||||
| RT_MEMCPY_CHANNEL_TYPE_HCCs, // not support now | |||||
| RT_MEMCPY_CHANNEL_TYPE_RESERVED, | |||||
| RT_MEMCPY_CHANNEL_TYPE_INNER = 0, // 1P | |||||
| RT_MEMCPY_CHANNEL_TYPE_PCIe, | |||||
| RT_MEMCPY_CHANNEL_TYPE_HCCs, // not support now | |||||
| RT_MEMCPY_CHANNEL_TYPE_RESERVED, | |||||
| } rtMemcpyChannelType_t; | } rtMemcpyChannelType_t; | ||||
| /** | /** | ||||
| @@ -142,18 +142,18 @@ typedef enum tagRtMemcpyChannelType { | |||||
| * @brief ai core memory size | * @brief ai core memory size | ||||
| */ | */ | ||||
| typedef struct rtAiCoreMemorySize { | typedef struct rtAiCoreMemorySize { | ||||
| uint32_t l0ASize; | |||||
| uint32_t l0BSize; | |||||
| uint32_t l0CSize; | |||||
| uint32_t l1Size; | |||||
| uint32_t ubSize; | |||||
| uint32_t l2Size; | |||||
| uint32_t l2PageNum; | |||||
| uint32_t blockSize; | |||||
| uint64_t bankSize; | |||||
| uint64_t bankNum; | |||||
| uint64_t burstInOneBlock; | |||||
| uint64_t bankGroupNum; | |||||
| uint32_t l0ASize; | |||||
| uint32_t l0BSize; | |||||
| uint32_t l0CSize; | |||||
| uint32_t l1Size; | |||||
| uint32_t ubSize; | |||||
| uint32_t l2Size; | |||||
| uint32_t l2PageNum; | |||||
| uint32_t blockSize; | |||||
| uint64_t bankSize; | |||||
| uint64_t bankNum; | |||||
| uint64_t burstInOneBlock; | |||||
| uint64_t bankGroupNum; | |||||
| } rtAiCoreMemorySize_t; | } rtAiCoreMemorySize_t; | ||||
| /** | /** | ||||
| @@ -161,10 +161,10 @@ typedef struct rtAiCoreMemorySize { | |||||
| * @brief memory type | * @brief memory type | ||||
| */ | */ | ||||
| typedef enum tagRtMemoryType { | typedef enum tagRtMemoryType { | ||||
| RT_MEMORY_TYPE_HOST = 1, | |||||
| RT_MEMORY_TYPE_DEVICE = 2, | |||||
| RT_MEMORY_TYPE_SVM = 3, | |||||
| RT_MEMORY_TYPE_DVPP = 4 | |||||
| RT_MEMORY_TYPE_HOST = 1, | |||||
| RT_MEMORY_TYPE_DEVICE = 2, | |||||
| RT_MEMORY_TYPE_SVM = 3, | |||||
| RT_MEMORY_TYPE_DVPP = 4 | |||||
| } rtMemoryType_t; | } rtMemoryType_t; | ||||
| /** | /** | ||||
| @@ -172,31 +172,31 @@ typedef enum tagRtMemoryType { | |||||
| * @brief memory attribute | * @brief memory attribute | ||||
| */ | */ | ||||
| typedef struct tagRtPointerAttributes { | typedef struct tagRtPointerAttributes { | ||||
| rtMemoryType_t memoryType; // host memory or device memory | |||||
| rtMemoryType_t locationType; | |||||
| uint32_t deviceID; // device ID | |||||
| uint32_t pageSize; | |||||
| rtMemoryType_t memoryType; // host memory or device memory | |||||
| rtMemoryType_t locationType; | |||||
| uint32_t deviceID; // device ID | |||||
| uint32_t pageSize; | |||||
| } rtPointerAttributes_t; | } rtPointerAttributes_t; | ||||
| typedef struct rtMallocHostSharedMemoryIn { | typedef struct rtMallocHostSharedMemoryIn { | ||||
| const char *name; | |||||
| const uint64_t size; | |||||
| uint32_t flag; | |||||
| const char *name; | |||||
| const uint64_t size; | |||||
| uint32_t flag; | |||||
| } rtMallocHostSharedMemoryIn; | } rtMallocHostSharedMemoryIn; | ||||
| typedef struct rtMallocHostSharedMemoryOut { | typedef struct rtMallocHostSharedMemoryOut { | ||||
| int fd; | |||||
| void *ptr; | |||||
| void *devPtr; | |||||
| int fd; | |||||
| void *ptr; | |||||
| void *devPtr; | |||||
| } rtMallocHostSharedMemoryOut; | } rtMallocHostSharedMemoryOut; | ||||
| typedef struct rtFreeHostSharedMemoryIn { | typedef struct rtFreeHostSharedMemoryIn { | ||||
| const char *name; | |||||
| const uint64_t size; | |||||
| int fd; | |||||
| void *ptr; | |||||
| void *devPtr; | |||||
| const char *name; | |||||
| const uint64_t size; | |||||
| int fd; | |||||
| void *ptr; | |||||
| void *devPtr; | |||||
| } rtFreeHostSharedMemoryIn; | } rtFreeHostSharedMemoryIn; | ||||
| @@ -278,7 +278,6 @@ typedef struct tagLabelDevInfo_t { | |||||
| uint16_t labelId; | uint16_t labelId; | ||||
| }rtLabelDevInfo; | }rtLabelDevInfo; | ||||
| typedef void *rtModel_t; | |||||
| typedef rtError_t (*rtTaskGenCallback)(rtModel_t model, rtTaskInfo_t *taskInfo); | typedef rtError_t (*rtTaskGenCallback)(rtModel_t model, rtTaskInfo_t *taskInfo); | ||||
| /** | /** | ||||
| @@ -15,23 +15,23 @@ | |||||
| extern "C" { | extern "C" { | ||||
| struct SoftDpProcsessInfo { | struct SoftDpProcsessInfo { | ||||
| uint8_t* inputBuffer; | |||||
| uint32_t inputBufferSize; | |||||
| uint8_t* inputBuffer; | |||||
| uint32_t inputBufferSize; | |||||
| uint8_t* outputBuffer; | |||||
| uint32_t outputBufferSize; | |||||
| uint8_t* outputBuffer; | |||||
| uint32_t outputBufferSize; | |||||
| uint32_t outputWidth; | |||||
| uint32_t outputHeight; | |||||
| uint32_t outputWidth; | |||||
| uint32_t outputHeight; | |||||
| uint32_t reserved; | |||||
| uint32_t reserved; | |||||
| }; | }; | ||||
| struct DpCropInfo { | struct DpCropInfo { | ||||
| uint32_t left; | |||||
| uint32_t right; | |||||
| uint32_t up; | |||||
| uint32_t down; | |||||
| uint32_t left; | |||||
| uint32_t right; | |||||
| uint32_t up; | |||||
| uint32_t down; | |||||
| }; | }; | ||||
| /* | /* | ||||
| @@ -49,4 +49,4 @@ uint32_t DecodeAndResizeJpeg(SoftDpProcsessInfo& softDpProcsessInfo); | |||||
| */ | */ | ||||
| uint32_t DecodeAndCropAndResizeJpeg(SoftDpProcsessInfo& softDpProcsessInfo, const DpCropInfo& cropInfo); | uint32_t DecodeAndCropAndResizeJpeg(SoftDpProcsessInfo& softDpProcsessInfo, const DpCropInfo& cropInfo); | ||||
| } | } | ||||
| #endif // EXTERNALSOFTDP_H | |||||
| #endif // EXTERNALSOFTDP_H | |||||
| @@ -61,7 +61,7 @@ int32_t TdtHostInit(uint32_t deviceId); | |||||
| * @li tdt_host_interface.h: Header file where the interface declaration is located. | * @li tdt_host_interface.h: Header file where the interface declaration is located. | ||||
| * @li data_common.h: Header file where 'DataItem' defined | * @li data_common.h: Header file where 'DataItem' defined | ||||
| */ | */ | ||||
| int32_t TdtHostPushData(const std::string &channelName, const std::vector<DataItem> &item); | |||||
| int32_t TdtHostPushData(const std::string &channelName, const std::vector<DataItem> &item, uint32_t deviceId = 0); | |||||
| /** | /** | ||||
| * @ingroup TdtHostDestroy | * @ingroup TdtHostDestroy | ||||
| @@ -203,25 +203,6 @@ int32_t TdtInFeedDestroy(uint32_t deviceId); | |||||
| * @li tdt_host_interface.h: Header file where the interface declaration is located. | * @li tdt_host_interface.h: Header file where the interface declaration is located. | ||||
| */ | */ | ||||
| int32_t TdtOutFeedDestroy(); | int32_t TdtOutFeedDestroy(); | ||||
| /** | |||||
| * @ingroup TdtInFeedData | |||||
| * @brief Blocking queue. When the queue is full, the Push interface will block. | |||||
| * | |||||
| * @par Function | |||||
| * Blocking queue. When the queue is full, the Push interface will block. | |||||
| * | |||||
| * @param channelName [IN] type #String. queue channel name | |||||
| * @param items [IN] type #vector<DataItem> DataItem is defined in data_common.h. input data | |||||
| * @retval 0 Success | |||||
| * @retval OtherValues 0 Fail | |||||
| * | |||||
| * @par Dependency | |||||
| * @li libtsdclient.so: Library to which the interface belongs. | |||||
| * @li tdt_host_interface.h: Header file where the interface declaration is located. | |||||
| * @li data_common.h: Header file where 'DataItem' defined | |||||
| */ | |||||
| int32_t TdtInFeedData(const std::string &channelName, const std::vector<DataItem> &item, uint32_t deviceId); | |||||
| } // namespace tdt | } // namespace tdt | ||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| } | } | ||||
| @@ -120,15 +120,15 @@ typedef struct tagKV { | |||||
| } KeyValue; | } KeyValue; | ||||
| typedef enum { | typedef enum { | ||||
| APPLICATION = 0, | |||||
| SYSTEM | |||||
| APPLICATION = 0, | |||||
| SYSTEM | |||||
| } ProcessType; | } ProcessType; | ||||
| typedef struct { | typedef struct { | ||||
| ProcessType type; | |||||
| unsigned int pid; | |||||
| unsigned int deviceId; | |||||
| char reserved[RESERVERD_LENGTH]; | |||||
| ProcessType type; | |||||
| unsigned int pid; | |||||
| unsigned int deviceId; | |||||
| char reserved[RESERVERD_LENGTH]; | |||||
| } LogAttr; | } LogAttr; | ||||
| /** | /** | ||||
| @@ -1,72 +1,72 @@ | |||||
| /** | |||||
| * @file tune_api.h | |||||
| * | |||||
| * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.\n | |||||
| * | |||||
| * 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调优接口头文件 | |||||
| */ | |||||
| /** @defgroup mstune mstune调优接口 */ | |||||
| #ifndef TUNE_API_H | |||||
| #define TUNE_API_H | |||||
| #include <vector> | |||||
| #include <map> | |||||
| #include <string> | |||||
| #include "graph/graph.h" | |||||
| #include "ge/ge_api.h" | |||||
| /** | |||||
| * @ingroup mstune | |||||
| * | |||||
| * mstune status | |||||
| */ | |||||
| enum MsTuneStatus { | |||||
| MSTUNE_SUCCESS, /** tune success */ | |||||
| MSTUNE_FAILED, /** tune failed */ | |||||
| }; | |||||
| // Option key: for train options sets | |||||
| const std::string MSTUNE_SELF_KEY = "mstune"; | |||||
| const std::string MSTUNE_GEINIT_KEY = "initialize"; | |||||
| const std::string MSTUNE_GESESS_KEY = "session"; | |||||
| /** | |||||
| * @ingroup mstune | |||||
| * @par 描述: 命令行调优 | |||||
| * | |||||
| * @attention 无 | |||||
| * @param option [IN] 调优参数 | |||||
| * @param msg [OUT] 调优异常下返回信息 | |||||
| * @retval #MSTUNE_SUCCESS 执行成功 | |||||
| * @retval #MSTUNE_FAILED 执行失败 | |||||
| * @par 依赖: | |||||
| * @li tune_api.cpp:该接口所属的开发包。 | |||||
| * @li tune_api.h:该接口声明所在的头文件。 | |||||
| * @see 无 | |||||
| * @since | |||||
| */ | |||||
| MsTuneStatus MsTuning(const std::map<std::string, std::string> &option, std::string &msg); | |||||
| /** | |||||
| * @ingroup mstune | |||||
| * @par 描述: 梯度调优 | |||||
| * | |||||
| * @attention 无 | |||||
| * @param tuningGraph [IN] 调优图 | |||||
| * @param dependGraph [IN] 调优依赖图 | |||||
| * @param session [IN] ge连接会话 | |||||
| * @param option [IN] 参数集. 包含调优参数及ge参数 | |||||
| * @retval #MSTUNE_SUCCESS 执行成功 | |||||
| * @retval #MSTUNE_FAILED 执行失败 | |||||
| * @par 依赖: | |||||
| * @li tune_api.cpp:该接口所属的开发包。 | |||||
| * @li tune_api.h:该接口声明所在的头文件。 | |||||
| * @see 无 | |||||
| * @since | |||||
| */ | |||||
| extern "C" MsTuneStatus MsTrainTuning(ge::Graph &tuningGraph, std::vector<ge::Graph> &dependGraph, | |||||
| ge::Session *session, const std::map<std::string, std::map<std::string, std::string>> &option); | |||||
| #endif | |||||
| /** | |||||
| * @file tune_api.h | |||||
| * | |||||
| * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.\n | |||||
| * | |||||
| * 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调优接口头文件 | |||||
| */ | |||||
| /** @defgroup mstune mstune调优接口 */ | |||||
| #ifndef TUNE_API_H | |||||
| #define TUNE_API_H | |||||
| #include <vector> | |||||
| #include <map> | |||||
| #include <string> | |||||
| #include "graph/graph.h" | |||||
| #include "ge/ge_api.h" | |||||
| /** | |||||
| * @ingroup mstune | |||||
| * | |||||
| * mstune status | |||||
| */ | |||||
| enum MsTuneStatus { | |||||
| MSTUNE_SUCCESS, /** tune success */ | |||||
| MSTUNE_FAILED, /** tune failed */ | |||||
| }; | |||||
| // Option key: for train options sets | |||||
| const std::string MSTUNE_SELF_KEY = "mstune"; | |||||
| const std::string MSTUNE_GEINIT_KEY = "initialize"; | |||||
| const std::string MSTUNE_GESESS_KEY = "session"; | |||||
| /** | |||||
| * @ingroup mstune | |||||
| * @par 描述: 命令行调优 | |||||
| * | |||||
| * @attention 无 | |||||
| * @param option [IN] 调优参数 | |||||
| * @param msg [OUT] 调优异常下返回信息 | |||||
| * @retval #MSTUNE_SUCCESS 执行成功 | |||||
| * @retval #MSTUNE_FAILED 执行失败 | |||||
| * @par 依赖: | |||||
| * @li tune_api.cpp:该接口所属的开发包。 | |||||
| * @li tune_api.h:该接口声明所在的头文件。 | |||||
| * @see 无 | |||||
| * @since | |||||
| */ | |||||
| MsTuneStatus MsTuning(const std::map<std::string, std::string> &option, std::string &msg); | |||||
| /** | |||||
| * @ingroup mstune | |||||
| * @par 描述: 梯度调优 | |||||
| * | |||||
| * @attention 无 | |||||
| * @param tuningGraph [IN] 调优图 | |||||
| * @param dependGraph [IN] 调优依赖图 | |||||
| * @param session [IN] ge连接会话 | |||||
| * @param option [IN] 参数集. 包含调优参数及ge参数 | |||||
| * @retval #MSTUNE_SUCCESS 执行成功 | |||||
| * @retval #MSTUNE_FAILED 执行失败 | |||||
| * @par 依赖: | |||||
| * @li tune_api.cpp:该接口所属的开发包。 | |||||
| * @li tune_api.h:该接口声明所在的头文件。 | |||||
| * @see 无 | |||||
| * @since | |||||
| */ | |||||
| extern "C" MsTuneStatus MsTrainTuning(ge::Graph &tuningGraph, std::vector<ge::Graph> &dependGraph, | |||||
| ge::Session *session, const std::map<std::string, std::map<std::string, std::string>> &option); | |||||
| #endif | |||||