Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Deep integration with NVIDIA CUDA toolkit for kernel development, compilation, and debugging. Execute nvcc compilation with optimization flags analysis, generate and validate CUDA kernel code, analyze PTX/SASS assembly output, and configure execution parameters.
.claude/skills/a5c-ai-cuda-toolkit/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 28% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 80% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 31% | 0% |
| case-15 | ✗→✓ | ▲ Improved | 129% | 0% |
| case-18 | ✗→✓ | ▲ Improved | 79% | 0% |
You are cuda-toolkit - a specialized skill for NVIDIA CUDA toolkit integration, providing expert capabilities for kernel development, compilation, and debugging workflows.
This skill enables AI-powered CUDA development operations including:
Compile CUDA programs with various optimization flags:
bash# Basic compilation nvcc -o program program.cu # Optimized release build nvcc -O3 -use_fast_math -o program program.cu # Debug build with line info nvcc -G -lineinfo -o program_debug program.cu # Specify compute capability nvcc -arch=sm_80 -o program program.cu # Generate PTX for multiple architectures nvcc -gencode arch=compute_70,code=sm_70 \ -gencode arch=compute_80,code=sm_80 \ -o program program.cu # Verbose compilation nvcc -v --ptxas-options=-v -o program program.cu
Generate properly structured CUDA kernels:
cuda// Thread indexing patterns __global__ void kernel1D(float* data, int n) { int idx = blockIdx.x * blockDim.x + threadIdx.x; if (idx < n) { data[idx] = data[idx] * 2.0f; } } __global__ void kernel2D(float* data, int width, int height) { int x = blockIdx.x * blockDim.x + threadIdx.x; int y = blockIdx.y * blockDim.y + threadIdx.y; if (x < width && y < height) { int idx = y * width + x; data[idx] = data[idx] * 2.0f; } } __global__ void kernel3D(float* data, int dimX, int dimY, int dimZ) { int x = blockIdx.x * blockDim.x + threadIdx.x; int y = blockIdx.y * blockDim.y + threadIdx.y; int z = blockIdx.z * blockDim.z + threadIdx.z; if (x < dimX && y < dimY && z < dimZ) { int idx = z * dimX * dimY + y * dimX + x; data[idx] = data[idx] * 2.0f; } }
Calculate optimal launch parameters:
cuda// Launch configuration helper void launchKernel(float* d_data, int n) { int blockSize = 256; // Common optimal block size int numBlocks = (n + blockSize - 1) / blockSize; // Limit blocks to device maximum int deviceId; cudaGetDevice(&deviceId); cudaDeviceProp props; cudaGetDeviceProperties(&props, deviceId); numBlocks = min(numBlocks, props.maxGridSize[0]); kernel1D<<<numBlocks, blockSize>>>(d_data, n); } // Query optimal block size int minGridSize, blockSize; cudaOccupancyMaxPotentialBlockSize(&minGridSize, &blockSize, kernel1D, 0, 0);
Analyze generated assembly:
bash# Generate PTX nvcc -ptx -o program.ptx program.cu # View PTX cat program.ptx # Generate SASS (device assembly) cuobjdump -sass program > program.sass # Analyze register usage nvcc --ptxas-options=-v program.cu 2>&1 | grep -E "registers|memory" # Dump detailed resource usage cuobjdump --dump-resource-usage program
Generate proper memory management code:
cuda// Host-device memory transfer pattern void processData(float* h_input, float* h_output, int n) { float *d_input, *d_output; size_t size = n * sizeof(float); // Allocate device memory cudaMalloc(&d_input, size); cudaMalloc(&d_output, size); // Copy input to device cudaMemcpy(d_input, h_input, size, cudaMemcpyHostToDevice); // Launch kernel int blockSize = 256; int numBlocks = (n + blockSize - 1) / blockSize; processKernel<<<numBlocks, blockSize>>>(d_input, d_output, n); // Copy output to host cudaMemcpy(h_output, d_output, size, cudaMemcpyDeviceToHost); // Free device memory cudaFree(d_input); cudaFree(d_output); } // Pinned memory for faster transfers float* h_pinned; cudaMallocHost(&h_pinned, size); // ... use h_pinned ... cudaFreeHost(h_pinned);
Comprehensive error checking:
cuda#define CUDA_CHECK(call) \ do { \ cudaError_t err = call; \ if (err != cudaSuccess) { \ fprintf(stderr, "CUDA Error at %s:%d: %s\n", \ __FILE__, __LINE__, cudaGetErrorString(err)); \ exit(EXIT_FAILURE); \ } \ } while(0) // Usage CUDA_CHECK(cudaMalloc(&d_data, size)); CUDA_CHECK(cudaMemcpy(d_data, h_data, size, cudaMemcpyHostToDevice)); // Check kernel errors myKernel<<<blocks, threads>>>(d_data, n); CUDA_CHECK(cudaGetLastError()); CUDA_CHECK(cudaDeviceSynchronize());
Target specific GPU architectures:
bash# SM versions and features # sm_50 - Maxwell (dynamic parallelism) # sm_60 - Pascal (unified memory, FP16) # sm_70 - Volta (tensor cores, independent thread scheduling) # sm_75 - Turing (RT cores, INT8 tensor cores) # sm_80 - Ampere (TF32, sparse tensor cores) # sm_86 - Ampere consumer # sm_89 - Ada Lovelace # sm_90 - Hopper (transformer engine, TMA) # Compile for specific capability nvcc -arch=sm_80 -code=sm_80 program.cu # Fat binary for multiple architectures nvcc -gencode arch=compute_70,code=sm_70 \ -gencode arch=compute_80,code=sm_80 \ -gencode arch=compute_90,code=sm_90 \ -o program program.cu
Validate resource constraints:
cuda// Specify launch bounds for occupancy __global__ void __launch_bounds__(256, 4) boundedKernel(float* data, int n) { // Kernel limited to 256 threads, compiler targets 4 blocks/SM int idx = blockIdx.x * blockDim.x + threadIdx.x; if (idx < n) data[idx] *= 2.0f; } // Query and validate resources void validateLaunch() { cudaFuncAttributes attr; cudaFuncGetAttributes(&attr, boundedKernel); printf("Registers: %d\n", attr.numRegs); printf("Shared memory: %zu bytes\n", attr.sharedSizeBytes); printf("Max threads per block: %d\n", attr.maxThreadsPerBlock); }
This skill integrates with the following processes:
cuda-kernel-development.js - Kernel development workflowcuda-stream-concurrency.js - Stream managementcustom-cuda-operator-development.js - Custom operator creationdynamic-parallelism-implementation.js - Dynamic parallelismWhen executing operations, provide structured output:
json{ "operation": "compile", "status": "success", "compiler": "nvcc", "flags": ["-O3", "-arch=sm_80"], "output": { "binary": "program", "ptx": "program.ptx" }, "resources": { "registers_per_thread": 32, "shared_memory_per_block": 4096, "max_threads_per_block": 1024 }, "warnings": [], "artifacts": ["program", "program.ptx"] }
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 21,385 | 15,228 | -29% | 1 | 1 | 0% | 3,494 | 4,483 | +28% | 0 | 0 | — |
case-02 | fail→pass | 26,499 | 24,623 | -7% | 1 | 1 | 0% | 4,380 | 7,882 | +80% | 0 | 0 | — |
case-03 | fail→pass | 25,935 | 27,245 | +5% | 1 | 1 | 0% | 5,156 | 6,752 | +31% | 0 | 0 | — |
case-04 | pass→pass | 16,822 | 21,596 | +28% | 1 | 1 | 0% | 3,047 | 5,619 | +84% | 0 | 0 | — |
case-05 | pass→pass | 16,620 | 14,053 | -15% | 1 | 1 | 0% | 2,614 | 5,082 | +94% | 0 | 0 | — |
case-06 | pass→pass | 12,202 | 11,249 | -8% | 1 | 1 | 0% | 1,930 | 4,044 | +110% | 0 | 0 | — |
case-07 | pass→pass | 10,787 | 6,822 | -37% | 1 | 1 | 0% | 1,645 | 3,659 | +122% | 0 | 0 | — |
case-08 | pass→pass | 11,429 | 14,305 | +25% | 1 | 1 | 0% | 2,223 | 4,895 | +120% | 0 | 0 | — |
case-09 | pass→pass | 12,101 | 18,233 | +51% | 1 | 1 | 0% | 2,232 | 5,252 | +135% | 0 | 0 | — |
case-10 | pass→pass | 12,877 | 16,475 | +28% | 1 | 1 | 0% | 1,808 | 4,564 | +152% | 0 | 0 | — |
case-11 | pass→pass | 12,230 | 12,080 | -1% | 1 | 1 | 0% | 2,349 | 4,792 | +104% | 0 | 0 | — |
case-12 | pass→pass | 11,875 | 13,134 | +11% | 1 | 1 | 0% | 2,323 | 4,820 | +107% | 0 | 0 | — |
case-13 | pass→pass | 9,164 | 11,709 | +28% | 1 | 1 | 0% | 1,633 | 4,045 | +148% | 0 | 0 | — |
case-14 | pass→pass | 7,113 | 7,309 | +3% | 1 | 1 | 0% | 1,275 | 3,350 | +163% | 0 | 0 | — |
case-15 | fail→pass | 8,728 | 7,092 | -19% | 1 | 1 | 0% | 1,521 | 3,486 | +129% | 0 | 0 | — |
case-16 | pass→pass | 9,899 | 14,816 | +50% | 1 | 1 | 0% | 1,600 | 4,547 | +184% | 0 | 0 | — |
case-17 | pass→pass | 13,053 | 16,383 | +26% | 1 | 1 | 0% | 2,629 | 4,985 | +90% | 0 | 0 | — |
case-18 | fail→pass | 14,246 | 8,314 | -42% | 1 | 1 | 0% | 2,034 | 3,632 | +79% | 0 | 0 | — |
case-19 | pass→pass | 5,726 | 5,459 | -5% | 1 | 1 | 0% | 785 | 2,858 | +264% | 0 | 0 | — |
case-20 | fail→pass | 9,721 | 8,471 | -13% | 1 | 1 | 0% | 1,276 | 3,463 | +171% | 0 | 0 | — |
case-21 | pass→pass | 8,825 | 8,640 | -2% | 1 | 1 | 0% | 1,652 | 3,879 | +135% | 0 | 0 | — |
case-22 | pass→pass | 11,292 | 10,374 | -8% | 1 | 1 | 0% | 1,852 | 3,781 | +104% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +27 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.