# Vectorization

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

- Repository: https://github.com/dotnet/skills (5787 stars)
- Category: Design
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add dotnet/skills --skill vectorization -g -a claude-code -y`
Codex: `npx skills add dotnet/skills --skill vectorization -g -a codex -y`
Cursor: `npx skills add dotnet/skills --skill vectorization -g -a cursor -y`
Gemini CLI: `npx skills add dotnet/skills --skill vectorization -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add dotnet/skills`

## Description

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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# .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](https://learn.microsoft.com/dotnet/standard/simd) 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

The rest: https://github.com/dotnet/skills/blob/HEAD/plugins/dotnet-advanced/skills/vectorization/SKILL.md
