Files
wehub-resource-sync d88fd01084
CI / test (3.10) (push) Failing after 1s
CI / test (3.12) (push) Failing after 0s
CI / skillgen-check (push) Failing after 0s
CI / security-scan (push) Failing after 0s
chore: import upstream snapshot with attribution
2026-07-13 12:09:14 +08:00

22 lines
392 B
Metal

#include <metal_stdlib>
using namespace metal;
struct Vec3 {
float x;
float y;
float z;
};
float dot3(Vec3 a, Vec3 b) {
return a.x * b.x + a.y * b.y + a.z * b.z;
}
kernel void saxpy(
device const float* x [[buffer(0)]],
device float* y [[buffer(1)]],
constant float& a [[buffer(2)]],
uint id [[thread_position_in_grid]]
) {
y[id] = a * x[id] + y[id];
}