// File: conv2d.cpp
// Binding harness: computes H_out/W_out from constexpr params, calls inner_conv2d.
// ABI: armbench_entry_conv2d(input*, output*, weight*, bias*, weight_scales*, N, C_in, H, W, C_out)
#include "conv2d.h"
using namespace conv2d_def;

extern "C" int armbench_entry_conv2d(
    const int8_t* input, float* output,
    const int8_t* weight, const float* bias, const float* weight_scales,
    int N, int C_in, int H, int W, int C_out)
{
    constexpr int ext_kh = Dh * (Kh - 1) + 1;
    constexpr int ext_kw = Dw * (Kw - 1) + 1;
    const int H_out = (H + 2 * pad_top  - ext_kh) / Sh + 1;
    const int W_out = (W + 2 * pad_left - ext_kw) / Sw + 1;
    inner_conv2d(input, output, weight, bias, weight_scales,
                 N, C_in, H, W, C_out, H_out, W_out);
    return 0;
}