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.

acl_tdt_queue.h 18 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600
  1. /**
  2. * Copyright 2019-2022 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 INC_EXTERNAL_ACL_ACL_TDT_QUEUE_H_
  17. #define INC_EXTERNAL_ACL_ACL_TDT_QUEUE_H_
  18. #include "acl/acl_base.h"
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. #define ACL_TDT_QUEUE_PERMISSION_MANAGE 1
  23. #define ACL_TDT_QUEUE_PERMISSION_DEQUEUE 2
  24. #define ACL_TDT_QUEUE_PERMISSION_ENQUEUE 4
  25. #define ACL_TDT_QUEUE_ROUTE_UNBIND 0
  26. #define ACL_TDT_QUEUE_ROUTE_BIND 1
  27. #define ACL_TDT_QUEUE_ROUTE_BIND_ABNORMAL 2
  28. typedef void *acltdtBuf;
  29. typedef struct tagMemQueueAttr acltdtQueueAttr;
  30. typedef struct acltdtQueueRouteList acltdtQueueRouteList;
  31. typedef struct acltdtQueueRouteQueryInfo acltdtQueueRouteQueryInfo;
  32. typedef struct acltdtQueueRoute acltdtQueueRoute;
  33. typedef enum { ACL_TDT_QUEUE_NAME_PTR = 0, ACL_TDT_QUEUE_DEPTH_UINT32 } acltdtQueueAttrType;
  34. typedef enum {
  35. ACL_TDT_QUEUE_ROUTE_SRC_UINT32 = 0,
  36. ACL_TDT_QUEUE_ROUTE_DST_UINT32,
  37. ACL_TDT_QUEUE_ROUTE_STATUS_INT32
  38. } acltdtQueueRouteParamType;
  39. typedef enum {
  40. ACL_TDT_QUEUE_ROUTE_QUERY_SRC = 0,
  41. ACL_TDT_QUEUE_ROUTE_QUERY_DST = 1,
  42. ACL_TDT_QUEUE_ROUTE_QUERY_SRC_AND_DST = 2,
  43. ACL_TDT_QUEUE_ROUTE_QUERY_ABNORMAL = 100
  44. } acltdtQueueRouteQueryMode;
  45. typedef enum {
  46. ACL_TDT_QUEUE_ROUTE_QUERY_MODE_ENUM = 0,
  47. ACL_TDT_QUEUE_ROUTE_QUERY_SRC_ID_UINT32,
  48. ACL_TDT_QUEUE_ROUTE_QUERY_DST_ID_UINT32
  49. } acltdtQueueRouteQueryInfoParamType;
  50. typedef enum { ACL_TDT_NORMAL_MEM = 0, ACL_TDT_DVPP_MEM } acltdtAllocBufType;
  51. /**
  52. * @ingroup AscendCL
  53. * @brief create queue
  54. *
  55. * @param attr [IN] pointer to the queue attr
  56. * @param qid [OUT] pointer to the qid
  57. *
  58. * @retval ACL_SUCCESS The function is successfully executed.
  59. * @retval OtherValues Failure
  60. *
  61. * @see acltdtDestroyQueue
  62. */
  63. ACL_FUNC_VISIBILITY aclError acltdtCreateQueue(const acltdtQueueAttr *attr, uint32_t *qid);
  64. /**
  65. * @ingroup AscendCL
  66. * @brief destroy queue
  67. *
  68. * @param qid [IN] qid which to be destroyed
  69. *
  70. * @retval ACL_SUCCESS The function is successfully executed.
  71. * @retval OtherValues Failure
  72. *
  73. * @see acltdtCreateQueue
  74. */
  75. ACL_FUNC_VISIBILITY aclError acltdtDestroyQueue(uint32_t qid);
  76. /**
  77. * @ingroup AscendCL
  78. * @brief enqueue function
  79. *
  80. * @param qid [IN] qid
  81. * @param buf [IN] acltdtBuf
  82. * @param timeout [IN] timeout, -1 means blocking
  83. *
  84. * @retval ACL_SUCCESS The function is successfully executed.
  85. * @retval OtherValues Failure
  86. *
  87. * @see acltdtDequeue
  88. */
  89. ACL_FUNC_VISIBILITY aclError acltdtEnqueue(uint32_t qid, acltdtBuf buf, int32_t timeout);
  90. /**
  91. * @ingroup AscendCL
  92. * @brief dequeue function
  93. *
  94. * @param qid [IN] qid
  95. * @param buf [OUT] pointer to the acltdtBuf
  96. * @param timeout [IN] timeout, -1 means blocking
  97. *
  98. * @retval ACL_SUCCESS The function is successfully executed.
  99. * @retval OtherValues Failure
  100. *
  101. * @see acltdtEnqueue
  102. */
  103. ACL_FUNC_VISIBILITY aclError acltdtDequeue(uint32_t qid, acltdtBuf *buf, int32_t timeout);
  104. /**
  105. * @ingroup AscendCL
  106. * @brief enqueue function
  107. *
  108. * @param qid [IN] qid
  109. * @param data [IN] the pointer to data buf
  110. * @param dataSize [IN] the size of data buf
  111. * @param userData [IN] the pointer to user data buf
  112. * @param userDataSize [IN] the size of user data buf
  113. * @param timeout [IN] timeout, -1 means blocking
  114. * @param rsv [IN] reserved param
  115. * @retval ACL_SUCCESS The function is successfully executed.
  116. * @retval OtherValues Failure
  117. *
  118. * @see acltdtDequeueData
  119. */
  120. ACL_FUNC_VISIBILITY aclError acltdtEnqueueData(uint32_t qid, const void *data, size_t dataSize, const void *userData,
  121. size_t userDataSize, int32_t timeout, uint32_t rsv);
  122. /**
  123. * @ingroup AscendCL
  124. * @brief dequeue function
  125. *
  126. * @param qid [IN] qid
  127. * @param data [IN|OUT] the pointer to data buf
  128. * @param dataSize [IN] the size of data buf
  129. * @param retDataSize [OUT] the return size of data buf
  130. * @param userData [IN|OUT] the pointer to user data buf
  131. * @param userDataSize [IN] the size of user data buf
  132. * @param timeout [IN] timeout, -1 means blocking
  133. * @retval ACL_SUCCESS The function is successfully executed.
  134. * @retval OtherValues Failure
  135. *
  136. * @see acltdtEnqueueData
  137. */
  138. ACL_FUNC_VISIBILITY aclError acltdtDequeueData(uint32_t qid, void *data, size_t dataSize, size_t *retDataSize,
  139. void *userData, size_t userDataSize, int32_t timeout);
  140. /**
  141. * @ingroup AscendCL
  142. * @brief grant queue to other process
  143. *
  144. * @param qid [IN] qid
  145. * @param pid [IN] pid of dst process
  146. * @param permission [IN] permission of queue
  147. * @param timeout [IN] timeout, -1 means blocking
  148. *
  149. * @retval ACL_SUCCESS The function is successfully executed.
  150. * @retval OtherValues Failure
  151. *
  152. * @see ACL_TDT_QUEUE_PERMISSION_MANAGE | ACL_TDT_QUEUE_PERMISSION_DEQUEUE | ACL_TDT_QUEUE_PERMISSION_ENQUEUE
  153. */
  154. ACL_FUNC_VISIBILITY aclError acltdtGrantQueue(uint32_t qid, int32_t pid, uint32_t permission, int32_t timeout);
  155. /**
  156. * @ingroup AscendCL
  157. * @brief attach queue in current process
  158. *
  159. * @param qid [IN] qid
  160. * @param timeout [IN] timeout, -1 means blocking
  161. * @param permission [OUT] permission of queue
  162. *
  163. * @retval ACL_SUCCESS The function is successfully executed.
  164. * @retval OtherValues Failure
  165. *
  166. * @see acltdtGrantQueue
  167. */
  168. ACL_FUNC_VISIBILITY aclError acltdtAttachQueue(uint32_t qid, int32_t timeout, uint32_t *permission);
  169. /**
  170. * @ingroup AscendCL
  171. * @brief bind queue routes
  172. *
  173. * @param qRouteList [IN|OUT] pointer to the route list
  174. *
  175. * @retval ACL_SUCCESS The function is successfully executed.
  176. * @retval OtherValues Failure
  177. */
  178. ACL_FUNC_VISIBILITY aclError acltdtBindQueueRoutes(acltdtQueueRouteList *qRouteList);
  179. /**
  180. * @ingroup AscendCL
  181. * @brief unbind queue routes
  182. *
  183. * @param qRouteList [IN|OUT] pointer to the route list
  184. *
  185. * @retval ACL_SUCCESS The function is successfully executed.
  186. * @retval OtherValues Failure
  187. */
  188. ACL_FUNC_VISIBILITY aclError acltdtUnbindQueueRoutes(acltdtQueueRouteList *qRouteList);
  189. /**
  190. * @ingroup AscendCL
  191. * @brief query queue routes according to query mode
  192. *
  193. * @param queryInfo [IN] pointer to the queue route query info
  194. * @param qRouteList [IN|OUT] pointer to the route list
  195. *
  196. * @retval ACL_SUCCESS The function is successfully executed.
  197. * @retval OtherValues Failure
  198. */
  199. ACL_FUNC_VISIBILITY aclError acltdtQueryQueueRoutes(const acltdtQueueRouteQueryInfo *queryInfo,
  200. acltdtQueueRouteList *qRouteList);
  201. /**
  202. * @ingroup AscendCL
  203. * @brief alloc acltdtBuf
  204. *
  205. * @param size [IN] alloc buf size
  206. * @param type [IN] reserved parameters, need to set zero currently
  207. * @param buf [OUT] pointer to the acltdtBuf
  208. *
  209. * @retval ACL_SUCCESS The function is successfully executed.
  210. * @retval OtherValues Failure
  211. *
  212. * @see acltdtFreeBuf
  213. */
  214. ACL_FUNC_VISIBILITY aclError acltdtAllocBuf(size_t size, uint32_t type, acltdtBuf *buf);
  215. /**
  216. * @ingroup AscendCL
  217. * @brief free acltdtBuf
  218. *
  219. * @param buf [IN] pointer to the acltdtBuf
  220. *
  221. * @retval ACL_SUCCESS The function is successfully executed.
  222. * @retval OtherValues Failure
  223. *
  224. * @see acltdtAllocBuf
  225. */
  226. ACL_FUNC_VISIBILITY aclError acltdtFreeBuf(acltdtBuf buf);
  227. /**
  228. * @ingroup AscendCL
  229. * @brief get data buf address
  230. *
  231. * @param buf [IN] acltdtBuf
  232. * @param dataPtr [OUT] pointer to the data ptr which is acquired from acltdtBuf
  233. * @param size [OUT] pointer to the size
  234. *
  235. * @retval ACL_SUCCESS The function is successfully executed.
  236. * @retval OtherValues Failure
  237. *
  238. * @see acltdtAllocBuf
  239. */
  240. ACL_FUNC_VISIBILITY aclError acltdtGetBufData(const acltdtBuf buf, void **dataPtr, size_t *size);
  241. /**
  242. * @ingroup AscendCL
  243. * @brief set data buf effective len
  244. *
  245. * @param buf [IN] acltdtBuf
  246. * @param len [IN] set effective len to data buf which must be smaller than size acquired by acltdtGetBufData
  247. *
  248. * @retval ACL_SUCCESS The function is successfully executed.
  249. * @retval OtherValues Failure
  250. *
  251. * @see acltdtGetBufData acltdtGetBufDataLen
  252. */
  253. ACL_FUNC_VISIBILITY aclError acltdtSetBufDataLen(acltdtBuf buf, size_t len);
  254. /**
  255. * @ingroup AscendCL
  256. * @brief get data buf effective len
  257. *
  258. * @param buf [IN] acltdtBuf
  259. * @param len [OUT] get effective len which is set by acltdtSetBufDataLen
  260. *
  261. * @retval ACL_SUCCESS The function is successfully executed.
  262. * @retval OtherValues Failure
  263. *
  264. * @see acltdtSetBufDataLen
  265. */
  266. ACL_FUNC_VISIBILITY aclError acltdtGetBufDataLen(acltdtBuf buf, size_t *len);
  267. /**
  268. * @ingroup AscendCL
  269. * @brief append acltdtBuf to acltdtBuf chain
  270. *
  271. * @param headBuf [IN] acltdtBuf chain head
  272. * @param buf [IN] acltdtBuf will be appended
  273. *
  274. * @retval ACL_SUCCESS The function is successfully executed.
  275. * @retval OtherValues Failure
  276. *
  277. */
  278. ACL_FUNC_VISIBILITY aclError acltdtAppendBufChain(acltdtBuf headBuf, acltdtBuf buf);
  279. /**
  280. * @ingroup AscendCL
  281. * @brief get acltdtBuf chain total size
  282. *
  283. * @param headBuf [IN] acltdtBuf chain head
  284. * @param num [OUT] acltdtBuf chain total size
  285. *
  286. * @retval ACL_SUCCESS The function is successfully executed.
  287. * @retval OtherValues Failure
  288. *
  289. * @see acltdtAppendBufChain
  290. */
  291. ACL_FUNC_VISIBILITY aclError acltdtGetBufChainNum(acltdtBuf headBuf, uint32_t *num);
  292. /**
  293. * @ingroup AscendCL
  294. * @brief get acltdtBuf from acltdtBuf chain by index
  295. *
  296. * @param headBuf [IN] acltdtBuf chain head
  297. * @param index [IN] the index which is smaller than num acquired from acltdtGetBufChainNum
  298. * @param buf [OUT] the acltdtBuf from acltdtBuf on index
  299. *
  300. * @retval ACL_SUCCESS The function is successfully executed.
  301. * @retval OtherValues Failure
  302. *
  303. * @see acltdtAppendBufChain acltdtGetBufChainNum
  304. */
  305. ACL_FUNC_VISIBILITY aclError acltdtGetBufFromChain(acltdtBuf headBuf, uint32_t index, acltdtBuf *buf);
  306. /**
  307. * @ingroup AscendCL
  308. * @brief get private data buf address and size
  309. *
  310. * @param buf [IN] acltdtBuf
  311. * @param dataPtr [IN/OUT] pointer to the user ptr
  312. * @param size [IN] the current private data area size, less than or equal to 96B
  313. * @param offset [IN] address offset, less than or equal to 96B
  314. *
  315. * @retval ACL_SUCCESS The function is successfully executed.
  316. * @retval OtherValues Failure
  317. *
  318. * @see acltdtGetBufUserData
  319. */
  320. ACL_FUNC_VISIBILITY aclError acltdtGetBufUserData(const acltdtBuf buf, void *dataPtr, size_t size, size_t offset);
  321. /**
  322. * @ingroup AscendCL
  323. * @brief set private data buf address and size
  324. *
  325. * @param buf [OUT] acltdtBuf
  326. * @param dataPtr [IN] pointer to the user ptr
  327. * @param size [IN] the current private data area size, less than or equal to 96B
  328. * @param offset [IN] address offset, less than or equal to 96B
  329. *
  330. * @retval ACL_SUCCESS The function is successfully executed.
  331. * @retval OtherValues Failure
  332. *
  333. * @see acltdtSetBufUserData
  334. */
  335. ACL_FUNC_VISIBILITY aclError acltdtSetBufUserData(acltdtBuf buf, const void *dataPtr, size_t size, size_t offset);
  336. /**
  337. * @ingroup AscendCL
  338. * @brief copy buf ref
  339. *
  340. * @param buf [IN] acltdtBuf
  341. * @param newBuf [OUT] Make a reference copy of the data area of buf and
  342. * create a new buf header pointing to the same data area
  343. *
  344. * @retval ACL_SUCCESS The function is successfully executed.
  345. * @retval OtherValues Failure
  346. *
  347. * @see acltdtCopyBufRef
  348. */
  349. ACL_FUNC_VISIBILITY aclError acltdtCopyBufRef(const acltdtBuf buf, acltdtBuf *newBuf);
  350. /**
  351. * @ingroup AscendCL
  352. * @brief Create the queue attr
  353. *
  354. * @retval null for failed
  355. * @retval OtherValues success
  356. *
  357. * @see acltdtDestroyQueueAttr
  358. */
  359. ACL_FUNC_VISIBILITY acltdtQueueAttr *acltdtCreateQueueAttr();
  360. /**
  361. * @ingroup AscendCL
  362. * @brief Destroy the queue attr
  363. *
  364. * @param attr [IN] pointer to the queue attr
  365. *
  366. * @retval ACL_SUCCESS The function is successfully executed.
  367. * @retval OtherValues Failure
  368. *
  369. * @see acltdtCreateQueueAttr
  370. */
  371. ACL_FUNC_VISIBILITY aclError acltdtDestroyQueueAttr(const acltdtQueueAttr *attr);
  372. /**
  373. * @ingroup AscendCL
  374. * @brief Set parameter for queue attr
  375. *
  376. * @param attr [IN|OUT] pointer to the queue attr
  377. * @param type [IN] parameter type
  378. * @param len [IN] parameter length
  379. * @param param [IN] pointer to parameter value
  380. *
  381. * @retval ACL_SUCCESS for success, other for failure
  382. *
  383. * @see acltdtCreateQueueAttr
  384. */
  385. ACL_FUNC_VISIBILITY aclError acltdtSetQueueAttr(acltdtQueueAttr *attr, acltdtQueueAttrType type, size_t len,
  386. const void *param);
  387. /**
  388. * @ingroup AscendCL
  389. *
  390. * @brief Get parameter for queue attr.
  391. *
  392. * @param attr [IN] pointer to the queue attr
  393. * @param type [IN] parameter type
  394. * @param len [IN] parameter length
  395. * @param paramRetSize [OUT] pointer to parameter real length
  396. * @param param [OUT] pointer to parameter value
  397. *
  398. * @retval ACL_SUCCESS for success, other for failure
  399. *
  400. * @see acltdtCreateQueueAttr
  401. */
  402. ACL_FUNC_VISIBILITY aclError acltdtGetQueueAttr(const acltdtQueueAttr *attr, acltdtQueueAttrType type, size_t len,
  403. size_t *paramRetSize, void *param);
  404. /**
  405. * @ingroup AscendCL
  406. * @brief Create the queue route
  407. *
  408. * @param srcId [IN] src id of queue route
  409. * @param dstId [IN] dst id of queue route
  410. *
  411. * @retval null for failed
  412. * @retval OtherValues success
  413. *
  414. * @see acltdtDestroyQueueRoute
  415. */
  416. ACL_FUNC_VISIBILITY acltdtQueueRoute *acltdtCreateQueueRoute(uint32_t srcId, uint32_t dstId);
  417. /**
  418. * @ingroup AscendCL
  419. * @brief Destroy the queue attr
  420. *
  421. * @param route [IN] pointer to the queue route
  422. *
  423. * @retval ACL_SUCCESS The function is successfully executed.
  424. * @retval OtherValues Failure
  425. *
  426. * @see acltdtCreateQueueRoute
  427. */
  428. ACL_FUNC_VISIBILITY aclError acltdtDestroyQueueRoute(const acltdtQueueRoute *route);
  429. /**
  430. * @ingroup AscendCL
  431. *
  432. * @brief Get parameter for queue route.
  433. *
  434. * @param route [IN] pointer to the queue route
  435. * @param type [IN] parameter type
  436. * @param len [IN] parameter length
  437. * @param paramRetSize [OUT] pointer to parameter real length
  438. * @param param [OUT] pointer to parameter value
  439. *
  440. * @retval ACL_SUCCESS for success, other for failure
  441. *
  442. * @see acltdtCreateQueueRoute
  443. */
  444. ACL_FUNC_VISIBILITY aclError acltdtGetQueueRouteParam(const acltdtQueueRoute *route, acltdtQueueRouteParamType type,
  445. size_t len, size_t *paramRetSize, void *param);
  446. /**
  447. * @ingroup AscendCL
  448. * @brief Create the queue route list
  449. *
  450. * @retval null for failed
  451. * @retval OtherValues success
  452. *
  453. * @see acltdtDestroyQueueRouteList
  454. */
  455. ACL_FUNC_VISIBILITY acltdtQueueRouteList *acltdtCreateQueueRouteList();
  456. /**
  457. * @ingroup AscendCL
  458. * @brief Destroy the queue route list
  459. *
  460. * @param routeList [IN] pointer to the queue route list
  461. *
  462. * @retval ACL_SUCCESS The function is successfully executed.
  463. * @retval OtherValues Failure
  464. *
  465. * @see acltdtCreateQueueRouteList
  466. */
  467. ACL_FUNC_VISIBILITY aclError acltdtDestroyQueueRouteList(const acltdtQueueRouteList *routeList);
  468. /**
  469. * @ingroup AscendCL
  470. * @brief add queue route to the route list
  471. *
  472. * @param routeList [IN|OUT] pointer to the queue route list
  473. * @param route [IN] pointer to the queue route
  474. *
  475. * @retval ACL_SUCCESS The function is successfully executed.
  476. * @retval OtherValues Failure
  477. *
  478. * @see acltdtCreateQueueRouteList | acltdtCreateQueueRoute
  479. *
  480. */
  481. ACL_FUNC_VISIBILITY aclError acltdtAddQueueRoute(acltdtQueueRouteList *routeList, const acltdtQueueRoute *route);
  482. /**
  483. * @ingroup AscendCL
  484. * @brief get queue route from route list
  485. *
  486. * @param routeList [IN] pointer to the queue route list
  487. * @param index [IN] index of queue route in route list
  488. * @param route [IN|OUT] pointer to the queue route
  489. *
  490. * @retval ACL_SUCCESS The function is successfully executed.
  491. * @retval OtherValues Failure
  492. *
  493. * @see acltdtCreateQueueRouteList | acltdtCreateQueueRoute
  494. *
  495. */
  496. ACL_FUNC_VISIBILITY aclError acltdtGetQueueRoute(const acltdtQueueRouteList *routeList, size_t index,
  497. acltdtQueueRoute *route);
  498. /**
  499. * @ingroup AscendCL
  500. * @brief get queue route num from route list
  501. *
  502. * @param routeList [IN] pointer to the queue route list
  503. *
  504. * @retval the number of queue route
  505. *
  506. */
  507. ACL_FUNC_VISIBILITY size_t acltdtGetQueueRouteNum(const acltdtQueueRouteList *routeList);
  508. /**
  509. * @ingroup AscendCL
  510. * @brief Create the queue route query info
  511. *
  512. * @retval null for failed
  513. * @retval OtherValues success
  514. *
  515. * @see acltdtDestroyQueueRouteQueryInfo
  516. */
  517. ACL_FUNC_VISIBILITY acltdtQueueRouteQueryInfo *acltdtCreateQueueRouteQueryInfo();
  518. /**
  519. * @ingroup AscendCL
  520. * @brief Destroy the queue route query info
  521. *
  522. * @param info [IN] pointer to the queue route info
  523. *
  524. * @retval ACL_SUCCESS The function is successfully executed.
  525. * @retval OtherValues Failure
  526. *
  527. * @see acltdtCreateQueueRouteQueryInfo
  528. *
  529. */
  530. ACL_FUNC_VISIBILITY aclError acltdtDestroyQueueRouteQueryInfo(const acltdtQueueRouteQueryInfo *info);
  531. /**
  532. * @ingroup AscendCL
  533. * @brief Set parameter for queue route info
  534. *
  535. * @param attr [IN|OUT] pointer to the queue route info
  536. * @param type [IN] parameter type
  537. * @param len [IN] parameter length
  538. * @param param [IN] pointer to parameter value
  539. *
  540. * @retval ACL_SUCCESS for success, other for failure
  541. *
  542. * @see acltdtCreateQueueRouteQueryInfo
  543. */
  544. ACL_FUNC_VISIBILITY aclError acltdtSetQueueRouteQueryInfo(acltdtQueueRouteQueryInfo *param,
  545. acltdtQueueRouteQueryInfoParamType type, size_t len,
  546. const void *value);
  547. #ifdef __cplusplus
  548. }
  549. #endif
  550. #endif // INC_EXTERNAL_ACL_ACL_TDT_QUEUE_H_

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