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 3.1 kB

5 years ago
5 years ago
5 years ago
5 years ago
3 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /**
  2. * Copyright 2019-2020 Huawei Technologies Co., Ltd
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef _MMPA_API_H_
  17. #define _MMPA_API_H_
  18. #define LINUX 0
  19. #define WIN 1
  20. #if(OS_TYPE == LINUX) //lint !e553
  21. #ifndef _GNU_SOURCE
  22. #define _GNU_SOURCE
  23. #endif
  24. #ifdef FUNC_VISIBILITY
  25. #define MMPA_FUNC_VISIBILITY __attribute__((visibility("default")))
  26. #else
  27. #define MMPA_FUNC_VISIBILITY
  28. #endif
  29. #include <string.h>
  30. #include <stdio.h>
  31. #include <errno.h>
  32. #include <time.h>
  33. #include <unistd.h>
  34. #include <semaphore.h>
  35. #include <fcntl.h>
  36. #include <dlfcn.h>
  37. #include <signal.h>
  38. #include <pthread.h>
  39. #include <syslog.h>
  40. #include <dirent.h>
  41. #include <arpa/inet.h>
  42. #include <stdlib.h>
  43. #include <string.h>
  44. #include <poll.h>
  45. #include <net/if.h>
  46. #include <stdarg.h>
  47. #include <limits.h>
  48. #include <ctype.h>
  49. #include <stddef.h>
  50. #include <dirent.h>
  51. #include <getopt.h>
  52. #include <libgen.h>
  53. #include <malloc.h>
  54. #include <linux/types.h>
  55. #include <linux/hdreg.h>
  56. #include <linux/fs.h>
  57. #include <linux/limits.h>
  58. #include <sys/stat.h>
  59. #include <sys/time.h>
  60. #include <sys/syscall.h>
  61. #include <sys/types.h>
  62. #include <sys/socket.h>
  63. #include <sys/resource.h>
  64. #include <sys/uio.h>
  65. #include <sys/mman.h>
  66. #include <sys/ioctl.h>
  67. #include <sys/shm.h>
  68. #include <sys/un.h>
  69. #include <sys/utsname.h>
  70. #include <sys/ipc.h>
  71. #include <sys/sem.h>
  72. #include <sys/shm.h>
  73. #include <sys/msg.h>
  74. #include <sys/wait.h>
  75. #include <sys/statvfs.h>
  76. #include <sys/prctl.h>
  77. #include <sys/inotify.h>
  78. #include "securec.h"
  79. #include "./sub_inc/mmpa_typedef_linux.h"
  80. #include "./sub_inc/mmpa_linux.h"
  81. #endif
  82. #if(OS_TYPE == WIN) //lint !e553
  83. #ifdef FUNC_VISIBILITY
  84. #define MMPA_FUNC_VISIBILITY _declspec(dllexport)
  85. #else
  86. #define MMPA_FUNC_VISIBILITY
  87. #endif
  88. #include <winsock2.h>
  89. #include <winsock.h>
  90. #include "Windows.h"
  91. #include <errno.h>
  92. #include <string.h>
  93. #include <fcntl.h>
  94. #include <io.h>
  95. #include <stdio.h>
  96. #include <ws2tcpip.h>
  97. #include <winioctl.h>
  98. #include <WinBase.h>
  99. #include <mswsock.h>
  100. #include <strsafe.h>
  101. #include <signal.h>
  102. #include <time.h>
  103. #include <stdarg.h>
  104. #include "shlwapi.h"
  105. #include <direct.h>
  106. #include <VersionHelpers.h>
  107. #include <processthreadsapi.h>
  108. #include <Wbemidl.h>
  109. #include <iphlpapi.h>
  110. #include <synchapi.h>
  111. #include <sys/types.h>
  112. #include <sys/stat.h>
  113. #include "securec.h"
  114. #include "sub_inc/mmpa_typedef_win.h"
  115. #include "sub_inc/mmpa_win.h"
  116. #pragma comment(lib, "ws2_32.lib")
  117. #pragma comment(lib, "mswsock.lib")
  118. #pragma comment(lib, "Kernel32.lib")
  119. #pragma comment(lib, "shlwapi.lib")
  120. #pragma comment(lib, "wbemuuid.lib")
  121. #pragma comment(lib, "Iphlpapi.lib")
  122. #endif
  123. #endif // MMPA_API_H_

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