#include <metal_stdlib>

using namespace metal;
uint3 subgroupExclusiveAdd_0ff95a() {
  uint3 arg_0 = uint3(1u);
  uint3 res = simd_prefix_exclusive_sum(arg_0);
  return res;
}

fragment void fragment_main(device packed_uint3* tint_symbol [[buffer(0)]]) {
  *(tint_symbol) = packed_uint3(subgroupExclusiveAdd_0ff95a());
  return;
}

kernel void compute_main(device packed_uint3* tint_symbol_1 [[buffer(0)]]) {
  *(tint_symbol_1) = packed_uint3(subgroupExclusiveAdd_0ff95a());
  return;
}

