// File: conv2d_depthwise.h
#pragma once
#include <cstdint>

// Per-definition constants for this conv2d_depthwise w8a8ch (int8) specialisation.
// Unlike plain conv2d_w8a8ch, input_scales here is a genuine per-channel runtime
// tensor (shape [C]), not a per-definition-constant scalar — passed as a regular
// float pointer below, same as weight_scales.
namespace conv2d_depthwise_def {
constexpr int Kh  = 5;
constexpr int Kw  = 5;
constexpr int Sh  = 1;
constexpr int Sw  = 1;
constexpr int Dh  = 1;
constexpr int Dw  = 1;
constexpr int pad = 2;
} // namespace conv2d_depthwise_def

#ifdef __cplusplus
extern "C" {
#endif
// LLM target: implement this in kernel.cpp.
// N, C, H, W are var dims; H_out/W_out are pre-computed by the binding harness.
// Input layout: (N, C, H, W); weight layout: (C, 1, Kh, Kw); output layout: (N, C, H_out, W_out).
// Dequantization: real = int8_value * scale, where scale = input_scales[c] * weight_scales[c]
// (per-channel — NOT ncnn's quantization convention int8 = round(real * scale)).
void inner_conv2d_depthwise(
    const int8_t* input, float* output,
    const int8_t* weight, const float* bias,
    const float* input_scales, const float* weight_scales,
    int N, int C, int H, int W, int H_out, int W_out);
#ifdef __cplusplus
}
#endif