Agent skill · dotnet
vectorization
Design, implement, optimize, and review SIMD code in .NET. USE FOR: vectorizing scalar loops with TensorPrimitives, Vector64/128/256/512, or platform hardware intrinsics; reviewing existing SIMD code, including Vector<T>, for contract equivalence, tail handling, memory safety, portability, fallbacks, and measured performance. DO NOT USE FOR: performance work unrelated to SIMD or vectorization.
What it needs
About 7k tokens when loaded.
What this skill does
.NET SIMD vectorization Produce a portable optimization that preserves the scalar contract, remains memory-safe at every length, and earns its complexity with measured results. Read the official SIMD and hardware-intrinsics guidance first and follow its comprehensive implementation templates. In particular, use its self-contained per-width dispatch, dedicated small-input handling, loop, and remainder shapes rather than reducing them to a chain of width checks. This skill supplies the decision rules and validation checks to apply while changing real code. Inputs and prerequisites Discover these from the repository before asking the user: Input Required What to establish --- --- --- Scalar implementation and tests Yes Existing contract, representative call sites, and supported overlap Target frameworks and platforms Yes Available SIMD APIs and architectures that must behave consistently Build and test workflow Yes The repository's normal commands and how to launch separate test processes Representative workload or benchmark For optimization Typical input sizes and the baseline to beat Do not add a package merely because an API exists there. First check the target framework and the project's existing dependency/versioning policy. Core rules 1. Use the highest-level API that matches the contract, then stop. Span<T> and string operations, TensorPrimitives, and tensor types already accelerate many operations. LINQ reductions such as Sum, Min, Max, and Average can also accelerate when the source exposes its underlying span. Verify empty-input and floating-point behavior rather than assuming similarly named operations are interchangeable. Once an existing API preserves the contract, use it instead of continuing into handwritten SIMD. Before writing an explicit loop, name the framework APIs considered and why none applies. Fixed-shape System.Numerics types remain appropriate for graphics and similar domains. 2. Start new explicit SIMD loops with Vector128<T>. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills dotnet/vectorization