Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions crates/onnx-runtime-ep-cpu-plugin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,21 @@ pub extern "C" fn nxrt_ep_compiled_node_count() -> usize {
onnx_runtime_ep_plugin::ep::compiled_node_count()
}

/// Number of node inputs this EP reported to its kernels as session-lifetime
/// constants. Read through `dlopen` by the plugin E2E suite to prove weights
/// are recognised as weights on the ORT plugin path, where ORT presents a
/// fused node's initializers as ordinary inputs.
#[unsafe(no_mangle)]
pub extern "C" fn nxrt_ep_constant_weight_inputs() -> usize {
onnx_runtime_ep_plugin::ep::constant_weight_inputs()
}

/// Resets the constant-weight-input counter to zero.
#[unsafe(no_mangle)]
pub extern "C" fn nxrt_ep_reset_constant_weight_inputs() {
onnx_runtime_ep_plugin::ep::reset_constant_weight_inputs()
}

/// Resets the compiled-node counter to zero.
#[unsafe(no_mangle)]
pub extern "C" fn nxrt_ep_reset_compiled_node_count() {
Expand Down
4 changes: 4 additions & 0 deletions crates/onnx-runtime-ep-cpu-plugin/tests/plugin_export_abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,8 @@ fn l1_required_symbols_resolve() {
&b"nxrt_ep_reset_compiled_node_count"[..],
&b"nxrt_ep_workspace_placement_queries"[..],
&b"nxrt_ep_reset_workspace_placement_queries"[..],
&b"nxrt_ep_constant_weight_inputs"[..],
&b"nxrt_ep_reset_constant_weight_inputs"[..],
] {
let _counter: libloading::Symbol<'_, unsafe extern "C" fn() -> usize> =
unsafe { lib.get(symbol) }.unwrap_or_else(|e| {
Expand Down Expand Up @@ -576,6 +578,8 @@ fn l1_no_symbol_leakage() {
&& *name != "nxrt_ep_reset_compiled_node_count"
&& *name != "nxrt_ep_workspace_placement_queries"
&& *name != "nxrt_ep_reset_workspace_placement_queries"
&& *name != "nxrt_ep_constant_weight_inputs"
&& *name != "nxrt_ep_reset_constant_weight_inputs"
&& !name.starts_with("_Z")
&& !name.starts_with("__rust")
&& !name.starts_with("__rdl_")
Expand Down
Loading
Loading