GPU code speed tuner
Give it MATLAB code bound for the GPU. Get faster generated CUDA code, measured after each change.
GPU code speed tuner is a free AI skill for the job "Test and fix code". Give the instructions to an AI assistant that supports the required files and tools, then review its output.
Free · No account · BSD 2 Clause licence · Made by MathWorks · Level: expert · Thinking: high
Made by MathWorks. See the original on GitHub; we copied it as it is, with its licence.
What it does
Your MATLAB function, rewritten to run faster as generated CUDA code, with proof it still gives the same answers. It works in loops: compile, time it, change one structure, profile, and check the output against the original. It uses the GPU Performance Analyzer to find slow kernels, memory waste and poor parallelism. Then it fixes the diagnostics it reports. Each change is checked for numerical equivalence before the next. It tunes only the main design file, not helper functions, and it does not handle Simulink or standalone executables. It needs MATLAB with GPU Coder, an NVIDIA GPU, and representative test inputs.
You give it
- Your MATLAB design file
- Representative test inputs
- An NVIDIA GPU with GPU Coder
- A speed target (optional)
You get
- Faster generated CUDA or MEX code
- Timing before and after each change
- Profiler findings explained
- Proof that results still match
Use it when
- Your generated GPU code runs slower than expected.
- You want to cut GPU memory use in a MATLAB function.
- The Performance Analyzer shows warnings you cannot read.
- You need to confirm a speed-up did not change results.
How to use it
- Add it to your AI once: download it and add the folder to Claude, ChatGPT or Codex as a skill.
- Ask for the job in your own words. Your AI opens the skill when it fits.
- It works best when your AI can run MATLAB with GPU Coder and a GPU.