Fix forward of 60564: sharded_tests goes with its one user
spirv::testing's sharded_tests macro split a long check into several tests; the YCbCr conversion's kernel sweep was its only user, and dcb16b6da3 removed it, so clippy denied the unused macro and its re-export. Test-only; no version bump, the runtime pin is unchanged. Verified: m3-max-60564 at dcb16b6da3 showed the two errors (clippy, clippy_gpu, clippy_cpu); fmt, doc and the focused tests (65) passed there. A lint job is owed for this commit.
This commit is contained in:
1 parent
3ffbd4f224
commit
d95206f37b
1 file changed
-33
@@ -327,39 +327,6 @@ pub fn is_moltenvk_capture(stem: &str) -> bool {
|
||||
MOLTENVK_CAPTURES.contains(&stem)
|
||||
}
|
||||
|
||||
/// One long check as several tests, so nextest runs them side by side: a suite's wall-clock is
|
||||
/// at least its longest test's, and an exhaustive table run as one test was the longest.
|
||||
///
|
||||
/// `sharded_tests!(group = run(shard_0 => 0, shard_1 => 1, ...))` declares module `group` with
|
||||
/// test `shard_k` calling `run(k, n)` (`run` in the module that invokes this), `n` the number of
|
||||
/// shards listed; `run` checks the cases whose index is `k` modulo `n`. The shards must be
|
||||
/// numbered `0, 1, ..., n - 1` in order, or the module does not compile: every case runs in
|
||||
/// exactly one shard.
|
||||
macro_rules! sharded_tests {
|
||||
($group:ident = $run:ident($($test:ident => $k:literal),+ $(,)?)) => {
|
||||
mod $group {
|
||||
/// The number of shards.
|
||||
const SHARDS: usize = [$($k),+].len();
|
||||
// The shards are numbered 0, 1, ..., SHARDS - 1, in order.
|
||||
const _: () = {
|
||||
let shards: [usize; SHARDS] = [$($k),+];
|
||||
let mut i = 0;
|
||||
while i < SHARDS {
|
||||
assert!(shards[i] == i, "shards are numbered 0, 1, ... in order");
|
||||
i += 1;
|
||||
}
|
||||
};
|
||||
$(
|
||||
#[test]
|
||||
fn $test() {
|
||||
super::$run($k, SHARDS);
|
||||
}
|
||||
)+
|
||||
}
|
||||
};
|
||||
}
|
||||
pub(crate) use sharded_tests;
|
||||
|
||||
/// The constants of SPIR-V `words` by id: `(width, value)` of each 32- or 64-bit integer
|
||||
/// `OpConstant`.
|
||||
pub fn int_constants(words: &[u32]) -> std::collections::BTreeMap<u32, (u32, u64)> {
|
||||
|
||||
Reference in new issue
Block a user