#include <metal_stdlib>

using namespace metal;
uint subgroupInclusiveAdd_7ed675() {
  uint arg_0 = 1u;
  uint res = simd_prefix_inclusive_sum(arg_0);
  return res;
}

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

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

