portable_parallel_tuning.h#
-
namespace onnx_light
Alias that makes onnx-light headers compatible with code that references
ONNX_LIGHT_NAMESPACE(the macro used in the standard onnx package).Set to
ONNX_LIGHT_NAMESPACEso both names resolve to the same namespace.Symbol-visibility attribute for the public onnx-light C++ API.
Maps the upstream compatibility macro to onnx-light’s explicit proto ABI annotation. This keeps declarations from vendored ONNX headers visible when
lib_onnx_protouses hidden visibility by default.Namespace alias so that ONNX C++ code (and consumers such as onnxruntime) that refers to the literal
onnxnamespace — rather than theONNX_NAMESPACEmacro — resolves to the onnx-light namespace. The standard onnx package lives innamespace onnx; onnx-light usesonnx_light(via ONNX_LIGHT_NAMESPACE), so this alias keeps onnx-light a true drop-in. It is only introduced when the onnx-light namespace differs fromonnx.-
namespace onnx_kernels
-
namespace tuning
Functions
-
core::runtime::KernelTuningKey MakePortableTuningKey(std::string_view kernel, int32_t element_type, uint32_t tuning_abi = 1)#
Returns the tuning key for one portable onnx-light kernel implementation.
Returns: The exact key for
kernelandelement_type.
-
bool IsSupportedElementType(int32_t element_type, std::span<const int32_t> supported_element_types)#
Returns whether an element type is supported by a kernel.
Returns:
truewhenelement_typeappears insupported_element_types.
-
void RegisterParallelTuningSchemas(std::string_view kernel, std::span<const int32_t> supported_element_types, int64_t portable_minimum_elements, uint32_t tuning_abi = 1)#
Registers one parallel tuning schema for every supported element type.
-
void ConfigureParallelTuning(std::string_view kernel, const core::runtime::KernelTuningParameters ¶meters, ParallelTuning &tuning, uint32_t tuning_abi = 1)#
Validates and copies resolved parallel parameters into a typed configuration.
-
class ParallelTunableKernel : public onnx_light::core::runtime::KernelBase#
- #include <portable_parallel_tuning.h>
Implements the shared runtime contract for one parallel-tunable kernel.
Subclassed by onnx_light::onnx_kernels::kernel::BitShift, onnx_light::onnx_kernels::kernel::BitwiseAnd, onnx_light::onnx_kernels::kernel::BitwiseOr, onnx_light::onnx_kernels::kernel::BitwiseXor, onnx_light::onnx_kernels::kernel::Div, onnx_light::onnx_kernels::kernel::Equal, onnx_light::onnx_kernels::kernel::Greater, onnx_light::onnx_kernels::kernel::GreaterOrEqual, onnx_light::onnx_kernels::kernel::Less, onnx_light::onnx_kernels::kernel::LessOrEqual, onnx_light::onnx_kernels::kernel::Mod, onnx_light::onnx_kernels::kernel::Or, onnx_light::onnx_kernels::kernel::PRelu, onnx_light::onnx_kernels::kernel::Pow, onnx_light::onnx_kernels::kernel::StringConcat, onnx_light::onnx_kernels::kernel::Sub, onnx_light::onnx_kernels::kernel::SwiGLU, onnx_light::onnx_kernels::kernel::Xor
Public Functions
-
ParallelTunableKernel(const core::runtime::KernelContext &ctx, std::string_view kernel, std::span<const int32_t> supported_element_types, int64_t portable_minimum_elements, uint32_t tuning_abi = 1)#
-
virtual core::runtime::KernelTuningKey TuningKey(int32_t element_type) const override#
Returns the tuning key for this implementation and
element_type.The default returns an undefined key, indicating that the kernel has no tuning schema. Tunable kernels override this together with :cpp:func:
Configure.
-
virtual void Configure(const core::runtime::KernelTuningParameters ¶meters) override#
Validates and copies resolved parameters into this kernel’s typed, immutable configuration.
Called at most once, while a :cpp:class:
RuntimeSessioninitializes the kernel and before its first :cpp:func:Run.
-
inline const ParallelTuning &tuning() const noexcept#
Returns the immutable configuration used by the execution path.
-
ParallelTunableKernel(const core::runtime::KernelContext &ctx, std::string_view kernel, std::span<const int32_t> supported_element_types, int64_t portable_minimum_elements, uint32_t tuning_abi = 1)#
-
core::runtime::KernelTuningKey MakePortableTuningKey(std::string_view kernel, int32_t element_type, uint32_t tuning_abi = 1)#
-
namespace tuning
-
namespace onnx_kernels