#include <metal_stdlib>

using namespace metal;
float3 subgroupShuffleUp_87c9d6() {
  float3 arg_0 = float3(1.0f);
  uint arg_1 = 1u;
  float3 res = simd_shuffle_up(arg_0,arg_1);
  return res;
}

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

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

