SEMANTICS 2130 / RUNTIME 2406: 16x16x16 simdgroup matrix products: refused as their own feature, Metal's rule below Apple10
What: `air.simdgroup_matrix_16x16x16_[widening_]multiply_accumulate` is now refused in every stage
as `Unsupported{SimdgroupMatrix16x16x16, NotImplemented}` (a new `Feature`), ahead of the 8x8
lowering's kernel-only check. The runtime's `compile_error` answers it as Metal does:
`Needs::MetalGpuFamily(1010)` on a device that does not claim Apple10, `NotImplemented` on one
that does (as `IndirectRenderState`). The owned fixture engine/simd_matrix16 shrinks to one form
per class (float, half, widening signed int8), each with the four transpose-flag pairs, 12
kernels; the probe carries the M3's answer in its header.
Why: Metal itself refuses these products below Apple10. The M3 Max (macOS 27.0.1) refused every
pipeline of the fixture at creation, AGXMetalG15X_M1 code 3, "simdgroup_matrix<T,16,16x16>
operations are supported by GPUFamily10 and later" (job m3-max-34410). No device the runtime
presents claims Apple10: the family lists the "SIMD-scoped matrix multiply operations" row (from
Apple7), refused NotImplemented(SimdgroupMatrix) on every device, and the lod-bias row, a gap. So
the refusal is Metal's own answer, not a device gap: no FAST-PATHS known gap.
Tests: engine_simd_matrix::products_of_16x16x16_are_refused_as_their_own_feature (every
committed profile, the fixture's 12 kernels); runtime_lane::simd_matrix16 (the device's compute
pipeline creation answers MetalGpuFamily of Apple10). REFUSALS.md regenerated, api_signatures
blessed, reach mark added. The engine fixture expectation table and golden hashes take the
fixture's rows on development.
Also: f639b74288 adds the owned fixture (MSL we wrote, compiled by scripts/regen-air-fixtures) and
its Metal probe; 5dbfa3d3d5 imports AirLibrary in the runtime-lane test.
Verified in the lane: m3-max-34499 (msi, at 38d4694b12) clippy -D warnings for metal2vulkan, runtime
and validation (all targets and features) and 45/45 tests, incl. the new engine_simd_matrix test (12
kernels on every committed profile), the error tests, refusal_surface, api_signatures, api_surface;
m3-max-34514 (gem10, at 5dbfa3d3d5) clippy m2v_cpu_icd and runtime_lane::simd_matrix16 on lavapipe
(Needs::MetalGpuFamily(1010) for all 12). Clippy m2v_gpu (34516) still running when landed.
API: adds Feature::SimdgroupMatrix16x16x16 (additive; api_signatures blessed in the lane).
This commit is contained in:
1 parent
dc9d9a4ba9
commit
aa5511f61e
17 files changed
+1420
-35
No files matched your search
@@ -0,0 +1,362 @@
|
||||
// What plain Metal answers for the 16x16x16 simdgroup matrix products,
|
||||
// `air.simdgroup_matrix_16x16x16_[widening_]multiply_accumulate`: `<8 x R> (<8 x A>, i1,
|
||||
// <8 x B>, i1, <8 x R>)`, each lane's eight cells of `A`, its transpose flag, of `B`, its flag,
|
||||
// and of the accumulator `C`. MSL has no spelling for them; the owned fixture
|
||||
// `engine/simd_matrix16.metal` declares one function per form, renamed to the intrinsic
|
||||
// (scripts/regen-air-fixtures), in kernels `m16_<form>_<ta><tb>` that pass element `t` of each
|
||||
// buffer as thread `t`'s cells: `float` factors (`f32_f32`), `half` factors (`f16_f16`) and signed
|
||||
// 8-bit integers widened to `int` (`s_s`), each with the four flag pairs.
|
||||
//
|
||||
// Run with simd_matrix16.sh beside this file (it assembles the committed fixture's typed text
|
||||
// into a metallib and builds this probe), or by hand:
|
||||
// xcrun metal-as simd_matrix16.air.ll -o m.air && xcrun metallib m.air -o m.metallib
|
||||
// clang -fobjc-arc -O1 -fmodules -o simd_matrix16 simd_matrix16.m \
|
||||
// -framework Foundation -framework Metal
|
||||
// ./simd_matrix16 m.metallib <form> (one form a process; MTL_DEBUG_LAYER unset)
|
||||
//
|
||||
// For each flag pair it prints whether a compute pipeline was made (or Metal's error), then, for
|
||||
// a pipeline Metal made, the measured relation of the product, as dispatches of 256 one-simdgroup
|
||||
// threadgroups:
|
||||
//
|
||||
// - `pairs`: cell `p` (lane `p >> 3`, element `p & 7`) of one factor is 1 and every other cell of
|
||||
// it 0, the other factor's cell `q` holds a digit of `q` plus one (two passes for 8-bit
|
||||
// integers), and `C` is 0; result cell `d` is then 0 or the digit of the one cell `q` the product
|
||||
// pairs with `p` for `d`. A line `REL <form> <tt> <d> <hex>` lists, for result cell `d`, every
|
||||
// pair (`A` cell, `B` cell) as two bytes, sorted.
|
||||
// - `accumulate`: `A` and `B` 0, `C` distinct integers: the result equals `C` cell for cell.
|
||||
// - `check`: small integer cells everywhere, every sum exact in the result format: the result
|
||||
// equals `C + Σ A·B` over the measured pairs, cell for cell.
|
||||
//
|
||||
// Exit status: 0 when Metal answered (a refused pipeline is an answer), 2 when the probe could not
|
||||
// ask (arguments, the metallib, a command buffer's error).
|
||||
//
|
||||
// WHAT IT MEASURED (Apple M3 Max, macOS 27.0.1, Apple metal 32023.922): Metal refuses every
|
||||
// pipeline of the three forms and four flag pairs at its creation, in 1 to 42 ms, with
|
||||
// `AGXMetalG15X_M1` code 3, "simdgroup_matrix<T,16,16x16> operations are supported by
|
||||
// GPUFamily10 and later". No pipeline was made, so no relation was measured. The translator
|
||||
// refuses these products `Unsupported{SimdgroupMatrix16x16x16}`, and the runtime answers that as
|
||||
// Metal's own refusal (`Needs::MetalGpuFamily` of Apple10) on a device that does not claim
|
||||
// Apple10.
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <Metal/Metal.h>
|
||||
#include <math.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
typedef enum { F32, F16, S8, I32 } Fmt;
|
||||
|
||||
typedef struct {
|
||||
const char *name;
|
||||
Fmt a, b, r;
|
||||
} Form;
|
||||
|
||||
static const Form FORMS[] = {
|
||||
{"f32_f32", F32, F32, F32},
|
||||
{"f16_f16", F16, F16, F32},
|
||||
{"s_s", S8, S8, I32},
|
||||
};
|
||||
|
||||
enum { GROUPS = 256, CELLS = 256, NONE = 0xffff };
|
||||
|
||||
static unsigned fsize(Fmt f) {
|
||||
switch (f) {
|
||||
case F32:
|
||||
case I32:
|
||||
return 4;
|
||||
case F16:
|
||||
return 2;
|
||||
case S8:
|
||||
return 1;
|
||||
}
|
||||
return 4;
|
||||
}
|
||||
|
||||
// The integers 1..base are exact in the format.
|
||||
static unsigned base_of(Fmt f) { return f == S8 ? 16 : 256; }
|
||||
|
||||
static unsigned passes_of(Fmt f) {
|
||||
unsigned b = base_of(f), n = 0, reach = 1;
|
||||
while (reach < CELLS) {
|
||||
reach *= b;
|
||||
n++;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
static void die(const char *what) {
|
||||
printf("PROBE-ERROR %s\n", what);
|
||||
exit(2);
|
||||
}
|
||||
|
||||
static void put(Fmt f, uint8_t *base, size_t index, double v) {
|
||||
uint8_t *p = base + index * fsize(f);
|
||||
switch (f) {
|
||||
case F32: {
|
||||
float x = (float)v;
|
||||
memcpy(p, &x, 4);
|
||||
break;
|
||||
}
|
||||
case I32: {
|
||||
int32_t x = (int32_t)v;
|
||||
memcpy(p, &x, 4);
|
||||
break;
|
||||
}
|
||||
case F16: {
|
||||
_Float16 h = (_Float16)v;
|
||||
if ((double)h != v) {
|
||||
die("a half value is not exact");
|
||||
}
|
||||
memcpy(p, &h, 2);
|
||||
break;
|
||||
}
|
||||
case S8:
|
||||
if (v < -128 || v > 127) {
|
||||
die("an int8 value out of range");
|
||||
}
|
||||
*p = (uint8_t)(int8_t)v;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static double get(Fmt r, const uint8_t *base, size_t index) {
|
||||
const uint8_t *p = base + index * fsize(r);
|
||||
if (r == I32) {
|
||||
int32_t x;
|
||||
memcpy(&x, p, 4);
|
||||
return x;
|
||||
}
|
||||
float x;
|
||||
memcpy(&x, p, 4);
|
||||
return x;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
id<MTLCommandQueue> q;
|
||||
id<MTLComputePipelineState> pso;
|
||||
const Form *form;
|
||||
id<MTLBuffer> a, b, c, d;
|
||||
} Run;
|
||||
|
||||
static void clear(Run *r) {
|
||||
memset(r->a.contents, 0, r->a.length);
|
||||
memset(r->b.contents, 0, r->b.length);
|
||||
memset(r->c.contents, 0, r->c.length);
|
||||
memset(r->d.contents, 0xa5, r->d.length);
|
||||
}
|
||||
|
||||
static void dispatch(Run *r, NSUInteger groups) {
|
||||
id<MTLCommandBuffer> cb = [r->q commandBuffer];
|
||||
id<MTLComputeCommandEncoder> e = [cb computeCommandEncoder];
|
||||
[e setComputePipelineState:r->pso];
|
||||
[e setBuffer:r->a offset:0 atIndex:0];
|
||||
[e setBuffer:r->b offset:0 atIndex:1];
|
||||
[e setBuffer:r->c offset:0 atIndex:2];
|
||||
[e setBuffer:r->d offset:0 atIndex:3];
|
||||
[e dispatchThreadgroups:MTLSizeMake(groups, 1, 1) threadsPerThreadgroup:MTLSizeMake(32, 1, 1)];
|
||||
[e endEncoding];
|
||||
[cb commit];
|
||||
[cb waitUntilCompleted];
|
||||
if (cb.status != MTLCommandBufferStatusCompleted) {
|
||||
printf("PROBE-ERROR command buffer status %ld: %s\n", (long)cb.status,
|
||||
cb.error.description.UTF8String);
|
||||
exit(2);
|
||||
}
|
||||
}
|
||||
|
||||
// Cell `p` of simdgroup `s`: element `s * 256 + p` (lane `p >> 3`, element `p & 7`).
|
||||
static size_t at(unsigned s, unsigned p) { return (size_t)s * CELLS + p; }
|
||||
|
||||
static uint64_t lcg(uint64_t *x) {
|
||||
*x = *x * 6364136223846793005ull + 1442695040888963407ull;
|
||||
return *x >> 33;
|
||||
}
|
||||
|
||||
static void measure(Run *r, const char *tt) {
|
||||
const Form *f = r->form;
|
||||
// The one-hot factor is `A`, the counted one `B` (both factors of a form share a format).
|
||||
unsigned base = base_of(f->b), passes = passes_of(f->b);
|
||||
static uint16_t rel[CELLS][CELLS]; // [p][d]: the counted cell
|
||||
static int seen[CELLS][CELLS]; // passes with a nonzero result
|
||||
memset(rel, 0, sizeof rel);
|
||||
memset(seen, 0, sizeof seen);
|
||||
unsigned odd = 0;
|
||||
unsigned scale = 1;
|
||||
for (unsigned pass = 0; pass < passes; pass++, scale *= base) {
|
||||
clear(r);
|
||||
for (unsigned s = 0; s < GROUPS; s++) {
|
||||
put(f->a, r->a.contents, at(s, s), 1);
|
||||
for (unsigned q = 0; q < CELLS; q++) {
|
||||
put(f->b, r->b.contents, at(s, q), (q / scale) % base + 1);
|
||||
}
|
||||
}
|
||||
dispatch(r, GROUPS);
|
||||
for (unsigned s = 0; s < GROUPS; s++) {
|
||||
for (unsigned d = 0; d < CELLS; d++) {
|
||||
double v = get(f->r, r->d.contents, at(s, d));
|
||||
if (v == 0) {
|
||||
continue;
|
||||
}
|
||||
if (v != floor(v) || v < 1 || v > base) {
|
||||
if (odd++ < 8) {
|
||||
printf(" odd value %s %s pass %u p %u d %u: %.9g\n", f->name, tt, pass,
|
||||
s, d, v);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
seen[s][d]++;
|
||||
rel[s][d] += (uint16_t)(((unsigned)v - 1) * scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
unsigned mixed = 0, per_min = CELLS, per_max = 0;
|
||||
static unsigned char pairs[CELLS][CELLS][2];
|
||||
unsigned count[CELLS];
|
||||
uint64_t h = 1469598103934665603ull;
|
||||
for (unsigned d = 0; d < CELLS; d++) {
|
||||
count[d] = 0;
|
||||
// Ascending `A` cell, each with its one `B` cell: the pairs are sorted.
|
||||
for (unsigned p = 0; p < CELLS; p++) {
|
||||
if (seen[p][d] == 0) {
|
||||
continue;
|
||||
}
|
||||
if (seen[p][d] != (int)passes || rel[p][d] >= CELLS) {
|
||||
mixed++;
|
||||
continue;
|
||||
}
|
||||
pairs[d][count[d]][0] = (unsigned char)p;
|
||||
pairs[d][count[d]][1] = (unsigned char)rel[p][d];
|
||||
count[d]++;
|
||||
}
|
||||
if (count[d] < per_min) per_min = count[d];
|
||||
if (count[d] > per_max) per_max = count[d];
|
||||
printf("REL %s %s %u ", f->name, tt, d);
|
||||
for (unsigned i = 0; i < count[d]; i++) {
|
||||
printf("%02x%02x", pairs[d][i][0], pairs[d][i][1]);
|
||||
h = (h ^ pairs[d][i][0]) * 1099511628211ull;
|
||||
h = (h ^ pairs[d][i][1]) * 1099511628211ull;
|
||||
}
|
||||
h = (h ^ 0xff) * 1099511628211ull;
|
||||
printf("\n");
|
||||
}
|
||||
printf("%s %s pairs: per result cell %u..%u, odd values %u, partial cells %u, passes %u, "
|
||||
"relation %016llx\n",
|
||||
f->name, tt, per_min, per_max, odd, mixed, passes, (unsigned long long)h);
|
||||
|
||||
// accumulate: A = B = 0, C distinct integers in two simdgroups.
|
||||
clear(r);
|
||||
for (unsigned s = 0; s < 2; s++) {
|
||||
for (unsigned d = 0; d < CELLS; d++) {
|
||||
put(f->r, r->c.contents, at(s, d), 1000.0 * s + d + 1);
|
||||
}
|
||||
}
|
||||
dispatch(r, 2);
|
||||
unsigned acc_bad = 0;
|
||||
for (unsigned s = 0; s < 2; s++) {
|
||||
for (unsigned d = 0; d < CELLS; d++) {
|
||||
if (get(f->r, r->d.contents, at(s, d)) != 1000.0 * s + d + 1) {
|
||||
acc_bad++;
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("%s %s accumulate: %u of 512 cells differ from C\n", f->name, tt, acc_bad);
|
||||
|
||||
// check: small integers everywhere against C + sum over the measured pairs.
|
||||
enum { CHECK = 8 };
|
||||
clear(r);
|
||||
uint64_t x = 0x5eed1234u;
|
||||
static double av[CHECK][CELLS], bv[CHECK][CELLS], cv[CHECK][CELLS];
|
||||
for (unsigned s = 0; s < CHECK; s++) {
|
||||
for (unsigned p = 0; p < CELLS; p++) {
|
||||
av[s][p] = (double)(int)(lcg(&x) % 7) - 3;
|
||||
bv[s][p] = (double)(int)(lcg(&x) % 7) - 3;
|
||||
cv[s][p] = (double)(int)(lcg(&x) % 17) - 8;
|
||||
put(f->a, r->a.contents, at(s, p), av[s][p]);
|
||||
put(f->b, r->b.contents, at(s, p), bv[s][p]);
|
||||
put(f->r, r->c.contents, at(s, p), cv[s][p]);
|
||||
}
|
||||
}
|
||||
dispatch(r, CHECK);
|
||||
unsigned bad = 0;
|
||||
for (unsigned s = 0; s < CHECK; s++) {
|
||||
for (unsigned d = 0; d < CELLS; d++) {
|
||||
double want = cv[s][d];
|
||||
for (unsigned i = 0; i < count[d]; i++) {
|
||||
want += av[s][pairs[d][i][0]] * bv[s][pairs[d][i][1]];
|
||||
}
|
||||
double got = get(f->r, r->d.contents, at(s, d));
|
||||
if (got != want && bad++ < 4) {
|
||||
printf(" check %s %s simdgroup %u cell %u: %.9g, measured pairs give %.9g\n",
|
||||
f->name, tt, s, d, got, want);
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("%s %s check: %u of %u cells differ from C + sum over the measured pairs\n", f->name,
|
||||
tt, bad, CHECK * CELLS);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
@autoreleasepool {
|
||||
if (argc != 3) {
|
||||
die("usage: simd_matrix16 <metallib> <form>");
|
||||
}
|
||||
const Form *form = NULL;
|
||||
for (size_t i = 0; i < sizeof FORMS / sizeof FORMS[0]; i++) {
|
||||
if (strcmp(FORMS[i].name, argv[2]) == 0) {
|
||||
form = &FORMS[i];
|
||||
}
|
||||
}
|
||||
if (!form) {
|
||||
die("unknown form");
|
||||
}
|
||||
id<MTLDevice> dev = MTLCreateSystemDefaultDevice();
|
||||
if (!dev) {
|
||||
die("no Metal device");
|
||||
}
|
||||
printf("device %s, form %s\n", dev.name.UTF8String, form->name);
|
||||
NSError *err = nil;
|
||||
NSURL *url = [NSURL fileURLWithPath:[NSString stringWithUTF8String:argv[1]]];
|
||||
id<MTLLibrary> lib = [dev newLibraryWithURL:url error:&err];
|
||||
if (!lib) {
|
||||
printf("PROBE-ERROR library: %s\n", err.description.UTF8String);
|
||||
return 2;
|
||||
}
|
||||
Run r = {.q = [dev newCommandQueue], .form = form};
|
||||
r.a = [dev newBufferWithLength:GROUPS * CELLS * fsize(form->a)
|
||||
options:MTLResourceStorageModeShared];
|
||||
r.b = [dev newBufferWithLength:GROUPS * CELLS * fsize(form->b)
|
||||
options:MTLResourceStorageModeShared];
|
||||
r.c = [dev newBufferWithLength:GROUPS * CELLS * fsize(form->r)
|
||||
options:MTLResourceStorageModeShared];
|
||||
r.d = [dev newBufferWithLength:GROUPS * CELLS * fsize(form->r)
|
||||
options:MTLResourceStorageModeShared];
|
||||
static const char *TT[] = {"00", "01", "10", "11"};
|
||||
for (int k = 0; k < 4; k++) {
|
||||
NSString *name = [NSString stringWithFormat:@"m16_%s_%s", form->name, TT[k]];
|
||||
id<MTLFunction> fn = [lib newFunctionWithName:name];
|
||||
if (!fn) {
|
||||
printf("%s %s function: missing from the library\n", form->name, TT[k]);
|
||||
return 2;
|
||||
}
|
||||
err = nil;
|
||||
NSDate *t0 = [NSDate date];
|
||||
id<MTLComputePipelineState> pso = [dev newComputePipelineStateWithFunction:fn
|
||||
error:&err];
|
||||
double ms = -[t0 timeIntervalSinceNow] * 1000.0;
|
||||
if (!pso) {
|
||||
printf("%s %s pipeline: REFUSED after %.0f ms: %s\n", form->name, TT[k], ms,
|
||||
err.description.UTF8String);
|
||||
continue;
|
||||
}
|
||||
printf("%s %s pipeline: made in %.0f ms, threadExecutionWidth %lu\n", form->name,
|
||||
TT[k], ms, (unsigned long)pso.threadExecutionWidth);
|
||||
if (pso.threadExecutionWidth != 32) {
|
||||
die("a simdgroup is not 32 threads");
|
||||
}
|
||||
r.pso = pso;
|
||||
measure(&r, TT[k]);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
# Runs simd_matrix16.m on this Mac's Metal over the committed fixture
|
||||
# engine/simd_matrix16.air.ll: assembles its typed text into a metallib, builds the probe, and runs
|
||||
# it once per form named, one process each, so that a compiler failure on one form leaves the
|
||||
# others. Scratch files live in a temporary directory removed on exit.
|
||||
#
|
||||
# Usage: sh crates/metal2vulkan-conformance/probes/simd_matrix16.sh <form>...
|
||||
# (forms: f32_f32 f16_f16 s_s)
|
||||
set -u
|
||||
unset MTL_DEBUG_LAYER
|
||||
here=$(cd "$(dirname "$0")" && pwd)
|
||||
fixture="$here/../../metal2vulkan-validation/fixtures/public/engine/simd_matrix16.air.ll"
|
||||
work=$(mktemp -d "${TMPDIR:-/tmp}/simd_matrix16.XXXXXX") || exit 2
|
||||
trap 'rm -rf "$work"' EXIT
|
||||
sw_vers
|
||||
xcrun -sdk macosx metal --version | head -1
|
||||
xcrun -sdk macosx metal-as "$fixture" -o "$work/m.air" || exit 2
|
||||
xcrun -sdk macosx metallib "$work/m.air" -o "$work/m.metallib" || exit 2
|
||||
clang -fobjc-arc -O1 -fmodules -o "$work/probe" "$here/simd_matrix16.m" \
|
||||
-framework Foundation -framework Metal || exit 2
|
||||
status=0
|
||||
for form in "$@"; do
|
||||
"$work/probe" "$work/m.metallib" "$form"
|
||||
code=$?
|
||||
echo "EXIT $form=$code"
|
||||
[ "$code" -eq 0 ] || status=1
|
||||
done
|
||||
exit $status
|
||||
@@ -841,7 +841,11 @@ impl Device {
|
||||
/// process at its creation. A kernel that sets a render state on
|
||||
/// a render command is `Unsupported{IndirectRenderState}` with `Needs::MetalGpuFamily` of
|
||||
/// Apple10 on a device that does not claim Apple10, as Metal's compiler refuses it on an M4 and
|
||||
/// an M3 Max, and `NotImplemented(IndirectRenderCommands)` on one that does.
|
||||
/// an M3 Max, and `NotImplemented(IndirectRenderCommands)` on one that does. A kernel with a
|
||||
/// 16x16x16 simdgroup matrix product is `Unsupported{SimdgroupMatrix16x16x16}` with
|
||||
/// `Needs::MetalGpuFamily` of Apple10 on a device that does not claim Apple10, as Metal refuses
|
||||
/// its pipeline on an M3 Max ("supported by GPUFamily10 and later"), and `NotImplemented` on
|
||||
/// one that does.
|
||||
///
|
||||
/// The symbols the kernel imports come from its dynamic libraries: those its descriptor
|
||||
/// preloads (`FunctionDescriptor::libraries`, `preloadedLibraries`, of
|
||||
@@ -2425,7 +2429,11 @@ const GLOBAL_BUILTIN_IN_FRAGMENT_REFUSED_ON: &[&str] =
|
||||
/// fragment function's global built-in Metal does not lower (`GlobalBuiltinInFragment`) is Metal's
|
||||
/// own refusal on a device the measured M3 Max and M4 stand for, one that does not claim Apple10
|
||||
/// (`Needs::MetalRefuses`, naming them), and stays `NotImplemented` on one that does, which no
|
||||
/// measurement covers; the rest as the compile layer's device reports it.
|
||||
/// measurement covers; a 16x16x16 simdgroup matrix product (`SimdgroupMatrix16x16x16`) is
|
||||
/// Metal's own refusal on a device that does not claim Apple10, as Metal refuses its pipeline
|
||||
/// below that family on an M3 Max (`Needs::MetalGpuFamily`), and stays `NotImplemented` on one
|
||||
/// that does, whose fragment layout is not measured; the rest as the compile layer's device
|
||||
/// reports it.
|
||||
fn compile_error(device: &Device, error: metal2vulkan::error::Error) -> Error {
|
||||
match error {
|
||||
metal2vulkan::error::Error::NeedsInput(RuntimeInput::StorageTextureFormat { .. }) => {
|
||||
@@ -2450,6 +2458,13 @@ fn compile_error(device: &Device, error: metal2vulkan::error::Error) -> Error {
|
||||
unsupported.needs = Needs::MetalRefuses(GLOBAL_BUILTIN_IN_FRAGMENT_REFUSED_ON);
|
||||
Error::Unsupported(unsupported)
|
||||
}
|
||||
metal2vulkan::error::Error::Unsupported(mut unsupported)
|
||||
if unsupported.feature == Feature::SimdgroupMatrix16x16x16
|
||||
&& !device.supports_family_now(GpuFamily::Apple10.raw()) =>
|
||||
{
|
||||
unsupported.needs = Needs::MetalGpuFamily(GpuFamily::Apple10.raw());
|
||||
Error::Unsupported(unsupported)
|
||||
}
|
||||
other => device_error(other),
|
||||
}
|
||||
}
|
||||
@@ -335,6 +335,7 @@ fixture sfo_split_fetch: metal: Apple metal version 32023.922 (metalfe-32023.922
|
||||
fixture sfold_fast: metal: Apple metal version 32023.922 (metalfe-32023.922.4); macosx-sdk: 27.2 (26B118)
|
||||
fixture sfold_fast_poison: metal: Apple metal version 32023.922 (metalfe-32023.922.4); macosx-sdk: 27.2 (26B118)
|
||||
fixture sfold_precise: metal: Apple metal version 32023.922 (metalfe-32023.922.4); macosx-sdk: 27.2 (26B118)
|
||||
fixture simd_matrix16: metal: Apple metal version 32023.922 (metalfe-32023.922.4); macosx-sdk: 27.2 (26B118)
|
||||
fixture smp_constexpr_array: metal: Apple metal version 32023.921 (metalfe-32023.921.6); macosx-sdk: 27.0 (26A425)
|
||||
fixture smp_runtime_array: metal: Apple metal version 32023.921 (metalfe-32023.921.6); macosx-sdk: 27.0 (26A425)
|
||||
fixture smp_shared_sampler: metal: Apple metal version 32023.921 (metalfe-32023.921.6); macosx-sdk: 27.0 (26A425)
|
||||
|
||||
@@ -0,0 +1,413 @@
|
||||
; Generated by scripts/regen-air-fixtures from simd_matrix16.metal (typed pointers; xcrun metal-as reassembles it). Do not edit.
|
||||
; ModuleID = '-'
|
||||
source_filename = "-"
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024-n8:16:32"
|
||||
target triple = "air64_v29-apple-macosx27.0.0"
|
||||
|
||||
; Function Attrs: convergent mustprogress nounwind
|
||||
define void @m16_f32_f32_00(<8 x float> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %0, <8 x float> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %1, <8 x float> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %2, <8 x float> addrspace(1)* nocapture noundef writeonly "air-buffer-no-alias" %3, i32 noundef %4) local_unnamed_addr #0 {
|
||||
%6 = zext i32 %4 to i64
|
||||
%7 = getelementptr inbounds <8 x float>, <8 x float> addrspace(1)* %0, i64 %6
|
||||
%8 = load <8 x float>, <8 x float> addrspace(1)* %7, align 32, !tbaa !42, !alias.scope !46, !noalias !49
|
||||
%9 = getelementptr inbounds <8 x float>, <8 x float> addrspace(1)* %1, i64 %6
|
||||
%10 = load <8 x float>, <8 x float> addrspace(1)* %9, align 32, !tbaa !42, !alias.scope !53, !noalias !54
|
||||
%11 = getelementptr inbounds <8 x float>, <8 x float> addrspace(1)* %2, i64 %6
|
||||
%12 = load <8 x float>, <8 x float> addrspace(1)* %11, align 32, !tbaa !42, !alias.scope !55, !noalias !56
|
||||
%13 = tail call fast <8 x float> @air.simdgroup_matrix_16x16x16_multiply_accumulate.f.f.v8f32.v8f32.v8f32.v8f32(<8 x float> noundef %8, i1 noundef zeroext false, <8 x float> noundef %10, i1 noundef zeroext false, <8 x float> noundef %12) #2
|
||||
%14 = getelementptr inbounds <8 x float>, <8 x float> addrspace(1)* %3, i64 %6
|
||||
store <8 x float> %13, <8 x float> addrspace(1)* %14, align 32, !tbaa !42, !alias.scope !57, !noalias !58
|
||||
ret void
|
||||
}
|
||||
|
||||
; Function Attrs: convergent
|
||||
declare <8 x float> @air.simdgroup_matrix_16x16x16_multiply_accumulate.f.f.v8f32.v8f32.v8f32.v8f32(<8 x float> noundef, i1 noundef zeroext, <8 x float> noundef, i1 noundef zeroext, <8 x float> noundef) local_unnamed_addr #1
|
||||
|
||||
; Function Attrs: convergent mustprogress nounwind
|
||||
define void @m16_f32_f32_01(<8 x float> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %0, <8 x float> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %1, <8 x float> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %2, <8 x float> addrspace(1)* nocapture noundef writeonly "air-buffer-no-alias" %3, i32 noundef %4) local_unnamed_addr #0 {
|
||||
%6 = zext i32 %4 to i64
|
||||
%7 = getelementptr inbounds <8 x float>, <8 x float> addrspace(1)* %0, i64 %6
|
||||
%8 = load <8 x float>, <8 x float> addrspace(1)* %7, align 32, !tbaa !42, !alias.scope !59, !noalias !62
|
||||
%9 = getelementptr inbounds <8 x float>, <8 x float> addrspace(1)* %1, i64 %6
|
||||
%10 = load <8 x float>, <8 x float> addrspace(1)* %9, align 32, !tbaa !42, !alias.scope !66, !noalias !67
|
||||
%11 = getelementptr inbounds <8 x float>, <8 x float> addrspace(1)* %2, i64 %6
|
||||
%12 = load <8 x float>, <8 x float> addrspace(1)* %11, align 32, !tbaa !42, !alias.scope !68, !noalias !69
|
||||
%13 = tail call fast <8 x float> @air.simdgroup_matrix_16x16x16_multiply_accumulate.f.f.v8f32.v8f32.v8f32.v8f32(<8 x float> noundef %8, i1 noundef zeroext false, <8 x float> noundef %10, i1 noundef zeroext true, <8 x float> noundef %12) #2
|
||||
%14 = getelementptr inbounds <8 x float>, <8 x float> addrspace(1)* %3, i64 %6
|
||||
store <8 x float> %13, <8 x float> addrspace(1)* %14, align 32, !tbaa !42, !alias.scope !70, !noalias !71
|
||||
ret void
|
||||
}
|
||||
|
||||
; Function Attrs: convergent mustprogress nounwind
|
||||
define void @m16_f32_f32_10(<8 x float> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %0, <8 x float> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %1, <8 x float> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %2, <8 x float> addrspace(1)* nocapture noundef writeonly "air-buffer-no-alias" %3, i32 noundef %4) local_unnamed_addr #0 {
|
||||
%6 = zext i32 %4 to i64
|
||||
%7 = getelementptr inbounds <8 x float>, <8 x float> addrspace(1)* %0, i64 %6
|
||||
%8 = load <8 x float>, <8 x float> addrspace(1)* %7, align 32, !tbaa !42, !alias.scope !72, !noalias !75
|
||||
%9 = getelementptr inbounds <8 x float>, <8 x float> addrspace(1)* %1, i64 %6
|
||||
%10 = load <8 x float>, <8 x float> addrspace(1)* %9, align 32, !tbaa !42, !alias.scope !79, !noalias !80
|
||||
%11 = getelementptr inbounds <8 x float>, <8 x float> addrspace(1)* %2, i64 %6
|
||||
%12 = load <8 x float>, <8 x float> addrspace(1)* %11, align 32, !tbaa !42, !alias.scope !81, !noalias !82
|
||||
%13 = tail call fast <8 x float> @air.simdgroup_matrix_16x16x16_multiply_accumulate.f.f.v8f32.v8f32.v8f32.v8f32(<8 x float> noundef %8, i1 noundef zeroext true, <8 x float> noundef %10, i1 noundef zeroext false, <8 x float> noundef %12) #2
|
||||
%14 = getelementptr inbounds <8 x float>, <8 x float> addrspace(1)* %3, i64 %6
|
||||
store <8 x float> %13, <8 x float> addrspace(1)* %14, align 32, !tbaa !42, !alias.scope !83, !noalias !84
|
||||
ret void
|
||||
}
|
||||
|
||||
; Function Attrs: convergent mustprogress nounwind
|
||||
define void @m16_f32_f32_11(<8 x float> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %0, <8 x float> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %1, <8 x float> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %2, <8 x float> addrspace(1)* nocapture noundef writeonly "air-buffer-no-alias" %3, i32 noundef %4) local_unnamed_addr #0 {
|
||||
%6 = zext i32 %4 to i64
|
||||
%7 = getelementptr inbounds <8 x float>, <8 x float> addrspace(1)* %0, i64 %6
|
||||
%8 = load <8 x float>, <8 x float> addrspace(1)* %7, align 32, !tbaa !42, !alias.scope !85, !noalias !88
|
||||
%9 = getelementptr inbounds <8 x float>, <8 x float> addrspace(1)* %1, i64 %6
|
||||
%10 = load <8 x float>, <8 x float> addrspace(1)* %9, align 32, !tbaa !42, !alias.scope !92, !noalias !93
|
||||
%11 = getelementptr inbounds <8 x float>, <8 x float> addrspace(1)* %2, i64 %6
|
||||
%12 = load <8 x float>, <8 x float> addrspace(1)* %11, align 32, !tbaa !42, !alias.scope !94, !noalias !95
|
||||
%13 = tail call fast <8 x float> @air.simdgroup_matrix_16x16x16_multiply_accumulate.f.f.v8f32.v8f32.v8f32.v8f32(<8 x float> noundef %8, i1 noundef zeroext true, <8 x float> noundef %10, i1 noundef zeroext true, <8 x float> noundef %12) #2
|
||||
%14 = getelementptr inbounds <8 x float>, <8 x float> addrspace(1)* %3, i64 %6
|
||||
store <8 x float> %13, <8 x float> addrspace(1)* %14, align 32, !tbaa !42, !alias.scope !96, !noalias !97
|
||||
ret void
|
||||
}
|
||||
|
||||
; Function Attrs: convergent mustprogress nounwind
|
||||
define void @m16_f16_f16_00(<8 x half> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %0, <8 x half> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %1, <8 x float> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %2, <8 x float> addrspace(1)* nocapture noundef writeonly "air-buffer-no-alias" %3, i32 noundef %4) local_unnamed_addr #0 {
|
||||
%6 = zext i32 %4 to i64
|
||||
%7 = getelementptr inbounds <8 x half>, <8 x half> addrspace(1)* %0, i64 %6
|
||||
%8 = load <8 x half>, <8 x half> addrspace(1)* %7, align 16, !tbaa !98, !alias.scope !100, !noalias !103
|
||||
%9 = getelementptr inbounds <8 x half>, <8 x half> addrspace(1)* %1, i64 %6
|
||||
%10 = load <8 x half>, <8 x half> addrspace(1)* %9, align 16, !tbaa !98, !alias.scope !107, !noalias !108
|
||||
%11 = getelementptr inbounds <8 x float>, <8 x float> addrspace(1)* %2, i64 %6
|
||||
%12 = load <8 x float>, <8 x float> addrspace(1)* %11, align 32, !tbaa !42, !alias.scope !109, !noalias !110
|
||||
%13 = tail call fast <8 x float> @air.simdgroup_matrix_16x16x16_multiply_accumulate.f.f.v8f32.v8f16.v8f16.v8f32(<8 x half> noundef %8, i1 noundef zeroext false, <8 x half> noundef %10, i1 noundef zeroext false, <8 x float> noundef %12) #2
|
||||
%14 = getelementptr inbounds <8 x float>, <8 x float> addrspace(1)* %3, i64 %6
|
||||
store <8 x float> %13, <8 x float> addrspace(1)* %14, align 32, !tbaa !42, !alias.scope !111, !noalias !112
|
||||
ret void
|
||||
}
|
||||
|
||||
; Function Attrs: convergent
|
||||
declare <8 x float> @air.simdgroup_matrix_16x16x16_multiply_accumulate.f.f.v8f32.v8f16.v8f16.v8f32(<8 x half> noundef, i1 noundef zeroext, <8 x half> noundef, i1 noundef zeroext, <8 x float> noundef) local_unnamed_addr #1
|
||||
|
||||
; Function Attrs: convergent mustprogress nounwind
|
||||
define void @m16_f16_f16_01(<8 x half> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %0, <8 x half> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %1, <8 x float> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %2, <8 x float> addrspace(1)* nocapture noundef writeonly "air-buffer-no-alias" %3, i32 noundef %4) local_unnamed_addr #0 {
|
||||
%6 = zext i32 %4 to i64
|
||||
%7 = getelementptr inbounds <8 x half>, <8 x half> addrspace(1)* %0, i64 %6
|
||||
%8 = load <8 x half>, <8 x half> addrspace(1)* %7, align 16, !tbaa !98, !alias.scope !113, !noalias !116
|
||||
%9 = getelementptr inbounds <8 x half>, <8 x half> addrspace(1)* %1, i64 %6
|
||||
%10 = load <8 x half>, <8 x half> addrspace(1)* %9, align 16, !tbaa !98, !alias.scope !120, !noalias !121
|
||||
%11 = getelementptr inbounds <8 x float>, <8 x float> addrspace(1)* %2, i64 %6
|
||||
%12 = load <8 x float>, <8 x float> addrspace(1)* %11, align 32, !tbaa !42, !alias.scope !122, !noalias !123
|
||||
%13 = tail call fast <8 x float> @air.simdgroup_matrix_16x16x16_multiply_accumulate.f.f.v8f32.v8f16.v8f16.v8f32(<8 x half> noundef %8, i1 noundef zeroext false, <8 x half> noundef %10, i1 noundef zeroext true, <8 x float> noundef %12) #2
|
||||
%14 = getelementptr inbounds <8 x float>, <8 x float> addrspace(1)* %3, i64 %6
|
||||
store <8 x float> %13, <8 x float> addrspace(1)* %14, align 32, !tbaa !42, !alias.scope !124, !noalias !125
|
||||
ret void
|
||||
}
|
||||
|
||||
; Function Attrs: convergent mustprogress nounwind
|
||||
define void @m16_f16_f16_10(<8 x half> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %0, <8 x half> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %1, <8 x float> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %2, <8 x float> addrspace(1)* nocapture noundef writeonly "air-buffer-no-alias" %3, i32 noundef %4) local_unnamed_addr #0 {
|
||||
%6 = zext i32 %4 to i64
|
||||
%7 = getelementptr inbounds <8 x half>, <8 x half> addrspace(1)* %0, i64 %6
|
||||
%8 = load <8 x half>, <8 x half> addrspace(1)* %7, align 16, !tbaa !98, !alias.scope !126, !noalias !129
|
||||
%9 = getelementptr inbounds <8 x half>, <8 x half> addrspace(1)* %1, i64 %6
|
||||
%10 = load <8 x half>, <8 x half> addrspace(1)* %9, align 16, !tbaa !98, !alias.scope !133, !noalias !134
|
||||
%11 = getelementptr inbounds <8 x float>, <8 x float> addrspace(1)* %2, i64 %6
|
||||
%12 = load <8 x float>, <8 x float> addrspace(1)* %11, align 32, !tbaa !42, !alias.scope !135, !noalias !136
|
||||
%13 = tail call fast <8 x float> @air.simdgroup_matrix_16x16x16_multiply_accumulate.f.f.v8f32.v8f16.v8f16.v8f32(<8 x half> noundef %8, i1 noundef zeroext true, <8 x half> noundef %10, i1 noundef zeroext false, <8 x float> noundef %12) #2
|
||||
%14 = getelementptr inbounds <8 x float>, <8 x float> addrspace(1)* %3, i64 %6
|
||||
store <8 x float> %13, <8 x float> addrspace(1)* %14, align 32, !tbaa !42, !alias.scope !137, !noalias !138
|
||||
ret void
|
||||
}
|
||||
|
||||
; Function Attrs: convergent mustprogress nounwind
|
||||
define void @m16_f16_f16_11(<8 x half> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %0, <8 x half> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %1, <8 x float> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %2, <8 x float> addrspace(1)* nocapture noundef writeonly "air-buffer-no-alias" %3, i32 noundef %4) local_unnamed_addr #0 {
|
||||
%6 = zext i32 %4 to i64
|
||||
%7 = getelementptr inbounds <8 x half>, <8 x half> addrspace(1)* %0, i64 %6
|
||||
%8 = load <8 x half>, <8 x half> addrspace(1)* %7, align 16, !tbaa !98, !alias.scope !139, !noalias !142
|
||||
%9 = getelementptr inbounds <8 x half>, <8 x half> addrspace(1)* %1, i64 %6
|
||||
%10 = load <8 x half>, <8 x half> addrspace(1)* %9, align 16, !tbaa !98, !alias.scope !146, !noalias !147
|
||||
%11 = getelementptr inbounds <8 x float>, <8 x float> addrspace(1)* %2, i64 %6
|
||||
%12 = load <8 x float>, <8 x float> addrspace(1)* %11, align 32, !tbaa !42, !alias.scope !148, !noalias !149
|
||||
%13 = tail call fast <8 x float> @air.simdgroup_matrix_16x16x16_multiply_accumulate.f.f.v8f32.v8f16.v8f16.v8f32(<8 x half> noundef %8, i1 noundef zeroext true, <8 x half> noundef %10, i1 noundef zeroext true, <8 x float> noundef %12) #2
|
||||
%14 = getelementptr inbounds <8 x float>, <8 x float> addrspace(1)* %3, i64 %6
|
||||
store <8 x float> %13, <8 x float> addrspace(1)* %14, align 32, !tbaa !42, !alias.scope !150, !noalias !151
|
||||
ret void
|
||||
}
|
||||
|
||||
; Function Attrs: convergent mustprogress nounwind
|
||||
define void @m16_s_s_00(<8 x i8> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %0, <8 x i8> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %1, <8 x i32> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %2, <8 x i32> addrspace(1)* nocapture noundef writeonly "air-buffer-no-alias" %3, i32 noundef %4) local_unnamed_addr #0 {
|
||||
%6 = zext i32 %4 to i64
|
||||
%7 = getelementptr inbounds <8 x i8>, <8 x i8> addrspace(1)* %0, i64 %6
|
||||
%8 = load <8 x i8>, <8 x i8> addrspace(1)* %7, align 8, !tbaa !152, !alias.scope !153, !noalias !156
|
||||
%9 = getelementptr inbounds <8 x i8>, <8 x i8> addrspace(1)* %1, i64 %6
|
||||
%10 = load <8 x i8>, <8 x i8> addrspace(1)* %9, align 8, !tbaa !152, !alias.scope !160, !noalias !161
|
||||
%11 = getelementptr inbounds <8 x i32>, <8 x i32> addrspace(1)* %2, i64 %6
|
||||
%12 = load <8 x i32>, <8 x i32> addrspace(1)* %11, align 32, !tbaa !162, !alias.scope !164, !noalias !165
|
||||
%13 = tail call <8 x i32> @air.simdgroup_matrix_16x16x16_widening_multiply_accumulate.s.s.v8i32.v8i8.v8i8.v8i32(<8 x i8> noundef %8, i1 noundef zeroext false, <8 x i8> noundef %10, i1 noundef zeroext false, <8 x i32> noundef %12) #2
|
||||
%14 = getelementptr inbounds <8 x i32>, <8 x i32> addrspace(1)* %3, i64 %6
|
||||
store <8 x i32> %13, <8 x i32> addrspace(1)* %14, align 32, !tbaa !162, !alias.scope !166, !noalias !167
|
||||
ret void
|
||||
}
|
||||
|
||||
; Function Attrs: convergent
|
||||
declare <8 x i32> @air.simdgroup_matrix_16x16x16_widening_multiply_accumulate.s.s.v8i32.v8i8.v8i8.v8i32(<8 x i8> noundef, i1 noundef zeroext, <8 x i8> noundef, i1 noundef zeroext, <8 x i32> noundef) local_unnamed_addr #1
|
||||
|
||||
; Function Attrs: convergent mustprogress nounwind
|
||||
define void @m16_s_s_01(<8 x i8> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %0, <8 x i8> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %1, <8 x i32> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %2, <8 x i32> addrspace(1)* nocapture noundef writeonly "air-buffer-no-alias" %3, i32 noundef %4) local_unnamed_addr #0 {
|
||||
%6 = zext i32 %4 to i64
|
||||
%7 = getelementptr inbounds <8 x i8>, <8 x i8> addrspace(1)* %0, i64 %6
|
||||
%8 = load <8 x i8>, <8 x i8> addrspace(1)* %7, align 8, !tbaa !152, !alias.scope !168, !noalias !171
|
||||
%9 = getelementptr inbounds <8 x i8>, <8 x i8> addrspace(1)* %1, i64 %6
|
||||
%10 = load <8 x i8>, <8 x i8> addrspace(1)* %9, align 8, !tbaa !152, !alias.scope !175, !noalias !176
|
||||
%11 = getelementptr inbounds <8 x i32>, <8 x i32> addrspace(1)* %2, i64 %6
|
||||
%12 = load <8 x i32>, <8 x i32> addrspace(1)* %11, align 32, !tbaa !162, !alias.scope !177, !noalias !178
|
||||
%13 = tail call <8 x i32> @air.simdgroup_matrix_16x16x16_widening_multiply_accumulate.s.s.v8i32.v8i8.v8i8.v8i32(<8 x i8> noundef %8, i1 noundef zeroext false, <8 x i8> noundef %10, i1 noundef zeroext true, <8 x i32> noundef %12) #2
|
||||
%14 = getelementptr inbounds <8 x i32>, <8 x i32> addrspace(1)* %3, i64 %6
|
||||
store <8 x i32> %13, <8 x i32> addrspace(1)* %14, align 32, !tbaa !162, !alias.scope !179, !noalias !180
|
||||
ret void
|
||||
}
|
||||
|
||||
; Function Attrs: convergent mustprogress nounwind
|
||||
define void @m16_s_s_10(<8 x i8> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %0, <8 x i8> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %1, <8 x i32> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %2, <8 x i32> addrspace(1)* nocapture noundef writeonly "air-buffer-no-alias" %3, i32 noundef %4) local_unnamed_addr #0 {
|
||||
%6 = zext i32 %4 to i64
|
||||
%7 = getelementptr inbounds <8 x i8>, <8 x i8> addrspace(1)* %0, i64 %6
|
||||
%8 = load <8 x i8>, <8 x i8> addrspace(1)* %7, align 8, !tbaa !152, !alias.scope !181, !noalias !184
|
||||
%9 = getelementptr inbounds <8 x i8>, <8 x i8> addrspace(1)* %1, i64 %6
|
||||
%10 = load <8 x i8>, <8 x i8> addrspace(1)* %9, align 8, !tbaa !152, !alias.scope !188, !noalias !189
|
||||
%11 = getelementptr inbounds <8 x i32>, <8 x i32> addrspace(1)* %2, i64 %6
|
||||
%12 = load <8 x i32>, <8 x i32> addrspace(1)* %11, align 32, !tbaa !162, !alias.scope !190, !noalias !191
|
||||
%13 = tail call <8 x i32> @air.simdgroup_matrix_16x16x16_widening_multiply_accumulate.s.s.v8i32.v8i8.v8i8.v8i32(<8 x i8> noundef %8, i1 noundef zeroext true, <8 x i8> noundef %10, i1 noundef zeroext false, <8 x i32> noundef %12) #2
|
||||
%14 = getelementptr inbounds <8 x i32>, <8 x i32> addrspace(1)* %3, i64 %6
|
||||
store <8 x i32> %13, <8 x i32> addrspace(1)* %14, align 32, !tbaa !162, !alias.scope !192, !noalias !193
|
||||
ret void
|
||||
}
|
||||
|
||||
; Function Attrs: convergent mustprogress nounwind
|
||||
define void @m16_s_s_11(<8 x i8> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %0, <8 x i8> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %1, <8 x i32> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %2, <8 x i32> addrspace(1)* nocapture noundef writeonly "air-buffer-no-alias" %3, i32 noundef %4) local_unnamed_addr #0 {
|
||||
%6 = zext i32 %4 to i64
|
||||
%7 = getelementptr inbounds <8 x i8>, <8 x i8> addrspace(1)* %0, i64 %6
|
||||
%8 = load <8 x i8>, <8 x i8> addrspace(1)* %7, align 8, !tbaa !152, !alias.scope !194, !noalias !197
|
||||
%9 = getelementptr inbounds <8 x i8>, <8 x i8> addrspace(1)* %1, i64 %6
|
||||
%10 = load <8 x i8>, <8 x i8> addrspace(1)* %9, align 8, !tbaa !152, !alias.scope !201, !noalias !202
|
||||
%11 = getelementptr inbounds <8 x i32>, <8 x i32> addrspace(1)* %2, i64 %6
|
||||
%12 = load <8 x i32>, <8 x i32> addrspace(1)* %11, align 32, !tbaa !162, !alias.scope !203, !noalias !204
|
||||
%13 = tail call <8 x i32> @air.simdgroup_matrix_16x16x16_widening_multiply_accumulate.s.s.v8i32.v8i8.v8i8.v8i32(<8 x i8> noundef %8, i1 noundef zeroext true, <8 x i8> noundef %10, i1 noundef zeroext true, <8 x i32> noundef %12) #2
|
||||
%14 = getelementptr inbounds <8 x i32>, <8 x i32> addrspace(1)* %3, i64 %6
|
||||
store <8 x i32> %13, <8 x i32> addrspace(1)* %14, align 32, !tbaa !162, !alias.scope !205, !noalias !206
|
||||
ret void
|
||||
}
|
||||
|
||||
attributes #0 = { convergent mustprogress nounwind "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="256" "no-builtins" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" }
|
||||
attributes #1 = { convergent "approx-func-fp-math"="true" "frame-pointer"="all" "no-builtins" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" }
|
||||
attributes #2 = { convergent nobuiltin nounwind "no-builtins" }
|
||||
|
||||
!llvm.module.flags = !{!0, !1, !2, !3, !4, !5, !6, !7, !8}
|
||||
!air.kernel = !{!9, !17, !18, !19, !20, !24, !25, !26, !27, !33, !34, !35}
|
||||
!air.compile_options = !{!36, !37, !38}
|
||||
!llvm.ident = !{!39}
|
||||
!air.version = !{!40}
|
||||
!air.language_version = !{!41}
|
||||
|
||||
!0 = !{i32 2, !"SDK Version", [2 x i32] [i32 27, i32 2]}
|
||||
!1 = !{i32 1, !"wchar_size", i32 4}
|
||||
!2 = !{i32 7, !"frame-pointer", i32 2}
|
||||
!3 = !{i32 7, !"air.max_device_buffers", i32 31}
|
||||
!4 = !{i32 7, !"air.max_constant_buffers", i32 31}
|
||||
!5 = !{i32 7, !"air.max_threadgroup_buffers", i32 31}
|
||||
!6 = !{i32 7, !"air.max_textures", i32 128}
|
||||
!7 = !{i32 7, !"air.max_read_write_textures", i32 8}
|
||||
!8 = !{i32 7, !"air.max_samplers", i32 16}
|
||||
!9 = !{void (<8 x float> addrspace(1)*, <8 x float> addrspace(1)*, <8 x float> addrspace(1)*, <8 x float> addrspace(1)*, i32)* @m16_f32_f32_00, !10, !11}
|
||||
!10 = !{}
|
||||
!11 = !{!12, !13, !14, !15, !16}
|
||||
!12 = !{i32 0, !"air.buffer", !"air.location_index", i32 0, i32 1, !"air.read", !"air.address_space", i32 1, !"air.arg_type_size", i32 32, !"air.arg_type_align_size", i32 32, !"air.arg_type_name", !"float8", !"air.arg_name", !"a"}
|
||||
!13 = !{i32 1, !"air.buffer", !"air.location_index", i32 1, i32 1, !"air.read", !"air.address_space", i32 1, !"air.arg_type_size", i32 32, !"air.arg_type_align_size", i32 32, !"air.arg_type_name", !"float8", !"air.arg_name", !"b"}
|
||||
!14 = !{i32 2, !"air.buffer", !"air.location_index", i32 2, i32 1, !"air.read", !"air.address_space", i32 1, !"air.arg_type_size", i32 32, !"air.arg_type_align_size", i32 32, !"air.arg_type_name", !"float8", !"air.arg_name", !"c"}
|
||||
!15 = !{i32 3, !"air.buffer", !"air.location_index", i32 3, i32 1, !"air.read_write", !"air.address_space", i32 1, !"air.arg_type_size", i32 32, !"air.arg_type_align_size", i32 32, !"air.arg_type_name", !"float8", !"air.arg_name", !"d"}
|
||||
!16 = !{i32 4, !"air.thread_position_in_grid", !"air.arg_type_name", !"uint", !"air.arg_name", !"t"}
|
||||
!17 = !{void (<8 x float> addrspace(1)*, <8 x float> addrspace(1)*, <8 x float> addrspace(1)*, <8 x float> addrspace(1)*, i32)* @m16_f32_f32_01, !10, !11}
|
||||
!18 = !{void (<8 x float> addrspace(1)*, <8 x float> addrspace(1)*, <8 x float> addrspace(1)*, <8 x float> addrspace(1)*, i32)* @m16_f32_f32_10, !10, !11}
|
||||
!19 = !{void (<8 x float> addrspace(1)*, <8 x float> addrspace(1)*, <8 x float> addrspace(1)*, <8 x float> addrspace(1)*, i32)* @m16_f32_f32_11, !10, !11}
|
||||
!20 = !{void (<8 x half> addrspace(1)*, <8 x half> addrspace(1)*, <8 x float> addrspace(1)*, <8 x float> addrspace(1)*, i32)* @m16_f16_f16_00, !10, !21}
|
||||
!21 = !{!22, !23, !14, !15, !16}
|
||||
!22 = !{i32 0, !"air.buffer", !"air.location_index", i32 0, i32 1, !"air.read", !"air.address_space", i32 1, !"air.arg_type_size", i32 16, !"air.arg_type_align_size", i32 16, !"air.arg_type_name", !"half8", !"air.arg_name", !"a"}
|
||||
!23 = !{i32 1, !"air.buffer", !"air.location_index", i32 1, i32 1, !"air.read", !"air.address_space", i32 1, !"air.arg_type_size", i32 16, !"air.arg_type_align_size", i32 16, !"air.arg_type_name", !"half8", !"air.arg_name", !"b"}
|
||||
!24 = !{void (<8 x half> addrspace(1)*, <8 x half> addrspace(1)*, <8 x float> addrspace(1)*, <8 x float> addrspace(1)*, i32)* @m16_f16_f16_01, !10, !21}
|
||||
!25 = !{void (<8 x half> addrspace(1)*, <8 x half> addrspace(1)*, <8 x float> addrspace(1)*, <8 x float> addrspace(1)*, i32)* @m16_f16_f16_10, !10, !21}
|
||||
!26 = !{void (<8 x half> addrspace(1)*, <8 x half> addrspace(1)*, <8 x float> addrspace(1)*, <8 x float> addrspace(1)*, i32)* @m16_f16_f16_11, !10, !21}
|
||||
!27 = !{void (<8 x i8> addrspace(1)*, <8 x i8> addrspace(1)*, <8 x i32> addrspace(1)*, <8 x i32> addrspace(1)*, i32)* @m16_s_s_00, !10, !28}
|
||||
!28 = !{!29, !30, !31, !32, !16}
|
||||
!29 = !{i32 0, !"air.buffer", !"air.location_index", i32 0, i32 1, !"air.read", !"air.address_space", i32 1, !"air.arg_type_size", i32 8, !"air.arg_type_align_size", i32 8, !"air.arg_type_name", !"char8", !"air.arg_name", !"a"}
|
||||
!30 = !{i32 1, !"air.buffer", !"air.location_index", i32 1, i32 1, !"air.read", !"air.address_space", i32 1, !"air.arg_type_size", i32 8, !"air.arg_type_align_size", i32 8, !"air.arg_type_name", !"char8", !"air.arg_name", !"b"}
|
||||
!31 = !{i32 2, !"air.buffer", !"air.location_index", i32 2, i32 1, !"air.read", !"air.address_space", i32 1, !"air.arg_type_size", i32 32, !"air.arg_type_align_size", i32 32, !"air.arg_type_name", !"int8", !"air.arg_name", !"c"}
|
||||
!32 = !{i32 3, !"air.buffer", !"air.location_index", i32 3, i32 1, !"air.read_write", !"air.address_space", i32 1, !"air.arg_type_size", i32 32, !"air.arg_type_align_size", i32 32, !"air.arg_type_name", !"int8", !"air.arg_name", !"d"}
|
||||
!33 = !{void (<8 x i8> addrspace(1)*, <8 x i8> addrspace(1)*, <8 x i32> addrspace(1)*, <8 x i32> addrspace(1)*, i32)* @m16_s_s_01, !10, !28}
|
||||
!34 = !{void (<8 x i8> addrspace(1)*, <8 x i8> addrspace(1)*, <8 x i32> addrspace(1)*, <8 x i32> addrspace(1)*, i32)* @m16_s_s_10, !10, !28}
|
||||
!35 = !{void (<8 x i8> addrspace(1)*, <8 x i8> addrspace(1)*, <8 x i32> addrspace(1)*, <8 x i32> addrspace(1)*, i32)* @m16_s_s_11, !10, !28}
|
||||
!36 = !{!"air.compile.denorms_disable"}
|
||||
!37 = !{!"air.compile.fast_math_enable"}
|
||||
!38 = !{!"air.compile.framebuffer_fetch_enable"}
|
||||
!39 = !{!"Apple metal version 32023.922 (metalfe-32023.922.4)"}
|
||||
!40 = !{i32 2, i32 9, i32 0}
|
||||
!41 = !{!"Metal", i32 4, i32 1, i32 0}
|
||||
!42 = !{!43, !43, i64 0}
|
||||
!43 = !{!"float", !44, i64 0}
|
||||
!44 = !{!"omnipotent char", !45, i64 0}
|
||||
!45 = !{!"Simple C++ TBAA"}
|
||||
!46 = !{!47}
|
||||
!47 = distinct !{!47, !48, !"air-alias-scope-arg(0)"}
|
||||
!48 = distinct !{!48, !"air-alias-scopes(m16_f32_f32_00)"}
|
||||
!49 = !{!50, !51, !52}
|
||||
!50 = distinct !{!50, !48, !"air-alias-scope-arg(1)"}
|
||||
!51 = distinct !{!51, !48, !"air-alias-scope-arg(2)"}
|
||||
!52 = distinct !{!52, !48, !"air-alias-scope-arg(3)"}
|
||||
!53 = !{!50}
|
||||
!54 = !{!47, !51, !52}
|
||||
!55 = !{!51}
|
||||
!56 = !{!47, !50, !52}
|
||||
!57 = !{!52}
|
||||
!58 = !{!47, !50, !51}
|
||||
!59 = !{!60}
|
||||
!60 = distinct !{!60, !61, !"air-alias-scope-arg(0)"}
|
||||
!61 = distinct !{!61, !"air-alias-scopes(m16_f32_f32_01)"}
|
||||
!62 = !{!63, !64, !65}
|
||||
!63 = distinct !{!63, !61, !"air-alias-scope-arg(1)"}
|
||||
!64 = distinct !{!64, !61, !"air-alias-scope-arg(2)"}
|
||||
!65 = distinct !{!65, !61, !"air-alias-scope-arg(3)"}
|
||||
!66 = !{!63}
|
||||
!67 = !{!60, !64, !65}
|
||||
!68 = !{!64}
|
||||
!69 = !{!60, !63, !65}
|
||||
!70 = !{!65}
|
||||
!71 = !{!60, !63, !64}
|
||||
!72 = !{!73}
|
||||
!73 = distinct !{!73, !74, !"air-alias-scope-arg(0)"}
|
||||
!74 = distinct !{!74, !"air-alias-scopes(m16_f32_f32_10)"}
|
||||
!75 = !{!76, !77, !78}
|
||||
!76 = distinct !{!76, !74, !"air-alias-scope-arg(1)"}
|
||||
!77 = distinct !{!77, !74, !"air-alias-scope-arg(2)"}
|
||||
!78 = distinct !{!78, !74, !"air-alias-scope-arg(3)"}
|
||||
!79 = !{!76}
|
||||
!80 = !{!73, !77, !78}
|
||||
!81 = !{!77}
|
||||
!82 = !{!73, !76, !78}
|
||||
!83 = !{!78}
|
||||
!84 = !{!73, !76, !77}
|
||||
!85 = !{!86}
|
||||
!86 = distinct !{!86, !87, !"air-alias-scope-arg(0)"}
|
||||
!87 = distinct !{!87, !"air-alias-scopes(m16_f32_f32_11)"}
|
||||
!88 = !{!89, !90, !91}
|
||||
!89 = distinct !{!89, !87, !"air-alias-scope-arg(1)"}
|
||||
!90 = distinct !{!90, !87, !"air-alias-scope-arg(2)"}
|
||||
!91 = distinct !{!91, !87, !"air-alias-scope-arg(3)"}
|
||||
!92 = !{!89}
|
||||
!93 = !{!86, !90, !91}
|
||||
!94 = !{!90}
|
||||
!95 = !{!86, !89, !91}
|
||||
!96 = !{!91}
|
||||
!97 = !{!86, !89, !90}
|
||||
!98 = !{!99, !99, i64 0}
|
||||
!99 = !{!"half", !44, i64 0}
|
||||
!100 = !{!101}
|
||||
!101 = distinct !{!101, !102, !"air-alias-scope-arg(0)"}
|
||||
!102 = distinct !{!102, !"air-alias-scopes(m16_f16_f16_00)"}
|
||||
!103 = !{!104, !105, !106}
|
||||
!104 = distinct !{!104, !102, !"air-alias-scope-arg(1)"}
|
||||
!105 = distinct !{!105, !102, !"air-alias-scope-arg(2)"}
|
||||
!106 = distinct !{!106, !102, !"air-alias-scope-arg(3)"}
|
||||
!107 = !{!104}
|
||||
!108 = !{!101, !105, !106}
|
||||
!109 = !{!105}
|
||||
!110 = !{!101, !104, !106}
|
||||
!111 = !{!106}
|
||||
!112 = !{!101, !104, !105}
|
||||
!113 = !{!114}
|
||||
!114 = distinct !{!114, !115, !"air-alias-scope-arg(0)"}
|
||||
!115 = distinct !{!115, !"air-alias-scopes(m16_f16_f16_01)"}
|
||||
!116 = !{!117, !118, !119}
|
||||
!117 = distinct !{!117, !115, !"air-alias-scope-arg(1)"}
|
||||
!118 = distinct !{!118, !115, !"air-alias-scope-arg(2)"}
|
||||
!119 = distinct !{!119, !115, !"air-alias-scope-arg(3)"}
|
||||
!120 = !{!117}
|
||||
!121 = !{!114, !118, !119}
|
||||
!122 = !{!118}
|
||||
!123 = !{!114, !117, !119}
|
||||
!124 = !{!119}
|
||||
!125 = !{!114, !117, !118}
|
||||
!126 = !{!127}
|
||||
!127 = distinct !{!127, !128, !"air-alias-scope-arg(0)"}
|
||||
!128 = distinct !{!128, !"air-alias-scopes(m16_f16_f16_10)"}
|
||||
!129 = !{!130, !131, !132}
|
||||
!130 = distinct !{!130, !128, !"air-alias-scope-arg(1)"}
|
||||
!131 = distinct !{!131, !128, !"air-alias-scope-arg(2)"}
|
||||
!132 = distinct !{!132, !128, !"air-alias-scope-arg(3)"}
|
||||
!133 = !{!130}
|
||||
!134 = !{!127, !131, !132}
|
||||
!135 = !{!131}
|
||||
!136 = !{!127, !130, !132}
|
||||
!137 = !{!132}
|
||||
!138 = !{!127, !130, !131}
|
||||
!139 = !{!140}
|
||||
!140 = distinct !{!140, !141, !"air-alias-scope-arg(0)"}
|
||||
!141 = distinct !{!141, !"air-alias-scopes(m16_f16_f16_11)"}
|
||||
!142 = !{!143, !144, !145}
|
||||
!143 = distinct !{!143, !141, !"air-alias-scope-arg(1)"}
|
||||
!144 = distinct !{!144, !141, !"air-alias-scope-arg(2)"}
|
||||
!145 = distinct !{!145, !141, !"air-alias-scope-arg(3)"}
|
||||
!146 = !{!143}
|
||||
!147 = !{!140, !144, !145}
|
||||
!148 = !{!144}
|
||||
!149 = !{!140, !143, !145}
|
||||
!150 = !{!145}
|
||||
!151 = !{!140, !143, !144}
|
||||
!152 = !{!44, !44, i64 0}
|
||||
!153 = !{!154}
|
||||
!154 = distinct !{!154, !155, !"air-alias-scope-arg(0)"}
|
||||
!155 = distinct !{!155, !"air-alias-scopes(m16_s_s_00)"}
|
||||
!156 = !{!157, !158, !159}
|
||||
!157 = distinct !{!157, !155, !"air-alias-scope-arg(1)"}
|
||||
!158 = distinct !{!158, !155, !"air-alias-scope-arg(2)"}
|
||||
!159 = distinct !{!159, !155, !"air-alias-scope-arg(3)"}
|
||||
!160 = !{!157}
|
||||
!161 = !{!154, !158, !159}
|
||||
!162 = !{!163, !163, i64 0}
|
||||
!163 = !{!"int", !44, i64 0}
|
||||
!164 = !{!158}
|
||||
!165 = !{!154, !157, !159}
|
||||
!166 = !{!159}
|
||||
!167 = !{!154, !157, !158}
|
||||
!168 = !{!169}
|
||||
!169 = distinct !{!169, !170, !"air-alias-scope-arg(0)"}
|
||||
!170 = distinct !{!170, !"air-alias-scopes(m16_s_s_01)"}
|
||||
!171 = !{!172, !173, !174}
|
||||
!172 = distinct !{!172, !170, !"air-alias-scope-arg(1)"}
|
||||
!173 = distinct !{!173, !170, !"air-alias-scope-arg(2)"}
|
||||
!174 = distinct !{!174, !170, !"air-alias-scope-arg(3)"}
|
||||
!175 = !{!172}
|
||||
!176 = !{!169, !173, !174}
|
||||
!177 = !{!173}
|
||||
!178 = !{!169, !172, !174}
|
||||
!179 = !{!174}
|
||||
!180 = !{!169, !172, !173}
|
||||
!181 = !{!182}
|
||||
!182 = distinct !{!182, !183, !"air-alias-scope-arg(0)"}
|
||||
!183 = distinct !{!183, !"air-alias-scopes(m16_s_s_10)"}
|
||||
!184 = !{!185, !186, !187}
|
||||
!185 = distinct !{!185, !183, !"air-alias-scope-arg(1)"}
|
||||
!186 = distinct !{!186, !183, !"air-alias-scope-arg(2)"}
|
||||
!187 = distinct !{!187, !183, !"air-alias-scope-arg(3)"}
|
||||
!188 = !{!185}
|
||||
!189 = !{!182, !186, !187}
|
||||
!190 = !{!186}
|
||||
!191 = !{!182, !185, !187}
|
||||
!192 = !{!187}
|
||||
!193 = !{!182, !185, !186}
|
||||
!194 = !{!195}
|
||||
!195 = distinct !{!195, !196, !"air-alias-scope-arg(0)"}
|
||||
!196 = distinct !{!196, !"air-alias-scopes(m16_s_s_11)"}
|
||||
!197 = !{!198, !199, !200}
|
||||
!198 = distinct !{!198, !196, !"air-alias-scope-arg(1)"}
|
||||
!199 = distinct !{!199, !196, !"air-alias-scope-arg(2)"}
|
||||
!200 = distinct !{!200, !196, !"air-alias-scope-arg(3)"}
|
||||
!201 = !{!198}
|
||||
!202 = !{!195, !199, !200}
|
||||
!203 = !{!199}
|
||||
!204 = !{!195, !198, !200}
|
||||
!205 = !{!200}
|
||||
!206 = !{!195, !198, !199}
|
||||
@@ -0,0 +1,413 @@
|
||||
; Generated by scripts/regen-air-fixtures from simd_matrix16.metal (llvm-dis of simd_matrix16.air). Do not edit.
|
||||
; ModuleID = '<stdin>'
|
||||
source_filename = "-"
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024-n8:16:32"
|
||||
target triple = "air64_v29-apple-macosx27.0.0"
|
||||
|
||||
; Function Attrs: convergent mustprogress nounwind
|
||||
define void @m16_f32_f32_00(ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %0, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %1, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %2, ptr addrspace(1) noundef writeonly captures(none) "air-buffer-no-alias" %3, i32 noundef %4) local_unnamed_addr #0 {
|
||||
%6 = zext i32 %4 to i64
|
||||
%7 = getelementptr inbounds <8 x float>, ptr addrspace(1) %0, i64 %6
|
||||
%8 = load <8 x float>, ptr addrspace(1) %7, align 32, !tbaa !42, !alias.scope !46, !noalias !49
|
||||
%9 = getelementptr inbounds <8 x float>, ptr addrspace(1) %1, i64 %6
|
||||
%10 = load <8 x float>, ptr addrspace(1) %9, align 32, !tbaa !42, !alias.scope !53, !noalias !54
|
||||
%11 = getelementptr inbounds <8 x float>, ptr addrspace(1) %2, i64 %6
|
||||
%12 = load <8 x float>, ptr addrspace(1) %11, align 32, !tbaa !42, !alias.scope !55, !noalias !56
|
||||
%13 = tail call fast <8 x float> @air.simdgroup_matrix_16x16x16_multiply_accumulate.f.f.v8f32.v8f32.v8f32.v8f32(<8 x float> noundef %8, i1 noundef zeroext false, <8 x float> noundef %10, i1 noundef zeroext false, <8 x float> noundef %12) #2
|
||||
%14 = getelementptr inbounds <8 x float>, ptr addrspace(1) %3, i64 %6
|
||||
store <8 x float> %13, ptr addrspace(1) %14, align 32, !tbaa !42, !alias.scope !57, !noalias !58
|
||||
ret void
|
||||
}
|
||||
|
||||
; Function Attrs: convergent
|
||||
declare <8 x float> @air.simdgroup_matrix_16x16x16_multiply_accumulate.f.f.v8f32.v8f32.v8f32.v8f32(<8 x float> noundef, i1 noundef zeroext, <8 x float> noundef, i1 noundef zeroext, <8 x float> noundef) local_unnamed_addr #1
|
||||
|
||||
; Function Attrs: convergent mustprogress nounwind
|
||||
define void @m16_f32_f32_01(ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %0, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %1, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %2, ptr addrspace(1) noundef writeonly captures(none) "air-buffer-no-alias" %3, i32 noundef %4) local_unnamed_addr #0 {
|
||||
%6 = zext i32 %4 to i64
|
||||
%7 = getelementptr inbounds <8 x float>, ptr addrspace(1) %0, i64 %6
|
||||
%8 = load <8 x float>, ptr addrspace(1) %7, align 32, !tbaa !42, !alias.scope !59, !noalias !62
|
||||
%9 = getelementptr inbounds <8 x float>, ptr addrspace(1) %1, i64 %6
|
||||
%10 = load <8 x float>, ptr addrspace(1) %9, align 32, !tbaa !42, !alias.scope !66, !noalias !67
|
||||
%11 = getelementptr inbounds <8 x float>, ptr addrspace(1) %2, i64 %6
|
||||
%12 = load <8 x float>, ptr addrspace(1) %11, align 32, !tbaa !42, !alias.scope !68, !noalias !69
|
||||
%13 = tail call fast <8 x float> @air.simdgroup_matrix_16x16x16_multiply_accumulate.f.f.v8f32.v8f32.v8f32.v8f32(<8 x float> noundef %8, i1 noundef zeroext false, <8 x float> noundef %10, i1 noundef zeroext true, <8 x float> noundef %12) #2
|
||||
%14 = getelementptr inbounds <8 x float>, ptr addrspace(1) %3, i64 %6
|
||||
store <8 x float> %13, ptr addrspace(1) %14, align 32, !tbaa !42, !alias.scope !70, !noalias !71
|
||||
ret void
|
||||
}
|
||||
|
||||
; Function Attrs: convergent mustprogress nounwind
|
||||
define void @m16_f32_f32_10(ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %0, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %1, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %2, ptr addrspace(1) noundef writeonly captures(none) "air-buffer-no-alias" %3, i32 noundef %4) local_unnamed_addr #0 {
|
||||
%6 = zext i32 %4 to i64
|
||||
%7 = getelementptr inbounds <8 x float>, ptr addrspace(1) %0, i64 %6
|
||||
%8 = load <8 x float>, ptr addrspace(1) %7, align 32, !tbaa !42, !alias.scope !72, !noalias !75
|
||||
%9 = getelementptr inbounds <8 x float>, ptr addrspace(1) %1, i64 %6
|
||||
%10 = load <8 x float>, ptr addrspace(1) %9, align 32, !tbaa !42, !alias.scope !79, !noalias !80
|
||||
%11 = getelementptr inbounds <8 x float>, ptr addrspace(1) %2, i64 %6
|
||||
%12 = load <8 x float>, ptr addrspace(1) %11, align 32, !tbaa !42, !alias.scope !81, !noalias !82
|
||||
%13 = tail call fast <8 x float> @air.simdgroup_matrix_16x16x16_multiply_accumulate.f.f.v8f32.v8f32.v8f32.v8f32(<8 x float> noundef %8, i1 noundef zeroext true, <8 x float> noundef %10, i1 noundef zeroext false, <8 x float> noundef %12) #2
|
||||
%14 = getelementptr inbounds <8 x float>, ptr addrspace(1) %3, i64 %6
|
||||
store <8 x float> %13, ptr addrspace(1) %14, align 32, !tbaa !42, !alias.scope !83, !noalias !84
|
||||
ret void
|
||||
}
|
||||
|
||||
; Function Attrs: convergent mustprogress nounwind
|
||||
define void @m16_f32_f32_11(ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %0, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %1, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %2, ptr addrspace(1) noundef writeonly captures(none) "air-buffer-no-alias" %3, i32 noundef %4) local_unnamed_addr #0 {
|
||||
%6 = zext i32 %4 to i64
|
||||
%7 = getelementptr inbounds <8 x float>, ptr addrspace(1) %0, i64 %6
|
||||
%8 = load <8 x float>, ptr addrspace(1) %7, align 32, !tbaa !42, !alias.scope !85, !noalias !88
|
||||
%9 = getelementptr inbounds <8 x float>, ptr addrspace(1) %1, i64 %6
|
||||
%10 = load <8 x float>, ptr addrspace(1) %9, align 32, !tbaa !42, !alias.scope !92, !noalias !93
|
||||
%11 = getelementptr inbounds <8 x float>, ptr addrspace(1) %2, i64 %6
|
||||
%12 = load <8 x float>, ptr addrspace(1) %11, align 32, !tbaa !42, !alias.scope !94, !noalias !95
|
||||
%13 = tail call fast <8 x float> @air.simdgroup_matrix_16x16x16_multiply_accumulate.f.f.v8f32.v8f32.v8f32.v8f32(<8 x float> noundef %8, i1 noundef zeroext true, <8 x float> noundef %10, i1 noundef zeroext true, <8 x float> noundef %12) #2
|
||||
%14 = getelementptr inbounds <8 x float>, ptr addrspace(1) %3, i64 %6
|
||||
store <8 x float> %13, ptr addrspace(1) %14, align 32, !tbaa !42, !alias.scope !96, !noalias !97
|
||||
ret void
|
||||
}
|
||||
|
||||
; Function Attrs: convergent mustprogress nounwind
|
||||
define void @m16_f16_f16_00(ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %0, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %1, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %2, ptr addrspace(1) noundef writeonly captures(none) "air-buffer-no-alias" %3, i32 noundef %4) local_unnamed_addr #0 {
|
||||
%6 = zext i32 %4 to i64
|
||||
%7 = getelementptr inbounds <8 x half>, ptr addrspace(1) %0, i64 %6
|
||||
%8 = load <8 x half>, ptr addrspace(1) %7, align 16, !tbaa !98, !alias.scope !100, !noalias !103
|
||||
%9 = getelementptr inbounds <8 x half>, ptr addrspace(1) %1, i64 %6
|
||||
%10 = load <8 x half>, ptr addrspace(1) %9, align 16, !tbaa !98, !alias.scope !107, !noalias !108
|
||||
%11 = getelementptr inbounds <8 x float>, ptr addrspace(1) %2, i64 %6
|
||||
%12 = load <8 x float>, ptr addrspace(1) %11, align 32, !tbaa !42, !alias.scope !109, !noalias !110
|
||||
%13 = tail call fast <8 x float> @air.simdgroup_matrix_16x16x16_multiply_accumulate.f.f.v8f32.v8f16.v8f16.v8f32(<8 x half> noundef %8, i1 noundef zeroext false, <8 x half> noundef %10, i1 noundef zeroext false, <8 x float> noundef %12) #2
|
||||
%14 = getelementptr inbounds <8 x float>, ptr addrspace(1) %3, i64 %6
|
||||
store <8 x float> %13, ptr addrspace(1) %14, align 32, !tbaa !42, !alias.scope !111, !noalias !112
|
||||
ret void
|
||||
}
|
||||
|
||||
; Function Attrs: convergent
|
||||
declare <8 x float> @air.simdgroup_matrix_16x16x16_multiply_accumulate.f.f.v8f32.v8f16.v8f16.v8f32(<8 x half> noundef, i1 noundef zeroext, <8 x half> noundef, i1 noundef zeroext, <8 x float> noundef) local_unnamed_addr #1
|
||||
|
||||
; Function Attrs: convergent mustprogress nounwind
|
||||
define void @m16_f16_f16_01(ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %0, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %1, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %2, ptr addrspace(1) noundef writeonly captures(none) "air-buffer-no-alias" %3, i32 noundef %4) local_unnamed_addr #0 {
|
||||
%6 = zext i32 %4 to i64
|
||||
%7 = getelementptr inbounds <8 x half>, ptr addrspace(1) %0, i64 %6
|
||||
%8 = load <8 x half>, ptr addrspace(1) %7, align 16, !tbaa !98, !alias.scope !113, !noalias !116
|
||||
%9 = getelementptr inbounds <8 x half>, ptr addrspace(1) %1, i64 %6
|
||||
%10 = load <8 x half>, ptr addrspace(1) %9, align 16, !tbaa !98, !alias.scope !120, !noalias !121
|
||||
%11 = getelementptr inbounds <8 x float>, ptr addrspace(1) %2, i64 %6
|
||||
%12 = load <8 x float>, ptr addrspace(1) %11, align 32, !tbaa !42, !alias.scope !122, !noalias !123
|
||||
%13 = tail call fast <8 x float> @air.simdgroup_matrix_16x16x16_multiply_accumulate.f.f.v8f32.v8f16.v8f16.v8f32(<8 x half> noundef %8, i1 noundef zeroext false, <8 x half> noundef %10, i1 noundef zeroext true, <8 x float> noundef %12) #2
|
||||
%14 = getelementptr inbounds <8 x float>, ptr addrspace(1) %3, i64 %6
|
||||
store <8 x float> %13, ptr addrspace(1) %14, align 32, !tbaa !42, !alias.scope !124, !noalias !125
|
||||
ret void
|
||||
}
|
||||
|
||||
; Function Attrs: convergent mustprogress nounwind
|
||||
define void @m16_f16_f16_10(ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %0, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %1, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %2, ptr addrspace(1) noundef writeonly captures(none) "air-buffer-no-alias" %3, i32 noundef %4) local_unnamed_addr #0 {
|
||||
%6 = zext i32 %4 to i64
|
||||
%7 = getelementptr inbounds <8 x half>, ptr addrspace(1) %0, i64 %6
|
||||
%8 = load <8 x half>, ptr addrspace(1) %7, align 16, !tbaa !98, !alias.scope !126, !noalias !129
|
||||
%9 = getelementptr inbounds <8 x half>, ptr addrspace(1) %1, i64 %6
|
||||
%10 = load <8 x half>, ptr addrspace(1) %9, align 16, !tbaa !98, !alias.scope !133, !noalias !134
|
||||
%11 = getelementptr inbounds <8 x float>, ptr addrspace(1) %2, i64 %6
|
||||
%12 = load <8 x float>, ptr addrspace(1) %11, align 32, !tbaa !42, !alias.scope !135, !noalias !136
|
||||
%13 = tail call fast <8 x float> @air.simdgroup_matrix_16x16x16_multiply_accumulate.f.f.v8f32.v8f16.v8f16.v8f32(<8 x half> noundef %8, i1 noundef zeroext true, <8 x half> noundef %10, i1 noundef zeroext false, <8 x float> noundef %12) #2
|
||||
%14 = getelementptr inbounds <8 x float>, ptr addrspace(1) %3, i64 %6
|
||||
store <8 x float> %13, ptr addrspace(1) %14, align 32, !tbaa !42, !alias.scope !137, !noalias !138
|
||||
ret void
|
||||
}
|
||||
|
||||
; Function Attrs: convergent mustprogress nounwind
|
||||
define void @m16_f16_f16_11(ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %0, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %1, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %2, ptr addrspace(1) noundef writeonly captures(none) "air-buffer-no-alias" %3, i32 noundef %4) local_unnamed_addr #0 {
|
||||
%6 = zext i32 %4 to i64
|
||||
%7 = getelementptr inbounds <8 x half>, ptr addrspace(1) %0, i64 %6
|
||||
%8 = load <8 x half>, ptr addrspace(1) %7, align 16, !tbaa !98, !alias.scope !139, !noalias !142
|
||||
%9 = getelementptr inbounds <8 x half>, ptr addrspace(1) %1, i64 %6
|
||||
%10 = load <8 x half>, ptr addrspace(1) %9, align 16, !tbaa !98, !alias.scope !146, !noalias !147
|
||||
%11 = getelementptr inbounds <8 x float>, ptr addrspace(1) %2, i64 %6
|
||||
%12 = load <8 x float>, ptr addrspace(1) %11, align 32, !tbaa !42, !alias.scope !148, !noalias !149
|
||||
%13 = tail call fast <8 x float> @air.simdgroup_matrix_16x16x16_multiply_accumulate.f.f.v8f32.v8f16.v8f16.v8f32(<8 x half> noundef %8, i1 noundef zeroext true, <8 x half> noundef %10, i1 noundef zeroext true, <8 x float> noundef %12) #2
|
||||
%14 = getelementptr inbounds <8 x float>, ptr addrspace(1) %3, i64 %6
|
||||
store <8 x float> %13, ptr addrspace(1) %14, align 32, !tbaa !42, !alias.scope !150, !noalias !151
|
||||
ret void
|
||||
}
|
||||
|
||||
; Function Attrs: convergent mustprogress nounwind
|
||||
define void @m16_s_s_00(ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %0, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %1, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %2, ptr addrspace(1) noundef writeonly captures(none) "air-buffer-no-alias" %3, i32 noundef %4) local_unnamed_addr #0 {
|
||||
%6 = zext i32 %4 to i64
|
||||
%7 = getelementptr inbounds <8 x i8>, ptr addrspace(1) %0, i64 %6
|
||||
%8 = load <8 x i8>, ptr addrspace(1) %7, align 8, !tbaa !152, !alias.scope !153, !noalias !156
|
||||
%9 = getelementptr inbounds <8 x i8>, ptr addrspace(1) %1, i64 %6
|
||||
%10 = load <8 x i8>, ptr addrspace(1) %9, align 8, !tbaa !152, !alias.scope !160, !noalias !161
|
||||
%11 = getelementptr inbounds <8 x i32>, ptr addrspace(1) %2, i64 %6
|
||||
%12 = load <8 x i32>, ptr addrspace(1) %11, align 32, !tbaa !162, !alias.scope !164, !noalias !165
|
||||
%13 = tail call <8 x i32> @air.simdgroup_matrix_16x16x16_widening_multiply_accumulate.s.s.v8i32.v8i8.v8i8.v8i32(<8 x i8> noundef %8, i1 noundef zeroext false, <8 x i8> noundef %10, i1 noundef zeroext false, <8 x i32> noundef %12) #2
|
||||
%14 = getelementptr inbounds <8 x i32>, ptr addrspace(1) %3, i64 %6
|
||||
store <8 x i32> %13, ptr addrspace(1) %14, align 32, !tbaa !162, !alias.scope !166, !noalias !167
|
||||
ret void
|
||||
}
|
||||
|
||||
; Function Attrs: convergent
|
||||
declare <8 x i32> @air.simdgroup_matrix_16x16x16_widening_multiply_accumulate.s.s.v8i32.v8i8.v8i8.v8i32(<8 x i8> noundef, i1 noundef zeroext, <8 x i8> noundef, i1 noundef zeroext, <8 x i32> noundef) local_unnamed_addr #1
|
||||
|
||||
; Function Attrs: convergent mustprogress nounwind
|
||||
define void @m16_s_s_01(ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %0, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %1, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %2, ptr addrspace(1) noundef writeonly captures(none) "air-buffer-no-alias" %3, i32 noundef %4) local_unnamed_addr #0 {
|
||||
%6 = zext i32 %4 to i64
|
||||
%7 = getelementptr inbounds <8 x i8>, ptr addrspace(1) %0, i64 %6
|
||||
%8 = load <8 x i8>, ptr addrspace(1) %7, align 8, !tbaa !152, !alias.scope !168, !noalias !171
|
||||
%9 = getelementptr inbounds <8 x i8>, ptr addrspace(1) %1, i64 %6
|
||||
%10 = load <8 x i8>, ptr addrspace(1) %9, align 8, !tbaa !152, !alias.scope !175, !noalias !176
|
||||
%11 = getelementptr inbounds <8 x i32>, ptr addrspace(1) %2, i64 %6
|
||||
%12 = load <8 x i32>, ptr addrspace(1) %11, align 32, !tbaa !162, !alias.scope !177, !noalias !178
|
||||
%13 = tail call <8 x i32> @air.simdgroup_matrix_16x16x16_widening_multiply_accumulate.s.s.v8i32.v8i8.v8i8.v8i32(<8 x i8> noundef %8, i1 noundef zeroext false, <8 x i8> noundef %10, i1 noundef zeroext true, <8 x i32> noundef %12) #2
|
||||
%14 = getelementptr inbounds <8 x i32>, ptr addrspace(1) %3, i64 %6
|
||||
store <8 x i32> %13, ptr addrspace(1) %14, align 32, !tbaa !162, !alias.scope !179, !noalias !180
|
||||
ret void
|
||||
}
|
||||
|
||||
; Function Attrs: convergent mustprogress nounwind
|
||||
define void @m16_s_s_10(ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %0, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %1, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %2, ptr addrspace(1) noundef writeonly captures(none) "air-buffer-no-alias" %3, i32 noundef %4) local_unnamed_addr #0 {
|
||||
%6 = zext i32 %4 to i64
|
||||
%7 = getelementptr inbounds <8 x i8>, ptr addrspace(1) %0, i64 %6
|
||||
%8 = load <8 x i8>, ptr addrspace(1) %7, align 8, !tbaa !152, !alias.scope !181, !noalias !184
|
||||
%9 = getelementptr inbounds <8 x i8>, ptr addrspace(1) %1, i64 %6
|
||||
%10 = load <8 x i8>, ptr addrspace(1) %9, align 8, !tbaa !152, !alias.scope !188, !noalias !189
|
||||
%11 = getelementptr inbounds <8 x i32>, ptr addrspace(1) %2, i64 %6
|
||||
%12 = load <8 x i32>, ptr addrspace(1) %11, align 32, !tbaa !162, !alias.scope !190, !noalias !191
|
||||
%13 = tail call <8 x i32> @air.simdgroup_matrix_16x16x16_widening_multiply_accumulate.s.s.v8i32.v8i8.v8i8.v8i32(<8 x i8> noundef %8, i1 noundef zeroext true, <8 x i8> noundef %10, i1 noundef zeroext false, <8 x i32> noundef %12) #2
|
||||
%14 = getelementptr inbounds <8 x i32>, ptr addrspace(1) %3, i64 %6
|
||||
store <8 x i32> %13, ptr addrspace(1) %14, align 32, !tbaa !162, !alias.scope !192, !noalias !193
|
||||
ret void
|
||||
}
|
||||
|
||||
; Function Attrs: convergent mustprogress nounwind
|
||||
define void @m16_s_s_11(ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %0, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %1, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %2, ptr addrspace(1) noundef writeonly captures(none) "air-buffer-no-alias" %3, i32 noundef %4) local_unnamed_addr #0 {
|
||||
%6 = zext i32 %4 to i64
|
||||
%7 = getelementptr inbounds <8 x i8>, ptr addrspace(1) %0, i64 %6
|
||||
%8 = load <8 x i8>, ptr addrspace(1) %7, align 8, !tbaa !152, !alias.scope !194, !noalias !197
|
||||
%9 = getelementptr inbounds <8 x i8>, ptr addrspace(1) %1, i64 %6
|
||||
%10 = load <8 x i8>, ptr addrspace(1) %9, align 8, !tbaa !152, !alias.scope !201, !noalias !202
|
||||
%11 = getelementptr inbounds <8 x i32>, ptr addrspace(1) %2, i64 %6
|
||||
%12 = load <8 x i32>, ptr addrspace(1) %11, align 32, !tbaa !162, !alias.scope !203, !noalias !204
|
||||
%13 = tail call <8 x i32> @air.simdgroup_matrix_16x16x16_widening_multiply_accumulate.s.s.v8i32.v8i8.v8i8.v8i32(<8 x i8> noundef %8, i1 noundef zeroext true, <8 x i8> noundef %10, i1 noundef zeroext true, <8 x i32> noundef %12) #2
|
||||
%14 = getelementptr inbounds <8 x i32>, ptr addrspace(1) %3, i64 %6
|
||||
store <8 x i32> %13, ptr addrspace(1) %14, align 32, !tbaa !162, !alias.scope !205, !noalias !206
|
||||
ret void
|
||||
}
|
||||
|
||||
attributes #0 = { convergent mustprogress nounwind "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="256" "no-builtins" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" }
|
||||
attributes #1 = { convergent "approx-func-fp-math"="true" "frame-pointer"="all" "no-builtins" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" }
|
||||
attributes #2 = { convergent nobuiltin nounwind "no-builtins" }
|
||||
|
||||
!llvm.module.flags = !{!0, !1, !2, !3, !4, !5, !6, !7, !8}
|
||||
!air.kernel = !{!9, !17, !18, !19, !20, !24, !25, !26, !27, !33, !34, !35}
|
||||
!air.compile_options = !{!36, !37, !38}
|
||||
!llvm.ident = !{!39}
|
||||
!air.version = !{!40}
|
||||
!air.language_version = !{!41}
|
||||
|
||||
!0 = !{i32 2, !"SDK Version", [2 x i32] [i32 27, i32 2]}
|
||||
!1 = !{i32 1, !"wchar_size", i32 4}
|
||||
!2 = !{i32 7, !"frame-pointer", i32 2}
|
||||
!3 = !{i32 7, !"air.max_device_buffers", i32 31}
|
||||
!4 = !{i32 7, !"air.max_constant_buffers", i32 31}
|
||||
!5 = !{i32 7, !"air.max_threadgroup_buffers", i32 31}
|
||||
!6 = !{i32 7, !"air.max_textures", i32 128}
|
||||
!7 = !{i32 7, !"air.max_read_write_textures", i32 8}
|
||||
!8 = !{i32 7, !"air.max_samplers", i32 16}
|
||||
!9 = !{ptr @m16_f32_f32_00, !10, !11}
|
||||
!10 = !{}
|
||||
!11 = !{!12, !13, !14, !15, !16}
|
||||
!12 = !{i32 0, !"air.buffer", !"air.location_index", i32 0, i32 1, !"air.read", !"air.address_space", i32 1, !"air.arg_type_size", i32 32, !"air.arg_type_align_size", i32 32, !"air.arg_type_name", !"float8", !"air.arg_name", !"a"}
|
||||
!13 = !{i32 1, !"air.buffer", !"air.location_index", i32 1, i32 1, !"air.read", !"air.address_space", i32 1, !"air.arg_type_size", i32 32, !"air.arg_type_align_size", i32 32, !"air.arg_type_name", !"float8", !"air.arg_name", !"b"}
|
||||
!14 = !{i32 2, !"air.buffer", !"air.location_index", i32 2, i32 1, !"air.read", !"air.address_space", i32 1, !"air.arg_type_size", i32 32, !"air.arg_type_align_size", i32 32, !"air.arg_type_name", !"float8", !"air.arg_name", !"c"}
|
||||
!15 = !{i32 3, !"air.buffer", !"air.location_index", i32 3, i32 1, !"air.read_write", !"air.address_space", i32 1, !"air.arg_type_size", i32 32, !"air.arg_type_align_size", i32 32, !"air.arg_type_name", !"float8", !"air.arg_name", !"d"}
|
||||
!16 = !{i32 4, !"air.thread_position_in_grid", !"air.arg_type_name", !"uint", !"air.arg_name", !"t"}
|
||||
!17 = !{ptr @m16_f32_f32_01, !10, !11}
|
||||
!18 = !{ptr @m16_f32_f32_10, !10, !11}
|
||||
!19 = !{ptr @m16_f32_f32_11, !10, !11}
|
||||
!20 = !{ptr @m16_f16_f16_00, !10, !21}
|
||||
!21 = !{!22, !23, !14, !15, !16}
|
||||
!22 = !{i32 0, !"air.buffer", !"air.location_index", i32 0, i32 1, !"air.read", !"air.address_space", i32 1, !"air.arg_type_size", i32 16, !"air.arg_type_align_size", i32 16, !"air.arg_type_name", !"half8", !"air.arg_name", !"a"}
|
||||
!23 = !{i32 1, !"air.buffer", !"air.location_index", i32 1, i32 1, !"air.read", !"air.address_space", i32 1, !"air.arg_type_size", i32 16, !"air.arg_type_align_size", i32 16, !"air.arg_type_name", !"half8", !"air.arg_name", !"b"}
|
||||
!24 = !{ptr @m16_f16_f16_01, !10, !21}
|
||||
!25 = !{ptr @m16_f16_f16_10, !10, !21}
|
||||
!26 = !{ptr @m16_f16_f16_11, !10, !21}
|
||||
!27 = !{ptr @m16_s_s_00, !10, !28}
|
||||
!28 = !{!29, !30, !31, !32, !16}
|
||||
!29 = !{i32 0, !"air.buffer", !"air.location_index", i32 0, i32 1, !"air.read", !"air.address_space", i32 1, !"air.arg_type_size", i32 8, !"air.arg_type_align_size", i32 8, !"air.arg_type_name", !"char8", !"air.arg_name", !"a"}
|
||||
!30 = !{i32 1, !"air.buffer", !"air.location_index", i32 1, i32 1, !"air.read", !"air.address_space", i32 1, !"air.arg_type_size", i32 8, !"air.arg_type_align_size", i32 8, !"air.arg_type_name", !"char8", !"air.arg_name", !"b"}
|
||||
!31 = !{i32 2, !"air.buffer", !"air.location_index", i32 2, i32 1, !"air.read", !"air.address_space", i32 1, !"air.arg_type_size", i32 32, !"air.arg_type_align_size", i32 32, !"air.arg_type_name", !"int8", !"air.arg_name", !"c"}
|
||||
!32 = !{i32 3, !"air.buffer", !"air.location_index", i32 3, i32 1, !"air.read_write", !"air.address_space", i32 1, !"air.arg_type_size", i32 32, !"air.arg_type_align_size", i32 32, !"air.arg_type_name", !"int8", !"air.arg_name", !"d"}
|
||||
!33 = !{ptr @m16_s_s_01, !10, !28}
|
||||
!34 = !{ptr @m16_s_s_10, !10, !28}
|
||||
!35 = !{ptr @m16_s_s_11, !10, !28}
|
||||
!36 = !{!"air.compile.denorms_disable"}
|
||||
!37 = !{!"air.compile.fast_math_enable"}
|
||||
!38 = !{!"air.compile.framebuffer_fetch_enable"}
|
||||
!39 = !{!"Apple metal version 32023.922 (metalfe-32023.922.4)"}
|
||||
!40 = !{i32 2, i32 9, i32 0}
|
||||
!41 = !{!"Metal", i32 4, i32 1, i32 0}
|
||||
!42 = !{!43, !43, i64 0}
|
||||
!43 = !{!"float", !44, i64 0}
|
||||
!44 = !{!"omnipotent char", !45, i64 0}
|
||||
!45 = !{!"Simple C++ TBAA"}
|
||||
!46 = !{!47}
|
||||
!47 = distinct !{!47, !48, !"air-alias-scope-arg(0)"}
|
||||
!48 = distinct !{!48, !"air-alias-scopes(m16_f32_f32_00)"}
|
||||
!49 = !{!50, !51, !52}
|
||||
!50 = distinct !{!50, !48, !"air-alias-scope-arg(1)"}
|
||||
!51 = distinct !{!51, !48, !"air-alias-scope-arg(2)"}
|
||||
!52 = distinct !{!52, !48, !"air-alias-scope-arg(3)"}
|
||||
!53 = !{!50}
|
||||
!54 = !{!47, !51, !52}
|
||||
!55 = !{!51}
|
||||
!56 = !{!47, !50, !52}
|
||||
!57 = !{!52}
|
||||
!58 = !{!47, !50, !51}
|
||||
!59 = !{!60}
|
||||
!60 = distinct !{!60, !61, !"air-alias-scope-arg(0)"}
|
||||
!61 = distinct !{!61, !"air-alias-scopes(m16_f32_f32_01)"}
|
||||
!62 = !{!63, !64, !65}
|
||||
!63 = distinct !{!63, !61, !"air-alias-scope-arg(1)"}
|
||||
!64 = distinct !{!64, !61, !"air-alias-scope-arg(2)"}
|
||||
!65 = distinct !{!65, !61, !"air-alias-scope-arg(3)"}
|
||||
!66 = !{!63}
|
||||
!67 = !{!60, !64, !65}
|
||||
!68 = !{!64}
|
||||
!69 = !{!60, !63, !65}
|
||||
!70 = !{!65}
|
||||
!71 = !{!60, !63, !64}
|
||||
!72 = !{!73}
|
||||
!73 = distinct !{!73, !74, !"air-alias-scope-arg(0)"}
|
||||
!74 = distinct !{!74, !"air-alias-scopes(m16_f32_f32_10)"}
|
||||
!75 = !{!76, !77, !78}
|
||||
!76 = distinct !{!76, !74, !"air-alias-scope-arg(1)"}
|
||||
!77 = distinct !{!77, !74, !"air-alias-scope-arg(2)"}
|
||||
!78 = distinct !{!78, !74, !"air-alias-scope-arg(3)"}
|
||||
!79 = !{!76}
|
||||
!80 = !{!73, !77, !78}
|
||||
!81 = !{!77}
|
||||
!82 = !{!73, !76, !78}
|
||||
!83 = !{!78}
|
||||
!84 = !{!73, !76, !77}
|
||||
!85 = !{!86}
|
||||
!86 = distinct !{!86, !87, !"air-alias-scope-arg(0)"}
|
||||
!87 = distinct !{!87, !"air-alias-scopes(m16_f32_f32_11)"}
|
||||
!88 = !{!89, !90, !91}
|
||||
!89 = distinct !{!89, !87, !"air-alias-scope-arg(1)"}
|
||||
!90 = distinct !{!90, !87, !"air-alias-scope-arg(2)"}
|
||||
!91 = distinct !{!91, !87, !"air-alias-scope-arg(3)"}
|
||||
!92 = !{!89}
|
||||
!93 = !{!86, !90, !91}
|
||||
!94 = !{!90}
|
||||
!95 = !{!86, !89, !91}
|
||||
!96 = !{!91}
|
||||
!97 = !{!86, !89, !90}
|
||||
!98 = !{!99, !99, i64 0}
|
||||
!99 = !{!"half", !44, i64 0}
|
||||
!100 = !{!101}
|
||||
!101 = distinct !{!101, !102, !"air-alias-scope-arg(0)"}
|
||||
!102 = distinct !{!102, !"air-alias-scopes(m16_f16_f16_00)"}
|
||||
!103 = !{!104, !105, !106}
|
||||
!104 = distinct !{!104, !102, !"air-alias-scope-arg(1)"}
|
||||
!105 = distinct !{!105, !102, !"air-alias-scope-arg(2)"}
|
||||
!106 = distinct !{!106, !102, !"air-alias-scope-arg(3)"}
|
||||
!107 = !{!104}
|
||||
!108 = !{!101, !105, !106}
|
||||
!109 = !{!105}
|
||||
!110 = !{!101, !104, !106}
|
||||
!111 = !{!106}
|
||||
!112 = !{!101, !104, !105}
|
||||
!113 = !{!114}
|
||||
!114 = distinct !{!114, !115, !"air-alias-scope-arg(0)"}
|
||||
!115 = distinct !{!115, !"air-alias-scopes(m16_f16_f16_01)"}
|
||||
!116 = !{!117, !118, !119}
|
||||
!117 = distinct !{!117, !115, !"air-alias-scope-arg(1)"}
|
||||
!118 = distinct !{!118, !115, !"air-alias-scope-arg(2)"}
|
||||
!119 = distinct !{!119, !115, !"air-alias-scope-arg(3)"}
|
||||
!120 = !{!117}
|
||||
!121 = !{!114, !118, !119}
|
||||
!122 = !{!118}
|
||||
!123 = !{!114, !117, !119}
|
||||
!124 = !{!119}
|
||||
!125 = !{!114, !117, !118}
|
||||
!126 = !{!127}
|
||||
!127 = distinct !{!127, !128, !"air-alias-scope-arg(0)"}
|
||||
!128 = distinct !{!128, !"air-alias-scopes(m16_f16_f16_10)"}
|
||||
!129 = !{!130, !131, !132}
|
||||
!130 = distinct !{!130, !128, !"air-alias-scope-arg(1)"}
|
||||
!131 = distinct !{!131, !128, !"air-alias-scope-arg(2)"}
|
||||
!132 = distinct !{!132, !128, !"air-alias-scope-arg(3)"}
|
||||
!133 = !{!130}
|
||||
!134 = !{!127, !131, !132}
|
||||
!135 = !{!131}
|
||||
!136 = !{!127, !130, !132}
|
||||
!137 = !{!132}
|
||||
!138 = !{!127, !130, !131}
|
||||
!139 = !{!140}
|
||||
!140 = distinct !{!140, !141, !"air-alias-scope-arg(0)"}
|
||||
!141 = distinct !{!141, !"air-alias-scopes(m16_f16_f16_11)"}
|
||||
!142 = !{!143, !144, !145}
|
||||
!143 = distinct !{!143, !141, !"air-alias-scope-arg(1)"}
|
||||
!144 = distinct !{!144, !141, !"air-alias-scope-arg(2)"}
|
||||
!145 = distinct !{!145, !141, !"air-alias-scope-arg(3)"}
|
||||
!146 = !{!143}
|
||||
!147 = !{!140, !144, !145}
|
||||
!148 = !{!144}
|
||||
!149 = !{!140, !143, !145}
|
||||
!150 = !{!145}
|
||||
!151 = !{!140, !143, !144}
|
||||
!152 = !{!44, !44, i64 0}
|
||||
!153 = !{!154}
|
||||
!154 = distinct !{!154, !155, !"air-alias-scope-arg(0)"}
|
||||
!155 = distinct !{!155, !"air-alias-scopes(m16_s_s_00)"}
|
||||
!156 = !{!157, !158, !159}
|
||||
!157 = distinct !{!157, !155, !"air-alias-scope-arg(1)"}
|
||||
!158 = distinct !{!158, !155, !"air-alias-scope-arg(2)"}
|
||||
!159 = distinct !{!159, !155, !"air-alias-scope-arg(3)"}
|
||||
!160 = !{!157}
|
||||
!161 = !{!154, !158, !159}
|
||||
!162 = !{!163, !163, i64 0}
|
||||
!163 = !{!"int", !44, i64 0}
|
||||
!164 = !{!158}
|
||||
!165 = !{!154, !157, !159}
|
||||
!166 = !{!159}
|
||||
!167 = !{!154, !157, !158}
|
||||
!168 = !{!169}
|
||||
!169 = distinct !{!169, !170, !"air-alias-scope-arg(0)"}
|
||||
!170 = distinct !{!170, !"air-alias-scopes(m16_s_s_01)"}
|
||||
!171 = !{!172, !173, !174}
|
||||
!172 = distinct !{!172, !170, !"air-alias-scope-arg(1)"}
|
||||
!173 = distinct !{!173, !170, !"air-alias-scope-arg(2)"}
|
||||
!174 = distinct !{!174, !170, !"air-alias-scope-arg(3)"}
|
||||
!175 = !{!172}
|
||||
!176 = !{!169, !173, !174}
|
||||
!177 = !{!173}
|
||||
!178 = !{!169, !172, !174}
|
||||
!179 = !{!174}
|
||||
!180 = !{!169, !172, !173}
|
||||
!181 = !{!182}
|
||||
!182 = distinct !{!182, !183, !"air-alias-scope-arg(0)"}
|
||||
!183 = distinct !{!183, !"air-alias-scopes(m16_s_s_10)"}
|
||||
!184 = !{!185, !186, !187}
|
||||
!185 = distinct !{!185, !183, !"air-alias-scope-arg(1)"}
|
||||
!186 = distinct !{!186, !183, !"air-alias-scope-arg(2)"}
|
||||
!187 = distinct !{!187, !183, !"air-alias-scope-arg(3)"}
|
||||
!188 = !{!185}
|
||||
!189 = !{!182, !186, !187}
|
||||
!190 = !{!186}
|
||||
!191 = !{!182, !185, !187}
|
||||
!192 = !{!187}
|
||||
!193 = !{!182, !185, !186}
|
||||
!194 = !{!195}
|
||||
!195 = distinct !{!195, !196, !"air-alias-scope-arg(0)"}
|
||||
!196 = distinct !{!196, !"air-alias-scopes(m16_s_s_11)"}
|
||||
!197 = !{!198, !199, !200}
|
||||
!198 = distinct !{!198, !196, !"air-alias-scope-arg(1)"}
|
||||
!199 = distinct !{!199, !196, !"air-alias-scope-arg(2)"}
|
||||
!200 = distinct !{!200, !196, !"air-alias-scope-arg(3)"}
|
||||
!201 = !{!198}
|
||||
!202 = !{!195, !199, !200}
|
||||
!203 = !{!199}
|
||||
!204 = !{!195, !198, !200}
|
||||
!205 = !{!200}
|
||||
!206 = !{!195, !198, !199}
|
||||
@@ -0,0 +1,50 @@
|
||||
// metal-macos-min: 27.0
|
||||
// air-rename: _Z13sgm16_f32_f32Dv8_fbS_bS_ air.simdgroup_matrix_16x16x16_multiply_accumulate.f.f.v8f32.v8f32.v8f32.v8f32
|
||||
// air-rename: _Z13sgm16_f16_f16Dv8_DhbS_bDv8_f air.simdgroup_matrix_16x16x16_multiply_accumulate.f.f.v8f32.v8f16.v8f16.v8f32
|
||||
// air-rename: _Z9sgm16_s_sDv8_cbS_bDv8_i air.simdgroup_matrix_16x16x16_widening_multiply_accumulate.s.s.v8i32.v8i8.v8i8.v8i32
|
||||
// Owned fixture: the 16x16x16 simdgroup matrix products,
|
||||
// `air.simdgroup_matrix_16x16x16_multiply_accumulate.f.f.v8f32.<A>.<B>.v8f32` and
|
||||
// `air.simdgroup_matrix_16x16x16_widening_multiply_accumulate.<sa>.<sb>.v8i32.v8i8.v8i8.v8i32`:
|
||||
// `<8 x R> (<8 x A>, i1, <8 x B>, i1, <8 x R>)`, each lane's eight cells of `A`, its transpose
|
||||
// flag, of `B`, its flag, and of the accumulator. One form of each class: `float` factors, `half`
|
||||
// factors, and signed 8-bit integers widened to `int`, each with the four flag pairs. MSL has no
|
||||
// spelling for them (the frontend's builtins are the 8x8 ones), so the source declares one function
|
||||
// per form and never defines it, and the directives above rename every call to the intrinsic in
|
||||
// both companions (scripts/regen-air-fixtures). The eight-lane vectors are declared here (`float8`
|
||||
// is ambiguous in this toolchain's headers).
|
||||
//
|
||||
// Metal makes these kernels' pipelines only on an Apple GPU of family 10 and later: an M3 Max under
|
||||
// macOS 27.0.1 refuses every one ("simdgroup_matrix<T,16,16x16> operations are supported by
|
||||
// GPUFamily10 and later"; crates/metal2vulkan-conformance/probes/simd_matrix16.m). Written for this
|
||||
// repository; no third-party source.
|
||||
#include <metal_stdlib>
|
||||
|
||||
typedef float f32x8 __attribute__((ext_vector_type(8)));
|
||||
typedef half f16x8 __attribute__((ext_vector_type(8)));
|
||||
typedef char i8x8 __attribute__((ext_vector_type(8)));
|
||||
typedef int i32x8 __attribute__((ext_vector_type(8)));
|
||||
|
||||
f32x8 sgm16_f32_f32(f32x8 a, bool ta, f32x8 b, bool tb, f32x8 c);
|
||||
f32x8 sgm16_f16_f16(f16x8 a, bool ta, f16x8 b, bool tb, f32x8 c);
|
||||
i32x8 sgm16_s_s(i8x8 a, bool ta, i8x8 b, bool tb, i32x8 c);
|
||||
|
||||
// Kernel `m16_<form>_<ta><tb>`: thread `t` passes element `t` of `a`, `b` and `c` as its lane's
|
||||
// cells, with the constant flags `ta` and `tb`, and writes the product's cells to element `t` of
|
||||
// `d`. A threadgroup of 32 threads is one simdgroup; simdgroup `s` is threads [32s, 32s + 32).
|
||||
#define M16(form, AT, BT, RT, ta, tb, tag) \
|
||||
kernel void m16_##form##_##tag(device const AT *a [[buffer(0)]], \
|
||||
device const BT *b [[buffer(1)]], \
|
||||
device const RT *c [[buffer(2)]], \
|
||||
device RT *d [[buffer(3)]], \
|
||||
uint t [[thread_position_in_grid]]) { \
|
||||
d[t] = sgm16_##form(a[t], ta, b[t], tb, c[t]); \
|
||||
}
|
||||
#define M16_ALL(form, AT, BT, RT) \
|
||||
M16(form, AT, BT, RT, false, false, 00) \
|
||||
M16(form, AT, BT, RT, false, true, 01) \
|
||||
M16(form, AT, BT, RT, true, false, 10) \
|
||||
M16(form, AT, BT, RT, true, true, 11)
|
||||
|
||||
M16_ALL(f32_f32, f32x8, f32x8, f32x8)
|
||||
M16_ALL(f16_f16, f16x8, f16x8, f32x8)
|
||||
M16_ALL(s_s, i8x8, i8x8, i32x8)
|
||||
@@ -901,6 +901,8 @@ mod shadow_sync_costs;
|
||||
#[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))]
|
||||
mod shared_exponent_storage;
|
||||
#[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))]
|
||||
mod simd_matrix16;
|
||||
#[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))]
|
||||
mod single_sample_passes;
|
||||
#[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))]
|
||||
mod snapshot_reads;
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
//! A kernel's 16x16x16 simdgroup matrix product on the device the cfg selects, under the
|
||||
//! validation layer.
|
||||
//!
|
||||
//! Metal makes the pipeline of such a kernel only on a GPU of the Apple10 family and later: an M3
|
||||
//! Max under macOS 27.0.1 refuses every kernel of the owned fixture `simd_matrix16` (`float`,
|
||||
//! `half` and widening signed 8-bit products, each with the four transpose-flag pairs) at its
|
||||
//! creation, "simdgroup_matrix<T,16,16x16> operations are supported by GPUFamily10 and later"
|
||||
//! (`crates/metal2vulkan-conformance/probes/simd_matrix16.m`). The runtime refuses it as Metal
|
||||
//! does: `Unsupported` (`SimdgroupMatrix16x16x16`, `Needs::MetalGpuFamily` of Apple10) on a device
|
||||
//! that does not claim Apple10, and `NotImplemented` on one that does, whose fragment layout is
|
||||
//! not measured.
|
||||
|
||||
use super::resolves::{lane, quiet, Lane};
|
||||
use crate::air_library::AirLibrary;
|
||||
use metal2vulkan::error::{Feature, Needs};
|
||||
use metal2vulkan::pipeline::{ComputePipelineDescriptor, StageSource};
|
||||
use metal2vulkan_devtools::llvm_assemble;
|
||||
use metal2vulkan_runtime::{ComputePipelineState, Error, GpuFamily, PipelineOptions};
|
||||
|
||||
/// The compute pipeline of the fixture's kernel `name` on `lane`'s device.
|
||||
fn pipeline(lane: &Lane, name: &str) -> Result<ComputePipelineState, Error> {
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("simd_matrix16.ll");
|
||||
let function = (lane.device)
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap()
|
||||
.new_function_with_name(name)
|
||||
.unwrap();
|
||||
lane.device.new_compute_pipeline_state(
|
||||
&ComputePipelineDescriptor::new(StageSource::Function(function.function_descriptor())),
|
||||
&PipelineOptions::default(),
|
||||
)
|
||||
}
|
||||
|
||||
/// Every kernel of the fixture fails its compute pipeline's creation as Metal's does below
|
||||
/// Apple10.
|
||||
#[test]
|
||||
fn a_kernel_s_16x16x16_product_fails_its_pipeline_s_creation_as_metal_s() {
|
||||
let (messages, _cache, lane) = lane();
|
||||
let name = lane.device.name().to_owned();
|
||||
let apple10 = GpuFamily::Apple10.raw();
|
||||
let needs = if lane.device.supports_family(apple10) {
|
||||
Needs::NotImplemented
|
||||
} else {
|
||||
Needs::MetalGpuFamily(apple10)
|
||||
};
|
||||
for form in ["f32_f32", "f16_f16", "s_s"] {
|
||||
for tt in ["00", "01", "10", "11"] {
|
||||
let kernel = format!("m16_{form}_{tt}");
|
||||
match pipeline(&lane, &kernel) {
|
||||
Err(Error::Unsupported(u)) => assert_eq!(
|
||||
(u.feature, u.needs),
|
||||
(Feature::SimdgroupMatrix16x16x16, needs.clone()),
|
||||
"{name} {kernel}"
|
||||
),
|
||||
other => panic!("{name} {kernel}: {:?}", other.err()),
|
||||
}
|
||||
}
|
||||
}
|
||||
quiet(lane, &messages);
|
||||
}
|
||||
Vendored
+2
-2
@@ -61,7 +61,7 @@ mod tests;
|
||||
/// unchanged version, and its bless records the version. Independent of the crate's version and of
|
||||
/// [`ARTIFACT_FORMAT_VERSION`]. The commit that bumps it says what changed; this comment keeps no
|
||||
/// history.
|
||||
pub const SEMANTICS_VERSION: u32 = 2129;
|
||||
pub const SEMANTICS_VERSION: u32 = 2130;
|
||||
|
||||
/// The byte-layout version of encoded artifacts (`CompiledFunction::to_bytes` and the
|
||||
/// [`PipelineArtifact`] encodings). Every encoded artifact carries it, and a decode under another
|
||||
@@ -94,7 +94,7 @@ pub const ARTIFACT_FORMAT_VERSION: u32 = 523;
|
||||
/// changes no behaviour, and then updates that hash alone with the commit saying why, or changes
|
||||
/// behaviour and also bumps this version. The commit that bumps it says what changed; this comment
|
||||
/// keeps no history.
|
||||
pub const RUNTIME_VERSION: u32 = 2405;
|
||||
pub const RUNTIME_VERSION: u32 = 2406;
|
||||
|
||||
/// The digest of the sources this build of the crate was compiled from: SHA-256, as lowercase hex,
|
||||
/// of the manifest, the build script, and exactly the files the crate roots' module tree compiles
|
||||
|
||||
@@ -1246,6 +1246,14 @@ pub enum Feature {
|
||||
QuadOperations,
|
||||
/// Simdgroup matrix operations.
|
||||
SimdgroupMatrix,
|
||||
/// A 16x16x16 simdgroup matrix product
|
||||
/// (`air.simdgroup_matrix_16x16x16_[widening_]multiply_accumulate`), in any stage. Metal makes
|
||||
/// a pipeline of one only on a GPU of the Apple10 family and later: an M3 Max under macOS
|
||||
/// 27.0.1 refuses every one ("simdgroup_matrix<T,16,16x16> operations are supported by
|
||||
/// GPUFamily10 and later"), so the runtime answers it as Metal does on a device that does not
|
||||
/// claim Apple10 ([`Needs::MetalGpuFamily`]). Its fragment layout, which only such a GPU can
|
||||
/// show, is not measured.
|
||||
SimdgroupMatrix16x16x16,
|
||||
|
||||
// ---- Memory ----
|
||||
/// Argument buffers holding buffer pointers (dynamic roots).
|
||||
|
||||
@@ -44,9 +44,15 @@
|
||||
//! **Classes.** The multiply-add is `CrossLane(SHUFFLE)` and tangled in both tiers; the other
|
||||
//! operations read only the lane (`CrossLane(BASIC)`), so the fragment layout is the one the
|
||||
//! shuffles and the dispatch builtins agree on. Only kernels are lowered (a fragment or vertex
|
||||
//! simdgroup may be partially occupied, which the 32-lane layout cannot express); the 16x16x16
|
||||
//! products, whose fragment layout was never measured, are refused. Both refusals are
|
||||
//! simdgroup may be partially occupied, which the 32-lane layout cannot express), else
|
||||
//! `Unsupported{SimdgroupMatrix, NotImplemented}`.
|
||||
//!
|
||||
//! **16x16x16 products** (`MultiplyAccumulate16`, `<8 x R>` fragments) are refused in every stage
|
||||
//! as `Unsupported{SimdgroupMatrix16x16x16, NotImplemented}`: Metal makes them only on an Apple10
|
||||
//! GPU and later (an M3 Max refuses each at pipeline creation,
|
||||
//! `crates/metal2vulkan-conformance/probes/simd_matrix16.m`), so their fragment layout cannot be
|
||||
//! measured on the Apple9 GPUs at hand, and the runtime answers the refusal as Metal's own on a
|
||||
//! device that does not claim Apple10.
|
||||
|
||||
use std::borrow::Cow;
|
||||
|
||||
@@ -298,11 +304,12 @@ pub(super) fn select(
|
||||
op: &SimdMatrix,
|
||||
meter: &mut Meter,
|
||||
) -> Result<MatrixStrategy, Error> {
|
||||
if cx.stage != Stage::Kernel {
|
||||
return Err(not_implemented());
|
||||
}
|
||||
let (s, ops) = match *op {
|
||||
SimdMatrix::MultiplyAccumulate16 { .. } => return Err(not_implemented()),
|
||||
// Refused in every stage, ahead of the kernel-only check (the module docs).
|
||||
SimdMatrix::MultiplyAccumulate16 { .. } => {
|
||||
return Err(Unsupported::not_implemented(Feature::SimdgroupMatrix16x16x16).into())
|
||||
}
|
||||
_ if cx.stage != Stage::Kernel => return Err(not_implemented()),
|
||||
// Canonicalization rewrote every AIR 2.7 block operation whose transpose flag is a
|
||||
// constant into the AIR 2.8 form; one whose flag is not is not lowered.
|
||||
SimdMatrix::Load8x8Legacy { .. } | SimdMatrix::Store8x8Legacy { .. } => {
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
//! simdgroup matrices ([`matrix`]).
|
||||
//!
|
||||
//! **Simdgroup matrices** (`air.simdgroup_matrix_8x8_*`) are per-lane fragments of Apple's
|
||||
//! distributed 8x8 layout, multiplied with subgroup shuffles ([`matrix`]); the 16x16x16 products,
|
||||
//! whose fragment layout has never been measured on a device, and matrices outside kernels are
|
||||
//! refused as `Unsupported{SimdgroupMatrix, NotImplemented}`.
|
||||
//! distributed 8x8 layout, multiplied with subgroup shuffles ([`matrix`]); matrices outside
|
||||
//! kernels are refused as `Unsupported{SimdgroupMatrix, NotImplemented}`, and the 16x16x16
|
||||
//! products, which Metal makes only on an Apple10 GPU and later, as
|
||||
//! `Unsupported{SimdgroupMatrix16x16x16, NotImplemented}`.
|
||||
//!
|
||||
//! **Width.** A Metal simdgroup is 32 lanes on every profile: `get_simdgroup_size` is the constant
|
||||
//! 32, and every operation below acts on the 32-lane simdgroup of the calling lane.
|
||||
|
||||
@@ -23,8 +23,9 @@
|
||||
//! The data are small integers (or 8-bit floats that are multiples of 1/4 no larger than 4), so
|
||||
//! every product and sum is exact and the expectations do not depend on the accumulation's
|
||||
//! rounding. On every committed profile each kernel compiles, links, and passes L3 exactly where a
|
||||
//! cross-lane shuffle class has a compute tier. 16x16x16 products are refused as
|
||||
//! `SimdgroupMatrix`. No GPU is used.
|
||||
//! cross-lane shuffle class has a compute tier. The owned fixture `engine/simd_matrix16`'s 16x16x16
|
||||
//! products, which Metal makes only on an Apple10 GPU and later, are refused as
|
||||
//! `SimdgroupMatrix16x16x16` on every committed profile. No GPU is used.
|
||||
|
||||
use std::collections::BTreeMap;
|
||||
use std::sync::atomic::{AtomicU64, Ordering};
|
||||
@@ -693,16 +694,8 @@ fn fp8_factors_multiply_exactly() {
|
||||
}
|
||||
}
|
||||
|
||||
/// A 16x16x16 product.
|
||||
/// An AIR 2.7 block load whose transpose flag is no constant, which stays in that form.
|
||||
fn refused_kernels() -> Vec<(&'static str, String)> {
|
||||
let op16 = "air.simdgroup_matrix_16x16x16_multiply_accumulate.f.f.v8f32.v8f32.v8f32.v8f32";
|
||||
let body16 = format!(
|
||||
" %r = tail call <8 x float> @{op16}(<8 x float> zeroinitializer, i1 false, <8 x float> zeroinitializer, i1 false, <8 x float> zeroinitializer)\n \
|
||||
%e = extractelement <8 x float> %r, i64 0\n store float %e, ptr addrspace(1) %b0, align 4\n"
|
||||
);
|
||||
let decl16 =
|
||||
format!("declare <8 x float> @{op16}(<8 x float>, i1, <8 x float>, i1, <8 x float>)\n");
|
||||
// An AIR 2.7 block load whose transpose flag is no constant stays in that form.
|
||||
let legacy = format!(
|
||||
" %w = load i32, ptr addrspace(1) %b0, align 4\n %f = icmp ne i32 %w, 0\n \
|
||||
%a = tail call <64 x float> @{LOAD1}(ptr addrspace(1) %b0, i64 8, <2 x i64> zeroinitializer, i1 %f)\n \
|
||||
@@ -710,17 +703,45 @@ fn refused_kernels() -> Vec<(&'static str, String)> {
|
||||
);
|
||||
let legacy_decl =
|
||||
format!("declare <64 x float> @{LOAD1}(ptr addrspace(1), i64, <2 x i64>, i1)\n");
|
||||
vec![
|
||||
("mac16", kernel("mac16", 1, &body16, &decl16)),
|
||||
(
|
||||
"legacy_runtime_transpose",
|
||||
kernel("legacy_runtime_transpose", 1, &legacy, &legacy_decl),
|
||||
),
|
||||
]
|
||||
vec![(
|
||||
"legacy_runtime_transpose",
|
||||
kernel("legacy_runtime_transpose", 1, &legacy, &legacy_decl),
|
||||
)]
|
||||
}
|
||||
|
||||
/// The unmeasured 16x16x16 fragment layout is refused as `Unsupported{SimdgroupMatrix,
|
||||
/// NotImplemented}`, and so is an AIR 2.7 block load whose transpose flag is no constant.
|
||||
/// Every kernel of the owned fixture `engine/simd_matrix16` (`float`, `half` and widening signed
|
||||
/// 8-bit products, each with the four transpose-flag pairs) is refused as
|
||||
/// `Unsupported{SimdgroupMatrix16x16x16, NotImplemented}` on every committed profile: Metal makes
|
||||
/// these products only on an Apple10 GPU and later, and the runtime answers the refusal as Metal's
|
||||
/// own on a device that does not claim Apple10.
|
||||
#[test]
|
||||
fn products_of_16x16x16_are_refused_as_their_own_feature() {
|
||||
let Some(bc) = assembled(
|
||||
llvm_assemble(&engine_dir().join("simd_matrix16.ll")),
|
||||
"simd_matrix16",
|
||||
) else {
|
||||
return;
|
||||
};
|
||||
let names: Vec<String> = ["f32_f32", "f16_f16", "s_s"]
|
||||
.iter()
|
||||
.flat_map(|form| ["00", "01", "10", "11"].map(|tt| format!("m16_{form}_{tt}")))
|
||||
.collect();
|
||||
for (stem, p) in committed_profiles().expect("profiles") {
|
||||
for name in &names {
|
||||
match compile(&bc, name, &p) {
|
||||
Err(Error::Unsupported(u)) => assert_eq!(
|
||||
(u.feature, u.needs),
|
||||
(Feature::SimdgroupMatrix16x16x16, Needs::NotImplemented),
|
||||
"{stem} {name}"
|
||||
),
|
||||
other => panic!("{stem} {name}: {:?}", other.err()),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// An AIR 2.7 block load whose transpose flag is no constant is refused as
|
||||
/// `Unsupported{SimdgroupMatrix, NotImplemented}`.
|
||||
#[test]
|
||||
fn unmeasured_forms_are_refused() {
|
||||
let p = moltenvk();
|
||||
|
||||
@@ -14686,6 +14686,7 @@ variant metal2vulkan::error::Feature::SeparateMultisampledDepthStencil SeparateM
|
||||
variant metal2vulkan::error::Feature::SeqCstFence SeqCstFence
|
||||
variant metal2vulkan::error::Feature::SimdWidth SimdWidth
|
||||
variant metal2vulkan::error::Feature::SimdgroupMatrix SimdgroupMatrix
|
||||
variant metal2vulkan::error::Feature::SimdgroupMatrix16x16x16 SimdgroupMatrix16x16x16
|
||||
variant metal2vulkan::error::Feature::SparseTexture SparseTexture { slot: SlotRef }
|
||||
variant metal2vulkan::error::Feature::SparseTextures SparseTextures { missing: SparseNeed }
|
||||
variant metal2vulkan::error::Feature::Stage Stage(u8)
|
||||
|
||||
|
Can't render this file because it is too large.
|
+4
-2
@@ -27,7 +27,7 @@ Columns:
|
||||
|
||||
| Kind | Variants | With a site | Reach system | Reach app | Reach rare | Reach none | Unassessed |
|
||||
|---|---|---|---|---|---|---|---|
|
||||
| Translator and front-end refusals | 131 | 131 | 8 | 32 | 72 | 19 | 0 |
|
||||
| Translator and front-end refusals | 132 | 132 | 8 | 32 | 73 | 19 | 0 |
|
||||
| Runtime gaps | 80 | 80 | 1 | 10 | 46 | 23 | 0 |
|
||||
| Apple-only calls | 4 | 4 | 0 | 0 | 0 | 4 | 0 |
|
||||
| Binder refusals at a device limit | 9 | 9 | 0 | 1 | 7 | 1 | 0 |
|
||||
@@ -41,7 +41,7 @@ Columns:
|
||||
|
||||
| Kind | `metal-measured` | `metal-documented` | `metal-takes` | `device` | `ours` | `unknown` | `delegated` | `-` |
|
||||
|---|---|---|---|---|---|---|---|---|
|
||||
| Translator and front-end refusals | 0 | 0 | 0 | 50 | 58 | 0 | 0 | 23 |
|
||||
| Translator and front-end refusals | 0 | 0 | 0 | 50 | 59 | 0 | 0 | 23 |
|
||||
| Runtime gaps | 0 | 0 | 0 | 0 | 80 | 0 | 0 | 0 |
|
||||
| Apple-only calls | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
|
||||
| Binder refusals at a device limit | 0 | 0 | 0 | 9 | 0 | 0 | 0 | 0 |
|
||||
@@ -76,6 +76,7 @@ Columns:
|
||||
| `ComputeDerivatives` | Derivatives outside fragment without compute-derivative support | devices without VkFeature::ComputeDerivativeGroupLinear; every device (no Vulkan mechanism); every device (not implemented) | `ours` | 4: `crates/metal2vulkan/src/bind/dispatch.rs (check_local)`, `crates/metal2vulkan/src/lower/sync/barrier.rs (select_derivative, 3 sites)` | `rare`: derivatives in a kernel |
|
||||
| `QuadOperations` | Quad operations in a stage without quad support | devices without VkLimit::MinSubgroupSize; devices without VkProperty::SubgroupQuadOperationsInAllStages | `device` | 2: `crates/metal2vulkan/src/device/subgroup.rs (subgroup_tier, 2 sites)` | `app`: quad shuffles in kernels on devices without quad operations there |
|
||||
| `SimdgroupMatrix` | Simdgroup matrix operations | every device (not implemented) | `ours` | 1: `crates/metal2vulkan/src/lower/simd/matrix.rs (not_implemented)` | `rare`: simdgroup matrix kernels |
|
||||
| `SimdgroupMatrix16x16x16` | A 16x16x16 simdgroup matrix product (`air.simdgroup_matrix_16x16x16_[widening_]multiply_accumulate`), in any stage | every device (not implemented) | `ours` | 1: `crates/metal2vulkan/src/lower/simd/matrix.rs (select)` | `rare`: 16x16x16 simdgroup matrix products (Metal: Apple10 GPUs and later) |
|
||||
| `ArgumentBufferPointers` | Argument buffers holding buffer pointers (dynamic roots) | devices without buffer device addresses (`addressed_needs`) | `device` | 1: `crates/metal2vulkan/src/device/metal.rs (unsupported_features)` | `app`: argument buffers holding buffer pointers |
|
||||
| `ArgumentBufferTextures` | Argument buffers holding textures or samplers (handle domain) | devices short of a device limit the site names; devices without a capability the site computes (`gaps`); devices without a capability the site computes (`missing`); devices without a capability the site computes (`needs`); every device (not implemented) | `ours` | 20: `crates/metal2vulkan-runtime/src/families/features.rs (tier2)`, `crates/metal2vulkan-runtime/src/pipeline/objects.rs (create_set_layout)` (+11) | `app`: argument buffers holding textures and samplers (bindless) |
|
||||
| `ArgumentBufferObjects` | Argument-buffer members that are pipeline states, ICBs, function tables, or acceleration structures | every device (not implemented) | `ours` | 5: `crates/metal2vulkan/src/lower/access/encode.rs (select_command, 3 sites)`, `crates/metal2vulkan/src/memory/provenance.rs (access)` (+1) | `rare`: pipeline states and ICBs in argument buffers |
|
||||
@@ -612,6 +613,7 @@ Each refusal's sites, with the function that builds it.
|
||||
- `feature::ComputeDerivatives`: `crates/metal2vulkan/src/bind/dispatch.rs (check_local)`; `crates/metal2vulkan/src/lower/sync/barrier.rs (select_derivative, 3 sites)`
|
||||
- `feature::QuadOperations`: `crates/metal2vulkan/src/device/subgroup.rs (subgroup_tier, 2 sites)`
|
||||
- `feature::SimdgroupMatrix`: `crates/metal2vulkan/src/lower/simd/matrix.rs (not_implemented)`
|
||||
- `feature::SimdgroupMatrix16x16x16`: `crates/metal2vulkan/src/lower/simd/matrix.rs (select)`
|
||||
- `feature::ArgumentBufferPointers`: `crates/metal2vulkan/src/device/metal.rs (unsupported_features)`
|
||||
- `feature::ArgumentBufferTextures`: `crates/metal2vulkan-runtime/src/families/features.rs (tier2)`; `crates/metal2vulkan-runtime/src/pipeline/objects.rs (create_set_layout)`; `crates/metal2vulkan-runtime/src/resource_ids.rs (check_capacity, 2 sites)`; `crates/metal2vulkan/src/bind/heap.rs (array)`; `crates/metal2vulkan/src/bind/heap.rs (member_texel_view, 2 sites)`; `crates/metal2vulkan/src/bind/heap.rs (member_view, 5 sites)`; `crates/metal2vulkan/src/bind/heap.rs (new)`; `crates/metal2vulkan/src/lower/access/handle.rs (select)`; `crates/metal2vulkan/src/lower/sampler/select.rs (select_one)`; `crates/metal2vulkan/src/lower/sampler/select.rs (select_sampling)`; `crates/metal2vulkan/src/lower/texture/atomic.rs (select)`; `crates/metal2vulkan/src/lower/texture/slot.rs (declare_heap, 2 sites)`; `crates/metal2vulkan/src/pipeline/link.rs (heap_set)`
|
||||
- `feature::ArgumentBufferObjects`: `crates/metal2vulkan/src/lower/access/encode.rs (select_command, 3 sites)`; `crates/metal2vulkan/src/memory/provenance.rs (access)`; `crates/metal2vulkan/src/memory/provenance.rs (classify)`
|
||||
|
||||
@@ -23,6 +23,7 @@ feature ComputeDerivativesWithSimd rare derivatives in a kernel
|
||||
feature ComputeDerivatives rare derivatives in a kernel
|
||||
feature QuadOperations app quad shuffles in kernels on devices without quad operations there
|
||||
feature SimdgroupMatrix rare simdgroup matrix kernels
|
||||
feature SimdgroupMatrix16x16x16 rare 16x16x16 simdgroup matrix products (Metal: Apple10 GPUs and later)
|
||||
feature ArgumentBufferPointers app argument buffers holding buffer pointers
|
||||
feature ArgumentBufferTextures app argument buffers holding textures and samplers (bindless)
|
||||
feature ArgumentBufferObjects rare pipeline states and ICBs in argument buffers
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 17 and column 65.
|
Reference in new issue
Block a user