cuda
Use when writing CUDA kernels, managing the thread, block, and grid hierarchy, tiling shared memory, using streams, setting nvcc flags, or using Thrust. Not for kernel debugging: use cuda-debugging.
Install / Use
npx skills add OutlineDriven/outline-driven-development --skill cudaInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Content & MediaSupported Platforms
Our assessment of cuda
cuda scores 65/100 on our quality scale, 1116th of 1,180 Content & Media skills we index.
Its SKILL.md is 7.1 KB long, split into 6 sections with 2 code examples: a thorough specification that gives an agent plenty to work with.
It has no GitHub stars yet, so there is no community track record; judge it on its content.
Maintenance, license and trust
- We could not determine when the repository was last updated.
- No license is declared. By default that means all rights are reserved: you can read it, but reusing or redistributing it is not clearly permitted. Ask the author before building on it commercially.
- Its trust signals score 68/100, with 3 cautions from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
cuda compared with similar skills
All 4 of these similar skills score higher than cuda; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| cuda (this skill)by OutlineDriven | 65 | 0 | — | SKILL.md |
| siyuanby siyuan-note | 100 | 46.9k | today | MCP Server |
| algorithmic-artby anthropics | 100 | 177.9k | 34d ago | SKILL.md |
| pptxby anthropics | 100 | 177.9k | 34d ago | SKILL.md |
| designby nextlevelbuilder | 100 | 137.2k | 12d ago | SKILL.md |
Frequently asked questions
- How do I install cuda?
- Run
npx skills add OutlineDriven/outline-driven-development --skill cuda. The install tabs above show the steps for each supported agent. - Which AI agents does cuda work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is cuda safe to use?
- It declares no license and scores 68/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is cuda still maintained?
- We could not determine when the repository was last updated.
Skill content
View source on GitHubname: cuda description: 'Use when writing CUDA kernels, managing the thread, block, and grid hierarchy, tiling shared memory, using streams, setting nvcc flags, or using Thrust. Not for kernel debugging: use cuda-debugging.'
CUDA
Contract
| Field | Bound contract | |---|---| | Trigger | CUDA C or C++ kernel code is being written, optimized, or reviewed: launch configuration, memory hierarchy, streams, nvcc flags, Thrust, or known performance traps such as warp divergence and uncoalesced access. | | Authority | Read-only. The skill emits guidance and code; it writes no files. Nothing to roll back. No remote mutation. | | Side effect | Guidance, code samples, and flag recommendations in chat output. | | Done | A launch configuration, memory plan, build command, and pitfall review exist for the kernel in question, each grounded in the toolkit version the project pins. |
Inputs
- Kernel goal (required): the operation to move to the GPU, or the existing kernel under review.
- GPU model (required if code must run on it): compute capability from
nvidia-smi --query-gpu=compute_cap. - Toolkit version (required if not inferrable):
nvcc --version. The grounded current stable is CUDA Toolkit 13.3 Update 1. - Build system (optional): existing nvcc or CMake CUDA flags.
Procedure
- Identify the GPU compute capability and toolkit version. CUDA 13.x supports Turing (sm_75) and later; older targets require an older toolkit. Done when: the
sm_XXtarget and toolkit line are recorded, or the mismatch is reported. - Write or review the launch: threads grouped into blocks, blocks into a grid. Cap a block at 1024 threads. Compute
blocks = (n + threads - 1) / threadsand guard every load and store withif (i < n). Check each launch withcudaGetLastError()and each sync with a second check. Done when: the launch math covers every element and both error checks are present. - Place data at the right level of the hierarchy. Registers hold per-thread scalars. Shared memory holds tiles reused across the block. Global memory holds large arrays, read coalesced. Constant memory holds broadcast read-only data. Latency numbers below are order-of-magnitude guides on current parts, not constants:
| Memory | Scope | Typical latency | Use |
|---|---|---|---|
| Registers | Per thread | ~1 cycle | Scalars, indices |
| Shared (__shared__) | Per block | low tens of cycles | Tiled data |
| Global | Device | hundreds of cycles | Large arrays, coalesced |
| Constant (__constant__) | Device, cached | fast broadcast | Parameters, lookup tables |
Done when: every buffer has an assigned level and tiles reuse shared memory.
- Tile matrix work through shared memory and
__syncthreads():
#define TILE 16
__global__ void matmul_tiled(const float *A, const float *B, float *C, int N) {
__shared__ float As[TILE][TILE];
__shared__ float Bs[TILE][TILE];
int row = blockIdx.y * TILE + threadIdx.y;
int col = blockIdx.x * TILE + threadIdx.x;
float sum = 0.0f;
for (int t = 0; t < (N + TILE - 1) / TILE; t++) {
As[threadIdx.y][threadIdx.x] = (row < N && t * TILE + threadIdx.x < N)
? A[row * N + t * TILE + threadIdx.x] : 0.0f;
Bs[threadIdx.y][threadIdx.x] = (col < N && t * TILE + threadIdx.y < N)
? B[(t * TILE + threadIdx.y) * N + col] : 0.0f;
__syncthreads();
for (int k = 0; k < TILE; k++)
sum += As[threadIdx.y][k] * Bs[k][threadIdx.x];
__syncthreads();
}
if (row < N && col < N)
C[row * N + col] = sum;
}
Done when: each tile load is bounds-checked and the sync points separate load from use.
- Move copies off the critical path with streams and pinned memory.
cudaMallocHostpins host buffers socudaMemcpyAsyncoverlaps compute with DMA. Assign each stage its owncudaStream_tand pass the stream as the fourth launch parameter. Synchronize withcudaStreamSynchronize, not the whole device, when streams run independently. Done when: copies and kernels overlap across streams or a single-stream design is justified. - Select nvcc flags for the build purpose:
| Flag | Effect |
|---|---|
| -O3 | Optimize device code |
| -arch=sm_XX | Target one architecture |
| -gencode arch=compute_XX,code=sm_XX | Fat binary for several GPUs |
| -G | Disable optimizations for cuda-gdb |
| -lineinfo | Source-line correlation in profiles |
| --use_fast_math | Faster, less precise math intrinsics |
| -maxrregcount=N | Cap registers per thread |
| -Xcompiler -fopenmp | Pass host flags to the host compiler |
Done when: the build command targets the recorded sm_XX and omits -G outside debugging.
- Estimate occupancy before tuning by hand. Call
cudaOccupancyMaxActiveBlocksPerMultiprocessor, or readsm__warps_active.avg.pct_of_peak_sustained_activein Nsight Compute. Treat a low achieved-occupancy reading as a signal to check register pressure, shared memory size, and block size against the measured stall reasons, not as a failure on its own. A compute-bound kernel with enough instruction-level parallelism can run well at a low occupancy; a latency-bound streaming kernel usually cannot. Done when: occupancy is measured and any change made to registers, shared memory, or block size is tied to a named limiting factor. - Use Thrust for sort, scan, and reduce instead of hand-written kernels:
#include <thrust/device_vector.h>
#include <thrust/sort.h>
#include <thrust/reduce.h>
thrust::device_vector<int> d_vec(1000000);
thrust::sort(d_vec.begin(), d_vec.end());
int sum = thrust::reduce(d_vec.begin(), d_vec.end());
Write custom kernels for fused, domain-specific operations. Done when: every primitive that Thrust covers is delegated or the custom kernel is justified.
- Review the kernel against the two common traps. Divergence: threads in a warp of 32 execute in lockstep, so a branch on
threadIdxserializes the paths. Uncoalesced access: consecutive threads must read consecutive addresses; a strided read likedata[threadIdx.x * stride]defeats the memory system. Done when: no hot branch splits a warp and every hot load is coalesced.
Failure and recovery
| Failure class | Behavior |
|---|---|
| GPU or toolkit version unknown | Ask for nvidia-smi --query-gpu=compute_cap and nvcc --version output. Guidance stays generic until both are known. |
| cudaErrorIllegalAddress (700) | Out-of-bounds device pointer. Re-run under compute-sanitizer --tool memcheck and add bounds checks. |
| cudaErrorLaunchTimeout (702) | Kernel exceeded the watchdog limit, primarily Windows TDR. Split the kernel or shrink the work per launch. |
| no kernel image available | Binary lacks this GPU's sm_XX. Rebuild with the recorded compute capability. |
| Copies dominate the timeline | Host buffers are pageable. Pin them with cudaMallocHost. |
| CPU and GPU results differ | Race on shared or global memory. Audit __syncthreads() placement and use atomics for cross-thread reductions. |
Output
Guidance in chat: the launch configuration, the memory plan per buffer, the nvcc build command for the recorded target, the occupancy measurement with its limiting factor, and the pitfall review. Each recommendation names the toolkit and architecture it assumes.
Related Skills
siyuan
46.9kAn open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
algorithmic-art
177.9kCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems.
pptx
177.9kUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an em…
design
137.2kComprehensive design skill: brand identity, design tokens, UI styling, logo generation (55 styles, Gemini, Atlas Cloud, or MuAPI AI), corporate identity program (50 deliverables, CIP mockups), HTML presentations (Chart.js), banner design (22 styles, social/ads/web/print), icon design (15 styles, SVG…
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
