Skills

Vectorization

Design, implement, optimize, and review SIMD code in .NET.

Install

npx skills add dotnet/skills --skill vectorization -g -a claude-code -y
Repository
dotnet/skills5.8k
Category
Design
Updated
3d ago
License
MIT
Context cost
Mediumabout 2,864 tokens
Runs scripts
No, instructions only

What it does

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 the generic Vector type, for contract equivalence, tail handling, memory safety, portability, fallbacks, and measured performance. DO NOT USE FOR: performance work unrelated to SIMD or vectorization.

.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:

InputRequiredWhat to establish
Scalar implementation and testsYesExisting contract, representative call sites, and supported overlap
Target frameworks and platformsYesAvailable SIMD APIs and architectures that must behave consistently
Build and test workflowYesThe repository's normal commands and how to launch separate test processes
Representative workload or benchmarkFor optimizationTypical 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

Read the whole SKILL.md on GitHub

More in Design