GetLogMaxMinTmpSize
功能说明
Host侧接口,用于获取Log接口能完成计算所需最小的临时空间大小,此空间为预留空间,即需要保证预留有足够的物理空间,用于执行计算。
函数原型
void GetLogMaxMinTmpSize(const ge::Shape& srcShape, const uint32_t typeSize, const bool isReuseSource, uint32_t& maxValue, uint32_t& minValue)
void GetLog10MaxMinTmpSize(const ge::Shape& srcShape, const uint32_t typeSize, const bool isReuseSource, uint32_t& maxValue, uint32_t& minValue)
void GetLog2MaxMinTmpSize(const ge::Shape& srcShape, const uint32_t typeSize, const bool isReuseSource, uint32_t& maxValue, uint32_t& minValue)
参数说明
表 1 接口参数列表
返回值说明
无
约束说明
无
调用示例
完整的调用样例请参考更多样例。
-
GetLogMaxMinTmpSize接口样例:
// 输入shape信息为1024;算子输入的数据类型为half;不允许修改源操作数 std::vector<int64_t> shape_vec = {1024}; ge::Shape shape(shape_vec); uint32_t maxValue = 0; uint32_t minValue = 0; auto tmp_size = AscendC::GetLogMaxMinTmpSize(shape, 2, false, maxValue, minValue); -
GetLog10MaxMinTmpSize接口样例:
// 输入shape信息为1024;算子输入的数据类型为half;不允许修改源操作数 std::vector<int64_t> shape_vec = {1024}; ge::Shape shape(shape_vec); uint32_t maxValue = 0; uint32_t minValue = 0; auto tmp_size = AscendC::GetLog10MaxMinTmpSize(shape, 2, false, maxValue, minValue); -
GetLog2MaxMinTmpSize接口样例:
// 输入shape信息为1024;算子输入的数据类型为half;不允许修改源操作数 std::vector<int64_t> shape_vec = {1024}; ge::Shape shape(shape_vec); uint32_t maxValue = 0; uint32_t minValue = 0; auto tmp_size = AscendC::GetLog2MaxMinTmpSize(shape, 2, false, maxValue, minValue);