okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
7c5e84612
main
1// wrap_probe.metal - the tests/wrap_split_test.cpp kernel: reads a window at the start of a bound range and another at 2// its far end (`far` floats on), to prove a chunked no-copy buffer (Context::wrap with a span) binds the whole range. 3#include <metal_stdlib> 4using namespace metal; 5 6kernel void probe_copy(device const float* src [[buffer(0)]], device float* dst [[buffer(1)]], 7 device const uint* par [[buffer(2)]], uint i [[thread_position_in_grid]]) { 8 const uint n = par[0], far = par[1]; 9 if (i >= n) return; 10 dst[i] = src[i]; 11 dst[n + i] = src[far + i]; 12}