cuda-c-patterns

Provide CUDA-C kernel pattern templates for vector operations, reductions, and matrix multiplication.

258|48|Updated Jun 22, 2020
One-click install
npx skills add https://github.com/mindspore-ai/akg --skill cuda-c-patterns-mindspore-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cuda-c-patterns
Source: https://github.com/mindspore-ai/akg/tree/main/akg_agents/python/akg_agents/op/resources/skills/cuda-c/guides/cuda-c-patterns
Command: npx skills add https://github.com/mindspore-ai/akg --skill cuda-c-patterns-mindspore-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

CUDA-C kernel development for GPU compute often demands boilerplate and expert tuning. This Skill provides reusable pattern templates for vector operations, reductions, and matrix multiplication to speed kernel development and improve performance.

Core Features & Use Cases

  • Vector operation pattern with element-wise kernels (add, mul, etc.)
  • Reduction pattern with shared memory and atomic reductions
  • Matrix multiplication pattern with tiling and optional shared memory
  • Use case: implement custom operators for DL workloads on CUDA GPUs

Quick Start

Instantiate a vector add kernel using the vector pattern and adapt block size and grid to your CUDA target.

Frequently Asked Questions about cuda-c-patterns

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

FAQPage Schema
How do I write a high-performance CUDA-C kernel for vector operations?

To write a high-performance CUDA-C kernel for vector operations, use element-wise pattern templates for tasks like add or mul, adapting the block size and grid dimensions to your specific CUDA target hardware for efficient execution.

What is the best way to implement reduction operations in CUDA using shared memory?

The best way to implement reduction operations in CUDA is by applying reusable pattern templates that utilize shared memory and atomic reductions, significantly reducing boilerplate code and improving performance across CUDA-enabled GPUs.

Does this CUDA-C pattern template support tiled matrix multiplication?

Yes, the CUDA-C pattern templates support matrix multiplication by providing built-in tiling and optional shared memory configurations, allowing engineers to quickly implement efficient custom operators for deep learning workloads.

When do I need CUDA kernel patterns for matrix multiplication and reductions?

You need CUDA kernel patterns for matrix multiplication and reductions when developing custom operators for deep learning workloads, requiring expert tuning and boilerplate code to achieve high-performance GPU compute efficiency.

Can I adapt vector add kernel templates to different input sizes and CUDA hardware?

Yes, you can instantiate a vector add kernel using the vector pattern and adapt the block size and grid layout to match different input sizes and specific CUDA-enabled GPU hardware configurations.