#include <metal_stdlib>

using namespace metal;
int2 subgroupInclusiveAdd_fabbde() {
  int2 res = simd_prefix_inclusive_sum(int2(1));
  return res;
}

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

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

