Commit 36012fd
refactor(cuda.core): build advise reverse-lookup eagerly at module load (N4)
Per Leo's review on PR #1775 (_managed_memory_ops.pyx:23), drop the
lazy-init plumbing for the enum→alias reverse lookup table. The forward
table _MANAGED_ADVICE_ALIASES has six entries; building the inverse at
module load via a dict comprehension is the same data without the
mutable-global pattern, the `if None` check, or the `global` declaration
inside the function body.
Forward lookup table (_MANAGED_ADVICE_ALIASES) is preserved as the source
of truth — explicit alias→CUDA-name mapping, grep-friendly, no implicit
naming-convention coupling.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 6204c57 commit 36012fd
1 file changed
Lines changed: 6 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
| |||
65 | 69 | | |
66 | 70 | | |
67 | 71 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | 72 | | |
76 | 73 | | |
77 | 74 | | |
| |||
0 commit comments