#include <metal_stdlib>

using namespace metal;
half2 subgroupInclusiveMul_ac5df5() {
  half2 res = simd_prefix_inclusive_product(half2(1.0h));
  return res;
}

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

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

