Kernel inventory and usage#
- registered_kernel_names() dict[str, str]#
Returns a
{op_type: kernel name}mapping for accelerated registered kernels, for example{"Abs": "onnx_light_cpu::Abs"}. Use it to confirm that accelerated rather than built-in kernels are registered. The mapping is derived fromregistered_kernels()rather than a separate operator list.
- class RegisteredKernel#
Immutable record describing one kernel registration.
- domain: str#
ONNX operator domain, e.g.
"ai.onnx".
- op_type: str#
ONNX operator type name, e.g.
"Abs".
- device: str#
Device the kernel runs on, e.g.
"CPU".
- kernel_name: str#
Library-qualified C++ kernel class name, e.g.
"onnx_light_cpu::Abs".
- types: tuple[str, ...]#
Element type names accepted for primary tensor operands.
- since_version: int | None#
Inclusive opset lower bound, or
Nonewithout a lower bound.
- until_version: int | None#
Inclusive opset upper bound, or
Nonewithout an upper bound.
- registered_kernels() tuple[RegisteredKernel, ...]#
Returns registrations collected from the C++
CollectRegisteredKernels()inventory without executing kernels.
- used_kernel_names() list[str]#
Returns, in invocation order, the accelerated kernels run since the last
clear_used_kernel_names()call.
- clear_used_kernel_names() None#
Clears the recorded accelerated-kernel invocations.
- set_kernel_usage_recording(enabled) None#
Enables or disables per-invocation kernel usage recording.