// File: binding.cpp
#include "pooling_global_avg_contract.h"
#include "mat.h"
#include "option.h"

extern "C" {
int armbench_entry_pooling(
    void* bottom_v, void* top_v,
    void* opt_v)
{
    const auto& bottom = *reinterpret_cast<const ncnn::Mat*>(bottom_v);
    auto&       top    = *reinterpret_cast<ncnn::Mat*>(top_v);
    const auto& opt    = *reinterpret_cast<const ncnn::Option*>(opt_v);

    const int C = bottom.c;
    top.create(C, (size_t)4u, opt.blob_allocator);
    if (top.empty()) return -1;

    return ncnn::pooling_global_avg_kernel(bottom, top, opt);
}
} // extern "C"