用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/ZhangXin8069/PyQCU --skill include命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | include |
| description | cpp/cuda/qcu/include 目录的完整生成 skill:26 个模板化 CUDA 头文件(内核内联),define.h 须镜像 pyqcu/cuda/define.py。 |
C++ header files for the CUDA backend. 26 templated headers containing CUDA kernel implementations (kernels are inline in headers).
| Header | Purpose |
|---|---|
define.h | Parameter index constants, block size — must mirror pyqcu/cuda/define.py |
lattice_complex.h | Complex number arithmetic on GPU |
lattice_set.h | Lattice geometry, grid layout, site indexing (use ceiling division for grid dims) |
lattice_cuda.h | CUDA stream management, device utilities |
lattice_mpi.h | MPI halo exchange (blocking MPI_Sendrecv) |
qcu.h | Top-level include aggregator |
dslash.h | Dslash dispatch (Wilson vs Clover) |
wilson_dslash.h | Wilson dslash kernel |
clover_dslash.h | Clover dslash dispatch |
lattice_wilson_dslash.h | Wilson dslash implementation |
lattice_clover_dslash.h | Clover dslash implementation |
bistabcg.h / cg.h | BiCGStab and CG algorithm kernels |
lattice_wilson_bistabcg.h / lattice_wilson_cg.h | Wilson solver wrappers |
lattice_clover_bistabcg.h | Clover BiStabCG solver |
lattice_clover_multigrid.h | Clover multigrid V-cycle (~1100 lines, 5-stream architecture) |
lattice_multigrid.h / multigrid.h | Multigrid restrict/prolong/coarse-dslash |
laplacian.h / lattice_laplacian.h | Laplacian operator |
gauss_gauge.h | Gaussian gauge field generation |
Headers correspond to .cu source files in ../src/ that #include them and instantiate the templates.
define.h 必须与 pyqcu/cuda/define.py 镜像:_PARAMS_SIZE_=58 是整个
params 数组长度,_MG_PARAMS_SIZE_=8 是每个 coarse-level 描述块的长度。params[54..57] 依次为 _MG_USE_GCR_、_MG_USE_DEFLATE_、_MG_MU_PRE_、
_MG_USE_INIT_GUESS_;其中 57 是 fermion_out 奇半 x0 的 0/1 开关。set_ptrs[60..79] 按 transition 每四槽存放 V/raw-Y/Yhat/(X,X^-1),
set_ptrs[80] 存放持久 hierarchy;这些槽位不替代
params[_SET_INDEX_] 指向的 LatticeSet 槽位。define.h 同步项:_MG_USE_DEFLATE_ / _MG_MU_PRE_ /
_MG_USE_INIT_GUESS_ / _PARAMS_SIZE_=58实测收益(V100,examples/qcu/dev84/dev84_report.md):粗解向量开销 3246→4ms(~800×)、
V-cycle 156→60ms(2.6×)。
Strict 专用 CUDA kernel 位于 ../src/apply_multigrid_strict.cu,不是一个额外
头文件;本目录的 qcu.h 提供其依赖的公共 CUDA 类型和工具。