Musify MooreThreads
/install musify
Musify - CUDA to MUSA Code Conversion
Musify converts CUDA code to MUSA (Moore Threads GPU architecture) using text-based API mapping.
Installation
# Install dependencies
pip install ahocorapy
# musify-text should be available in MUSA toolkit
Basic Usage
# Convert files in-place (CUDA -> MUSA)
musify-text --inplace -- file1.cu file2.cpp
# Convert and create new files (default)
musify-text --create -- a.cu b.cpp
# Print to stdout
musify-text -t -- file.cu
Batch Conversion
# Find and convert all CUDA/C++ files in directory
musify-text --inplace -- $(find /path/to/project -name '*.cu' -o -name '*.cuh' -o -name '*.cpp' -o -name '*.h')
# Using ripgrep (recommended)
musify-text --inplace -- $(rg --files -g '*.cu' -g '*.cuh' -g '*.cpp' -g '*.h' /path/to/project)
Options
| Option | Description |
|---|---|
-t, --terminal |
Print output to stdout |
-c, --create |
Create new files with converted code (default) |
-i, --inplace |
Modify files in-place |
-d {c2m,m2c} |
Conversion direction: c2m (CUDA→MUSA, default), m2c (MUSA→CUDA) |
-m \x3Cfile.json> |
Custom API mapping file (can specify multiple) |
--clear-mapping |
Clear default mapping, use only custom mappings |
-l {DEBUG,INFO,WARNING} |
Log level |
Exclusion Markers
Prevent specific code sections from being converted:
// MUSIFY_EXCL_LINE - Exclude this line
char *str = "cudaMalloc"; // MUSIFY_EXCL_LINE
// MUSIFY_EXCL_START - Start exclusion block
char *apis[] = {
"cudaInit",
"cudaFree"
};
// MUSIFY_EXCL_STOP - End exclusion block
Common CUDA → MUSA Mappings
| CUDA | MUSA |
|---|---|
cuda prefix |
musa prefix |
CUDA |
MUSA |
cu prefix (driver API) |
mu prefix |
__cuda |
__musa |
cudaMalloc |
musaMalloc |
cudaFree |
musaFree |
cudaMemcpy |
musaMemcpy |
cudaLaunchKernel |
musaLaunchKernel |
__global__ |
__global__ (unchanged) |
__device__ |
__device__ (unchanged) |
__shared__ |
__shared__ (unchanged) |
Workflow
- Backup code before conversion
- Run musify on target files
- Review changes - text-based conversion may need manual fixes
- Compile with MUSA compiler (
mcc) to verify - Test on MUSA device
References
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install musify - After installation, invoke the skill by name or use
/musify - Provide required inputs per the skill's parameter spec and get structured output
What is Musify MooreThreads?
Convert CUDA code to MUSA (Moore Threads GPU) using the musify tool. Use when migrating CUDA codebases to MUSA platform, converting CUDA kernels/APIs to MUSA... It is an AI Agent Skill for Claude Code / OpenClaw, with 290 downloads so far.
How do I install Musify MooreThreads?
Run "/install musify" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Musify MooreThreads free?
Yes, Musify MooreThreads is completely free (open-source). You can download, install and use it at no cost.
Which platforms does Musify MooreThreads support?
Musify MooreThreads is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Musify MooreThreads?
It is built and maintained by dongyang-mt (@dongyang-mt); the current version is v0.1.0.