exp-simd-vectorization
仓库创建 2026年2月4日最近提交 18 小时前SkillHot 收录 20 天前
▸ 精选理由
覆盖多种矢量指令宽度与常见算法,适合性能敏感代码库。
这个 Skill 做什么
为 .NET 8+ 的热路径标量循环使用 Vector128/256/512 与 TensorPrimitives 进行矢量化优化。
帮你把 .NET 8+ 中的性能热点标量循环用 SIMD 指令加速,支持 Vector128/Vector256/Vector512,也可以用 TensorPrimitives 把手写循环替成一次性 API 调用。适合对吞吐量或延迟敏感的场景,比如字节范围校验、字符计数、大量按位运算、跨类型批量转换和浮点密集计算时使用。特别之处是兼顾底层跨平台 SIMD 原语和高阶 TensorPrimitives 接口,能在不大幅牺牲可读性的前提下把热路径矢量化。
▸ 展开 SKILL.md 英文原文
Optimizes hot-path scalar loops in .NET 8+ with cross-platform Vector128/Vector256/Vector512 SIMD intrinsics, or replaces manual math loops with single TensorPrimitives API calls. Covers byte-range validation, character counting, bulk bitwise ops, cross-type conversion, fused multi-array computations, and float/double math operations.
4.8k
Stars
351
Forks
40
仓库内 Skill
+610
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/dotnet/skills/main/plugins/dotnet-experimental/skills/exp-simd-vectorization/SKILL.md或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/dotnet/skills/main/plugins/dotnet-experimental/skills/exp-simd-vectorization/SKILL.md"SKILL.MD 节选查看完整文件 ↗
# SIMD Vectorization ## Decision Gate 1. **Check `Span<T>` and `MemoryExtensions` first.** If the operation can be expressed using built-in `Span<T>` methods (e.g., `Contains`, `IndexOf`, `CopyTo`, `SequenceEqual`) or `MemoryExtensions`, use them — no additional dependency is needed and the runtime already vectorizes many of these internally. 2. **Check for TensorPrimitives next.** If one or more TensorPrimitives methods cover the operation → use them. If the `.csproj` does NOT already reference `System.Numerics.Tensors`, **add the package**, for example: `<PackageReference Include="System.Numerics.Tensors" />` (or use the versioning approach already used by your solution). Then replace the
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有