CANN/asc-devkit:remainderf浮点余数函数 remainderf【免费下载链接】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 训练系列产品不支持功能说明获取输入数据x除以y的余数。求余数时商取最接近x除以y浮点数结果的整数当x除以y的浮点数结果与左右最接近的整数距离相等时商取偶数。函数原型inline float remainderf(float x, float y)参数说明表1参数说明参数名输入/输出描述x输入源操作数。y输入源操作数。返回值说明输入数据x除以y的余数。y为0时返回值为nan。x为inf或-inf时返回值为nan。x为有限数y为inf或-inf时返回值为x。xy任意一个为nan时返回值为nan。约束说明无需要包含的头文件使用该接口需要包含simt_api/math_functions.h头文件。#include simt_api/math_functions.h调用示例SIMT编程场景__global__ __launch_bounds__(256) void compute_remainderf(float *result, const float *x, const float *y, uint32_t count) { const uint32_t idx blockIdx.x * blockDim.x threadIdx.x; if (idx count) { return; } result[idx] remainderf(x[idx], y[idx]); }SIMD与SIMT混合编程场景__simt_vf__ __launch_bounds__(256) inline void compute_remainderf_vf(__gm__ float *result, __gm__ const float *x, __gm__ const float *y, uint32_t count) { const uint32_t idx blockIdx.x * blockDim.x threadIdx.x; if (idx count) { return; } result[idx] remainderf(x[idx], y[idx]); } __global__ __vector__ void run_remainderf(__gm__ float *result, __gm__ const float *x, __gm__ const float *y, uint32_t count) { asc_vf_callcompute_remainderf_vf(dim3(256), result, x, y, count); }输入输出示例如下x0.25, 0.75, 1.25, 1.75 y1.25, 2.25, 3.25, 4.25 result: 0.25 0.75 1.25 1.75【免费下载链接】asc-devkit本项目是CANN 推出的昇腾AI处理器专用的算子程序开发语言原生支持C和C标准规范主要由类库和语言扩展层构成提供多层级API满足多维场景算子开发诉求。项目地址: https://gitcode.com/cann/asc-devkit创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

相关新闻

最新新闻

SerenityOS 命令行选项解析指南:getopt 与 getopt_long 用法、返回值与底层实现

SerenityOS 命令行选项解析指南:getopt 与 getopt_long 用法、返回值与底层实现

SerenityOS 命令行选项解析指南:getopt 与 getopt_long 用法、返回值与底层实现 【免费下载链接】serenity The Serenity Operating System 🐞 项目地址: https://gitcode.com/GitHub_Trending/se/serenity 导读 本文以 getopt(3) 手册 为核心&a…

2026/9/23 4:54:42
轻量服务器还是ECS?大促云服务器选购与避坑实战指南

轻量服务器还是ECS?大促云服务器选购与避坑实战指南

每年大促节点,群里永远有人在问同一个问题:“38元的轻量服务器到底怎么抢?为什么我每次点进去都是已售罄?68元直购和99元的ECS我到底选哪个?”作为一个常年帮团队和自己采购云服务器的老用户,我太清楚这种纠…

2026/9/23 8:01:55
为 AI 代理的 Review 动作编写 Cedar 审批门控策略:review-agent-governance 策略编写实战指南

为 AI 代理的 Review 动作编写 Cedar 审批门控策略:review-agent-governance 策略编写实战指南

为 AI 代理的 Review 动作编写 Cedar 审批门控策略:review-agent-governance 策略编写实战指南 【免费下载链接】agents Multi-harness agentic plugin marketplace for Claude Code, Codex, Cursor, OpenCode, GitHub Copilot, and Google Antigravity 项目地址:…

2026/9/23 8:02:11
PaddleOCR 手写数学公式识别算法 CAN 实战指南:Counting-Aware Network 训练、评估与推理部署

PaddleOCR 手写数学公式识别算法 CAN 实战指南:Counting-Aware Network 训练、评估与推理部署

PaddleOCR 手写数学公式识别算法 CAN 实战指南:Counting-Aware Network 训练、评估与推理部署 【免费下载链接】PaddleOCR Turn any PDF or image document into structured data for your AI. A powerful, lightweight OCR toolkit that bridges the gap between i…

2026/9/23 8:01:38
Spring源码解析:构造器注入的类型转换与候选匹配机制

Spring源码解析:构造器注入的类型转换与候选匹配机制

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

2026/9/23 8:01:21
openai-agents-python 多模型接入指南:深入解析 AnyLLMModel 适配层与 any-llm 路由

openai-agents-python 多模型接入指南:深入解析 AnyLLMModel 适配层与 any-llm 路由

openai-agents-python 多模型接入指南:深入解析 AnyLLMModel 适配层与 any-llm 路由 【免费下载链接】openai-agents-python A lightweight, powerful framework for multi-agent workflows 项目地址: https://gitcode.com/GitHub_Trending/op/openai-agents-pyth…

2026/9/23 8:02:28

日新闻

周新闻