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.

rt_stars.h 3.2 kB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 CCE_RUNTIME_RT_STARS_H
  17. #define CCE_RUNTIME_RT_STARS_H
  18. #include "base.h"
  19. #if defined(__cplusplus)
  20. extern "C" {
  21. #endif
  22. /**
  23. * @ingroup rt_stars
  24. * @brief launch stars task.
  25. * used for send star sqe directly.
  26. * @param [in] taskSqe stars task sqe
  27. * @param [in] sqeLen stars task sqe length
  28. * @param [in] stream associated stream
  29. * @return RT_ERROR_NONE for ok, others failed
  30. */
  31. RTS_API rtError_t rtStarsTaskLaunch(const void *taskSqe, uint32_t sqeLen, rtStream_t stream);
  32. /**
  33. * @ingroup rt_stars
  34. * @brief create cdq instance.
  35. * @param [in] batchNum batch number
  36. * @param [in] batchSize batch size
  37. * @param [in] queName cdq name
  38. * @return RT_ERROR_NONE for ok, ACL_ERROR_RT_NO_CDQ_RESOURCE for no cdq resources
  39. */
  40. RTS_API rtError_t rtCdqCreate(uint32_t batchNum, uint32_t batchSize, const char_t *queName);
  41. /**
  42. * @ingroup rt_stars
  43. * @brief destroy cdq instance.
  44. * @param [in] queName cdq name
  45. * @return RT_ERROR_NONE for ok, others failed
  46. */
  47. RTS_API rtError_t rtCdqDestroy(const char_t *queName);
  48. /**
  49. * @ingroup rt_stars
  50. * @brief get free batch in the queue.
  51. * @param [in] queName cdq name
  52. * @param [in] timeout batch size
  53. * @param [out] batchId batch index
  54. * @return RT_ERROR_NONE for ok, ACL_ERROR_RT_WAIT_TIMEOUT for timeout
  55. */
  56. RTS_API rtError_t rtCdqAllocBatch(const char_t *queName, int32_t timeout, uint32_t *batchId);
  57. /**
  58. * @ingroup rt_stars
  59. * @brief launch a write_cdqm task on the stream.
  60. * When the task is executed, the data information will be inserted into the cdqe index position of the queue.
  61. * @param [in] queName cdq name
  62. * @param [in] cdqeIndex cdqe index
  63. * @param [in] data cdqe infomation
  64. * @param [in] dataSize data size
  65. * @param [in] stream launch task on the stream
  66. * @return RT_ERROR_NONE for ok, others failed
  67. */
  68. RTS_API rtError_t rtCdqEnQueue(const char_t *queName, uint32_t cdqeIndex, void *data, uint32_t dataSize,
  69. rtStream_t stream);
  70. /**
  71. * @ingroup rt_stars
  72. * @brief launch a write_cdqm task on the stream.
  73. * When the task is executed, the data information will be inserted into the cdqe index position of the queue.
  74. * @param [in] queName cdq name
  75. * @param [in] cdqeIndex cdqe index
  76. * @param [in] data cdqe infomation
  77. * @param [in] dataSize data size
  78. * @param [in] stream launch task on the stream
  79. * @return RT_ERROR_NONE for ok, others failed
  80. */
  81. RTS_API rtError_t rtCdqEnQueuePtrMode(const char_t *queName, uint32_t cdqeIndex, const void *ptrAddr,
  82. rtStream_t stream);
  83. #if defined(__cplusplus)
  84. }
  85. #endif
  86. #endif // CCE_RUNTIME_RT_STARS_H

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