| @@ -17,10 +17,10 @@ | |||
| #ifndef _MMPA_API_H_ | |||
| #define _MMPA_API_H_ | |||
| #define LINUX 0 | |||
| #define WIN 1 | |||
| #define LINUX 0 | |||
| #define WIN 1 | |||
| #if(OS_TYPE == LINUX) | |||
| #if(OS_TYPE == LINUX) //lint !e553 | |||
| #ifndef _GNU_SOURCE | |||
| #define _GNU_SOURCE | |||
| @@ -75,6 +75,7 @@ | |||
| #include <sys/wait.h> | |||
| #include <sys/statvfs.h> | |||
| #include <sys/prctl.h> | |||
| #include <sys/inotify.h> | |||
| #include "securec.h" | |||
| @@ -84,7 +85,7 @@ | |||
| #endif | |||
| #if(OS_TYPE == WIN) | |||
| #if(OS_TYPE == WIN) //lint !e553 | |||
| #include <winsock2.h> | |||
| #include <winsock.h> | |||
| #include "Windows.h" | |||
| @@ -103,16 +104,19 @@ | |||
| #include <stdarg.h> | |||
| #include "shlwapi.h" | |||
| #include <direct.h> | |||
| #include "sub_inc/mmpa_typedef_win.h" | |||
| #include "sub_inc/mmpa_win.h" | |||
| #include <VersionHelpers.h> | |||
| #include <processthreadsapi.h> | |||
| #include <Wbemidl.h> | |||
| #include <iphlpapi.h> | |||
| #include <synchapi.h> | |||
| #include <sys/types.h> | |||
| #include <sys/stat.h> | |||
| #include "securec.h" | |||
| #include "sub_inc/mmpa_typedef_win.h" | |||
| #include "sub_inc/mmpa_win.h" | |||
| #pragma comment(lib, "ws2_32.lib") | |||
| #pragma comment(lib, "mswsock.lib") | |||
| #pragma comment(lib, "Kernel32.lib") | |||
| @@ -30,18 +30,26 @@ typedef pthread_t mmThread; | |||
| typedef pthread_mutex_t mmMutex_t; | |||
| typedef pthread_cond_t mmCond; | |||
| typedef pthread_mutex_t mmMutexFC; | |||
| typedef pthread_rwlock_t mmRWLock_t; | |||
| typedef signed int mmProcess; | |||
| typedef int mmPollHandle; | |||
| typedef int mmPipeHandle; | |||
| typedef int mmFileHandle; | |||
| typedef int mmComPletionKey; | |||
| typedef int mmCompletionHandle; | |||
| typedef int mmErrorMsg; | |||
| typedef int mmFd_t; | |||
| typedef VOID *mmExitCode; | |||
| typedef key_t mmKey_t; | |||
| typedef int mmMsgid; | |||
| typedef struct dirent mmDirent; | |||
| typedef struct shmid_ds mmshmId_ds; | |||
| typedef int (*mmFilter)(const mmDirent *entry); | |||
| typedef int (*mmSort)(const mmDirent **a, const mmDirent **b); | |||
| typedef size_t mmSize_t; | |||
| typedef off_t mmOfft_t; | |||
| typedef pid_t mmPid_t; | |||
| typedef VOID *(*userProcFunc)(VOID *pulArg); | |||
| @@ -50,6 +58,16 @@ typedef struct { | |||
| VOID *pulArg; // Callback function parameters | |||
| } mmUserBlock_t; | |||
| typedef struct { | |||
| const char *dli_fname; | |||
| void *dli_fbase; | |||
| const char *dli_sname; | |||
| void *dli_saddr; | |||
| size_t dli_size; /* ELF only */ | |||
| int dli_bind; /* ELF only */ | |||
| int dli_type; | |||
| } mmDlInfo; | |||
| typedef struct { | |||
| int wSecond; // Seconds. [0-60] (1 leap second) | |||
| int wMinute; // Minutes. [0-59] | |||
| @@ -73,6 +91,7 @@ typedef pthread_key_t mmThreadKey; | |||
| typedef int mmOverLap; | |||
| typedef ssize_t mmSsize_t; | |||
| typedef size_t mmSize; // size | |||
| typedef struct { | |||
| UINT32 createFlag; | |||
| @@ -201,6 +220,17 @@ typedef struct { | |||
| #define M_RDWR O_RDWR | |||
| #define M_CREAT O_CREAT | |||
| #define M_BINARY O_RDONLY | |||
| #define M_TRUNC O_TRUNC | |||
| #define M_IRWXU S_IRWXU | |||
| #define M_IN_CREATE IN_CREATE | |||
| #define M_IN_CLOSE_WRITE IN_CLOSE_WRITE | |||
| #define M_IN_IGNORED IN_IGNORED | |||
| #define M_OUT_CREATE IN_CREATE | |||
| #define M_OUT_CLOSE_WRITE IN_CLOSE_WRITE | |||
| #define M_OUT_IGNORED IN_IGNORED | |||
| #define M_OUT_ISDIR IN_ISDIR | |||
| #define M_IREAD S_IREAD | |||
| #define M_IRUSR S_IRUSR | |||
| @@ -236,13 +266,20 @@ typedef struct { | |||
| #define MMPA_OPTIONAL_ARGUMENT 2 | |||
| #define MMPA_MAX_PATH PATH_MAX | |||
| #define M_NAME_MAX MAX_FNAME | |||
| #define M_F_OK F_OK | |||
| #define M_R_OK R_OK | |||
| #define M_W_OK W_OK | |||
| #define MMPA_STDIN STDIN_FILENO | |||
| #define MMPA_STDOUT STDOUT_FILENO | |||
| #define MMPA_STDERR STDERR_FILENO | |||
| #define MMPA_RTLD_NOW RTLD_NOW | |||
| #define MMPA_RTLD_GLOBAL RTLD_GLOBAL | |||
| #define MMPA_RTLD_LAZY RTLD_LAZY | |||
| #define MMPA_RTLD_NODELETE RTLD_NODELETE | |||
| #define MMPA_DL_EXT_NAME ".so" | |||
| @@ -250,6 +287,7 @@ extern INT32 mmCreateTask(mmThread *threadHandle, mmUserBlock_t *funcBlock); | |||
| extern INT32 mmJoinTask(mmThread *threadHandle); | |||
| extern INT32 mmMutexInit(mmMutex_t *mutex); | |||
| extern INT32 mmMutexLock(mmMutex_t *mutex); | |||
| extern INT32 mmMutexTryLock(mmMutex_t *mutex); | |||
| extern INT32 mmMutexUnLock(mmMutex_t *mutex); | |||
| extern INT32 mmMutexDestroy(mmMutex_t *mutex); | |||
| extern INT32 mmCondInit(mmCond *cond); | |||
| @@ -257,6 +295,14 @@ extern INT32 mmCondLockInit(mmMutexFC *mutex); | |||
| extern INT32 mmCondLock(mmMutexFC *mutex); | |||
| extern INT32 mmCondUnLock(mmMutexFC *mutex); | |||
| extern INT32 mmCondLockDestroy(mmMutexFC *mutex); | |||
| extern INT32 mmRWLockInit(mmRWLock_t *rwLock); | |||
| extern INT32 mmRWLockRDLock(mmRWLock_t *rwLock); | |||
| extern INT32 mmRWLockTryRDLock(mmRWLock_t *rwLock); | |||
| extern INT32 mmRWLockWRLock(mmRWLock_t *rwLock); | |||
| extern INT32 mmRWLockTryWRLock(mmRWLock_t *rwLock); | |||
| extern INT32 mmRDLockUnLock(mmRWLock_t *rwLock); | |||
| extern INT32 mmWRLockUnLock(mmRWLock_t *rwLock); | |||
| extern INT32 mmRWLockDestroy(mmRWLock_t *rwLock); | |||
| extern INT32 mmCondWait(mmCond *cond, mmMutexFC *mutex); | |||
| extern INT32 mmCondTimedWait(mmCond *cond, mmMutexFC *mutex, UINT32 milliSecond); | |||
| extern INT32 mmCondNotify(mmCond *cond); | |||
| @@ -266,6 +312,7 @@ extern INT32 mmGetPid(); | |||
| extern INT32 mmGetTid(); | |||
| extern INT32 mmGetPidHandle(mmProcess *processHandle); | |||
| extern INT32 mmGetLocalTime(mmSystemTime_t *sysTime); | |||
| extern INT32 mmGetSystemTime(mmSystemTime_t *sysTime); | |||
| extern INT32 mmSemInit(mmSem_t *sem, UINT32 value); | |||
| extern INT32 mmSemWait(mmSem_t *sem); | |||
| @@ -273,7 +320,9 @@ extern INT32 mmSemPost(mmSem_t *sem); | |||
| extern INT32 mmSemDestroy(mmSem_t *sem); | |||
| extern INT32 mmOpen(const CHAR *pathName, INT32 flags); | |||
| extern INT32 mmOpen2(const CHAR *pathName, INT32 flags, MODE mode); | |||
| extern FILE *mmPopen(CHAR *command, CHAR *type); | |||
| extern INT32 mmClose(INT32 fd); | |||
| extern INT32 mmPclose(FILE *stream); | |||
| extern mmSsize_t mmWrite(INT32 fd, VOID *buf, UINT32 bufLen); | |||
| extern mmSsize_t mmRead(INT32 fd, VOID *buf, UINT32 bufLen); | |||
| extern mmSockHandle mmSocket(INT32 sockFamily, INT32 type, INT32 protocol); | |||
| @@ -284,9 +333,22 @@ extern INT32 mmConnect(mmSockHandle sockFd, mmSockAddr *addr, mmSocklen_t addrLe | |||
| extern INT32 mmCloseSocket(mmSockHandle sockFd); | |||
| extern mmSsize_t mmSocketSend(mmSockHandle sockFd, VOID *sendBuf, INT32 sendLen, INT32 sendFlag); | |||
| extern mmSsize_t mmSocketRecv(mmSockHandle sockFd, VOID *recvBuf, INT32 recvLen, INT32 recvFlag); | |||
| extern INT32 mmSocketSendTo(mmSockHandle sockFd, | |||
| VOID *sendMsg, | |||
| INT32 sendLen, | |||
| UINT32 sendFlag, | |||
| const mmSockAddr* addr, | |||
| INT32 tolen); | |||
| extern mmSsize_t mmSocketRecvFrom(mmSockHandle sockFd, | |||
| VOID *recvBuf, | |||
| mmSize recvLen, | |||
| UINT32 recvFlag, | |||
| mmSockAddr* addr, | |||
| mmSocklen_t *FromLen); | |||
| extern INT32 mmSAStartup(); | |||
| extern INT32 mmSACleanup(); | |||
| extern VOID *mmDlopen(const CHAR *fileName, INT32 mode); | |||
| extern INT32 mmDladdr(VOID *addr, mmDlInfo *info); | |||
| extern VOID *mmDlsym(VOID *handle, CHAR *funcName); | |||
| extern INT32 mmDlclose(VOID *handle); | |||
| extern CHAR *mmDlerror(); | |||
| @@ -294,6 +356,7 @@ extern INT32 mmCreateAndSetTimer(mmTimer *timerHandle, mmUserBlock_t *timerBlock | |||
| extern INT32 mmDeleteTimer(mmTimer timerHandle); | |||
| extern INT32 mmStatGet(const CHAR *path, mmStat_t *buffer); | |||
| extern INT32 mmStat64Get(const CHAR *path, mmStat64_t *buffer); | |||
| extern INT32 mmFStatGet(INT32 fd, mmStat_t *buffer); | |||
| extern INT32 mmMkdir(const CHAR *pathName, mmMode_t mode); | |||
| extern INT32 mmSleep(UINT32 milliSecond); | |||
| @@ -337,6 +400,7 @@ extern VOID mmCloseCompletionPort(mmCompletionHandle handle); | |||
| extern INT32 mmPoll(mmPollfd *fds, INT32 fdCount, INT32 timeout, mmCompletionHandle handleIOCP, pmmPollData polledData, | |||
| mmPollBack pollBack); | |||
| extern INT32 mmGetErrorCode(); | |||
| extern CHAR *mmGetErrorFormatMessage(mmErrorMsg errnum, CHAR *buf, mmSize size); | |||
| extern INT32 mmGetTimeOfDay(mmTimeval *timeVal, mmTimezone *timeZone); | |||
| extern mmTimespec mmGetTickCount(); | |||
| extern INT32 mmGetRealPath(CHAR *path, CHAR *realPath); | |||
| @@ -382,6 +446,7 @@ extern INT32 mmTlsDelete(mmThreadKey key); | |||
| extern INT32 mmGetOsType(); | |||
| extern INT32 mmFsync(mmProcess fd); | |||
| extern INT32 mmFsync2(INT32 fd); | |||
| extern INT32 mmChdir(const CHAR *path); | |||
| extern INT32 mmUmask(INT32 pmode); | |||
| extern INT32 mmThreadKill(mmThread id); | |||
| @@ -439,6 +504,10 @@ extern INT32 mmCreateProcess(const CHAR *fileName, const mmArgvEnv *env, const c | |||
| extern INT32 mmCreateTaskWithThreadAttr(mmThread *threadHandle, const mmUserBlock_t *funcBlock, | |||
| const mmThreadAttr *threadAttr); | |||
| extern mmFileHandle mmShmOpen(const CHAR *name, INT32 oflag, mmMode_t mode); | |||
| extern INT32 mmShmUnlink(const CHAR *name); | |||
| extern VOID *mmMmap(mmFd_t fd, mmSize_t size, mmOfft_t offset, mmFd_t *extra, INT32 prot, INT32 flags); | |||
| extern INT32 mmMunMap(VOID *data, mmSize_t size, mmFd_t *extra); | |||
| #define MMPA_DLL_API | |||
| #ifdef __cplusplus | |||
| @@ -79,6 +79,8 @@ typedef long LONG; | |||
| #define MMPA_THREAD_SCHED_OTHER SCHED_OTHER | |||
| #define MMPA_THREAD_MIN_STACK_SIZE PTHREAD_STACK_MIN | |||
| #define MM_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER | |||
| #define MMPA_MAX_NI 19 | |||
| #define MMPA_MIN_NI (-20) | |||
| @@ -86,6 +88,7 @@ typedef long LONG; | |||
| #define EN_ERR 1 | |||
| #define EN_ERROR (-1) | |||
| #define EN_INVALID_PARAM (-2) | |||
| #define EN_TIMEOUT (-3) | |||
| #ifdef __cplusplus | |||
| #if __cplusplus | |||
| @@ -1,4 +1,4 @@ | |||
| /** | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * | |||
| * Licensed under the Apache License, Version 2.0 (the "License"); | |||
| @@ -35,6 +35,7 @@ extern "C" { | |||
| #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 | |||
| @@ -60,6 +61,7 @@ extern "C" { | |||
| #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 | |||
| @@ -71,6 +73,8 @@ extern "C" { | |||
| #define MMPA_THREAD_SCHED_OTHER 0 | |||
| #define MMPA_THREAD_MIN_STACK_SIZE 0 | |||
| #define MM_MUTEX_INITIALIZER NULL | |||
| #ifdef __cplusplus | |||
| #if __cplusplus | |||
| } | |||
| @@ -1,4 +1,4 @@ | |||
| /** | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * | |||
| * Licensed under the Apache License, Version 2.0 (the "License"); | |||
| @@ -43,8 +43,9 @@ typedef HANDLE mmThread; | |||
| typedef HANDLE mmProcess; | |||
| typedef HANDLE mmPollHandle; | |||
| typedef HANDLE mmPipeHandle; | |||
| typedef HANDLE mmFileHandle; | |||
| typedef HANDLE mmCompletionHandle; | |||
| typedef HANDLE mmFd_t; | |||
| typedef CRITICAL_SECTION mmMutexFC; | |||
| typedef CONDITION_VARIABLE mmCond; | |||
| @@ -59,15 +60,22 @@ typedef SYSTEMTIME mmSystemTime_t; | |||
| typedef HANDLE mmSem_t; | |||
| typedef SOCKET mmSockHandle; | |||
| typedef SRWLOCK mmRWLock_t; | |||
| typedef struct sockaddr mmSockAddr; | |||
| typedef int mmSocklen_t; | |||
| typedef int mmSemTimeout_t; | |||
| typedef long mmAtomicType; | |||
| typedef DWORD mmExitCode; | |||
| typedef DWORD mmErrorMsg; | |||
| typedef int mmKey_t; | |||
| typedef HANDLE mmMsgid; | |||
| typedef long int mmOfft_t; | |||
| typedef int mmPid_t; | |||
| typedef INT32 mmSsize_t; | |||
| typedef int mmSize; // size | |||
| typedef size_t mmSize_t; | |||
| typedef VOID mmshmId_ds; | |||
| typedef enum { | |||
| DT_DIR = FILE_ATTRIBUTE_DIRECTORY, | |||
| @@ -181,6 +189,16 @@ typedef struct { | |||
| ULONGLONG availSize; | |||
| } mmDiskSize; | |||
| typedef struct { | |||
| const char *dli_fname; | |||
| void *dli_fbase; | |||
| const char *dli_sname; | |||
| void *dli_saddr; | |||
| size_t dli_size; /* ELF only */ | |||
| int dli_bind; /* ELF only */ | |||
| int dli_type; | |||
| } mmDlInfo; | |||
| typedef struct { | |||
| char addr[MMPA_MACINFO_DEFAULT_SIZE]; // ex:aa-bb-cc-dd-ee-ff\0 | |||
| } mmMacInfo; | |||
| @@ -223,8 +241,10 @@ typedef VOID (*mmPf)(VOID); | |||
| #define M_RDONLY _O_RDONLY | |||
| #define M_WRONLY _O_WRONLY | |||
| #define M_RDWR _O_RDWR | |||
| #define M_IRWXU _O_RDWR | |||
| #define M_CREAT _O_CREAT | |||
| #define M_BINARY _O_BINARY | |||
| #define M_TRUNC _O_TRUNC | |||
| #define M_IREAD _S_IREAD | |||
| #define M_IRUSR _S_IREAD | |||
| @@ -232,6 +252,15 @@ typedef VOID (*mmPf)(VOID); | |||
| #define M_IWUSR _S_IWRITE | |||
| #define M_IXUSR 0 | |||
| #define M_IN_CREATE FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_DIR_NAME | |||
| #define M_IN_CLOSE_WRITE FILE_NOTIFY_CHANGE_LAST_WRITE | |||
| #define M_IN_IGNORED FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_DIR_NAME | |||
| #define M_OUT_CREATE 0x00000100 | |||
| #define M_OUT_CLOSE_WRITE 0x00000008 | |||
| #define M_OUT_IGNORED 0x00008000 | |||
| #define M_OUT_ISDIR 0x40000000 | |||
| #define M_MSG_CREAT 1 | |||
| #define M_MSG_EXCL 2 | |||
| #define M_MSG_NOWAIT 3 | |||
| @@ -251,6 +280,16 @@ typedef VOID (*mmPf)(VOID); | |||
| #define M_UMASK_GRPEXEC 0 | |||
| #define M_UMASK_OTHEXEC 0 | |||
| #define DT_UNKNOWN 0 | |||
| #define DT_FIFO 1 | |||
| #define DT_CHR 2 | |||
| #define DT_DIR 4 | |||
| #define DT_BLK 6 | |||
| #define DT_REG 8 | |||
| #define DT_LNK 10 | |||
| #define DT_SOCK 12 | |||
| #define DT_WHT 14 | |||
| #define mmConstructor(x) __declspec(allocate(".CRT$XCU")) mmPf con = x | |||
| #define mmDestructor(x) __declspec(allocate(".CRT$XPU")) mmPf de = x | |||
| @@ -269,13 +308,20 @@ typedef VOID (*mmPf)(VOID); | |||
| #define MMPA_EMSG "" | |||
| #define MMPA_MAX_PATH MAX_PATH | |||
| #define M_NAME_MAX _MAX_FNAME | |||
| #define M_F_OK 0 | |||
| #define M_W_OK 2 | |||
| #define M_R_OK 4 | |||
| #define MMPA_STDIN stdin | |||
| #define MMPA_STDOUT stdout | |||
| #define MMPA_STDERR stderr | |||
| #define MMPA_RTLD_NOW 0 | |||
| #define MMPA_RTLD_GLOBAL 0 | |||
| #define MMPA_RTLD_LAZY 0 | |||
| #define MMPA_RTLD_NODELETE 0 | |||
| #define MMPA_DL_EXT_NAME ".dll" | |||
| @@ -285,6 +331,7 @@ _declspec(dllexport) INT32 mmCreateTask(mmThread *threadHandle, mmUserBlock_t *f | |||
| _declspec(dllexport) INT32 mmJoinTask(mmThread *threadHandle); | |||
| _declspec(dllexport) INT32 mmMutexInit(mmMutex_t *mutex); | |||
| _declspec(dllexport) INT32 mmMutexLock(mmMutex_t *mutex); | |||
| _declspec(dllexport) INT32 mmMutexTryLock(mmMutex_t *mutex); | |||
| _declspec(dllexport) INT32 mmMutexUnLock(mmMutex_t *mutex); | |||
| _declspec(dllexport) INT32 mmMutexDestroy(mmMutex_t *mutex); | |||
| _declspec(dllexport) INT32 mmCondInit(mmCond *cond); | |||
| @@ -292,6 +339,14 @@ _declspec(dllexport) INT32 mmCondLockInit(mmMutexFC *mutex); | |||
| _declspec(dllexport) INT32 mmCondLock(mmMutexFC *mutex); | |||
| _declspec(dllexport) INT32 mmCondUnLock(mmMutexFC *mutex); | |||
| _declspec(dllexport) INT32 mmCondLockDestroy(mmMutexFC *mutex); | |||
| _declspec(dllexport) INT32 mmRWLockInit(mmRWLock_t *rwLock); | |||
| _declspec(dllexport) INT32 mmRWLockRDLock(mmRWLock_t *rwLock); | |||
| _declspec(dllexport) INT32 mmRWLockTryRDLock(mmRWLock_t *rwLock); | |||
| _declspec(dllexport) INT32 mmRWLockWRLock(mmRWLock_t *rwLock); | |||
| _declspec(dllexport) INT32 mmRWLockTryWRLock(mmRWLock_t *rwLock); | |||
| _declspec(dllexport) INT32 mmRDLockUnLock(mmRWLock_t *rwLock); | |||
| _declspec(dllexport) INT32 mmWRLockUnLock(mmRWLock_t *rwLock); | |||
| _declspec(dllexport) INT32 mmRWLockDestroy(mmRWLock_t *rwLock); | |||
| _declspec(dllexport) INT32 mmCondWait(mmCond *cond, mmMutexFC *mutex); | |||
| _declspec(dllexport) INT32 mmCondTimedWait(mmCond *cond, mmMutexFC *mutex, UINT32 milliSecond); | |||
| @@ -302,13 +357,16 @@ _declspec(dllexport) INT32 mmGetPid(VOID); | |||
| _declspec(dllexport) INT32 mmGetTid(VOID); | |||
| _declspec(dllexport) INT32 mmGetPidHandle(mmProcess *processHandle); | |||
| _declspec(dllexport) INT32 mmGetLocalTime(mmSystemTime_t *sysTime); | |||
| _declspec(dllexport) INT32 mmGetSystemTime(mmSystemTime_t *sysTime); | |||
| _declspec(dllexport) INT32 mmSemInit(mmSem_t *sem, UINT32 value); | |||
| _declspec(dllexport) INT32 mmSemWait(mmSem_t *sem); | |||
| _declspec(dllexport) INT32 mmSemPost(mmSem_t *sem); | |||
| _declspec(dllexport) INT32 mmSemDestroy(mmSem_t *sem); | |||
| _declspec(dllexport) INT32 mmOpen(const CHAR *pathName, INT32 flags); | |||
| _declspec(dllexport) INT32 mmOpen2(const CHAR *pathName, INT32 flags, MODE mode); | |||
| _declspec(dllexport) FILE *mmPopen(CHAR *command, CHAR *type); | |||
| _declspec(dllexport) INT32 mmClose(INT32 fd); | |||
| _declspec(dllexport) INT32 mmPclose(FILE *stream); | |||
| _declspec(dllexport) mmSsize_t mmWrite(INT32 fd, VOID *buf, UINT32 bufLen); | |||
| _declspec(dllexport) mmSsize_t mmRead(INT32 fd, VOID *buf, UINT32 bufLen); | |||
| _declspec(dllexport) mmSockHandle mmSocket(INT32 sockFamily, INT32 type, INT32 protocol); | |||
| @@ -319,9 +377,22 @@ _declspec(dllexport) INT32 mmConnect(mmSockHandle sockFd, mmSockAddr *addr, mmSo | |||
| _declspec(dllexport) INT32 mmCloseSocket(mmSockHandle sockFd); | |||
| _declspec(dllexport) mmSsize_t mmSocketRecv(mmSockHandle sockFd, VOID *recvBuf, INT32 recvLen, INT32 recvFlag); | |||
| _declspec(dllexport) mmSsize_t mmSocketSend(mmSockHandle sockFd, VOID *sendBuf, INT32 sendLen, INT32 sendFlag); | |||
| _declspec(dllexport) INT32 mmSocketSendTo(mmSockHandle sockFd, | |||
| VOID *sendMsg, | |||
| INT32 sendLen, | |||
| UINT32 sendFlag, | |||
| const mmSockAddr* addr, | |||
| INT32 tolen); | |||
| _declspec(dllexport) mmSsize_t mmSocketRecvFrom(mmSockHandle sockFd, | |||
| VOID *recvBuf, | |||
| mmSize recvLen, | |||
| UINT32 recvFlag, | |||
| mmSockAddr* addr, | |||
| mmSocklen_t *FromLen); | |||
| _declspec(dllexport) INT32 mmSAStartup(VOID); | |||
| _declspec(dllexport) INT32 mmSACleanup(VOID); | |||
| _declspec(dllexport) VOID *mmDlopen(const CHAR *fileName, INT mode); | |||
| _declspec(dllexport) INT32 mmDladdr(VOID *addr, mmDlInfo *info); | |||
| _declspec(dllexport) VOID *mmDlsym(VOID *handle, CHAR *fileName); | |||
| _declspec(dllexport) INT32 mmDlclose(VOID *handle); | |||
| _declspec(dllexport) CHAR *mmDlerror(VOID); | |||
| @@ -330,6 +401,7 @@ _declspec(dllexport) INT32 | |||
| _declspec(dllexport) INT32 mmDeleteTimer(mmTimer timerHandle); | |||
| _declspec(dllexport) INT32 mmStatGet(const CHAR *path, mmStat_t *buffer); | |||
| _declspec(dllexport) INT32 mmStat64Get(const CHAR *path, mmStat64_t *buffer); | |||
| _declspec(dllexport) INT32 mmFStatGet(INT32 fd, mmStat_t *buffer); | |||
| _declspec(dllexport) INT32 mmMkdir(const CHAR *pathName, mmMode_t mode); | |||
| _declspec(dllexport) INT32 mmSleep(UINT32 milliSecond); | |||
| _declspec(dllexport) INT32 mmCreateTaskWithAttr(mmThread *threadHandle, mmUserBlock_t *funcBlock); | |||
| @@ -371,6 +443,7 @@ _declspec(dllexport) INT32 mmPoll(mmPollfd *fds, INT32 fdCount, INT32 timeout, m | |||
| pmmPollData polledData, mmPollBack pollBack); | |||
| _declspec(dllexport) INT32 mmGetErrorCode(); | |||
| _declspec(dllexport) CHAR *mmGetErrorFormatMessage(mmErrorMsg errnum, CHAR *buf, mmSize size); | |||
| _declspec(dllexport) INT32 mmGetTimeOfDay(mmTimeval *timeVal, mmTimezone *timeZone); | |||
| _declspec(dllexport) mmTimespec mmGetTickCount(); | |||
| _declspec(dllexport) INT32 mmGetRealPath(CHAR *path, CHAR *realPath); | |||
| @@ -407,7 +480,7 @@ _declspec(dllexport) INT32 mmTlsDelete(mmThreadKey key); | |||
| _declspec(dllexport) INT32 mmGetOsType(); | |||
| _declspec(dllexport) INT32 mmFsync(mmProcess fd); | |||
| _declspec(dllexport) INT32 mmFsync2(INT32 fd); | |||
| _declspec(dllexport) INT32 mmChdir(const CHAR *path); | |||
| _declspec(dllexport) INT32 mmUmask(INT32 pmode); | |||
| _declspec(dllexport) INT32 mmWaitPid(mmProcess pid, INT32 *status, INT32 options); | |||
| @@ -455,7 +528,10 @@ _declspec(dllexport) INT32 | |||
| _declspec(dllexport) INT32 | |||
| mmCreateTaskWithThreadAttr(mmThread *threadHandle, const mmUserBlock_t *funcBlock, const mmThreadAttr *threadAttr); | |||
| _declspec(dllexport) mmFileHandle mmShmOpen(const CHAR *name, INT32 oflag, mmMode_t mode); | |||
| _declspec(dllexport) INT32 mmShmUnlink(const CHAR *name); | |||
| _declspec(dllexport) VOID *mmMmap(mmFd_t fd, mmSize_t size, mmOfft_t offset, mmFd_t *extra, INT32 prot, INT32 flags); | |||
| _declspec(dllexport) INT32 mmMunMap(VOID *data, mmSize_t size, mmFd_t *extra); | |||
| #ifdef __cplusplus | |||
| #if __cplusplus | |||
| } | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 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. | |||
| @@ -1,77 +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. | |||
| */ | |||
| #ifndef OPS_BUILT_IN_OP_PROTO_INC_MAX_POOL_V3_H_ | |||
| #define BUILT_IN_OP_PROTO_INC_MAX_POOL_V3_H_ | |||
| #include "graph/operator_reg.h" | |||
| namespace ge { | |||
| /** | |||
| * @brief Performs max pooling on the input . \n | |||
| * @par Inputs: | |||
| * One input: | |||
| * x: An NC1HWC0 Tensor. Supported type:float16, float32, double, int8, int16, | |||
| * int32, int64, uint8, uint16, qint8 | |||
| * @par Attributes: | |||
| * @li ksize: A required list of int8, int16, int32, or int64 values, | |||
| * specifying the size of the window for each dimension of the input tensor. | |||
| * No default value. | |||
| * @li strides: A required list of int8, int16, int32, or int64 values, | |||
| * specifying the stride of the sliding window for each dimension of | |||
| * the input tensor. No default value. | |||
| * @li padding_mode: A required string. Defaults to "CALCULATED". | |||
| * @li pads:A required list of int8, int16, int32, or int64 values, | |||
| * a data to caculate when padding_mode is "SAME" and "CALCULATED". | |||
| * @li data_format: An optional string. Defaults to "NHWC" . | |||
| * @li global_pooling bool, Whether to use the global pooling. | |||
| * If global_pooling = true, kernel size and paddings will be ignored. | |||
| * Default False | |||
| * @li ceil_mode:global_pooling (bool) – (bool) Whether to use the global pooling. | |||
| * If global_pooling = true, kernel size and paddings will be ignored. | |||
| * Default False \n | |||
| * @par Outputs: | |||
| * y: A Tensor. Has the same type and format as input "x" . \n | |||
| * @attention Constraints: | |||
| * @li "ksize" is a list that has length 4: ksize[0] = 1 or ksize[3] = 1, | |||
| * ksize[1] * ksize[2] <= 255. | |||
| * @li "stride is a list that has length 4: strides[0] = 1 or strides[3] = 1, | |||
| * strides[1] <= 63, strides[0] >= 1, strides[2] <= 63, strides[2] >= 1. | |||
| * @li "padding" is "SAME" "VALID" or "CACULATE" . | |||
| * @par Third-party framework compatibility | |||
| * Compatible with the TensorFlow operator MaxPool. | |||
| */ | |||
| REG_OP(MaxPoolV3) | |||
| .INPUT(x,TensorType({DT_FLOAT16, DT_FLOAT32})) | |||
| .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT32})) | |||
| .REQUIRED_ATTR(ksize, ListInt) | |||
| .REQUIRED_ATTR(strides, ListInt) | |||
| .ATTR(padding_mode, String, "CALCULATED") | |||
| .ATTR(pads, ListInt, {0,0,0,0}) | |||
| .ATTR(data_format, String, "NCHW") | |||
| .ATTR(global_pooling,Bool,false) | |||
| .ATTR(ceil_mode, Bool, false) | |||
| .OP_END_FACTORY_REG(MaxPoolV3) | |||
| } // namespace ge | |||
| #endif // OPS_BUILT_IN_OP_PROTO_INC_MAX_POOL_V3_H_ | |||
| @@ -1,80 +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 max_pool_v3_grad.h | |||
| *\brief | |||
| */ | |||
| #ifndef OPS_BUILT_IN_OP_PROTO_INC_MAX_POOL_V3_GRAD_H_ | |||
| #define OPS_BUILT_IN_OP_PROTO_INC_MAX_POOL_V3_GRAD_H_ | |||
| #include "graph/operator_reg.h" | |||
| namespace ge { | |||
| /** | |||
| * @brief Computes gradients of the maxpooling function . \n | |||
| * @par Inputs: | |||
| * @li orig_input: A mutable NC1HWC0 tensor of type RealNumberType. | |||
| * @li orig_output: A mutable NC1HWC0 tensor of type RealNumberTypex. | |||
| * @li grad: A mutable NC1HWC0 tensor of type RealNumberType . \n | |||
| * @par Attributes: | |||
| * @li ksize: A required list of int8, int16, int32, or int64 values, | |||
| * specifying the size of the window for each dimension of the input tensor. | |||
| * No default value. | |||
| * @li strides: A required list of int8, int16, int32, or int64 values, | |||
| * specifying the stride of the sliding window for each dimension of | |||
| * the input tensor. No default value. | |||
| * @li padding_mode: A required string. Defaults to "CALCULATED". | |||
| * @li pads:A required list of int8, int16, int32, or int64 values, | |||
| * a data to caculate when padding_mode is "SAME" and "CALCULATED". | |||
| * @li data_format: An optional string. Defaults to "NHWC" . | |||
| * @li global_pooling bool, Whether to use the global pooling. | |||
| * If global_pooling = true, kernel size and paddings will be ignored. | |||
| * Default False | |||
| * @li ceil_mode:global_pooling (bool) – (bool) Whether to use the global pooling. | |||
| * If global_pooling = true, kernel size and paddings will be ignored. | |||
| * Default False \n | |||
| * @par Outputs: | |||
| * y: A mutable tensor. Has the same shape and type as "x1" . \n | |||
| * @attention Constraints: | |||
| * @li Computing gradients of global pooling is not supported, which means | |||
| * "ksize < x1". | |||
| * @li "ksize" is in the range [1, 255]. "strides" is in the range [1, 63] | |||
| * @par Third-party framework compatibility | |||
| * Compatible with the TensorFlow operator MaxPoolGrad. | |||
| */ | |||
| REG_OP(MaxPoolV3Grad) | |||
| .INPUT(orig_input, TensorType::RealNumberType()) | |||
| .INPUT(orig_output, TensorType::RealNumberType()) | |||
| .INPUT(grad, TensorType::RealNumberType()) | |||
| .OUTPUT(out_grad, TensorType::RealNumberType()) | |||
| .REQUIRED_ATTR(ksize, ListInt) | |||
| .REQUIRED_ATTR(strides, ListInt) | |||
| .ATTR(padding_mod, String, "CALCULATED") | |||
| .ATTR(pads, ListInt, {0, 0, 0, 0}) | |||
| .ATTR(data_format, String, "NCHW") | |||
| .ATTR(global_pooling, Bool, false) | |||
| .ATTR(ceil_mode, Bool, false) | |||
| .OP_END_FACTORY_REG(MaxPoolV3Grad) | |||
| } // namespace ge | |||
| #endif // OPS_BUILT_IN_OP_PROTO_INC_MAX_POOL_V3_GRAD_H_ | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1190,6 +1190,108 @@ REG_OP(MaxPoolGradWithArgmaxV2) | |||
| .ATTR(dilation, ListInt, {1,1,1,1}) | |||
| .ATTR(ceil_mode, Bool, false) | |||
| .OP_END_FACTORY_REG(MaxPoolGradWithArgmaxV2) | |||
| } // namespace ge | |||
| #endif // OPS_BUILT_IN_OP_PROTO_INC_NN_POOLING_OPS_H_ | |||
| /** | |||
| * @brief Performs max pooling on the input . \n | |||
| * @par Inputs: | |||
| * One input: | |||
| * x: An NC1HWC0 Tensor. Supported type:float16, float32, double, int8, int16, | |||
| * int32, int64, uint8, uint16, qint8 | |||
| * @par Attributes: | |||
| * @li ksize: A required list of int8, int16, int32, or int64 values, | |||
| * specifying the size of the window for each dimension of the input tensor. | |||
| * No default value. | |||
| * @li strides: A required list of int8, int16, int32, or int64 values, | |||
| * specifying the stride of the sliding window for each dimension of | |||
| * the input tensor. No default value. | |||
| * @li padding_mode: A required string. Defaults to "CALCULATED". | |||
| * @li pads:A required list of int8, int16, int32, or int64 values, | |||
| * a data to caculate when padding_mode is "SAME" and "CALCULATED". | |||
| * @li data_format: An optional string. Defaults to "NHWC" . | |||
| * @li global_pooling bool, Whether to use the global pooling. | |||
| * If global_pooling = true, kernel size and paddings will be ignored. | |||
| * Default False | |||
| * @li ceil_mode:global_pooling (bool) – (bool) Whether to use the global pooling. | |||
| * If global_pooling = true, kernel size and paddings will be ignored. | |||
| * Default False \n | |||
| * @par Outputs: | |||
| * y: A Tensor. Has the same type and format as input "x" . \n | |||
| * @attention Constraints: | |||
| * @li "ksize" is a list that has length 4: ksize[0] = 1 or ksize[3] = 1, | |||
| * ksize[1] * ksize[2] <= 255. | |||
| * @li "stride is a list that has length 4: strides[0] = 1 or strides[3] = 1, | |||
| * strides[1] <= 63, strides[0] >= 1, strides[2] <= 63, strides[2] >= 1. | |||
| * @li "padding" is "SAME" "VALID" or "CACULATE" . | |||
| * @par Third-party framework compatibility | |||
| * Compatible with the TensorFlow operator MaxPool. | |||
| */ | |||
| REG_OP(MaxPoolV3) | |||
| .INPUT(x,TensorType({DT_FLOAT16, DT_FLOAT32})) | |||
| .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT32})) | |||
| .REQUIRED_ATTR(ksize, ListInt) | |||
| .REQUIRED_ATTR(strides, ListInt) | |||
| .ATTR(padding_mode, String, "CALCULATED") | |||
| .ATTR(pads, ListInt, {0,0,0,0}) | |||
| .ATTR(data_format, String, "NCHW") | |||
| .ATTR(global_pooling,Bool,false) | |||
| .ATTR(ceil_mode, Bool, false) | |||
| .OP_END_FACTORY_REG(MaxPoolV3) | |||
| /** | |||
| * @brief Computes gradients of the maxpooling function . \n | |||
| * @par Inputs: | |||
| * @li orig_input: A mutable NC1HWC0 tensor of type RealNumberType. | |||
| * @li orig_output: A mutable NC1HWC0 tensor of type RealNumberTypex. | |||
| * @li grad: A mutable NC1HWC0 tensor of type RealNumberType . \n | |||
| * @par Attributes: | |||
| * @li ksize: A required list of int8, int16, int32, or int64 values, | |||
| * specifying the size of the window for each dimension of the input tensor. | |||
| * No default value. | |||
| * @li strides: A required list of int8, int16, int32, or int64 values, | |||
| * specifying the stride of the sliding window for each dimension of | |||
| * the input tensor. No default value. | |||
| * @li padding_mode: A required string. Defaults to "CALCULATED". | |||
| * @li pads:A required list of int8, int16, int32, or int64 values, | |||
| * a data to caculate when padding_mode is "SAME" and "CALCULATED". | |||
| * @li data_format: An optional string. Defaults to "NHWC" . | |||
| * @li global_pooling bool, Whether to use the global pooling. | |||
| * If global_pooling = true, kernel size and paddings will be ignored. | |||
| * Default False | |||
| * @li ceil_mode:global_pooling (bool) – (bool) Whether to use the global pooling. | |||
| * If global_pooling = true, kernel size and paddings will be ignored. | |||
| * Default False \n | |||
| * @par Outputs: | |||
| * y: A mutable tensor. Has the same shape and type as "x1" . \n | |||
| * @attention Constraints: | |||
| * @li Computing gradients of global pooling is not supported, which means | |||
| * "ksize < x1". | |||
| * @li "ksize" is in the range [1, 255]. "strides" is in the range [1, 63] | |||
| * @par Third-party framework compatibility | |||
| * Compatible with the TensorFlow operator MaxPoolGrad. | |||
| */ | |||
| REG_OP(MaxPoolV3Grad) | |||
| .INPUT(orig_input, TensorType::RealNumberType()) | |||
| .INPUT(orig_output, TensorType::RealNumberType()) | |||
| .INPUT(grad, TensorType::RealNumberType()) | |||
| .OUTPUT(out_grad, TensorType::RealNumberType()) | |||
| .REQUIRED_ATTR(ksize, ListInt) | |||
| .REQUIRED_ATTR(strides, ListInt) | |||
| .ATTR(padding_mode, String, "CALCULATED") | |||
| .ATTR(pads, ListInt, {0, 0, 0, 0}) | |||
| .ATTR(data_format, String, "NCHW") | |||
| .ATTR(global_pooling, Bool, false) | |||
| .ATTR(ceil_mode, Bool, false) | |||
| .OP_END_FACTORY_REG(MaxPoolV3Grad) | |||
| } // namespace ge | |||
| #endif // OPS_BUILT_IN_OP_PROTO_INC_NN_POOLING_OPS_H | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 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. | |||
| @@ -343,7 +343,7 @@ REG_OP(AscendPadding) | |||
| */ | |||
| REG_OP(EmbeddingRankId) | |||
| .INPUT(addr_table, TensorType({DT_UINT64})) | |||
| .INPUT(index, TensorType({DT_UINT32})) | |||
| .INPUT(index, TensorType({DT_INT64,DT_INT32,DT_UINT64})) | |||
| .OUTPUT(rank_id, TensorType({DT_UINT64})) | |||
| .ATTR(row_memory, Int, 320) | |||
| .ATTR(mode, String, "mod") | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -825,7 +825,7 @@ REG_OP(SliceD) | |||
| * @attention Constraints: | |||
| * @li k =< 5120 | |||
| * @li Size of the last dimension =< 65500 | |||
| * @li Size of the last dimension =< 1458176 | |||
| * @li sorted = true | |||
| * @li It's unstable sorted indices on the platform of Ascend310 | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -1,5 +1,5 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * Copyright 2019 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. | |||
| @@ -41,6 +41,7 @@ class FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY OpKernelRegistry { | |||
| private: | |||
| OpKernelRegistry(); | |||
| class OpKernelRegistryImpl; | |||
| /*lint -e148*/ | |||
| std::unique_ptr<OpKernelRegistryImpl> impl_; | |||
| }; | |||
| } // namespace ge | |||
| @@ -1,18 +1,18 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * | |||
| * Copyright 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__ | |||
| @@ -100,6 +100,9 @@ typedef enum tagRtError { | |||
| 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_EVENT_BASE = 0x07050000, | |||
| RT_ERROR_EVENT_NULL, | |||
| @@ -1,18 +1,18 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * | |||
| * Copyright 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__ | |||
| @@ -1,18 +1,18 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * | |||
| * Copyright 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__ | |||
| @@ -1,18 +1,18 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * | |||
| * Copyright 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__ | |||
| @@ -1,18 +1,18 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * | |||
| * Copyright 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__ | |||
| @@ -1,18 +1,18 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * | |||
| * Copyright 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__ | |||
| @@ -1,18 +1,18 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * | |||
| * Copyright 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__ | |||
| @@ -1,23 +1,25 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * | |||
| * Copyright 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__ | |||
| /*lint -e7*/ | |||
| #include <stddef.h> | |||
| /*lint +e7*/ | |||
| #include "base.h" | |||
| #include "config.h" | |||
| #include "stream.h" | |||
| @@ -1,18 +1,18 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * | |||
| * Copyright 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__ | |||
| @@ -1,18 +1,18 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * | |||
| * Copyright 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__ | |||
| @@ -49,6 +49,7 @@ typedef enum tagModelTaskType { | |||
| RT_MODEL_TASK_MEMCPY_ADDR_ASYNC, | |||
| RT_MODEL_TASK_STREAM_LABEL_SWITCH_BY_INDEX, | |||
| RT_MODEL_TASK_STREAM_LABEL_GOTO, | |||
| RT_MODEL_TASK_MODEL_EXIT, | |||
| } rtModelTaskType_t; | |||
| typedef enum tagModelStreamType { | |||
| @@ -224,6 +225,13 @@ typedef struct tagrtModelEndGraphTaskInfo { | |||
| uint32_t reserved[8]; | |||
| } rtModelEndGraphTaskInfo_t; | |||
| typedef struct tagrtModelExitInfo { | |||
| uint32_t modelId; | |||
| uint32_t streamId; | |||
| uint32_t reserved[8]; | |||
| } rtModelExitTaskInfo_t; | |||
| typedef struct tagrtStreamLabelSwitchByIndexTask_t { | |||
| uint64_t indexPtr; | |||
| uint64_t labelInfoPtr; | |||
| @@ -256,6 +264,7 @@ typedef struct tagTaskInfo { | |||
| rtRdmaSendTaskInfo_t rdmaSendTask; | |||
| rtRdmaDbSendTaskInfo_t rdmaDbSendTask; | |||
| rtModelEndGraphTaskInfo_t modelEndGraphTask; | |||
| rtModelExitTaskInfo_t modelExitTask; | |||
| rtStreamSwitchNTaskInfo_t streamSwitchNTask; | |||
| rtStreamLabelSwitchByIndexTask_t streamLabelSwitchIndexTask; | |||
| rtStreamLabelGotoTask_t streamLabelGotoTask; | |||
| @@ -389,6 +398,16 @@ RTS_API rtError_t rtModelExecutorSet(rtModel_t model, uint8_t flags); | |||
| */ | |||
| RTS_API rtError_t rtModelAbort(rtModel_t model); | |||
| /** | |||
| * @ingroup rt_model | |||
| * @brief end graph task to model default stream | |||
| * @param [in] model model to execute | |||
| * @param [in] end graph stream | |||
| * @return RT_ERROR_NONE for ok | |||
| * @return RT_ERROR_INVALID_VALUE for error input | |||
| */ | |||
| RTS_API rtError_t rtModelExit(rtModel_t model, rtStream_t stream); | |||
| /** | |||
| * @ingroup rt_model | |||
| * @brief bind queue | |||
| @@ -1,18 +1,18 @@ | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * | |||
| * Copyright 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__ | |||
| @@ -1,4 +1,4 @@ | |||
| /** | |||
| /** | |||
| * Copyright 2019-2020 Huawei Technologies Co., Ltd | |||
| * | |||
| * Licensed under the Apache License, Version 2.0 (the "License"); | |||
| @@ -1,18 +1,12 @@ | |||
| /** | |||
| * 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 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. | |||
| */ | |||
| #ifndef ADX_DATADUMP_SERVER_H | |||
| #define ADX_DATADUMP_SERVER_H | |||