#include <metal_stdlib>

using namespace metal;
float3 subgroupExclusiveAdd_41cfde() {
  float3 res = simd_prefix_exclusive_sum(float3(1.0f));
  return res;
}

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

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

