#pragma once
#include <string>

// ── BackendConfig ─────────────────────────────────────────────────────────────
// Backend-neutral tuning knobs for the inference backends. Carried inside Config
// (as Config::trt) and handed to the make_face_detector / make_face_embedder
// factories. The core application sets these fields without knowing which
// backend (ONNX Runtime or TensorRT) will consume them.
//
// fp16:      FP16 Tensor Core kernels — safe for both SCRFD and ArcFace.
// int8:      INT8 quantisation — fast but UNSAFE for ArcFace without a
//            calibration table (embedding cosine space will shift, breaking
//            similarity thresholds).  Safe for the SCRFD detector.
// cache_dir: TRT engines are compiled once and cached here.  First run is
//            slow (~30–60 s per model); every subsequent run loads instantly.
//
// Shape profile (optional, set input_name + profile_{min,opt,max} to enable):
//   Shape strings are trtexec-style, e.g. "1x3x112x112".  When left empty the
//   backend derives a sensible default from the model.
//
// ort_cache_dir: ORT optimized-model cache. On first load ORT writes a
//   pre-optimized .ort file here; subsequent loads skip graph optimization.
//   Empty string = disabled.  Applies to all ORT providers (ROCm, CUDA, CPU).
struct BackendConfig {
    bool        fp16      = true;
    bool        int8      = false;
    std::string cache_dir = "./trt_cache";
    // Per-tensor optimisation profile.  All four fields must be set together.
    std::string input_name;     // e.g. "input.1"
    std::string profile_min;    // e.g. "1x3x112x112"
    std::string profile_opt;    // e.g. "4x3x112x112"
    std::string profile_max;    // e.g. "8x3x112x112"

    std::string ort_cache_dir = "./ort_cache";
};
