#include <metal_stdlib>

using namespace metal;
uint3 subgroupInclusiveAdd_f43b30() {
  uint3 res = simd_prefix_inclusive_sum(uint3(1u));
  return res;
}

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

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

