Implement GetAvaiableResource() callback (#28103)
This pull request introduces a new resource accounting mechanism to the
ONNX Runtime Execution Provider (EP) plugin API, enabling execution
providers to report available device resources (such as free GPU memory)
for use in budget enforcement during graph partitioning. The main
changes include the definition of an ABI-stable `OrtResourceCount`
struct and enum, a new optional API for querying available resources,
and a CUDA EP implementation that reports free device memory. Host-side
logic is updated to use this information when explicit session memory
limits are not set.
**API and Struct Additions:**
* Introduced the `OrtResourceCountKind` enum and ABI-stable
`OrtResourceCount` struct to represent device resource counts in a
forward-compatible way, including C++ helpers and ABI stability checks.
(`include/onnxruntime/core/session/onnxruntime_ep_c_api.h`)
* Added the optional `GetAvailableResource` function pointer to the
`OrtEp` struct, allowing EPs to report available device resources for
partitioning budget.
(`include/onnxruntime/core/session/onnxruntime_ep_c_api.h`)
**CUDA EP Implementation:**
* Implemented `GetAvailableResourceImpl` in `CudaEp`, which queries the
current device for free memory using `cudaMemGetInfo` and returns it as
an `OrtResourceCount`.
(`onnxruntime/core/providers/cuda/plugin/cuda_ep.cc`,
`onnxruntime/core/providers/cuda/plugin/cuda_ep.h`)
[[1]](diffhunk://#diff-0890d267a71ca02f4173c2ab226e6c5707fcbbf6bbb5f602fa5d92aa82f42a80R605-R649)
[[2]](diffhunk://#diff-82888350617a2e54bb30b1a11cd2563ecaf2b45ed0baba736674d9156c912b20R91-R93)
* Registered the new API in the CUDA EP constructor.
(`onnxruntime/core/providers/cuda/plugin/cuda_ep.cc`)
**Host-Side Integration:**
* Updated the host-side plugin EP logic to call `GetAvailableResource`
if no explicit threshold is set, using the returned value as the
resource budget for partitioning (mirroring in-tree CUDA EP behavior).
(`onnxruntime/core/session/plugin_ep/ep_plugin_provider_interfaces.cc`)
* Added necessary includes for type narrowing.
(`onnxruntime/core/session/plugin_ep/ep_plugin_provider_interfaces.cc`)