#if !defined(TORCH_STABLE_ONLY) && !defined(TORCH_TARGET_VERSION) #pragma once #include // Outputs each conv1d_depthwise thread keeps in registers, so every weight // tap is loaded once per 8 outputs. C10_METAL_CONSTEXPR int32_t kConv1dDepthwiseOutputsPerThread = 8; // Source element strides of the OIDHW weight view (may be non-contiguous). struct ConvWeightPermuteParams { uint32_t output_channels; uint32_t input_channels_per_group; uint32_t kernel_height; uint32_t kernel_width; uint32_t output_channel_stride; uint32_t input_channel_stride; uint32_t depth_stride; uint32_t height_stride; uint32_t width_stride; }; struct Conv2DParams { int32_t N; int32_t C_in; int32_t C_out; int32_t H; int32_t W; int32_t outH; int32_t outW; int32_t kH; int32_t kW; int32_t sH; int32_t sW; int32_t padH; int32_t padW; int32_t dH; int32_t dW; int32_t C_in_per_group; int32_t C_out_per_group; bool has_bias; }; // Shared between Convolution.metal and operations/Convolution.mm. conv3d_mpp // bakes kernel, stride, and dilation into template args; conv3d_simd reads // them from here. struct Conv3DParams { Conv2DParams conv2d; int32_t D; int32_t outD; int32_t kD; int32_t sD; int32_t padD; int32_t dD; bool out_ncdhw; }; #else #error "This file should not be included when either TORCH_STABLE_ONLY or TORCH_TARGET_VERSION is defined." #endif // !defined(TORCH_STABLE_ONLY) && !defined(TORCH_TARGET_VERSION)