Commit a3dd0fa
authored
qwen3_5_moe: guard new cudaMemGetInfo blocks behind EXECUTORCH_BUILD_CUDA (#19265)
### Summary
#19228 added structured GPU memory tracking to the qwen3_5_moe runner
but did not wrap the new cudaMemGetInfo blocks in the existing
EXECUTORCH_BUILD_CUDA guard that the rest of the file uses for CUDA-only
APIs. The same main.cpp is built for the Metal target where the CUDA
runtime headers are not available, so the new blocks failed to compile
on macOS:
error: use of undeclared identifier 'cudaMemGetInfo'
if (cudaMemGetInfo(&free, &total) == cudaSuccess) {
Wrap the three new scoped blocks in #ifdef EXECUTORCH_BUILD_CUDA,
matching the existing guard pattern at lines 27, 68, 113, 168, and 184.
The stats struct fields they would have populated
(gpu_free_before_load_bytes, gpu_free_after_load_bytes,
gpu_free_after_generate_bytes, gpu_peak_usage_mb) default to their
sentinel values on non-CUDA builds, so the rest of the runner's stats
reporting tolerates their absence.
Authored with Claude Code.
### Test plan
CI1 parent 8464b47 commit a3dd0fa
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
| |||
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
| 143 | + | |
142 | 144 | | |
143 | 145 | | |
144 | 146 | | |
| |||
224 | 226 | | |
225 | 227 | | |
226 | 228 | | |
| 229 | + | |
227 | 230 | | |
228 | 231 | | |
229 | 232 | | |
230 | 233 | | |
231 | 234 | | |
232 | 235 | | |
233 | 236 | | |
| 237 | + | |
234 | 238 | | |
235 | 239 | | |
236 | 240 | | |
| |||
397 | 401 | | |
398 | 402 | | |
399 | 403 | | |
| 404 | + | |
400 | 405 | | |
401 | 406 | | |
402 | 407 | | |
| |||
412 | 417 | | |
413 | 418 | | |
414 | 419 | | |
| 420 | + | |
415 | 421 | | |
416 | 422 | | |
417 | 423 | | |
| |||
0 commit comments