Commit a7279e0
committed
fix(simd_profile): target_arch guards on cpu-* features + std-gate example
Two independent bug fixes for codex P2 on de52a44 and the
no-default-features CI failure:
1) codex P2 — Reject ARM cpu-* on x86 builds (and vice versa).
Without target_arch guards, `--features cpu-a76` on an x86_64
build silently routes simd_profile() to A76DotProd, breaking
the is_x86()/is_aarch64() partitioning and routing callers
into the wrong dispatch family. Add compile_error! checks
that fail fast for the current target_arch — same fail-fast
pattern as the existing _PIN_COUNT mutual-exclusion assert.
2) CI fix — examples/simd_profile_probe.rs uses ndarray::hpc::*
and ndarray::simd_amx::* which are gated behind the "std"
feature. On `cargo test --no-default-features` the example
target still tries to compile, producing E0433 "cannot find
hpc in ndarray". Add `required-features = ["std"]` to the
example's Cargo.toml entry so it is skipped when std is
disabled, matching the existing pattern for ocr_benchmark.
No behavioral change on default builds. Both fixes are
independent of the architectural question about whether cpu-*
features should exist at all (which is for the originating
session to revisit if they want to unify with cpu_ops_for_cpu);
this just makes the existing features less of a footgun.1 parent de52a44 commit a7279e0
2 files changed
Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
274 | 312 | | |
275 | 313 | | |
276 | 314 | | |
| |||
0 commit comments