krnopt-cuda-coding

Generate CUDA kernel templates with explicit ownership and synchronization.

Updated May 27, 2026
One-click install
npx skills add https://github.com/igamenovoer/domain-skills --skill krnopt-cuda-coding
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: krnopt-cuda-coding
Source: https://github.com/igamenovoer/domain-skills/tree/main/domain/cuda/krnopt-cuda-coding
Command: npx skills add https://github.com/igamenovoer/domain-skills --skill krnopt-cuda-coding

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps engineers write CUDA kernels that are correct, structurally clear, and easy to verify, by enforcing an explicit ownership model, deliberate memory design, and disciplined synchronization.

Core Features & Use Cases

  • Explicit thread/warp/block ownership mapping to simplify reasoning and correctness checks.
  • Structured memory access plans that promote coalescing and reuse, with guided shared memory usage when necessary.
  • Clear dtype and instruction-path choices aligned to architecture targets, preventing silent slow paths.
  • Step-by-step coding discipline to keep correctness dominant before optimization, enabling safer profiling and iterative improvement.
  • Real-world use: authoring or refactoring CUDA kernels for matrix ops, image processing, or device-side utilities.

Quick Start

Create a CUDA kernel scaffold with explicit ownership, explicit bounds checks, and a clearly documented data flow, then progressively validate correctness before optimizing.

Frequently Asked Questions about krnopt-cuda-coding

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a correct CUDA kernel with proper memory layout and synchronization?

To write a correct CUDA kernel, enforce an explicit thread and block ownership model, plan memory access patterns for coalescing, and apply disciplined synchronization to ensure predictable performance and easier validation.

What is the best way to structure thread and block ownership in a CUDA kernel?

Structuring thread and block ownership requires explicitly mapping data elements to specific threads or warps, which simplifies reasoning about execution flow and prevents race conditions during memory operations.

How do I refactor CUDA kernels to improve memory coalescing and shared memory usage?

Refactoring CUDA kernels involves reorganizing memory access patterns to promote coalescing and reuse, selecting appropriate tile shapes, and applying shared memory only when necessary to optimize bandwidth.

When do I need explicit bounds checks and dtype consistency in CUDA programming?

Explicit bounds checks and dtype consistency are needed when authoring or refactoring CUDA kernels to prevent silent slow paths, ensure data integrity, and align instruction paths with specific architecture targets.

Can I use this approach for both matrix operations and image processing kernels?

Yes, this approach applies to authoring or refactoring CUDA kernels for matrix operations, image processing, or device-side utilities, ensuring correctness through a documented validation path before performance profiling.