#include <metal_stdlib>

using namespace metal;
half2 subgroupAdd_cae1ed() {
  half2 arg_0 = half2(1.0h);
  half2 res = simd_sum(arg_0);
  return res;
}

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

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

