Expand description
Per-kernel GPU time, for finding where time goes (NUVEC_PROFILE=1).
While enabled, array evaluation commits every dispatch in a command buffer of its own
and waits for it, and each completed command buffer’s GPU time (Metal’s GPU start and
end timestamps) is added to its kernel’s total. Commands then never overlap (nor wait
for one another on the GPU), so totals show each kernel’s cost alone, not the
overlapped wall time. NUVEC_PROFILE=shapes keeps each
grid size (threads per dimension) apart. The GPU idles between command buffers, so its
clocks drop: absolute times are inflated (most for short kernels); compare shares and
orders of magnitude, and measure throughput with the benchmarks.