Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/mindspore-ai/akg/cuda-c-apinpx skills add mindspore-ai/akg --skill cuda-c-apigit clone --depth 1 https://github.com/mindspore-ai/akgWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/mindspore-ai/akg/cuda-c-api)<a href="https://agentmods.dev/skills/mindspore-ai/akg/cuda-c-api"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/cuda-c-api.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00013 | $0.02711 |
| Opus 5 | $0.00006 | $0.01355 |
| Sonnet 5 | $0.00003 | $0.00542 |
| Haiku 4.5 | $0.00001 | $0.00271 |
Grade A, and why
cuda-c-api scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 311 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CUDA C API 参考手册
本文档提供 CUDA C 核心编程接口的详细参考,包括函数签名、参数说明和使用示例。
1. 函数修饰符
global
__global__ void kernel_function(参数列表);
- 功能: 标记为可在 GPU 上执行的内核函数
- 调用: 只能从主机代码调用,使用
<<<>>>语法启动 - 返回值: 必须为
void
device
__device__ float device_function(参数列表);
- 功能: 标记为在 GPU 上执行的设备函数
- 调用: 只能从其他
__device__或__global__函数调用 - 用途: 内核内部的辅助函数
host
__host__ void host_function(参数列表);
- 功能: 标记为在 CPU 上执行的函数(默认)
- 调用: 只能从主机代码调用
host device
__host__ __device__ float utility_function(float x);
- 功能: 同时在 CPU 和 GPU 上可用
- 用途: 通用工具函数
2. 内存类型修饰符
shared
__shared__ float shared_memory[256];
- 功能: 声明线程块内共享的内存
- 生命周期: 与线程块相同
- 访问: 块内所有线程可读写
- 容量: 通常 48-164 KB/SM
constant
__constant__ float constant_data[64];
- 功能: 声明只读的常量内存
- 特点: 缓存优化,适合广播读取
- 设置: 通过
cudaMemcpyToSymbol从主机端设置
extern shared
extern __shared__ float dynamic_shared[];
- 功能: 动态分配的共享内存
- 大小: 在内核启动时通过第三个参数指定
- 启动:
kernel<<<grid, block, shared_mem_bytes>>>(args)
3. 内核启动语法
基本语法
kernel_name<<<grid_size, block_size>>>(参数列表);
kernel_name<<<grid_size, block_size, shared_mem_bytes>>>(参数列表);
kernel_name<<<grid_size, block_size, shared_mem_bytes, stream>>>(参数列表);
- grid_size: 网格大小(
int或dim3) - block_size: 线程块大小(
int或dim3) - shared_mem_bytes: 动态共享内存大小(可选,默认 0)
- stream: CUDA 流(可选,默认 0)
dim3 类型
dim3 grid_size(blocks_x, blocks_y, blocks_z);
dim3 block_size(threads_x, threads_y, threads_z);
- 用途: 多维网格和线程块配置
- 默认: 未指定的维度默认为 1
4. 线程和块索引系统
块索引变量
int bx = blockIdx.x; // X 方向块索引
int by = blockIdx.y; // Y 方向块索引
int bz = blockIdx.z; // Z 方向块索引
- 类型:
uint3 - 用途: 确定当前线程块在网格中的位置
线程索引变量
int tx = threadIdx.x; // X 方向线程索引
int ty = threadIdx.y; // Y 方向线程索引
int tz = threadIdx.z; // Z 方向线程索引
- 类型:
uint3 - 用途: 确定当前线程在线程块中的位置
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 6d ago First seen · 311 lines · 13 tokens per session scan A 1b2501767b29
cuda-c-api is a skill published in the GitHub repository mindspore-ai/akg (259 stars, last pushed 26d ago), licensed Apache-2.0. It adds 13 tokens to every session and 2,711 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
cpu-basics
CPU C++ 算子核心概念、标准结构模式、KernelBench 代码规范和内嵌扩展方法.
cuda-c-api
CUDA C 编程接口完整参考手册.
cuda-c-basics
CUDA C 核心概念、内核结构和标准编程模式.
zoom-meeting-sdk-unreal
Zoom Meeting SDK for Unreal Engine wrapper integrations. Use when building Unreal projects that embed Zoom meetings with C++ and Blueprint wrappers, including wrapper-to-SDK mapping concerns.
doca-argp
Use this skill for hands-on DOCA Arg Parser CLI work on a shipped sample or new DOCA-using app — adding / removing / renaming flags; wiring docaargpinit → register params → docaargpstart → docaargpdestroy in order; picking a parameter type from the full public enum (DOCAARGPTYPESTRING, INT, BOOLEAN, DEVICE, DEVICEREP…
ax-cpp-gen
Use when writing C++ code with axllm for AxGen programs, forward calls, indexed multi-sampling, result pickers, streaming, tools, assertions, traces, usage, and output parsing.