CANN/asc-devkit资源管理API示例
Resource Management API Examples Introduction
【免费下载链接】asc-devkit本项目是CANN 推出的昇腾AI处理器专用的算子程序开发语言,原生支持C和C++标准规范,主要由类库和语言扩展层构成,提供多层级API,满足多维场景算子开发诉求。项目地址: https://gitcode.com/cann/asc-devkit
Overview
This directory contains examples for multiple APIs related to resource management. Each example is based on the Ascend C <<<>>> direct call method, supporting implementation of both the main function and kernel function in the same cpp file.
Example List
| Directory Name | Description |
|---|---|
| tpipe_reuse | This example implements TPipe repeated allocation and usage based on TPipe::Init and TPipe::Destroy. |
| get_tpipe_ptr | This example obtains the global TPipe pointer based on GetTPipePtr, allowing the kernel function to perform TPipe-related operations without explicitly passing the TPipe pointer. |
| tbufpool_management | This example implements TBufPool memory resource management based on TPipe::InitBufPool and TBufPool::InitBufPool interfaces, demonstrating usage patterns such as TBufPool resource allocation, memory partitioning, memory reuse, and custom TBufPool. |
| list_tensor_desc_input | This example implements an AddN example based on the static Tensor programming model, using the ListTensorDesc structure to handle dynamic input parameters, combined with static memory allocation and event synchronization mechanisms to achieve coordinated scheduling of data transfer and computation tasks. |
| tmp_buffer | This example initializes TBuf memory space based on the TPipe::InitBuffer interface and uses TBuf temporary buffer for data conversion during computation, implementing a vector addition (Add) example with bfloat16_t data type. |
| get_ub_size | This example demonstrates the usage of GetUBSizeInBytes and GetRuntimeUBSize interfaces, which are used to obtain the maximum user-available UB (Unified Buffer) size in bytes. |
【免费下载链接】asc-devkit本项目是CANN 推出的昇腾AI处理器专用的算子程序开发语言,原生支持C和C++标准规范,主要由类库和语言扩展层构成,提供多层级API,满足多维场景算子开发诉求。项目地址: https://gitcode.com/cann/asc-devkit
创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考
