#include <metal_stdlib>

using namespace metal;
int2 subgroupInclusiveAdd_fabbde() {
  int2 arg_0 = int2(1);
  int2 res = simd_prefix_inclusive_sum(arg_0);
  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;
}

