1 2 |
template <typename T> __aicore__ inline void InitSpmBuffer(const GlobalTensor<T>& workspace, const int32_t bufferSize) |
1
|
__aicore__ inline void InitSpmBuffer(const int32_t bufferSize) |
Atlas A2训练系列产品/Atlas 800I A2推理产品,不支持暂存到L1 Buffer初始化接口。
参数名称 |
输入/输出 |
含义 |
---|---|---|
wokspace |
输入 |
workspace地址。 |
bufferSize |
输入 |
SPM Buffer的大小,单位是字节。 |
Atlas 训练系列产品
Atlas推理系列产品AI Core
Atlas A2训练系列产品/Atlas 800I A2推理产品
无
无
1 2 3 4 5 |
AscendC::TPipe pipe; int len = 1024; // 设置spm buffer为1024个类型为T的数据 workspace_gm.SetGlobalBuffer((__gm__ T *)usrWorkspace, len); // 此处的usrWorkspace为用户自定义的workspace auto gm = workspace_gm[AscendC::GetBlockIdx() * len]; pipe.InitSpmBuffer(gm, len * sizeof(T)); |
1 2 3 |
AscendC::TPipe pipe; int len = 1024; // 设置spm buffer为1024个类型为T的数据 pipe.InitSpmBuffer(len * sizeof(T)); |