You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

mmpa_api.h 2.7 kB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /*
  2. * @file mmpa_api.h
  3. *
  4. * Copyright (C) Huawei Technologies Co., Ltd. 2019-2021. All Rights Reserved.
  5. *
  6. * This program is distributed in the hope that it will be useful,
  7. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. */
  10. #ifndef _MMPA_API_H_
  11. #define _MMPA_API_H_
  12. #define LINUX 0
  13. #define WIN 1
  14. #if(OS_TYPE == LINUX) //lint !e553
  15. #ifndef _GNU_SOURCE
  16. #define _GNU_SOURCE
  17. #endif
  18. #ifdef FUNC_VISIBILITY
  19. #define MMPA_FUNC_VISIBILITY __attribute__((visibility("default")))
  20. #else
  21. #define MMPA_FUNC_VISIBILITY
  22. #endif
  23. #include <string.h>
  24. #include <stdio.h>
  25. #include <errno.h>
  26. #include <time.h>
  27. #include <unistd.h>
  28. #include <semaphore.h>
  29. #include <fcntl.h>
  30. #include <dlfcn.h>
  31. #include <pthread.h>
  32. #include <syslog.h>
  33. #include <dirent.h>
  34. #include <arpa/inet.h>
  35. #include <stdlib.h>
  36. #include <string.h>
  37. #include <poll.h>
  38. #include <net/if.h>
  39. #include <stdarg.h>
  40. #include <limits.h>
  41. #include <ctype.h>
  42. #include <stddef.h>
  43. #include <dirent.h>
  44. #include <getopt.h>
  45. #include <libgen.h>
  46. #include <malloc.h>
  47. #include <linux/types.h>
  48. #include <linux/hdreg.h>
  49. #include <linux/fs.h>
  50. #include <linux/limits.h>
  51. #include <sys/stat.h>
  52. #include <sys/time.h>
  53. #include <sys/syscall.h>
  54. #include <sys/types.h>
  55. #include <sys/socket.h>
  56. #include <sys/resource.h>
  57. #include <sys/uio.h>
  58. #include <sys/mman.h>
  59. #include <sys/ioctl.h>
  60. #include <sys/shm.h>
  61. #include <sys/un.h>
  62. #include <sys/utsname.h>
  63. #include <sys/ipc.h>
  64. #include <sys/sem.h>
  65. #include <sys/shm.h>
  66. #include <sys/msg.h>
  67. #include <sys/wait.h>
  68. #include <sys/statvfs.h>
  69. #include <sys/prctl.h>
  70. #include <sys/inotify.h>
  71. #include "securec.h"
  72. #include "./sub_inc/mmpa_typedef_linux.h"
  73. #include "./sub_inc/mmpa_linux.h"
  74. #endif
  75. #if(OS_TYPE == WIN) //lint !e553
  76. #ifdef FUNC_VISIBILITY
  77. #define MMPA_FUNC_VISIBILITY _declspec(dllexport)
  78. #else
  79. #define MMPA_FUNC_VISIBILITY
  80. #endif
  81. #include <winsock2.h>
  82. #include <winsock.h>
  83. #include "Windows.h"
  84. #include <errno.h>
  85. #include <string.h>
  86. #include <fcntl.h>
  87. #include <io.h>
  88. #include <stdio.h>
  89. #include <ws2tcpip.h>
  90. #include <winioctl.h>
  91. #include <WinBase.h>
  92. #include <mswsock.h>
  93. #include <strsafe.h>
  94. #include <signal.h>
  95. #include <time.h>
  96. #include <stdarg.h>
  97. #include "shlwapi.h"
  98. #include <direct.h>
  99. #include <VersionHelpers.h>
  100. #include <processthreadsapi.h>
  101. #include <Wbemidl.h>
  102. #include <iphlpapi.h>
  103. #include <synchapi.h>
  104. #include <sys/types.h>
  105. #include <sys/stat.h>
  106. #include "securec.h"
  107. #include "sub_inc/mmpa_typedef_win.h"
  108. #include "sub_inc/mmpa_win.h"
  109. #pragma comment(lib, "ws2_32.lib")
  110. #pragma comment(lib, "mswsock.lib")
  111. #pragma comment(lib, "Kernel32.lib")
  112. #pragma comment(lib, "shlwapi.lib")
  113. #pragma comment(lib, "wbemuuid.lib")
  114. #pragma comment(lib, "Iphlpapi.lib")
  115. #endif
  116. #endif // MMPA_API_H_

图引擎模块(GE)是MindSpore的一个子模块,其代码由C++实现,位于前端模块ME和底层硬件之间,起到承接作用。图引擎模块以ME下发的图作为输入,然后进行一系列的深度图优化操作,最后输出一张可以在底层硬件上高效运行的图。GE针对昇腾AI处理器的硬件结构特点,做了特定的优化工作,以此来充分发挥出昇腾AI处理器的强大算力。在进行模型训练/推理时,GE会被自动调用而用户并不感知。GE主要由GE API和GE Core两部分组成,详细的架构图如下所示