#include <metal_stdlib>

using namespace metal;
uint textureDimensions_c27466(texture1d<int, access::read_write> tint_symbol) {
  uint res = tint_symbol.get_width(0);
  return res;
}

fragment void fragment_main(device uint* tint_symbol_1 [[buffer(0)]], texture1d<int, access::read_write> tint_symbol_2 [[texture(0)]]) {
  *(tint_symbol_1) = textureDimensions_c27466(tint_symbol_2);
  return;
}

kernel void compute_main(device uint* tint_symbol_3 [[buffer(0)]], texture1d<int, access::read_write> tint_symbol_4 [[texture(0)]]) {
  *(tint_symbol_3) = textureDimensions_c27466(tint_symbol_4);
  return;
}

