Cాలు/asc-devkitాలు类型特性分类
remove_volatile【免费下载链接】asc-devkit本项目是CANN 推出的昇腾AI处理器专用的算子程序开发语言原生支持C和C标准规范主要由类库和语言扩展层构成提供多层级API满足多维场景算子开发诉求。项目地址: https://gitcode.com/cann/asc-devkit产品支持情况Ascend 950PR/Ascend 950DT支持Atlas A3 训练系列产品/Atlas A3 推理系列产品支持Atlas A2 训练系列产品/Atlas A2 推理系列产品支持Atlas 200I/500 A2 推理产品不支持Atlas 推理系列产品AI Core不支持Atlas 推理系列产品Vector Core不支持Atlas 训练系列产品不支持功能说明在程序编译时对传入的模板参数类型移除volatile限定符可以用于在编译时进行类型转换。函数原型template typename Tp struct remove_volatile;参数说明表1模板参数说明参数名含义Tp需要处理的类型包括基本类型如int、float等、复合类型如数组、指针、引用、用户自定义类型如类、结构体等以及volatile限定的类型。约束说明无返回值说明remove_volatile是一个结构体其提供一个嵌套类型type表示移除volatile限定符后的类型。通过remove_volatileTp::type来访问该类型。调用示例// Test non-volatile type ascendc_assert((AscendC::Std::is_same_vAscendC::Std::remove_volatileint::type, int)); ascendc_assert((AscendC::Std::is_same_vAscendC::Std::remove_volatiledouble::type, double)); ascendc_assert((AscendC::Std::is_same_vAscendC::Std::remove_volatilechar::type, char)); // Test volatile type ascendc_assert((AscendC::Std::is_same_vAscendC::Std::remove_volatilevolatile int::type, int)); ascendc_assert((AscendC::Std::is_same_vAscendC::Std::remove_volatilevolatile double::type, double)); ascendc_assert((AscendC::Std::is_same_vAscendC::Std::remove_volatilevolatile char::type, char)); ascendc_assert((AscendC::Std::is_same_vAscendC::Std::remove_volatile_tint, int)); ascendc_assert((AscendC::Std::is_same_vAscendC::Std::remove_volatile_tdouble, double)); ascendc_assert((AscendC::Std::is_same_vAscendC::Std::remove_volatile_tvolatile int, int)); ascendc_assert((AscendC::Std::is_same_vAscendC::Std::remove_volatile_tvolatile double, double));【免费下载链接】asc-devkit本项目是CANN 推出的昇腾AI处理器专用的算子程序开发语言原生支持C和C标准规范主要由类库和语言扩展层构成提供多层级API满足多维场景算子开发诉求。项目地址: https://gitcode.com/cann/asc-devkit创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考