// // This file was auto-generated using the following command: // // jai generate.jai // ORT_API_VERSION :: 30; ORTCHAR_T :: u16; /** \brief Error codes reported by ONNX Runtime. * * The error code associated with an ::OrtStatus. */ OrtErrorCode :: enum s32 { ORT_OK :: 0; ORT_FAIL :: 1; ORT_INVALID_ARGUMENT :: 2; ORT_NO_SUCHFILE :: 3; ORT_NO_MODEL :: 4; ORT_ENGINE_ERROR :: 5; ORT_RUNTIME_EXCEPTION :: 6; ORT_INVALID_PROTOBUF :: 7; ORT_MODEL_LOADED :: 8; ORT_NOT_IMPLEMENTED :: 9; ORT_INVALID_GRAPH :: 10; ORT_EP_FAIL :: 11; ORT_MODEL_LOAD_CANCELED :: 12; ORT_MODEL_REQUIRES_COMPILATION :: 13; ORT_NOT_FOUND :: 14; ORT_DEVICE_RESET :: 15; } /** Copied from TensorProto::DataType * Currently, Ort doesn't support complex64, complex128 */ ONNXTensorElementDataType :: enum s32 { ONNX_TENSOR_ELEMENT_DATA_TYPE_UNDEFINED :: 0; ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT :: 1; ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT8 :: 2; ONNX_TENSOR_ELEMENT_DATA_TYPE_INT8 :: 3; ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT16 :: 4; ONNX_TENSOR_ELEMENT_DATA_TYPE_INT16 :: 5; ONNX_TENSOR_ELEMENT_DATA_TYPE_INT32 :: 6; ONNX_TENSOR_ELEMENT_DATA_TYPE_INT64 :: 7; ONNX_TENSOR_ELEMENT_DATA_TYPE_STRING :: 8; ONNX_TENSOR_ELEMENT_DATA_TYPE_BOOL :: 9; ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT16 :: 10; ONNX_TENSOR_ELEMENT_DATA_TYPE_DOUBLE :: 11; ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT32 :: 12; ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT64 :: 13; ONNX_TENSOR_ELEMENT_DATA_TYPE_COMPLEX64 :: 14; ONNX_TENSOR_ELEMENT_DATA_TYPE_COMPLEX128 :: 15; ONNX_TENSOR_ELEMENT_DATA_TYPE_BFLOAT16 :: 16; ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT8E4M3FN :: 17; ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT8E4M3FNUZ :: 18; ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT8E5M2 :: 19; ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT8E5M2FNUZ :: 20; ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT4 :: 21; ONNX_TENSOR_ELEMENT_DATA_TYPE_INT4 :: 22; ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT4E2M1 :: 23; ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT2 :: 24; ONNX_TENSOR_ELEMENT_DATA_TYPE_INT2 :: 25; ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT8E8M0 :: 26; } // Synced with onnx TypeProto oneof ONNXType :: enum s32 { ONNX_TYPE_UNKNOWN :: 0; ONNX_TYPE_TENSOR :: 1; ONNX_TYPE_SEQUENCE :: 2; ONNX_TYPE_MAP :: 3; ONNX_TYPE_OPAQUE :: 4; ONNX_TYPE_SPARSETENSOR :: 5; ONNX_TYPE_OPTIONAL :: 6; } // These types are synced with internal // SparseFormatFlags OrtSparseFormat :: enum s32 { ORT_SPARSE_UNDEFINED :: 0; ORT_SPARSE_COO :: 1; ORT_SPARSE_CSRC :: 2; ORT_SPARSE_BLOCK_SPARSE :: 4; } // Enum allows to query sparse tensor indices OrtSparseIndicesFormat :: enum s32 { ORT_SPARSE_COO_INDICES :: 0; ORT_SPARSE_CSR_INNER_INDICES :: 1; ORT_SPARSE_CSR_OUTER_INDICES :: 2; ORT_SPARSE_BLOCK_SPARSE_INDICES :: 3; } /** \brief Logging severity levels * * In typical API usage, specifying a logging severity level specifies the minimum severity of log messages to show. */ OrtLoggingLevel :: enum s32 { ORT_LOGGING_LEVEL_VERBOSE :: 0; ORT_LOGGING_LEVEL_INFO :: 1; ORT_LOGGING_LEVEL_WARNING :: 2; ORT_LOGGING_LEVEL_ERROR :: 3; ORT_LOGGING_LEVEL_FATAL :: 4; } OrtOpAttrType :: enum s32 { ORT_OP_ATTR_UNDEFINED :: 0; ORT_OP_ATTR_INT :: 1; ORT_OP_ATTR_INTS :: 2; ORT_OP_ATTR_FLOAT :: 3; ORT_OP_ATTR_FLOATS :: 4; ORT_OP_ATTR_STRING :: 5; ORT_OP_ATTR_STRINGS :: 6; ORT_OP_ATTR_GRAPH :: 7; ORT_OP_ATTR_TENSOR :: 8; } /** \addtogroup Global * ONNX Runtime C API * @{ */ // The actual types defined have an Ort prefix OrtEnv :: struct {} OrtStatus :: struct {} OrtMemoryInfo :: struct {} OrtIoBinding :: struct {} OrtSession :: struct {} OrtValue :: struct {} OrtRunOptions :: struct {} OrtTypeInfo :: struct {} OrtTensorTypeAndShapeInfo :: struct {} OrtMapTypeInfo :: struct {} OrtSequenceTypeInfo :: struct {} OrtOptionalTypeInfo :: struct {} OrtSessionOptions :: struct {} OrtCustomOpDomain :: struct {} OrtModelMetadata :: struct {} OrtThreadPoolParams :: struct {} OrtThreadingOptions :: struct {} OrtArenaCfg :: struct {} OrtPrepackedWeightsContainer :: struct {} OrtTensorRTProviderOptionsV2 :: struct {} OrtNvTensorRtRtxProviderOptions :: struct {} OrtCUDAProviderOptionsV2 :: struct {} OrtCANNProviderOptions :: struct {} OrtDnnlProviderOptions :: struct {} OrtOp :: struct {} OrtOpAttr :: struct {} OrtLogger :: struct {} OrtShapeInferContext :: struct {} OrtLoraAdapter :: struct {} OrtValueInfo :: struct {} OrtNode :: struct {} OrtGraph :: struct {} OrtModel :: struct {} OrtModelCompilationOptions :: struct {} OrtHardwareDevice :: struct {} OrtEpDevice :: struct {} OrtKeyValuePairs :: struct {} OrtSyncStream :: struct {} OrtExternalInitializerInfo :: struct {} OrtExternalResourceImporter :: struct {} OrtDeviceEpIncompatibilityDetails :: struct {} OrtEpAssignedSubgraph :: struct {} OrtEpAssignedNode :: struct {} OrtStatusPtr :: *OrtStatus; /** \brief Generic function pointer type for experimental API lookup. * * Returned by OrtApi::GetExperimentalFunction. Cast to the correct function pointer type before calling. * The experimental API function pointer types are defined in onnxruntime_experimental_c_api.h. * * This is a function pointer rather than \c void* because casting between function pointers and object * pointers is undefined behavior in C and C++. Using a function pointer type keeps all casts well-defined. */ OrtExperimentalFnPtr :: #type () -> void #c_call; /** \brief Memory allocation interface * * Structure of function pointers that defines a memory allocator. This can be created and filled in by the user for custom allocators. * * When an allocator is passed to any function, be sure that the allocator object is not destroyed until the last allocated object using it is freed. */ OrtAllocator :: struct { version: u32; ///< Must be initialized to ORT_API_VERSION /// Returns a pointer to an allocated block of `size` bytes Alloc: #type (this_: *OrtAllocator, size: u64) -> *void #c_call; /// Free a block of memory previously allocated with OrtAllocator::Alloc Free: #type (this_: *OrtAllocator, p: *void) -> void #c_call; /// Return a pointer to an ::OrtMemoryInfo that describes this allocator Info: #type (this_: *OrtAllocator) -> *OrtMemoryInfo #c_call; /** * @brief Optional allocation function to use for memory allocations made during session initialization. * Use this function if you want to separate allocations made by ORT during Run() calls from * those made during session initialization. This allows for separate memory management strategies for these * allocations. * * \return pointer to an allocated block of `size` bytes. nullptr if size was 0 or allocation failed. * * \since 1.18 */ Reserve: #type (this_: *OrtAllocator, size: u64) -> *void #c_call; /** * @brief Function used to get the statistics of the allocator. * * Return a pointer to the OrtKeyValuePairs structure that contains the statistics of the allocator. * The user should call OrtApi::ReleaseKeyValuePairs when done. * * Current known keys are: * - Limit: Bytes limit of the allocator. -1 if no limit is set. * - InUse: Number of bytes in use. * - TotalAllocated: The total number of allocated bytes by the allocator. * - MaxInUse: The maximum bytes in use. * - NumAllocs: Number of allocations. * - NumReserves: Number of reserves. (Number of calls to Reserve() in arena-based allocators) * - NumArenaExtensions: Number of arena extensions (Relevant only for arena based allocators) * - NumArenaShrinkages: Number of arena shrinkages (Relevant only for arena based allocators) * - MaxAllocSize: The max single allocation seen. * * The allocator is free to add other entries as appropriate. * * \note Implementation of this function is optional and GetStats may be set to a nullptr. * If the OrtAllocator is wrapping an internal ORT allocator that does not implement GetStats * the returned OrtKeyValuePairs instance will be empty. * * \since 1.23 */ GetStats: #type (this_: *OrtAllocator, out: **OrtKeyValuePairs) -> OrtStatusPtr #c_call; /** \brief Allocate using a stream. * * If the allocator is stream aware this performs allocation using a stream. * * Alloc will be used if this is nullptr. * * \param[in] this_ OrtAllocator instance * \param[in] size Size of the allocation in bytes. nullptr if size was 0 or allocation failed. * \param[in] stream The stream to allocate on. * * \return pointer to an allocated block of `size` bytes * * \note Implementation of this function is optional and AllocOnStream may be set to a nullptr. * \since 1.23 */ AllocOnStream: #type (this_: *OrtAllocator, size: u64, stream: *OrtSyncStream) -> *void #c_call; /** \brief Release unused memory held by the allocator back to the system. * * For arena-based allocators, this frees allocation regions that are completely unused. * For mempool-based allocators, this trims the pool to a configured minimum. * For non-arena allocators this is a no-op. * * \param[in] this_ OrtAllocator instance * * \return nullptr on success, or an OrtStatus* on failure. * * \note Implementation of this function is optional and Shrink may be set to a nullptr. * Callers must check for nullptr before invoking. * \since 1.25 */ Shrink: #type (this_: *OrtAllocator) -> OrtStatusPtr #c_call; } OrtLoggingFunction :: #type (param: *void, severity: OrtLoggingLevel, category: *u8, logid: *u8, code_location: *u8, message: *u8) -> void #c_call; /** \brief Graph optimization level * * Refer to https://www.onnxruntime.ai/docs/performance/graph-optimizations.html#graph-optimization-levels * for an in-depth understanding of the Graph Optimization Levels. */ GraphOptimizationLevel :: enum s32 { ORT_DISABLE_ALL :: 0; ORT_ENABLE_BASIC :: 1; ORT_ENABLE_EXTENDED :: 2; ORT_ENABLE_LAYOUT :: 3; ORT_ENABLE_ALL :: 99; } ExecutionMode :: enum s32 { ORT_SEQUENTIAL :: 0; ORT_PARALLEL :: 1; } /** \brief Language projection identifiers * /see OrtApi::SetLanguageProjection */ OrtLanguageProjection :: enum s32 { ORT_PROJECTION_C :: 0; ORT_PROJECTION_CPLUSPLUS :: 1; ORT_PROJECTION_CSHARP :: 2; ORT_PROJECTION_PYTHON :: 3; ORT_PROJECTION_JAVA :: 4; ORT_PROJECTION_WINML :: 5; ORT_PROJECTION_NODEJS :: 6; } OrtKernelInfo :: struct {} OrtKernelContext :: struct {} OrtAllocatorType :: enum s32 { OrtInvalidAllocator :: -1; OrtDeviceAllocator :: 0; OrtArenaAllocator :: 1; OrtReadOnlyAllocator :: 2; } /** \brief Memory types for allocated memory, execution provider specific types should be extended in each provider. */ // Whenever this struct is updated, please also update the MakeKey function in onnxruntime / core / framework / execution_provider.cc OrtMemType :: enum s32 { OrtMemTypeCPUInput :: -2; OrtMemTypeCPUOutput :: -1; OrtMemTypeCPU :: -1; OrtMemTypeDefault :: 0; } /** \brief This matches OrtDevice::MemoryType values */ OrtDeviceMemoryType :: enum s32 { OrtDeviceMemoryType_DEFAULT :: 0; OrtDeviceMemoryType_HOST_ACCESSIBLE :: 5; } /** \brief This mimics OrtDevice type constants so they can be returned in the API */ OrtMemoryInfoDeviceType :: enum s32 { OrtMemoryInfoDeviceType_CPU :: 0; OrtMemoryInfoDeviceType_GPU :: 1; OrtMemoryInfoDeviceType_FPGA :: 2; OrtMemoryInfoDeviceType_NPU :: 3; } OrtHardwareDeviceType :: enum s32 { OrtHardwareDeviceType_CPU :: 0; OrtHardwareDeviceType_GPU :: 1; OrtHardwareDeviceType_NPU :: 2; } /** \brief These are the default EP selection policies used by ORT when doing automatic EP selection. */ OrtExecutionProviderDevicePolicy :: enum s32 { OrtExecutionProviderDevicePolicy_DEFAULT :: 0; OrtExecutionProviderDevicePolicy_PREFER_CPU :: 1; OrtExecutionProviderDevicePolicy_PREFER_NPU :: 2; OrtExecutionProviderDevicePolicy_PREFER_GPU :: 3; OrtExecutionProviderDevicePolicy_MAX_PERFORMANCE :: 4; OrtExecutionProviderDevicePolicy_MAX_EFFICIENCY :: 5; OrtExecutionProviderDevicePolicy_MIN_OVERALL_POWER :: 6; } /** \brief Reasons why an execution provider might not be compatible with a device */ OrtDeviceEpIncompatibilityReason :: enum s32 { OrtDeviceEpIncompatibility_NONE :: 0; OrtDeviceEpIncompatibility_DRIVER_INCOMPATIBLE :: 1; OrtDeviceEpIncompatibility_DEVICE_INCOMPATIBLE :: 2; OrtDeviceEpIncompatibility_MISSING_DEPENDENCY :: 4; OrtDeviceEpIncompatibility_UNKNOWN :: -2147483648; } /** \brief Delegate to allow providing custom OrtEpDevice selection logic * * This delegate is called by the EP selection code to allow the user to provide custom device selection logic. * The user can use this to select OrtEpDevice instances from the list of available devices. * * \param ep_devices The list of available devices. * \param num_devices The number of available devices. * \param model_metadata The model metadata. * \param runtime_metadata The runtime metadata. May be nullptr. * \param selected Pre-allocated array to populate with selected OrtEpDevice pointers from ep_devices. * \param max_selected The maximum number of devices that can be selected in the pre-allocated array. Currently the maximum is 8. * \param num_selected The number of selected devices. * \param state Opaque pointer. Required to use the delegate from other languages like C# and python. * * \return OrtStatus* Selection status. Return nullptr on success. * Use CreateStatus to provide error info. Use ORT_FAIL as the error code. * ORT will release the OrtStatus* if not null. */ EpSelectionDelegate :: #type (ep_devices: **OrtEpDevice, num_devices: u64, model_metadata: *OrtKeyValuePairs, runtime_metadata: *OrtKeyValuePairs, selected: **OrtEpDevice, max_selected: u64, num_selected: *u64, state: *void) -> *OrtStatus #c_call; /** \brief Function called by ORT to write a buffer to a custom destination (e.g., file, stream, etc.). * * \param state Opaque pointer holding the user's state. * \param buffer The buffer to write. * \param buffer_num_bytes The size of the buffer in bytes. * * \return OrtStatus* Write status. Return nullptr on success. * Use CreateStatus to provide error info. Use ORT_FAIL as the error code. * ORT will release the OrtStatus* if not null. */ OrtWriteBufferFunc :: #type (state: *void, buffer: *void, buffer_num_bytes: u64) -> *OrtStatus #c_call; /** \brief Function called by ORT to allow user to specify how an initializer should be saved, that is, either * written to an external file or stored within the model. ORT calls this function for every initializer when * generating a model. * * If the function implementation sets the `new_external_info` output parameter to NULL, ORT stores the initializer data * within the generated model. * * Otherwise, if the function implementation sets `new_external_info` to a valid OrtExternalInitializerInfo instance, * ORT assumes that this function stores the initializer data in a file. In this case, ORT configures the model's * initializer to point to the location specified by the `new_external_info` output parameter. * * \param[in] state Opaque pointer holding the user's state. * \param[in] initializer_name The initializer's name as a null-terminated string. * \param[in] initializer_value OrtValue containing the initializer's data, type, and shape. * \param[in] external_info If the initializer is originally stored in an external file, `external_info` contains * the file path, file offset, and the data's byte size within the file. Otherwise, * `external_info` is NULL if the initializer is not originally stored in a file. * \param[out] new_external_info Output parameter set to a new OrtExternalInitializerInfo instance indicating the * location where the function implementation stored the initializer data. * The function implementation must use `OrtApi::CreateExternalInitializerInfo()` to * create the instance. * If the function implementation sets `new_external_info` to NULL, * ORT stores the initializers within the model. * * \note ORT takes ownership of the `new_external_info` output parameter. * * \return OrtStatus* Write status. Return nullptr on success. * Use CreateStatus to provide error info. Use ORT_FAIL as the error code. * ORT will release the OrtStatus* if not null. */ OrtGetInitializerLocationFunc :: #type (state: *void, initializer_name: *u8, initializer_value: *OrtValue, external_info: *OrtExternalInitializerInfo, new_external_info: **OrtExternalInitializerInfo) -> *OrtStatus #c_call; /** \brief Algorithm to use for cuDNN Convolution Op */ OrtCudnnConvAlgoSearch :: enum s32 { OrtCudnnConvAlgoSearchExhaustive :: 0; OrtCudnnConvAlgoSearchHeuristic :: 1; OrtCudnnConvAlgoSearchDefault :: 2; } /** \brief CUDA Provider Options * * \see OrtApi::SessionOptionsAppendExecutionProvider_CUDA */ OrtCUDAProviderOptions :: struct { /** \brief CUDA device Id * Defaults to 0. */ device_id: s32; /** \brief CUDA Convolution algorithm search configuration. * See enum OrtCudnnConvAlgoSearch for more details. * Defaults to OrtCudnnConvAlgoSearchExhaustive. */ cudnn_conv_algo_search: OrtCudnnConvAlgoSearch; /** \brief CUDA memory limit (To use all possible memory pass in maximum size_t) * Defaults to SIZE_MAX. * \note If a ::OrtArenaCfg has been applied, it will override this field */ gpu_mem_limit: u64; /** \brief Strategy used to grow the memory arena * 0 = kNextPowerOfTwo
* 1 = kSameAsRequested
* Defaults to 0. * \note If a ::OrtArenaCfg has been applied, it will override this field */ arena_extend_strategy: s32; /** \brief Flag indicating if copying needs to take place on the same stream as the compute stream in the CUDA EP * 0 = Use separate streams for copying and compute. * 1 = Use the same stream for copying and compute. * Defaults to 1. * WARNING: Setting this to 0 may result in data races for some models. * Please see issue #4829 for more details. */ do_copy_in_default_stream: s32; /** \brief Flag indicating if there is a user provided compute stream * Defaults to 0. */ has_user_compute_stream: s32; /** \brief User provided compute stream. * If provided, please set `has_user_compute_stream` to 1. */ user_compute_stream: *void; /** \brief CUDA memory arena configuration parameters */ default_memory_arena_cfg: *OrtArenaCfg; /** \brief Enable TunableOp for using. * Set it to 1/0 to enable/disable TunableOp. Otherwise, it is disabled by default. * This option can be overridden by environment variable ORT_CUDA_TUNABLE_OP_ENABLE. */ tunable_op_enable: s32; /** \brief Enable TunableOp for tuning. * Set it to 1/0 to enable/disable TunableOp tuning. Otherwise, it is disabled by default. * This option can be overridden by environment variable ORT_CUDA_TUNABLE_OP_TUNING_ENABLE. */ tunable_op_tuning_enable: s32; /** \brief Max tuning duration time limit for each instance of TunableOp. * Defaults to 0 to disable the limit. */ tunable_op_max_tuning_duration_ms: s32; } /** \brief ROCM Provider Options * * \see OrtApi::SessionOptionsAppendExecutionProvider_ROCM */ OrtROCMProviderOptions :: struct { /** \brief ROCM device Id * Defaults to 0. */ device_id: s32; /** \brief ROCM MIOpen Convolution algorithm exhaustive search option. * Defaults to 0 (false). */ miopen_conv_exhaustive_search: s32; /** \brief ROCM memory limit (To use all possible memory pass in maximum size_t) * Defaults to SIZE_MAX. * \note If a ::OrtArenaCfg has been applied, it will override this field */ gpu_mem_limit: u64; /** \brief Strategy used to grow the memory arena * 0 = kNextPowerOfTwo
* 1 = kSameAsRequested
* Defaults to 0. * \note If a ::OrtArenaCfg has been applied, it will override this field */ arena_extend_strategy: s32; /** \brief Flag indicating if copying needs to take place on the same stream as the compute stream in the ROCM EP * 0 = Use separate streams for copying and compute. * 1 = Use the same stream for copying and compute. * Defaults to 1. * WARNING: Setting this to 0 may result in data races for some models. * Please see issue #4829 for more details. */ do_copy_in_default_stream: s32; /** \brief Flag indicating if there is a user provided compute stream * Defaults to 0. */ has_user_compute_stream: s32; /** \brief User provided compute stream. * If provided, please set `has_user_compute_stream` to 1. */ user_compute_stream: *void; /** \brief ROCM memory arena configuration parameters */ default_memory_arena_cfg: *OrtArenaCfg; enable_hip_graph: s32; /** \brief Enable TunableOp for using. * Set it to 1/0 to enable/disable TunableOp. Otherwise, it is disabled by default. * This option can be overridden by environment variable ORT_ROCM_TUNABLE_OP_ENABLE. */ tunable_op_enable: s32; /** \brief Enable TunableOp for tuning. * Set it to 1/0 to enable/disable TunableOp tuning. Otherwise, it is disabled by default. * This option can be overridden by environment variable ORT_ROCM_TUNABLE_OP_TUNING_ENABLE. */ tunable_op_tuning_enable: s32; /** \brief Max tuning duration time limit for each instance of TunableOp. * Defaults to 0 to disable the limit. */ tunable_op_max_tuning_duration_ms: s32; } /** \brief TensorRT Provider Options * * \see OrtApi::SessionOptionsAppendExecutionProvider_TensorRT */ OrtTensorRTProviderOptions :: struct { device_id: s32; ///< CUDA device id (0 = default device) has_user_compute_stream: s32; // indicator of user specified CUDA compute stream. user_compute_stream: *void; // user specified CUDA compute stream. trt_max_partition_iterations: s32; // maximum iterations for TensorRT parser to get capability trt_min_subgraph_size: s32; // minimum size of TensorRT subgraphs trt_max_workspace_size: u64; // maximum workspace size for TensorRT. trt_fp16_enable: s32; // enable TensorRT FP16 precision. Default 0 = false, nonzero = true trt_int8_enable: s32; // enable TensorRT INT8 precision. Default 0 = false, nonzero = true trt_int8_calibration_table_name: *u8; // TensorRT INT8 calibration table name. trt_int8_use_native_calibration_table: s32; // use native TensorRT generated calibration table. Default 0 = false, nonzero = true trt_dla_enable: s32; // enable DLA. Default 0 = false, nonzero = true trt_dla_core: s32; // DLA core number. Default 0 trt_dump_subgraphs: s32; // dump TRT subgraph. Default 0 = false, nonzero = true trt_engine_cache_enable: s32; // enable engine caching. Default 0 = false, nonzero = true trt_engine_cache_path: *u8; // specify engine cache path trt_engine_decryption_enable: s32; // enable engine decryption. Default 0 = false, nonzero = true trt_engine_decryption_lib_path: *u8; // specify engine decryption library path trt_force_sequential_engine_build: s32; // force building TensorRT engine sequentially. Default 0 = false, nonzero = true } /** \brief MIGraphX Provider Options * * \see OrtApi::SessionOptionsAppendExecutionProvider_MIGraphX */ OrtMIGraphXProviderOptions :: struct { device_id: s32; // hip device id. migraphx_fp16_enable: s32; // MIGraphX FP16 precision. Default 0 = false, nonzero = true migraphx_fp8_enable: s32; // MIGraphX FP8 precision. Default 0 = false, nonzero = true migraphx_int8_enable: s32; // MIGraphX INT8 precision. Default 0 = false, nonzero = true migraphx_use_native_calibration_table: s32; // MIGraphx INT8 cal table. Default 0 = false, nonzero = true migraphx_int8_calibration_table_name: *u8; // MIGraphx INT8 calibration table name migraphx_save_compiled_model: s32; // migraphx save compiled model. Default 0 = false, nonzero = true migraphx_save_model_path: *u8; // migraphx model path name migraphx_load_compiled_model: s32; // migraphx int8 cal table. Default 0 = false, nonzero = true migraphx_load_model_path: *u8; // migraphx model path name migraphx_exhaustive_tune: bool; // MIGraphX tuned compile. Default = false, nonzero = true /** \brief MIGraphX memory limit (To use all possible memory pass in maximum size_t) * Defaults to SIZE_MAX. * \note If a ::OrtArenaCfg has been applied, it will override this field */ migraphx_mem_limit: u64; /** \brief Strategy used to grow the memory arena * 0 = kNextPowerOfTwo
* 1 = kSameAsRequested
* Defaults to 0. * \note If a ::OrtArenaCfg has been applied, it will override this field */ migraphx_arena_extend_strategy: s32; } /** \brief OpenVINO Provider Options * \brief This Struct is frozen since ORT 1.13.0. Its maintained part of Legacy API for compatibility. * \brief For latest OpenVINO Provider Options update to the ProviderOptions map. * \brief Latest OpenVINO Provider Options are listed in the * \htmlonly * onnxruntime document. * \endhtmlonly * \see OrtApi::SessionOptionsAppendExecutionProvider() */ OrtOpenVINOProviderOptions :: struct { /** \brief Device type string * * Valid settings are one of: "CPU_FP32", "CPU_FP16", "GPU_FP32", "GPU_FP16" */ device_type: *u8; enable_npu_fast_compile: u8; ///< 0 = disabled, nonzero = enabled device_id: *u8; num_of_threads: u64; ///< 0 = Use default number of threads cache_dir: *u8; // path is set to empty by default _context: *void; enable_opencl_throttling: u8; ///< 0 = disabled, nonzero = enabled enable_dynamic_shapes: u8; ///< 0 = disabled, nonzero = enabled } OrtTrainingApi :: struct {} /** \brief The helper interface to get the right version of OrtApi * * Get a pointer to this structure through ::OrtGetApiBase */ OrtApiBase :: struct { /** \brief Get a pointer to the requested version of the ::OrtApi * * \param[in] version Must be ::ORT_API_VERSION * \return The ::OrtApi for the version requested, nullptr will be returned if this version is unsupported, for example when using a runtime * older than the version created with this header file. * * One can call GetVersionString() to get the version of the Onnxruntime library for logging * and error reporting purposes. */ GetApi: #type (version: u32) -> *OrtApi #c_call; /** \brief Returns a null terminated string of the version of the Onnxruntime library (eg: "1.8.1") * * \return UTF-8 encoded version string. Do not deallocate the returned buffer. */ GetVersionString: #type () -> *u8 #c_call; } /** \brief Thread work loop function * * Onnxruntime will provide the working loop on custom thread creation * Argument is an onnxruntime built-in type which will be provided when thread pool calls OrtCustomCreateThreadFn */ OrtThreadWorkerFn :: #type (ort_worker_fn_param: *void) -> void #c_call; OrtCustomHandleType :: struct { __place_holder: u8; } OrtCustomThreadHandle :: *OrtCustomHandleType; /** \brief Ort custom thread creation function * * The function should return a thread handle to be used in onnxruntime thread pools * Onnxruntime will throw exception on return value of nullptr or 0, indicating that the function failed to create a thread */ OrtCustomCreateThreadFn :: #type (ort_custom_thread_creation_options: *void, ort_thread_worker_fn: OrtThreadWorkerFn, ort_worker_fn_param: *void) -> OrtCustomThreadHandle #c_call; /** \brief Custom thread join function * * Onnxruntime thread pool destructor will call the function to join a custom thread. * Argument ort_custom_thread_handle is the value returned by OrtCustomCreateThreadFn */ OrtCustomJoinThreadFn :: #type (ort_custom_thread_handle: OrtCustomThreadHandle) -> void #c_call; /** \brief Thread pool work enqueue callback * * Called when work is about to be enqueued to a thread pool worker thread. * This runs on the thread that is submitting the work. * \param[in] user_context The user-provided context passed when configuring callbacks * \return Callback-specific data that will be passed to the configured * OrtThreadPoolCallbacksConfig::on_start_work and OrtThreadPoolCallbacksConfig::on_stop_work. * May return NULL. */ OrtThreadPoolWorkEnqueueFn :: #type (user_context: *void) -> *void #c_call; /** \brief Thread pool work start callback * * Called when a thread is about to start executing work. * This typically runs on a worker thread, but may also run on the submitting thread * when the work queue is full and work is executed synchronously. * \param[in] user_context The user-provided context passed when configuring callbacks * \param[in] enqueue_data Data returned by the corresponding OrtThreadPoolCallbacksConfig::on_enqueue call */ OrtThreadPoolWorkStartFn :: #type (user_context: *void, enqueue_data: *void) -> void #c_call; /** \brief Thread pool work stop callback * * Called when a thread has finished executing work. * This typically runs on a worker thread, but may also run on the submitting thread * when the work queue is full and work is executed synchronously. * Guaranteed to be called regardless of whether the work finishes successfully or not. * \param[in] user_context The user-provided context passed when configuring callbacks * \param[in] enqueue_data Data returned by the corresponding OrtThreadPoolCallbacksConfig::on_enqueue call */ OrtThreadPoolWorkStopFn :: #type (user_context: *void, enqueue_data: *void) -> void #c_call; /** \brief Thread pool work abandon callback * * Called when enqueued work is abandoned (revoked or rejected) without execution. * This allows the caller to free any resources associated with enqueue_data. * \param[in] user_context The user-provided context passed when configuring callbacks * \param[in] enqueue_data Data returned by the corresponding OrtThreadPoolCallbacksConfig::on_enqueue call */ OrtThreadPoolWorkAbandonFn :: #type (user_context: *void, enqueue_data: *void) -> void #c_call; /** \brief Configuration for thread pool work callbacks. * * A versioned struct that bundles all thread pool callback function pointers and a user context. * Pass to OrtApi::SetPerSessionThreadPoolCallbacks. * * \note The version field must be set to ORT_API_VERSION. * \note New fields MUST only be appended at the end of this struct. * * \since Version 1.25. */ OrtThreadPoolCallbacksConfig :: struct { version: u32; /**< Must be ORT_API_VERSION */ on_enqueue: OrtThreadPoolWorkEnqueueFn; /**< Called when work is enqueued. May be NULL. */ on_start_work: OrtThreadPoolWorkStartFn; /**< Called when work starts. May be NULL. */ on_stop_work: OrtThreadPoolWorkStopFn; /**< Called when work completes. May be NULL. */ on_abandon: OrtThreadPoolWorkAbandonFn; /**< Called when work is abandoned. May be NULL. */ /**< User-provided context passed to all callbacks. May be NULL. Must remain valid for the lifetime of the session. Subject to concurrent invocations from multiple threads and must be thread-safe. May affect inference performance. */ user_context: *void; } RegisterCustomOpsFn :: #type (options: *OrtSessionOptions, api: *OrtApiBase) -> *OrtStatus #c_call; /** \brief Callback function for RunAsync * * \param[in] user_data User specific data that passed back to the callback * \param[out] outputs On succeed, outputs host inference results, on error, the value will be nullptr * \param[out] num_outputs Number of outputs, on error, the value will be zero * \param[out] status On error, status will provide details */ RunAsyncCallbackFn :: #type (user_data: *void, outputs: **OrtValue, num_outputs: u64, status: OrtStatusPtr) -> void #c_call; /** \brief External memory handle type for importing GPU/NPU resources. * * \todo Add Linux DMA-BUF file descriptor for embedded GPU memory sharing * * \since Version 1.24. */ OrtExternalMemoryHandleType :: enum s32 { ORT_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE :: 0; ORT_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP :: 1; ORT_EXTERNAL_MEMORY_HANDLE_TYPE_MEMORY_WIN32 :: 2; ORT_EXTERNAL_MEMORY_HANDLE_TYPE_MEMORY_OPAQUE_FD :: 3; ORT_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION :: 4; } /** \brief Descriptor for importing external memory. * * \note The version field must be set to ORT_API_VERSION. * This ensures forward compatibility as fields may be added in future versions. * * \since Version 1.24. */ OrtExternalMemoryDescriptor :: struct { version: u32; /**< Must be ORT_API_VERSION */ handle_type: OrtExternalMemoryHandleType; /**< Type of the external memory handle */ native_handle: *void; /**< Platform-specific handle (e.g., Windows HANDLE) */ size_bytes: u64; /**< Total size in bytes of the external allocation */ /**< Offset in bytes into the allocation (default 0). Base offset for the imported memory region. */ offset_bytes: u64; } /** \brief External semaphore type for GPU synchronization. * * \since Version 1.24. */ OrtExternalSemaphoreType :: enum s32 { ORT_EXTERNAL_SEMAPHORE_D3D12_FENCE :: 0; ORT_EXTERNAL_SEMAPHORE_VK_TIMELINE_SEMAPHORE_WIN32 :: 1; ORT_EXTERNAL_SEMAPHORE_VK_TIMELINE_SEMAPHORE_OPAQUE_FD :: 2; } /** \brief Descriptor for importing external semaphores. * * \note The version field must be set to ORT_API_VERSION. * This ensures forward compatibility as fields may be added in future versions. * * \since Version 1.24. */ OrtExternalSemaphoreDescriptor :: struct { version: u32; /**< Must be ORT_API_VERSION */ type: OrtExternalSemaphoreType; /**< Type of the external semaphore */ native_handle: *void; /**< Platform-specific handle (e.g., Windows HANDLE) */ } /** \brief Graphics API type for interop configuration. * * Specifies the graphics API used for GPU interop with the execution provider. * This enables synchronization between graphics workloads (e.g., rendering, compute shaders) * and ONNX Runtime inference. * * \since Version 1.25. */ OrtGraphicsApi :: enum s32 { ORT_GRAPHICS_API_NONE :: 0; ORT_GRAPHICS_API_D3D12 :: 1; ORT_GRAPHICS_API_VULKAN :: 2; } /** \brief Configuration for initializing graphics interop on an EP factory. * * This structure contains all parameters needed to set up graphics interop between * ONNX Runtime and an external graphics API (D3D12, Vulkan). The factory stores this * configuration and uses it when creating synchronization streams. * * Design rationale: * - Single init function with all required params to avoid multiple init signatures * - Factory stores the context and uses it in stream creation * - Supports extensibility via additional_options for future requirements * * Example usage for D3D12: * \code * const OrtInteropApi* interop_api = ort_api->GetInteropApi(); * OrtGraphicsInteropConfig config = {0}; * config.version = ORT_API_VERSION; * config.graphics_api = ORT_GRAPHICS_API_D3D12; * config.command_queue = my_d3d12_command_queue; // ID3D12CommandQueue* * status = interop_api->InitGraphicsInteropForEpDevice(ep_device, &config); * \endcode * * \note The version field must be set to ORT_API_VERSION. * This ensures forward compatibility as fields may be added in future versions. * * \since Version 1.25. */ OrtGraphicsInteropConfig :: struct { version: u32; /**< Must be ORT_API_VERSION */ graphics_api: OrtGraphicsApi; /**< The graphics API to use for interop */ /** \brief Command queue/submission queue for graphics workloads (optional). * * Optional. When provided, the factory may use it for efficient GPU-side synchronization * with inference streams (performance optimization). When null, the Interop API still * works; streams use the default context. * * For D3D12: ID3D12CommandQueue* * For Vulkan: pass NULL */ command_queue: *void; /** \brief Additional API-specific options (optional). * * Can be used for future extensibility without changing the struct layout. * For example, D3D12 fence sharing flags or provider-specific options like * onnxruntime::nv::provider_option_names::kExternalComputeQueueDataParamNV_data * for Vulkan interop for the NvTensorRTRTX provider. */ additional_options: *OrtKeyValuePairs; } /** \brief Descriptor for creating a tensor from imported external memory. * * \note The version field must be set to ORT_API_VERSION. * This ensures forward compatibility as fields may be added in future versions. * * \since Version 1.24. */ OrtExternalTensorDescriptor :: struct { version: u32; /**< Must be ORT_API_VERSION */ element_type: ONNXTensorElementDataType; /**< Data type of tensor elements */ shape: *s64; /**< Array of dimension sizes */ rank: u64; /**< Number of dimensions */ /**< Additional offset within imported memory (default 0). Applied relative to OrtExternalMemoryDescriptor::offset_bytes. Enables multiple tensors from the same imported memory handle. */ offset_bytes: u64; } /* * Public enum for compiled model compatibility across EPs. */ OrtCompiledModelCompatibility :: enum s32 { OrtCompiledModelCompatibility_EP_NOT_APPLICABLE :: 0; OrtCompiledModelCompatibility_EP_SUPPORTED_OPTIMAL :: 1; OrtCompiledModelCompatibility_EP_SUPPORTED_PREFER_RECOMPILATION :: 2; OrtCompiledModelCompatibility_EP_UNSUPPORTED :: 3; } /** \brief Configuration options for creating an OrtEnv. * * \note The version field must be set to ORT_API_VERSION. * This ensures forward compatibility as fields may be added in future versions. * * \since Version 1.24. */ OrtEnvCreationOptions :: struct { version: u32; ///< Must be set to ORT_API_VERSION /** \brief The logging severity level for the environment. Must be set to a value from OrtLoggingLevel. * * \note Logging messages which are less severe than the `logging_severity_level` are not emitted. * * \note Serves as the default logging severity level for session creation and runs. * Use OrtApi::SetSessionLogSeverityLevel to set a logging severity level for the creation of specific session. * Use OrtApi::RunOptionsSetRunLogSeverityLevel to set a logging severity level for a specific session run. * * \since Version 1.24. */ logging_severity_level: s32; /** \brief The log identifier. Must be set to a valid UTF-8 null-terminated string. * * \note This string identifier is copied by ORT. * * \since Version 1.24. */ log_id: *u8; /** \brief Optional custom logging function. May be set to NULL. * * \note The OrtEnvCreationOptions::custom_logging_param is provided as the first argument to this logging function. * This allows passing custom state into the logging function. * * \note This function is only called when a message's severity meets or exceeds the set logging severity level. * * \since Version 1.24. */ custom_logging_function: OrtLoggingFunction; /** \brief Optional state to pass as the first argument to OrtEnvCreationOptions::custom_logger_function. * May be set to NULL. * * \since Version 1.24. */ custom_logging_param: *void; /** \brief Optional threading options for creating an environment with global thread pools shared across sessions. * May be set to NULL. * * \note The OrtThreadingOptions instance is copied by ORT. * * \note Use OrtApi::CreateThreadingOptions() to create an instance of OrtThreadingOptions. * * \note Use this in conjunction with OrtApi::DisablePerSessionThreads or else the session will use its own * thread pools. * * \since Version 1.24. */ threading_options: *OrtThreadingOptions; /** \brief Optional environment configuration entries represented as string key-value pairs. May be set to NULL. * * \note The OrtKeyValuePairs instance is copied by ORT. * * \note Refer to onnxruntime_env_config_keys.h for common config entry keys and their supported values. * * \note An application provides environment-level configuration options for execution provider libraries by * using keys with the prefix 'ep_factory.\\.'. Ex: the key 'ep_factory.my_ep.some_ep_key' represents * a key named 'some_ep_key' that is meant to be consumed by an execution provider named 'my_ep'. Refer to * the specific execution provider's documentation for valid keys and values. * * \note An application may separately set session-level configuration options for execution providers via other APIs * such as SessionOptionsAppendExecutionProvider_V2, which store configuration entries within OrtSessionOptions. * If an environment-level configuration conflicts with a session-level configuration, then * precedence is determined by the execution provider library itself. * * \since Version 1.24. */ config_entries: *OrtKeyValuePairs; } /** \brief The C API * * All C API functions are defined inside this structure as pointers to functions. * Call OrtApiBase::GetApi to get a pointer to it * * \nosubgrouping */ OrtApi :: struct { /** * \brief Create an OrtStatus from a null terminated string * * \param[in] code * \param[in] msg A null-terminated string. Its contents will be copied. * \return A new OrtStatus object, must be destroyed with OrtApi::ReleaseStatus */ CreateStatus: #type (code: OrtErrorCode, msg: *u8) -> *OrtStatus #c_call; /** \brief Get OrtErrorCode from OrtStatus * * \param[in] status * \return OrtErrorCode that \p status was created with */ GetErrorCode: #type (status: *OrtStatus) -> OrtErrorCode #c_call; /** \brief Get error string from OrtStatus * * \param[in] status * \return The error message inside the `status`. Do not free the returned value. */ GetErrorMessage: #type (status: *OrtStatus) -> *u8 #c_call; /** \brief Create an OrtEnv * * \note Invoking this function will return the same instance of the environment as that returned by a previous call * to another env creation function; all arguments to this function will be ignored. * \param[in] log_severity_level The log severity level. * \param[in] logid The log identifier. * \param[out] out Returned newly created OrtEnv. Must be freed with OrtApi::ReleaseEnv * * \snippet{doc} snippets.dox OrtStatus Return Value */ CreateEnv: #type (log_severity_level: OrtLoggingLevel, logid: *u8, out: **OrtEnv) -> OrtStatusPtr #c_call; /** \brief Create an OrtEnv * * \note Invoking this function will return the same instance of the environment as that returned by a previous call * to another env creation function; all arguments to this function will be ignored. If you want to provide your * own logging function, consider setting it using the SetUserLoggingFunction API instead. * \param[in] logging_function A pointer to a logging function. * \param[in] logger_param A pointer to arbitrary data passed as the ::OrtLoggingFunction `param` parameter to * `logging_function`. This parameter is optional. * \param[in] log_severity_level The log severity level. * \param[in] logid The log identifier. * \param[out] out Returned newly created OrtEnv. Must be freed with OrtApi::ReleaseEnv * * \snippet{doc} snippets.dox OrtStatus Return Value */ CreateEnvWithCustomLogger: #type (logging_function: OrtLoggingFunction, logger_param: *void, log_severity_level: OrtLoggingLevel, logid: *u8, out: **OrtEnv) -> OrtStatusPtr #c_call; /** \brief Enable Telemetry * * \note Telemetry events are on by default since they are lightweight * \param[in] env * * \snippet{doc} snippets.dox OrtStatus Return Value */ EnableTelemetryEvents: #type (env: *OrtEnv) -> OrtStatusPtr #c_call; /** \brief Disable Telemetry * * \see OrtApi::EnableTelemetryEvents * \param[in] env * * \snippet{doc} snippets.dox OrtStatus Return Value */ DisableTelemetryEvents: #type (env: *OrtEnv) -> OrtStatusPtr #c_call; /** \brief Create an OrtSession from a model file * * \param[in] env * \param[in] model_path * \param[in] options * \param[out] out Returned newly created OrtSession. Must be freed with OrtApi::ReleaseSession * * \snippet{doc} snippets.dox OrtStatus Return Value */ // TODO: document the path separator convention? '/' vs '\' // TODO: should specify the access characteristics of model_path. Is this read only during the // execution of CreateSession, or does the OrtSession retain a handle to the file/directory // and continue to access throughout the OrtSession lifetime? // What sort of access is needed to model_path : read or read/write? CreateSession: #type (env: *OrtEnv, model_path: *u16, options: *OrtSessionOptions, out: **OrtSession) -> OrtStatusPtr #c_call; /** \brief Create an OrtSession from memory * * \param[in] env * \param[in] model_data * \param[in] model_data_length * \param[in] options * \param[out] out Returned newly created OrtSession. Must be freed with OrtApi::ReleaseSession * * \snippet{doc} snippets.dox OrtStatus Return Value */ CreateSessionFromArray: #type (env: *OrtEnv, model_data: *void, model_data_length: u64, options: *OrtSessionOptions, out: **OrtSession) -> OrtStatusPtr #c_call; /** \brief Run the model in an ::OrtSession * * Will not return until the model run has completed. Multiple threads might be used to run the model based on * the options in the ::OrtSession and settings used when creating the ::OrtEnv * * \param[in] session * \param[in] run_options If nullptr, will use a default ::OrtRunOptions * \param[in] input_names Array of null terminated UTF8 encoded strings of the input names * \param[in] inputs Array of ::OrtValue%s of the input values * \param[in] input_len Number of elements in the input_names and inputs arrays * \param[in] output_names Array of null terminated UTF8 encoded strings of the output names * \param[in] output_names_len Number of elements in the output_names and outputs array * \param[out] outputs Array of ::OrtValue%s that the outputs are stored in. This can also be * an array of nullptr values, in this case ::OrtValue objects will be allocated and pointers * to them will be set into the `outputs` array. * * \snippet{doc} snippets.dox OrtStatus Return Value */ Run: #type (session: *OrtSession, run_options: *OrtRunOptions, input_names: **u8, inputs: **OrtValue, input_len: u64, output_names: **u8, output_names_len: u64, outputs: **OrtValue) -> OrtStatusPtr #c_call; /** \brief Create an ::OrtSessionOptions object * * To use additional providers, you must build ORT with the extra providers enabled. Then call one of these * functions to enable them in the session:
* OrtSessionOptionsAppendExecutionProvider_CPU
* OrtSessionOptionsAppendExecutionProvider_CUDA
* OrtSessionOptionsAppendExecutionProvider_(remaining providers...)
* The order they are called indicates the preference order as well. In other words call this method * on your most preferred execution provider first followed by the less preferred ones. * If none are called Ort will use its internal CPU execution provider. * * \param[out] options The newly created OrtSessionOptions. Must be freed with OrtApi::ReleaseSessionOptions * * \snippet{doc} snippets.dox OrtStatus Return Value */ CreateSessionOptions: #type (options: **OrtSessionOptions) -> OrtStatusPtr #c_call; /** \brief Set filepath to save optimized model after graph level transformations * * \param[in] options * \param[in] optimized_model_filepath * * \snippet{doc} snippets.dox OrtStatus Return Value */ SetOptimizedModelFilePath: #type (options: *OrtSessionOptions, optimized_model_filepath: *u16) -> OrtStatusPtr #c_call; /** \brief Create a copy of an existing ::OrtSessionOptions * * \param[in] in_options OrtSessionOptions to copy * \param[out] out_options Returned newly created ::OrtSessionOptions. Must be freed with OrtApi::ReleaseSessionOptions * * \snippet{doc} snippets.dox OrtStatus Return Value */ CloneSessionOptions: #type (in_options: *OrtSessionOptions, out_options: **OrtSessionOptions) -> OrtStatusPtr #c_call; /** \brief Set execution mode * * Controls whether you want to execute operators in your graph sequentially or in parallel. Usually when the model * has many branches, setting this option to ExecutionMode.ORT_PARALLEL will give you better performance. * See [docs/ONNX_Runtime_Perf_Tuning.md] for more details. * * \param[in] options * \param[in] execution_mode * * \snippet{doc} snippets.dox OrtStatus Return Value */ SetSessionExecutionMode: #type (options: *OrtSessionOptions, execution_mode: ExecutionMode) -> OrtStatusPtr #c_call; /** \brief Enable profiling for a session * * \param[in] options * \param[in] profile_file_prefix * * \snippet{doc} snippets.dox OrtStatus Return Value */ EnableProfiling: #type (options: *OrtSessionOptions, profile_file_prefix: *u16) -> OrtStatusPtr #c_call; /** \brief Disable profiling for a session * * \param[in] options * * \snippet{doc} snippets.dox OrtStatus Return Value */ DisableProfiling: #type (options: *OrtSessionOptions) -> OrtStatusPtr #c_call; /** \brief Enable the memory pattern optimization * * The idea is if the input shapes are the same, we could trace the internal memory allocation * and generate a memory pattern for future request. So next time we could just do one allocation * with a big chunk for all the internal memory allocation. * \note Memory pattern optimization is only available when Sequential Execution mode is enabled (see OrtApi::SetSessionExecutionMode) * * \see OrtApi::DisableMemPattern * * \param[in] options * * \snippet{doc} snippets.dox OrtStatus Return Value */ EnableMemPattern: #type (options: *OrtSessionOptions) -> OrtStatusPtr #c_call; /** \brief Disable the memory pattern optimization * * \see OrtApi::EnableMemPattern * * \param[in] options * * \snippet{doc} snippets.dox OrtStatus Return Value */ DisableMemPattern: #type (options: *OrtSessionOptions) -> OrtStatusPtr #c_call; /** \brief Enable the memory arena on CPU * * Arena may pre-allocate memory for future usage. * * \param[in] options * * \snippet{doc} snippets.dox OrtStatus Return Value */ EnableCpuMemArena: #type (options: *OrtSessionOptions) -> OrtStatusPtr #c_call; /** \brief Disable the memory arena on CPU * * \param[in] options * * \snippet{doc} snippets.dox OrtStatus Return Value */ DisableCpuMemArena: #type (options: *OrtSessionOptions) -> OrtStatusPtr #c_call; /** \brief Set session log id * * \param[in] options * \param[in] logid The log identifier. * * \snippet{doc} snippets.dox OrtStatus Return Value */ SetSessionLogId: #type (options: *OrtSessionOptions, logid: *u8) -> OrtStatusPtr #c_call; /** \brief Set session log verbosity level * * Applies to session load, initialization, etc * * \param[in] options * \param[in] session_log_verbosity_level \snippet{doc} snippets.dox Log Verbosity Level * * \snippet{doc} snippets.dox OrtStatus Return Value */ SetSessionLogVerbosityLevel: #type (options: *OrtSessionOptions, session_log_verbosity_level: s32) -> OrtStatusPtr #c_call; /** \brief Set session log severity level * * \param[in] options * \param[in] session_log_severity_level The log severity level (refer to ::OrtLoggingLevel for possible values). * * \snippet{doc} snippets.dox OrtStatus Return Value */ SetSessionLogSeverityLevel: #type (options: *OrtSessionOptions, session_log_severity_level: s32) -> OrtStatusPtr #c_call; /** \brief Set the optimization level to apply when loading a graph * * Please see https://onnxruntime.ai/docs/performance/model-optimizations/graph-optimizations.html for an in-depth explanation * \param[in,out] options The session options object * \param[in] graph_optimization_level The optimization level * * \snippet{doc} snippets.dox OrtStatus Return Value */ SetSessionGraphOptimizationLevel: #type (options: *OrtSessionOptions, graph_optimization_level: GraphOptimizationLevel) -> OrtStatusPtr #c_call; /** \brief Sets the number of threads used to parallelize the execution within nodes * * When running a single node operation, ex. add, this sets the maximum number of threads to use. * * \note If built with OpenMP, this has no effect on the number of threads used. In this case * use the OpenMP env variables to configure the number of intra op num threads. * * \param[in] options * \param[in] intra_op_num_threads Number of threads to use
* A value of 0 will use the default number of threads
* * \snippet{doc} snippets.dox OrtStatus Return Value */ SetIntraOpNumThreads: #type (options: *OrtSessionOptions, intra_op_num_threads: s32) -> OrtStatusPtr #c_call; /** \brief Sets the number of threads used to parallelize the execution of the graph * * If nodes can be run in parallel, this sets the maximum number of threads to use to run them in parallel. * * \note If sequential execution is enabled this value is ignored, it acts as if it was set to 1. * * \param[in] options * \param[in] inter_op_num_threads Number of threads to use
* A value of 0 will use the default number of threads
* * \snippet{doc} snippets.dox OrtStatus Return Value */ SetInterOpNumThreads: #type (options: *OrtSessionOptions, inter_op_num_threads: s32) -> OrtStatusPtr #c_call; /** \brief Create a custom op domain * * \param[in] domain * \param[out] out Newly created domain. Must be freed with OrtApi::ReleaseCustomOpDomain * * \snippet{doc} snippets.dox OrtStatus Return Value */ CreateCustomOpDomain: #type (domain: *u8, out: **OrtCustomOpDomain) -> OrtStatusPtr #c_call; /** \brief Add a custom op to a custom op domain * * \note The OrtCustomOp* pointer must remain valid until the ::OrtCustomOpDomain using it is released * * \param[in] custom_op_domain * \param[in] op * * \snippet{doc} snippets.dox OrtStatus Return Value */ CustomOpDomain_Add: #type (custom_op_domain: *OrtCustomOpDomain, op: *OrtCustomOp) -> OrtStatusPtr #c_call; /** \brief Add custom op domain to a session options * * \note The OrtCustomOpDomain* must not be deleted until all sessions using it are released * * \param[in] options * \param[in] custom_op_domain * * \snippet{doc} snippets.dox OrtStatus Return Value */ AddCustomOpDomain: #type (options: *OrtSessionOptions, custom_op_domain: *OrtCustomOpDomain) -> OrtStatusPtr #c_call; /** \deprecated Use OrtApi::RegisterCustomOpsLibrary_V2. * * Registers custom ops from a shared library. * * Loads a shared library (dll on windows, so on linux, etc) named 'library_path' and looks for this entry point: * OrtStatus* RegisterCustomOps(OrtSessionOptions * options, const OrtApiBase* api); * It then passes in the provided session options to this function along with the api base. * The handle to the loaded library is returned in library_handle. It can be freed by the caller after all sessions using the passed in * session options are destroyed, or if an error occurs and it is non null. * * \param[in] options * \param[in] library_path * \param[out] library_handle OS specific handle to the loaded library (Use FreeLibrary on Windows, dlclose on Linux, etc.. to unload) * * \snippet{doc} snippets.dox OrtStatus Return Value */ RegisterCustomOpsLibrary: #type (options: *OrtSessionOptions, library_path: *u8, library_handle: **void) -> OrtStatusPtr #c_call; /** \brief Get input count for a session * * This number must also match the number of inputs passed to OrtApi::Run * * \see OrtApi::SessionGetInputTypeInfo, OrtApi::SessionGetInputName, OrtApi::Session * * \param[in] session * \param[out] out Number of inputs * * \snippet{doc} snippets.dox OrtStatus Return Value */ SessionGetInputCount: #type (session: *OrtSession, out: *u64) -> OrtStatusPtr #c_call; /** \brief Get output count for a session * * This number must also match the number of outputs returned by OrtApi::Run * * \see OrtApi::SessionGetOutputTypeInfo, OrtApi::SessionGetOutputName, OrtApi::Session * * \param[in] session * \param[out] out Number of outputs * * \snippet{doc} snippets.dox OrtStatus Return Value */ SessionGetOutputCount: #type (session: *OrtSession, out: *u64) -> OrtStatusPtr #c_call; /** \brief Get overridable initializer count * * \see OrtApi::SessionGetOverridableInitializerTypeInfo, OrtApi::SessionGetOverridableInitializerName * * \param[in] session * \param[in] out * * \snippet{doc} snippets.dox OrtStatus Return Value */ SessionGetOverridableInitializerCount: #type (session: *OrtSession, out: *u64) -> OrtStatusPtr #c_call; /** \brief Get input type information * * \param[in] session * \param[in] index Must be between 0 (inclusive) and what OrtApi::SessionGetInputCount returns (exclusive) * \param[out] type_info Must be freed with OrtApi::ReleaseTypeInfo * * \snippet{doc} snippets.dox OrtStatus Return Value */ SessionGetInputTypeInfo: #type (session: *OrtSession, index: u64, _type_info: **OrtTypeInfo) -> OrtStatusPtr #c_call; /** \brief Get output type information * * \param[in] session * \param[in] index Must be between 0 (inclusive) and what OrtApi::SessionGetOutputCount returns (exclusive) * \param[out] type_info Must be freed with OrtApi::ReleaseTypeInfo * * \snippet{doc} snippets.dox OrtStatus Return Value */ SessionGetOutputTypeInfo: #type (session: *OrtSession, index: u64, _type_info: **OrtTypeInfo) -> OrtStatusPtr #c_call; /** \brief Get overridable initializer type information * * \param[in] session * \param[in] index Must be between 0 (inclusive) and what OrtApi::SessionGetOverridableInitializerCount returns (exclusive) * \param[out] type_info Must be freed with OrtApi::ReleaseTypeInfo * * \snippet{doc} snippets.dox OrtStatus Return Value */ SessionGetOverridableInitializerTypeInfo: #type (session: *OrtSession, index: u64, _type_info: **OrtTypeInfo) -> OrtStatusPtr #c_call; /** \brief Get input name * * \param[in] session * \param[in] index Must be between 0 (inclusive) and what OrtApi::SessionGetInputCount returns (exclusive) * \param[in] allocator * \param[out] value Set to a null terminated UTF-8 encoded string allocated using `allocator`. Must be freed using `allocator`. * * \snippet{doc} snippets.dox OrtStatus Return Value */ SessionGetInputName: #type (session: *OrtSession, index: u64, allocator: *OrtAllocator, value: **u8) -> OrtStatusPtr #c_call; /** \brief Get output name * * \param[in] session * \param[in] index Must be between 0 (inclusive) and what OrtApi::SessionGetOutputCount returns (exclusive) * \param[in] allocator * \param[out] value Set to a null terminated UTF-8 encoded string allocated using `allocator`. Must be freed using `allocator`. * * \snippet{doc} snippets.dox OrtStatus Return Value */ SessionGetOutputName: #type (session: *OrtSession, index: u64, allocator: *OrtAllocator, value: **u8) -> OrtStatusPtr #c_call; /** \brief Get overridable initializer name * * \param[in] session * \param[in] index Must be between 0 (inclusive) and what OrtApi::SessionGetOverridableInitializerCount returns (exclusive) * \param[in] allocator * \param[out] value Set to a null terminated UTF-8 encoded string allocated using `allocator`. Must be freed using `allocator`. * * \snippet{doc} snippets.dox OrtStatus Return Value */ SessionGetOverridableInitializerName: #type (session: *OrtSession, index: u64, allocator: *OrtAllocator, value: **u8) -> OrtStatusPtr #c_call; /** \brief Create an OrtRunOptions * * \param[out] out Returned newly created ::OrtRunOptions. Must be freed with OrtApi::ReleaseRunOptions * * \snippet{doc} snippets.dox OrtStatus Return Value */ CreateRunOptions: #type (out: **OrtRunOptions) -> OrtStatusPtr #c_call; /** \brief Set per-run log verbosity level * * \see OrtApi::RunOptionsGetRunLogVerbosityLevel * * \param[in] options * \param[in] log_verbosity_level \snippet{doc} snippets.dox Log Verbosity Level * * \snippet{doc} snippets.dox OrtStatus Return Value */ RunOptionsSetRunLogVerbosityLevel: #type (options: *OrtRunOptions, log_verbosity_level: s32) -> OrtStatusPtr #c_call; /** \brief Set per-run log severity level * * \see OrtApi::RunOptionsGetRunLogSeverityLevel * * \param[in] options * \param[in] log_severity_level The log severity level (refer to ::OrtLoggingLevel for possible values). */ RunOptionsSetRunLogSeverityLevel: #type (options: *OrtRunOptions, log_severity_level: s32) -> OrtStatusPtr #c_call; /** \brief Set per-run tag * * This is used in a per-run log identifier. * * \see OrtApi::RunOptionsGetRunTag * * \param[in] options * \param[in] run_tag The run tag. */ RunOptionsSetRunTag: #type (options: *OrtRunOptions, run_tag: *u8) -> OrtStatusPtr #c_call; /** \brief Get per-run log verbosity level * * \see OrtApi::RunOptionsSetRunLogVerbosityLevel * * \param[in] options * \param[out] log_verbosity_level \snippet{doc} snippets.dox Log Verbosity Level * * \snippet{doc} snippets.dox OrtStatus Return Value */ RunOptionsGetRunLogVerbosityLevel: #type (options: *OrtRunOptions, log_verbosity_level: *s32) -> OrtStatusPtr #c_call; /** \brief Get per-run log severity level * * \see OrtApi::RunOptionsSetRunLogSeverityLevel * * \param[in] options * \param[out] log_severity_level The log severity level (refer to ::OrtLoggingLevel for possible values). */ RunOptionsGetRunLogSeverityLevel: #type (options: *OrtRunOptions, log_severity_level: *s32) -> OrtStatusPtr #c_call; /** \brief Get per-run tag * * This is used in a per-run log identifier. * * \see OrtApi::RunOptionsSetRunTag * * \param[in] options * \param[out] run_tag The run tag. * Do not free this value, it is owned by `options`. It will be invalidated if the run tag * changes (i.e., with OrtApi::RunOptionsSetRunTag) or `options` is freed. */ RunOptionsGetRunTag: #type (options: *OrtRunOptions, run_tag: **u8) -> OrtStatusPtr #c_call; /** \brief Set terminate flag * * If a currently executing session needs to be force terminated, this can be called from another thread to force it to fail with an error. * * \param[in] options * * \snippet{doc} snippets.dox OrtStatus Return Value */ RunOptionsSetTerminate: #type (options: *OrtRunOptions) -> OrtStatusPtr #c_call; /** \brief Clears the terminate flag * * Used so the OrtRunOptions instance can be used in a new OrtApi::Run call without it instantly terminating * * \param[in] options * * \snippet{doc} snippets.dox OrtStatus Return Value */ RunOptionsUnsetTerminate: #type (options: *OrtRunOptions) -> OrtStatusPtr #c_call; /** \brief Create a tensor * * Create a tensor using a supplied ::OrtAllocator * * \param[in] allocator * \param[in] shape Pointer to the tensor shape dimensions. * \param[in] shape_len The number of tensor shape dimensions. * \param[in] type * \param[out] out Returns newly created ::OrtValue. Must be freed with OrtApi::ReleaseValue * * \snippet{doc} snippets.dox OrtStatus Return Value */ CreateTensorAsOrtValue: #type (allocator: *OrtAllocator, shape: *s64, shape_len: u64, type: ONNXTensorElementDataType, out: **OrtValue) -> OrtStatusPtr #c_call; /** \brief Create a tensor backed by a user supplied buffer * * Create a tensor with user's buffer. You can fill the buffer either before calling this function or after. * p_data is owned by caller. ReleaseValue won't release p_data. * * If you wish to transfer ownership of p_data to ORT use CreateTensorWithDataAndDeleterAsOrtValue. * * \param[in] info Memory description of where the p_data buffer resides (CPU vs GPU etc). * \param[in] p_data Pointer to the data buffer. * \param[in] p_data_len The number of bytes in the data buffer. * \param[in] shape Pointer to the tensor shape dimensions. * \param[in] shape_len The number of tensor shape dimensions. * \param[in] type The data type. * \param[out] out Returns newly created ::OrtValue. Must be freed with OrtApi::ReleaseValue * * \snippet{doc} snippets.dox OrtStatus Return Value */ CreateTensorWithDataAsOrtValue: #type (info: *OrtMemoryInfo, p_data: *void, p_data_len: u64, shape: *s64, shape_len: u64, type: ONNXTensorElementDataType, out: **OrtValue) -> OrtStatusPtr #c_call; /** \brief Return if an ::OrtValue is a tensor type * * \param[in] value A tensor type (string tensors are not supported) * \param[out] out Set to 1 iff ::OrtValue is a tensor, 0 otherwise * * \snippet{doc} snippets.dox OrtStatus Return Value */ IsTensor: #type (value: *OrtValue, out: *s32) -> OrtStatusPtr #c_call; /** \brief Get a pointer to the raw data inside a tensor * * Used to read/write/modify the internal tensor data directly. * \note The returned pointer is valid until the \p value is destroyed. * * \param[in] value A tensor type (string tensors are not supported) * \param[out] out Filled in with a pointer to the internal storage * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetTensorMutableData: #type (value: *OrtValue, out: **void) -> OrtStatusPtr #c_call; /** \brief Set all strings at once in a string tensor * * \param[in,out] value A tensor of type ONNX_TENSOR_ELEMENT_DATA_TYPE_STRING * \param[in] s An array of strings. Each string in this array must be null terminated. * \param[in] s_len Count of strings in s (Must match the size of \p value's tensor shape) * * \snippet{doc} snippets.dox OrtStatus Return Value */ FillStringTensor: #type (value: *OrtValue, s: **u8, s_len: u64) -> OrtStatusPtr #c_call; /** \brief Get total byte length for all strings in a string tensor * * Typically used with OrtApi::GetStringTensorContent * * \param[in] value A tensor of type ONNX_TENSOR_ELEMENT_DATA_TYPE_STRING * \param[out] len Total byte length of all strings (does not include trailing nulls) * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetStringTensorDataLength: #type (value: *OrtValue, len: *u64) -> OrtStatusPtr #c_call; /** \brief Get all strings from a string tensor * * An example of the results:
* Given \p value is a string tensor with the strings { "This" "is" "a" "test" }
* \p s must have a size of 11 bytes
* \p offsets must have 4 elements
* After the call, these values will be filled in:
* \p s will contain "Thisisatest"
* \p offsets will contain { 0, 4, 6, 7 }
* The length of the last string is just s_len - offsets[last] * * \param[in] value A tensor of type ONNX_TENSOR_ELEMENT_DATA_TYPE_STRING * \param[in] s Buffer to sequentially write all tensor strings to. Each string is NOT null-terminated. * \param[in] s_len Number of bytes of buffer pointed to by \p s (Get it from OrtApi::GetStringTensorDataLength) * \param[out] offsets Array of start offsets into the strings written to \p s * \param[in] offsets_len Number of elements in offsets * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetStringTensorContent: #type (value: *OrtValue, s: *void, s_len: u64, offsets: *u64, offsets_len: u64) -> OrtStatusPtr #c_call; /** \brief Get ::OrtTensorTypeAndShapeInfo from an ::OrtTypeInfo * * \param[in] type_info * \param[out] out Do not free this value, it will be valid until type_info is freed. * If type_info does not represent tensor, this value will be set to nullptr. * * \snippet{doc} snippets.dox OrtStatus Return Value */ CastTypeInfoToTensorInfo: #type (_type_info: *OrtTypeInfo, out: **OrtTensorTypeAndShapeInfo) -> OrtStatusPtr #c_call; /** \brief Get ::ONNXType from ::OrtTypeInfo * * \param[in] type_info * \param[out] out * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetOnnxTypeFromTypeInfo: #type (_type_info: *OrtTypeInfo, out: *ONNXType) -> OrtStatusPtr #c_call; /** \brief Create an ::OrtTensorTypeAndShapeInfo object * * \param[out] out Returns newly created ::OrtTensorTypeAndShapeInfo. Must be freed with OrtApi::ReleaseTensorTypeAndShapeInfo * * \snippet{doc} snippets.dox OrtStatus Return Value */ CreateTensorTypeAndShapeInfo: #type (out: **OrtTensorTypeAndShapeInfo) -> OrtStatusPtr #c_call; /** \brief Set element type in ::OrtTensorTypeAndShapeInfo * * \param[in] info * \param[in] type * * \snippet{doc} snippets.dox OrtStatus Return Value */ SetTensorElementType: #type (info: *OrtTensorTypeAndShapeInfo, type: ONNXTensorElementDataType) -> OrtStatusPtr #c_call; /** \brief Set shape information in ::OrtTensorTypeAndShapeInfo * * \param[in] info * \param[in] dim_values Array with `dim_count` elements. Can contain negative values. * \param[in] dim_count Number of elements in `dim_values` * * \snippet{doc} snippets.dox OrtStatus Return Value */ SetDimensions: #type (info: *OrtTensorTypeAndShapeInfo, dim_values: *s64, dim_count: u64) -> OrtStatusPtr #c_call; /** \brief Get element type in ::OrtTensorTypeAndShapeInfo * * \see OrtApi::SetTensorElementType * * \param[in] info * \param[out] out * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetTensorElementType: #type (info: *OrtTensorTypeAndShapeInfo, out: *ONNXTensorElementDataType) -> OrtStatusPtr #c_call; /** \brief Get dimension count in ::OrtTensorTypeAndShapeInfo * * \see OrtApi::GetDimensions * * \param[in] info * \param[out] out * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetDimensionsCount: #type (info: *OrtTensorTypeAndShapeInfo, out: *u64) -> OrtStatusPtr #c_call; /** \brief Get dimensions in ::OrtTensorTypeAndShapeInfo * * \param[in] info * \param[out] dim_values Array with `dim_values_length` elements. On return, filled with the dimensions stored in the ::OrtTensorTypeAndShapeInfo * \param[in] dim_values_length Number of elements in `dim_values`. Use OrtApi::GetDimensionsCount to get this value * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetDimensions: #type (info: *OrtTensorTypeAndShapeInfo, dim_values: *s64, dim_values_length: u64) -> OrtStatusPtr #c_call; /** \brief Get symbolic dimension names in ::OrtTensorTypeAndShapeInfo * * \param[in] info * \param[in] dim_params Array with `dim_params_length` elements. On return filled with pointers to null terminated strings of the dimension names * \param[in] dim_params_length Number of elements in `dim_params`. Use OrtApi::GetDimensionsCount to get this value * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetSymbolicDimensions: #type (info: *OrtTensorTypeAndShapeInfo, dim_params: **u8, dim_params_length: u64) -> OrtStatusPtr #c_call; /** \brief Get total number of elements in a tensor shape from an ::OrtTensorTypeAndShapeInfo * * Return the number of elements specified by the tensor shape (all dimensions multiplied by each other). * For 0 dimensions, 1 is returned. If any dimension is less than 0, the result is always -1. * * Examples:
* [] = 1
* [1,3,4] = 12
* [2,0,4] = 0
* [-1,3,4] = -1
* * \param[in] info * \param[out] out Number of elements * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetTensorShapeElementCount: #type (info: *OrtTensorTypeAndShapeInfo, out: *u64) -> OrtStatusPtr #c_call; /** \brief Get type and shape information from a tensor ::OrtValue * * \param[in] value Must be a tensor (not a map/sequence/etc) or will return failure * \param[out] out Newly created ::OrtTensorTypeAndShapeInfo. Must be freed with OrtApi::ReleaseTensorTypeAndShapeInfo * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetTensorTypeAndShape: #type (value: *OrtValue, out: **OrtTensorTypeAndShapeInfo) -> OrtStatusPtr #c_call; /** \brief Get type information of an OrtValue * * \param[in] value * \param[out] out Newly created ::OrtTypeInfo. Must be freed with OrtApi::ReleaseTypeInfo * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetTypeInfo: #type (value: *OrtValue, out: **OrtTypeInfo) -> OrtStatusPtr #c_call; /** \brief Get ONNXType of an ::OrtValue * * \param[in] value * \param[out] out * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetValueType: #type (value: *OrtValue, out: *ONNXType) -> OrtStatusPtr #c_call; /** \brief Create an ::OrtMemoryInfo * * \param[in] name * \param[in] type * \param[in] id * \param[in] mem_type * \param[out] out Newly created ::OrtMemoryInfo. Must be freed with OrtAPi::ReleaseMemoryInfo * * \snippet{doc} snippets.dox OrtStatus Return Value */ CreateMemoryInfo: #type (name: *u8, type: OrtAllocatorType, id: s32, mem_type: OrtMemType, out: **OrtMemoryInfo) -> OrtStatusPtr #c_call; /** \brief Create an ::OrtMemoryInfo for CPU memory * * Special case version of OrtApi::CreateMemoryInfo for CPU based memory. Same as using OrtApi::CreateMemoryInfo with name = "Cpu" and id = 0. * * \param[in] type * \param[in] mem_type * \param[out] out * * \snippet{doc} snippets.dox OrtStatus Return Value */ CreateCpuMemoryInfo: #type (type: OrtAllocatorType, mem_type: OrtMemType, out: **OrtMemoryInfo) -> OrtStatusPtr #c_call; /** \brief Compare ::OrtMemoryInfo objects for equality * * Compares all settings of each ::OrtMemoryInfo for equality * * \param[in] info1 * \param[in] info2 * \param[out] out Set to 0 if equal, -1 if not equal * * \snippet{doc} snippets.dox OrtStatus Return Value */ CompareMemoryInfo: #type (info1: *OrtMemoryInfo, info2: *OrtMemoryInfo, out: *s32) -> OrtStatusPtr #c_call; /** \brief Get name from ::OrtMemoryInfo * * \param[in] ptr * \param[out] out Writes null terminated string to this pointer. Do NOT free the returned pointer. It is valid for the lifetime of the ::OrtMemoryInfo * * \snippet{doc} snippets.dox OrtStatus Return Value */ MemoryInfoGetName: #type (ptr: *OrtMemoryInfo, out: **u8) -> OrtStatusPtr #c_call; /** \brief Get the device id from ::OrtMemoryInfo */ MemoryInfoGetId: #type (ptr: *OrtMemoryInfo, out: *s32) -> OrtStatusPtr #c_call; /** \brief Get the ::OrtMemType from ::OrtMemoryInfo */ MemoryInfoGetMemType: #type (ptr: *OrtMemoryInfo, out: *OrtMemType) -> OrtStatusPtr #c_call; /** \brief Get the ::OrtAllocatorType from ::OrtMemoryInfo */ MemoryInfoGetType: #type (ptr: *OrtMemoryInfo, out: *OrtAllocatorType) -> OrtStatusPtr #c_call; /// \brief Calls OrtAllocator::Alloc function AllocatorAlloc: #type (ort_allocator: *OrtAllocator, size: u64, out: **void) -> OrtStatusPtr #c_call; /// \brief Calls OrtAllocator::Free function AllocatorFree: #type (ort_allocator: *OrtAllocator, p: *void) -> OrtStatusPtr #c_call; /// \brief Calls OrtAllocator::Info function AllocatorGetInfo: #type (ort_allocator: *OrtAllocator, out: **OrtMemoryInfo) -> OrtStatusPtr #c_call; /** \brief Get the default allocator * * The default allocator is a CPU based, non-arena. Always returns the same pointer to the same default allocator. * * \param[out] out Returned value should NOT be freed * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetAllocatorWithDefaultOptions: #type (out: **OrtAllocator) -> OrtStatusPtr #c_call; /** \brief Override session symbolic dimensions * * Override symbolic dimensions (by specific denotation strings) with actual values if known at session initialization time to enable * optimizations that can take advantage of fixed values (such as memory planning, etc) * * \param[in] options * \param[in] dim_denotation * \param[in] dim_value * * \snippet{doc} snippets.dox OrtStatus Return Value */ AddFreeDimensionOverride: #type (options: *OrtSessionOptions, dim_denotation: *u8, dim_value: s64) -> OrtStatusPtr #c_call; /** \brief Get non tensor data from an ::OrtValue * * If `value` is of type ONNX_TYPE_MAP, you need to retrieve the keys and values * separately. Use index=0 to retrieve keys and index=1 to retrieve values. * If `value` is of type ONNX_TYPE_SEQUENCE, use index to retrieve the index'th element * of the sequence. * * \param[in] value * \param[in] index See above for usage based on `value` type * \param[in] allocator Allocator used to allocate ::OrtValue * \param[out] out Created ::OrtValue that holds the element requested. Must be freed with OrtApi::ReleaseValue * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetValue: #type (value: *OrtValue, index: s32, allocator: *OrtAllocator, out: **OrtValue) -> OrtStatusPtr #c_call; /** \brief Get non tensor value count from an ::OrtValue * * If `value` is of type ONNX_TYPE_MAP 2 will always be returned. For ONNX_TYPE_SEQUENCE * the number of elements in the sequence will be returned * * \param[in] value * \param[out] out * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetValueCount: #type (value: *OrtValue, out: *u64) -> OrtStatusPtr #c_call; /** \brief Create a map or sequence ::OrtValue * * To construct a map (ONNX_TYPE_MAP), use num_values = 2 and `in` should be an array of 2 ::OrtValue%s * representing keys and values.
* * To construct a sequence (ONNX_TYPE_SEQUENCE), use num_values = N where N is the number of the elements in the * sequence. 'in' should be an array of N ::OrtValue%s. * * \param[in] in See above for details * \param[in] num_values * \param[in] value_type Must be either ONNX_TYPE_MAP or ONNX_TYPE_SEQUENCE * \param[out] out Newly created ::OrtValue. Must be freed with OrtApi::ReleaseValue * * \snippet{doc} snippets.dox OrtStatus Return Value */ CreateValue: #type (in: **OrtValue, num_values: u64, value_type: ONNXType, out: **OrtValue) -> OrtStatusPtr #c_call; /** \brief Create an opaque (custom user defined type) ::OrtValue * * Constructs an ::OrtValue that contains a value of non-standard type created for * experiments or while awaiting standardization. ::OrtValue in this case would contain * an internal representation of the Opaque type. Opaque types are distinguished from * each other by two strings 1) domain and 2) type name. The combination of the two * must be unique, so the type representation is properly identified internally. The combination * must be properly registered from within ORT at both compile/run time or by another API. * * To construct the ::OrtValue pass domain and type names, also a pointer to a data container * the type of which must be known to both ORT and the client program. That data container may or may * not match the internal representation of the Opaque type. The sizeof(data_container) is passed for * verification purposes. * * \param[in] domain_name Null terminated string of the domain name * \param[in] type_name Null terminated string of the type name * \param[in] data_container User pointer Data to populate ::OrtValue * \param[in] data_container_size Size in bytes of what `data_container` points to * \param[out] out Newly created ::OrtValue. Must be freed with OrtApi::ReleaseValue * * \snippet{doc} snippets.dox OrtStatus Return Value */ CreateOpaqueValue: #type (domain_name: *u8, type_name: *u8, data_container: *void, data_container_size: u64, out: **OrtValue) -> OrtStatusPtr #c_call; /** \brief Get internal data from an opaque (custom user defined type) ::OrtValue * * Copies internal data from an opaque value into a user provided buffer * * \see OrtApi::CreateOpaqueValue * * \param[in] domain_name Null terminated string of the domain name * \param[in] type_name Null terminated string of the type name * \param[in] in The opaque ::OrtValue * \param[out] data_container Buffer to copy data into * \param[out] data_container_size Size in bytes of the buffer pointed to by data_container. Must match the size of the internal buffer. * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetOpaqueValue: #type (domain_name: *u8, type_name: *u8, in: *OrtValue, data_container: *void, data_container_size: u64) -> OrtStatusPtr #c_call; /** \brief Get a float stored as an attribute in the graph node * * \param[in] info ::OrtKernelInfo instance * \param[in] name Null terminated string of the name of the attribute * \param[out] out Pointer to memory where the attribute will be stored * * \snippet{doc} snippets.dox OrtStatus Return Value */ KernelInfoGetAttribute_float: #type (info: *OrtKernelInfo, name: *u8, out: *float) -> OrtStatusPtr #c_call; /** \brief Fetch a 64-bit int stored as an attribute in the graph node * * \param[in] info ::OrtKernelInfo instance * \param[in] name Null terminated string of the name of the attribute * \param[out] out Pointer to memory where the attribute will be stored * * \snippet{doc} snippets.dox OrtStatus Return Value */ KernelInfoGetAttribute_int64: #type (info: *OrtKernelInfo, name: *u8, out: *s64) -> OrtStatusPtr #c_call; /** \brief Fetch a string stored as an attribute in the graph node * * If `out` is nullptr, the value of `size` is set to the true size of the string * attribute, and a success status is returned. * * If the `size` parameter is greater than or equal to the actual string attribute's size, * the value of `size` is set to the true size of the string attribute, the provided memory * is filled with the attribute's contents, and a success status is returned. * * If the `size` parameter is less than the actual string attribute's size and `out` * is not nullptr, the value of `size` is set to the true size of the string attribute * and a failure status is returned.) * * \param[in] info ::OrtKernelInfo instance * \param[in] name Null terminated string of the name of the attribute * \param[out] out Pointer to memory where the attribute will be stored * \param[in,out] size See above comments for details * * \snippet{doc} snippets.dox OrtStatus Return Value */ KernelInfoGetAttribute_string: #type (info: *OrtKernelInfo, name: *u8, out: *u8, size: *u64) -> OrtStatusPtr #c_call; /** \brief Used for custom operators, get the input count of a kernel * * \see ::OrtCustomOp */ KernelContext_GetInputCount: #type (_context: *OrtKernelContext, out: *u64) -> OrtStatusPtr #c_call; /** \brief Used for custom operators, get the output count of a kernel * * \see ::OrtCustomOp */ KernelContext_GetOutputCount: #type (_context: *OrtKernelContext, out: *u64) -> OrtStatusPtr #c_call; /** \brief Used for custom operators, get an input of a kernel * * The function attempts fetches the input of the kernel. If the input is optional * and not present, the function returns success and out is set to nullptr. * * \param[in] context ::OrtKernelContext instance * \param[in] index See KernelContext_GetInputCount for boundaries check. * \param[out] out OrtValue if the input is present otherwise is set nullptr * * \snippet{doc} snippets.dox OrtStatus Return Value */ KernelContext_GetInput: #type (_context: *OrtKernelContext, index: u64, out: **OrtValue) -> OrtStatusPtr #c_call; /** \brief Used for custom operators, get an output of a kernel * * The function attempts fetches the output of the kernel. If the output is optional * and not present, the function returns success and out is set to nullptr. * * \param[in] context ::OrtKernelContext instance * \param[in] index See KernelContext_GetOutputCount for boundaries check. * \param[in] dim_values output dimensions * \param[in] dim_count number of dimensions * \param[out] out a ptr to OrtValue to output otherwise set to nullptr * * \snippet{doc} snippets.dox OrtStatus Return Value */ KernelContext_GetOutput: #type (_context: *OrtKernelContext, index: u64, dim_values: *s64, dim_count: u64, out: **OrtValue) -> OrtStatusPtr #c_call; /// @} /// \name OrtEnv /// @{ ReleaseEnv: #type (input: *OrtEnv) -> void #c_call; /// @} /// \name OrtStatus /// @{ ReleaseStatus: #type (input: *OrtStatus) -> void #c_call; /// @} /// \name OrtMemoryInfo /// @{ ReleaseMemoryInfo: #type (input: *OrtMemoryInfo) -> void #c_call; ReleaseSession: #type (input: *OrtSession) -> void #c_call; // Don't call ReleaseSession from Dllmain (because session owns a thread pool) /// @} /// \name OrtValue /// @{ ReleaseValue: #type (input: *OrtValue) -> void #c_call; /// @} /// \name OrtRunOptions /// @{ ReleaseRunOptions: #type (input: *OrtRunOptions) -> void #c_call; /// @} /// \name OrtTypeInfo /// @{ ReleaseTypeInfo: #type (input: *OrtTypeInfo) -> void #c_call; /// @} /// \name OrtTensorTypeAndShapeInfo /// @{ ReleaseTensorTypeAndShapeInfo: #type (input: *OrtTensorTypeAndShapeInfo) -> void #c_call; /// @} /// \name OrtSessionOptions /// @{ ReleaseSessionOptions: #type (input: *OrtSessionOptions) -> void #c_call; /// @} /// \name OrtCustomOpDomain /// @{ ReleaseCustomOpDomain: #type (input: *OrtCustomOpDomain) -> void #c_call; /** \brief Get denotation from type information * * Augments ::OrtTypeInfo to return denotations on the type. * * This is used by WinML to determine if an input/output is intended to be an Image or a Tensor. * * \param[in] type_info * \param[out] denotation Pointer to the null terminated denotation string is written to this pointer. This pointer is valid until the object is destroyed or the name is changed, do not free. * \param[out] len Length in bytes of the string returned in `denotation` * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetDenotationFromTypeInfo: #type (_type_info: *OrtTypeInfo, denotation: **u8, len: *u64) -> OrtStatusPtr #c_call; /** \brief Get detailed map information from an ::OrtTypeInfo * * This augments ::OrtTypeInfo to return an ::OrtMapTypeInfo when the type is a map. * The OrtMapTypeInfo has additional information about the map's key type and value type. * * This is used by WinML to support model reflection APIs. * * \param[out] type_info * \param[out] out A pointer to the ::OrtMapTypeInfo. Do not free this value. If type_info * does not contain a map, this value will be set to nullptr. * * \snippet{doc} snippets.dox OrtStatus Return Value */ CastTypeInfoToMapTypeInfo: #type (_type_info: *OrtTypeInfo, out: **OrtMapTypeInfo) -> OrtStatusPtr #c_call; /** \brief Cast ::OrtTypeInfo to an ::OrtSequenceTypeInfo * * This api augments ::OrtTypeInfo to return an ::OrtSequenceTypeInfo when the type is a sequence. * The ::OrtSequenceTypeInfo has additional information about the sequence's element type. * * This is used by WinML to support model reflection APIs. * * \param[in] type_info * \param[out] out A pointer to the OrtSequenceTypeInfo. Do not free this value. If type_info * doesn not contain a sequence, this value will be set to nullptr. * * \snippet{doc} snippets.dox OrtStatus Return Value */ CastTypeInfoToSequenceTypeInfo: #type (_type_info: *OrtTypeInfo, out: **OrtSequenceTypeInfo) -> OrtStatusPtr #c_call; /** \brief Get key type from an ::OrtMapTypeInfo * * Key types are restricted to being scalar types. * * This is used by WinML to support model reflection APIs. * * \param[in] map_type_info * \param[out] out * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetMapKeyType: #type (map_type_info: *OrtMapTypeInfo, out: *ONNXTensorElementDataType) -> OrtStatusPtr #c_call; /** \brief Get the value type from an ::OrtMapTypeInfo * * \param[in] map_type_info * \param[out] type_info A copy of the OrtTypeInfo for the map value type. * The user must free this value with ReleaseTypeInfo. * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetMapValueType: #type (map_type_info: *OrtMapTypeInfo, _type_info: **OrtTypeInfo) -> OrtStatusPtr #c_call; /** \brief Get element type from an ::OrtSequenceTypeInfo * * This is used by WinML to support model reflection APIs. * * \param[in] sequence_type_info * \param[out] type_info A copy of the OrtTypeInfo for the sequence element type. * The user must free this value with ReleaseTypeInfo. * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetSequenceElementType: #type (sequence_type_info: *OrtSequenceTypeInfo, _type_info: **OrtTypeInfo) -> OrtStatusPtr #c_call; /// @} /// \name OrtMapTypeInfo /// @{ ReleaseMapTypeInfo: #type (input: *OrtMapTypeInfo) -> void #c_call; /// @} /// \name OrtSequenceTypeInfo /// @{ ReleaseSequenceTypeInfo: #type (input: *OrtSequenceTypeInfo) -> void #c_call; /** \brief End profiling and return filename of the profile data * * Profiling is turned on through OrtApi::EnableProfiling * * \param[in] session * \param[in] allocator * \param[out] out Null terminated string of the filename, allocated using `allocator`. Must be freed using `allocator` * * \snippet{doc} snippets.dox OrtStatus Return Value */ SessionEndProfiling: #type (session: *OrtSession, allocator: *OrtAllocator, out: **u8) -> OrtStatusPtr #c_call; /** \brief Get ::OrtModelMetadata from an ::OrtSession * * \param[in] session * \param[out] out Newly created ::OrtModelMetadata. Must be freed using OrtApi::ReleaseModelMetadata * * \snippet{doc} snippets.dox OrtStatus Return Value */ SessionGetModelMetadata: #type (session: *OrtSession, out: **OrtModelMetadata) -> OrtStatusPtr #c_call; /** \brief Get `producer name` from an ::OrtModelMetadata * * \param[in] model_metadata * \param[in] allocator * \param[out] value Set to a null terminated string allocated using `allocator`. Must be freed using `allocator` * * \snippet{doc} snippets.dox OrtStatus Return Value */ ModelMetadataGetProducerName: #type (model_metadata: *OrtModelMetadata, allocator: *OrtAllocator, value: **u8) -> OrtStatusPtr #c_call; /** \brief Get `graph name` from an ::OrtModelMetadata * * \param[in] model_metadata * \param[in] allocator * \param[out] value Set to a null terminated string allocated using `allocator`. Must be freed using `allocator` * * \snippet{doc} snippets.dox OrtStatus Return Value */ ModelMetadataGetGraphName: #type (model_metadata: *OrtModelMetadata, allocator: *OrtAllocator, value: **u8) -> OrtStatusPtr #c_call; /** \brief Get `domain` from an ::OrtModelMetadata * * \param[in] model_metadata * \param[in] allocator * \param[out] value Set to a null terminated string allocated using `allocator`. Must be freed using `allocator` * * \snippet{doc} snippets.dox OrtStatus Return Value */ ModelMetadataGetDomain: #type (model_metadata: *OrtModelMetadata, allocator: *OrtAllocator, value: **u8) -> OrtStatusPtr #c_call; /** \brief Get `description` from an ::OrtModelMetadata * * \param[in] model_metadata * \param[in] allocator * \param[out] value Set to a null terminated string allocated using `allocator`. Must be freed using `allocator` * * \snippet{doc} snippets.dox OrtStatus Return Value */ ModelMetadataGetDescription: #type (model_metadata: *OrtModelMetadata, allocator: *OrtAllocator, value: **u8) -> OrtStatusPtr #c_call; /** \brief Return data for a key in the custom metadata map in an ::OrtModelMetadata * * \param[in] model_metadata * \param[in] allocator * \param[in] key Null terminated string * \param[out] value Set to a null terminated string allocated using `allocator`. Must be freed using `allocator` * `value` will be set to nullptr if the given key is not found in the custom metadata map. * * \snippet{doc} snippets.dox OrtStatus Return Value */ ModelMetadataLookupCustomMetadataMap: #type (model_metadata: *OrtModelMetadata, allocator: *OrtAllocator, key: *u8, value: **u8) -> OrtStatusPtr #c_call; /** \brief Get version number from an ::OrtModelMetadata * * \param[in] model_metadata * \param[out] value Set to the version number * * \snippet{doc} snippets.dox OrtStatus Return Value */ ModelMetadataGetVersion: #type (model_metadata: *OrtModelMetadata, value: *s64) -> OrtStatusPtr #c_call; ReleaseModelMetadata: #type (input: *OrtModelMetadata) -> void #c_call; /** \brief Create an OrtEnv * * Create an environment with global threadpools that will be shared across sessions. * Use this in conjunction with OrtApi::DisablePerSessionThreads or else the session will use * its own thread pools. * * \param[in] log_severity_level The log severity level. * \param[in] logid The log identifier. * \param[in] tp_options * \param[out] out Returned newly created OrtEnv. Must be freed with OrtApi::ReleaseEnv * * \snippet{doc} snippets.dox OrtStatus Return Value */ CreateEnvWithGlobalThreadPools: #type (log_severity_level: OrtLoggingLevel, logid: *u8, tp_options: *OrtThreadingOptions, out: **OrtEnv) -> OrtStatusPtr #c_call; /** \brief Use global thread pool on a session * * Disable using per session thread pool and use the shared global threadpool. * This should be used in conjunction with OrtApi::CreateEnvWithGlobalThreadPools. * * \param[in] options * * \snippet{doc} snippets.dox OrtStatus Return Value */ DisablePerSessionThreads: #type (options: *OrtSessionOptions) -> OrtStatusPtr #c_call; /** \brief Create an ::OrtThreadingOptions * * \param[out] out Newly created ::OrtThreadingOptions. Must be freed with OrtApi::ReleaseThreadingOptions * \snippet{doc} snippets.dox OrtStatus Return Value */ CreateThreadingOptions: #type (out: **OrtThreadingOptions) -> OrtStatusPtr #c_call; ReleaseThreadingOptions: #type (input: *OrtThreadingOptions) -> void #c_call; /** * * \param[in] model_metadata * \param[in] allocator * \param[out] keys Array of null terminated strings (array count = num_keys) allocated using `allocator`. * The strings and the pointer array must be freed using `allocator` * `keys` will be set to nullptr if the custom metadata map is empty. * \param[out] num_keys Set to the number of elements in the `keys` array * * \snippet{doc} snippets.dox OrtStatus Return Value */ ModelMetadataGetCustomMetadataMapKeys: #type (model_metadata: *OrtModelMetadata, allocator: *OrtAllocator, keys: ***u8, num_keys: *s64) -> OrtStatusPtr #c_call; /** * * Override symbolic dimensions (by specific name strings) with actual values * if known at session initialization time to enable optimizations that can * take advantage of fixed values (such as memory planning, etc) * */ AddFreeDimensionOverrideByName: #type (options: *OrtSessionOptions, dim_name: *u8, dim_value: s64) -> OrtStatusPtr #c_call; /** \brief Get the names of all available providers * * \note The providers in the list are not guaranteed to be usable. They may fail to load due to missing system dependencies. * For example, if the CUDA/cuDNN libraries are not installed, the CUDA provider will report an error when it is added to the session options. * * \param[out] out_ptr Set to a pointer to an array of null terminated strings of the available providers. The entries and the * array itself must be freed using OrtApi::ReleaseAvailableProviders * \param[out] provider_length Set to the number of entries in the `out_ptr` array * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetAvailableProviders: #type (out_ptr: ***u8, provider_length: *s32) -> OrtStatusPtr #c_call; /** \brief Release data from OrtApi::GetAvailableProviders. This API will never fail * so you can rely on it in a noexcept code. * * \param[in] ptr The `out_ptr` result from OrtApi::GetAvailableProviders. * \param[in] providers_length The `provider_length` result from OrtApi::GetAvailableProviders * * \snippet{doc} snippets.dox OrtStatus Return Value */ ReleaseAvailableProviders: #type (ptr: **u8, providers_length: s32) -> OrtStatusPtr #c_call; /** \brief Get the length of a single string in a string tensor * * \param[in] value A string tensor * \param[in] index Index of the string in the tensor * \param[out] out Set to number of bytes of the string element * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetStringTensorElementLength: #type (value: *OrtValue, index: u64, out: *u64) -> OrtStatusPtr #c_call; /** \brief Get a single string from a string tensor * * \param[in] value A string tensor * \param[in] s_len Number of bytes in the `s` buffer. Must match the value returned by OrtApi::GetStringTensorElementLength. * \param[in] index Index of the string in the tensor * \param[out] s The string element contents in UTF-8 encoding. The string is NOT null-terminated. * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetStringTensorElement: #type (value: *OrtValue, s_len: u64, index: u64, s: *void) -> OrtStatusPtr #c_call; /** \brief Set a single string in a string tensor * * \param[in] value A string tensor * \param[in] s A null terminated UTF-8 encoded string * \param[in] index Index of the string in the tensor to set * * \snippet{doc} snippets.dox OrtStatus Return Value */ FillStringTensorElement: #type (value: *OrtValue, s: *u8, index: u64) -> OrtStatusPtr #c_call; /** \brief Set a session configuration entry as a pair of strings * * If a configuration with same key exists, this will overwrite the configuration with the given config_value. * * The config_key and the format of config_value are defined in onnxruntime_session_options_config_keys.h * * \param[in] options * \param[in] config_key A null terminated string representation of the config key * \param[in] config_value A null terminated string representation of the config value * * \snippet{doc} snippets.dox OrtStatus Return Value */ AddSessionConfigEntry: #type (options: *OrtSessionOptions, config_key: *u8, config_value: *u8) -> OrtStatusPtr #c_call; /** \brief Create an allocator for an ::OrtSession following an ::OrtMemoryInfo * * The allocator wraps the internal allocator from the OrtSession and becomes invalid when the session does. * * \param[in] session * \param[in] mem_info valid ::OrtMemoryInfo instance * \param[out] out Newly created ::OrtAllocator. Must be freed with OrtApi::ReleaseAllocator * * \snippet{doc} snippets.dox OrtStatus Return Value */ CreateAllocator: #type (session: *OrtSession, mem_info: *OrtMemoryInfo, out: **OrtAllocator) -> OrtStatusPtr #c_call; /** \brief Release an ::OrtAllocator obtained from OrtApi::CreateAllocator */ ReleaseAllocator: #type (input: *OrtAllocator) -> void #c_call; /** \brief Run a model using Io Bindings for the inputs & outputs * * \see OrtApi::Run * * \param[in] session * \param[in] run_options * \param[in] binding_ptr * * \snippet{doc} snippets.dox OrtStatus Return Value */ RunWithBinding: #type (session: *OrtSession, run_options: *OrtRunOptions, binding_ptr: *OrtIoBinding) -> OrtStatusPtr #c_call; /** \brief Create an ::OrtIoBinding instance * * An IoBinding object allows one to bind pre-allocated ::OrtValue%s to input names. * Thus if you want to use a raw on device buffer as input or output you can avoid * extra copy during runtime. * * \param[in] session * \param[out] out Newly created ::OrtIoBinding. Must be freed with OrtApi::ReleaseIoBinding * * \snippet{doc} snippets.dox OrtStatus Return Value */ CreateIoBinding: #type (session: *OrtSession, out: **OrtIoBinding) -> OrtStatusPtr #c_call; /** \brief Release an ::OrtIoBinding obtained from OrtApi::CreateIoBinding */ ReleaseIoBinding: #type (input: *OrtIoBinding) -> void #c_call; /** \brief Bind an ::OrtValue to an ::OrtIoBinding input * * When using OrtApi::RunWithBinding this value is used for the named input * * \param[in] binding_ptr * \param[in] name Name for the model input * \param[in] val_ptr ::OrtValue of Tensor type. * * \snippet{doc} snippets.dox OrtStatus Return Value */ BindInput: #type (binding_ptr: *OrtIoBinding, name: *u8, val_ptr: *OrtValue) -> OrtStatusPtr #c_call; /** \brief Bind an ::OrtValue to an ::OrtIoBinding output * * When using OrtApi::RunWithBinding this value is used for the named output * * \param[in] binding_ptr * \param[in] name Null terminated string of the model output name * \param[in] val_ptr ::OrtValue of Tensor type. * * \snippet{doc} snippets.dox OrtStatus Return Value */ BindOutput: #type (binding_ptr: *OrtIoBinding, name: *u8, val_ptr: *OrtValue) -> OrtStatusPtr #c_call; /** \brief Bind an ::OrtIoBinding output to a device * * Binds the ::OrtValue to a device which is specified by ::OrtMemoryInfo. * You can either create an instance of ::OrtMemoryInfo with a device id or obtain one from the allocator that you have created/are using * This is useful when one or more outputs have dynamic shapes and, it is hard to pre-allocate and bind a chunk of * memory within ::OrtValue ahead of time. * * \see OrtApi::RunWithBinding * * \param[in] binding_ptr * \param[in] name Null terminated string of the device name * \param[in] mem_info_ptr * * \snippet{doc} snippets.dox OrtStatus Return Value */ BindOutputToDevice: #type (binding_ptr: *OrtIoBinding, name: *u8, mem_info_ptr: *OrtMemoryInfo) -> OrtStatusPtr #c_call; /** \brief Get the names of an ::OrtIoBinding's outputs * * Returns the names of the outputs in the order they were bound. This is useful after running the model * with bound outputs because the returned names are in order in which output ::OrtValue are returned. This is useful if * the order of outputs and their names is not known. * * \param[in] binding_ptr * \param[in] allocator Allocator used to allocate continuous buffers for output strings and lengths. * \param[out] buffer Returns an array of non-null terminated UTF-8 strings. The number of strings stored is returned in the count parameter. * This buffer is allocated using `allocator` and must be freed using it. * \param[out] lengths Returns an array of `count` lengths of the strings returned in `buffer` * This buffer is allocated using `allocator` and must be freed using it. * \param[out] count Number of strings returned. If `binding_ptr` has no bound outputs, zero is returned, * no memory allocation is performed and buffer and lengths are set to nullptr. * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetBoundOutputNames: #type (binding_ptr: *OrtIoBinding, allocator: *OrtAllocator, buffer: **u8, lengths: **u64, count: *u64) -> OrtStatusPtr #c_call; /** \brief Get the output ::OrtValue objects from an ::OrtIoBinding * * Returns an array of pointers to individually allocated ::OrtValue%s that contain results of a model execution with OrtApi::RunWithBinding * The array contains the same number of ::OrtValue%s and they are in the same order as they were bound with OrtApi::BindOutput * or OrtApi::BindOutputToDevice. * * The returned ::OrtValue%s must be released using OrtApi::ReleaseValue after they are no longer needed. * The array is allocated using the specified instance of the allocator and must be freed using the same allocator after * all the ::OrtValue%s contained therein are individually released. * * \param[in] binding_ptr * \param[in] allocator Allocator used to allocate output array * \param[out] output Set to the allocated array of allocated ::OrtValue outputs. Set to nullptr if there are 0 outputs. * \param[out] output_count Set to number of ::OrtValue%s returned * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetBoundOutputValues: #type (binding_ptr: *OrtIoBinding, allocator: *OrtAllocator, output: ***OrtValue, output_count: *u64) -> OrtStatusPtr #c_call; /** \brief Clears any previously set Inputs for an ::OrtIoBinding */ ClearBoundInputs: #type (binding_ptr: *OrtIoBinding) -> void #c_call; /** \brief Clears any previously set Outputs for an ::OrtIoBinding */ ClearBoundOutputs: #type (binding_ptr: *OrtIoBinding) -> void #c_call; /** \brief Direct memory access to a specified tensor element * * For example, given a tensor with shape of [3,224,224], a pointer to the element at location [2,150,128] can be retrieved * * This function only works for numeric type tensors (No strings, etc). * This function does not support sub-byte packed types (e.g., int4). * This is a no-copy method whose returned pointer is valid until the passed in ::OrtValue is free'd. * * \param[in] value * \param[in] location_values Pointer to an array of index values that specify an element's location relative to its shape * \param[in] location_values_count Number of elements in location_values. Must match the number of elements in the tensor's shape. * \param[out] out Set to a pointer to the element specified * * \snippet{doc} snippets.dox OrtStatus Return Value */ TensorAt: #type (value: *OrtValue, location_values: *s64, location_values_count: u64, out: **void) -> OrtStatusPtr #c_call; /** \brief Create an allocator and register it with the ::OrtEnv * * Enables sharing the allocator between multiple sessions that use the same env instance. * Lifetime of the created allocator will be valid for the duration of the environment. * Returns an error if an allocator with the same ::OrtMemoryInfo is already registered. * * See https://onnxruntime.ai/docs/get-started/with-c.html for details. * * \param[in] env ::OrtEnv instance * \param[in] mem_info * \param[in] arena_cfg Pass nullptr for defaults * * \snippet{doc} snippets.dox OrtStatus Return Value */ CreateAndRegisterAllocator: #type (env: *OrtEnv, mem_info: *OrtMemoryInfo, arena_cfg: *OrtArenaCfg) -> OrtStatusPtr #c_call; /** \brief Set language projection * * Set the language projection for collecting telemetry data when Env is created. * * The default is ORT_PROJECTION_C, which means it will classify the language not in the list to C also. * * \param[in] ort_env * \param[in] projection * * \snippet{doc} snippets.dox OrtStatus Return Value */ SetLanguageProjection: #type (ort_env: *OrtEnv, projection: OrtLanguageProjection) -> OrtStatusPtr #c_call; /** \brief Return the time that profiling was started * * \note The timer precision varies per platform. On Windows and MacOS, the precision will be ~100ns * * \param[in] session * \param[out] out nanoseconds of profiling's start time * * \snippet{doc} snippets.dox OrtStatus Return Value */ SessionGetProfilingStartTimeNs: #type (session: *OrtSession, out: *u64) -> OrtStatusPtr #c_call; /** \brief Set global intra-op thread count * * This configures the global thread pool options to be used in the call to OrtApi::CreateEnvWithGlobalThreadPools * * \param[in] tp_options * \param[in] intra_op_num_threads Number of threads, special values:
* 0 = Use default thread count
* 1 = The invoking thread will be used; no threads will be created in the thread pool. * * \snippet{doc} snippets.dox OrtStatus Return Value */ SetGlobalIntraOpNumThreads: #type (tp_options: *OrtThreadingOptions, intra_op_num_threads: s32) -> OrtStatusPtr #c_call; /** \brief Set global inter-op thread count * * This configures the global thread pool options to be used in the call to OrtApi::CreateEnvWithGlobalThreadPools * * \param[in] tp_options * \param[in] inter_op_num_threads Number of threads, special values:
* 0 = Use default thread count
* 1 = The invoking thread will be used; no threads will be created in the thread pool. * * \snippet{doc} snippets.dox OrtStatus Return Value */ SetGlobalInterOpNumThreads: #type (tp_options: *OrtThreadingOptions, inter_op_num_threads: s32) -> OrtStatusPtr #c_call; /** \brief Set global spin control options * * This will configure the global thread pool options to be used in the call to OrtApi::CreateEnvWithGlobalThreadPools. * Allow spinning of thread pools when their queues are empty. This will set the value for both * inter_op and intra_op threadpools. * * \param[in] tp_options * \param[in] allow_spinning Valid values are 0 or 1.
* 0 = It won't spin (recommended if CPU usage is high)
* 1 = Threadpool will spin to wait for queue to become non-empty * * \snippet{doc} snippets.dox OrtStatus Return Value */ SetGlobalSpinControl: #type (tp_options: *OrtThreadingOptions, allow_spinning: s32) -> OrtStatusPtr #c_call; /** \brief Add a pre-allocated initializer to a session * * If a model contains an initializer with a name that is same as the name passed to this call, * ORT will use this initializer instance instead of deserializing one from the model file. This * is useful when you want to share the same initializer across sessions. * * \param[in] options * \param[in] name Null terminated string of the initializer name * \param[in] val ::OrtValue containing the initializer. Its lifetime and the underlying initializer buffer must be * managed by the user (created using the OrtApi::CreateTensorWithDataAsOrtValue) and it must outlive the session object * to which it is added. * * \snippet{doc} snippets.dox OrtStatus Return Value */ AddInitializer: #type (options: *OrtSessionOptions, name: *u8, val: *OrtValue) -> OrtStatusPtr #c_call; /** * Create a custom environment with global threadpools and logger that will be shared across sessions. * Use this in conjunction with OrtApi::DisablePerSessionThreads or else the session will use * its own thread pools. * * \param[in] logging_function A pointer to a logging function. * \param[in] logger_param A pointer to arbitrary data passed as the ::OrtLoggingFunction `param` parameter to * `logging_function`. * \param[in] log_severity_level The log severity level. * \param[in] logid The log identifier. * \param[in] tp_options * \param[out] out Newly created OrtEnv. Must be freed with OrtApi::ReleaseEnv * * \snippet{doc} snippets.dox OrtStatus Return Value */ CreateEnvWithCustomLoggerAndGlobalThreadPools: #type (logging_function: OrtLoggingFunction, logger_param: *void, log_severity_level: OrtLoggingLevel, logid: *u8, tp_options: *OrtThreadingOptions, out: **OrtEnv) -> OrtStatusPtr #c_call; /** \brief Append CUDA provider to session options * * If CUDA is not available (due to a non CUDA enabled build, or if CUDA is not installed on the system), this function will return failure. * * \param[in] options * \param[in] cuda_options * * \snippet{doc} snippets.dox OrtStatus Return Value */ SessionOptionsAppendExecutionProvider_CUDA: #type (options: *OrtSessionOptions, cuda_options: *OrtCUDAProviderOptions) -> OrtStatusPtr #c_call; /** \brief Append ROCM execution provider to the session options * * If ROCM is not available (due to a non ROCM enabled build, or if ROCM is not installed on the system), this function will return failure. * * \param[in] options * \param[in] rocm_options * * \snippet{doc} snippets.dox OrtStatus Return Value */ SessionOptionsAppendExecutionProvider_ROCM: #type (options: *OrtSessionOptions, rocm_options: *OrtROCMProviderOptions) -> OrtStatusPtr #c_call; /** \brief Append OpenVINO execution provider to the session options * * If OpenVINO is not available (due to a non OpenVINO enabled build, or if OpenVINO is not installed on the system), this function will fail. * * \param[in] options * \param[in] provider_options * * \snippet{doc} snippets.dox OrtStatus Return Value */ SessionOptionsAppendExecutionProvider_OpenVINO: #type (options: *OrtSessionOptions, provider_options: *OrtOpenVINOProviderOptions) -> OrtStatusPtr #c_call; /** \brief Set threading flush-to-zero and denormal-as-zero * * Sets global thread pool options to be used in the call to OrtApi::CreateEnvWithGlobalThreadPools. * Flush-to-zero and denormal-as-zero are applied to threads in both intra and inter global thread pool. * \note This option is not needed if the models used have no denormals. Having no denormals is recommended as this option may hurt model accuracy. * * \param[in] tp_options * * \snippet{doc} snippets.dox OrtStatus Return Value */ SetGlobalDenormalAsZero: #type (tp_options: *OrtThreadingOptions) -> OrtStatusPtr #c_call; /** \deprecated Use OrtApi::CreateArenaCfgV2 * * This will create the configuration of an arena that can eventually be used to define an arena based allocator's behavior * * \param[in] max_mem Use 0 to allow ORT to choose the default * \param[in] arena_extend_strategy Use -1 to allow ORT to choose the default, 0 = kNextPowerOfTwo, 1 = kSameAsRequested * \param[in] initial_chunk_size_bytes Use -1 to allow ORT to choose the default * \param[in] max_dead_bytes_per_chunk Use -1 to allow ORT to choose the default * \param[in] out A pointer to an OrtArenaCfg instance * * \snippet{doc} snippets.dox OrtStatus Return Value */ CreateArenaCfg: #type (max_mem: u64, arena_extend_strategy: s32, initial_chunk_size_bytes: s32, max_dead_bytes_per_chunk: s32, out: **OrtArenaCfg) -> OrtStatusPtr #c_call; ReleaseArenaCfg: #type (input: *OrtArenaCfg) -> void #c_call; /** * Use this to obtain the description of the graph present in the model * (doc_string field of the GraphProto message within the ModelProto message). * If it doesn't exist, an empty string will be returned. * * \param[in] model_metadata An instance of ::OrtModelMetadata * \param[in] allocator Allocator used to allocate the string that will be returned back * \param[out] value Set to a null terminated string allocated using `allocator`. The caller is responsible for freeing it using `allocator` * * \snippet{doc} snippets.dox OrtStatus Return Value */ ModelMetadataGetGraphDescription: #type (model_metadata: *OrtModelMetadata, allocator: *OrtAllocator, value: **u8) -> OrtStatusPtr #c_call; /** \brief Append TensorRT provider to session options * * If TensorRT is not available (due to a non TensorRT enabled build, or if TensorRT is not installed on the system), this function will return failure. * * \param[in] options * \param[in] tensorrt_options * * \snippet{doc} snippets.dox OrtStatus Return Value */ SessionOptionsAppendExecutionProvider_TensorRT: #type (options: *OrtSessionOptions, tensorrt_options: *OrtTensorRTProviderOptions) -> OrtStatusPtr #c_call; /** \brief Set current GPU device ID * * Set the current device id of the GPU execution provider (CUDA/tensorrt/rocm). The device id should be less * than the total number of devices available. This is only useful when multiple-GPUs are installed and it is * required to restrict execution to a single GPU. * * \param[in] device_id * * \snippet{doc} snippets.dox OrtStatus Return Value */ SetCurrentGpuDeviceId: #type (device_id: s32) -> OrtStatusPtr #c_call; /** \brief Get current GPU device ID * * Get the current device id of the GPU execution provider (CUDA/tensorrt/rocm). * * \see OrtApi::SetCurrentGpuDeviceId * * \param[out] device_id * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetCurrentGpuDeviceId: #type (device_id: *s32) -> OrtStatusPtr #c_call; /** \brief Fetch an array of int64_t values stored as an attribute in the graph node * * * If `out` is nullptr, the value of `size` is set to the true size of the attribute * array's size, and a success status is returned. * * If the `size` parameter is greater than or equal to the actual attribute array's size, * the value of `size` is set to the true size of the attribute array's size, * the provided memory is filled with the attribute's contents, * and a success status is returned. * * If the `size` parameter is less than the actual attribute array's size and `out` * is not nullptr, the value of `size` is set to the true size of the attribute array's size * and a failure status is returned.) * * \param[in] info instance * \param[in] name name of the attribute to be parsed * \param[out] out pointer to memory where the attribute's contents are to be stored * \param[in, out] size actual size of attribute array * * \snippet{doc} snippets.dox OrtStatus Return Value */ KernelInfoGetAttributeArray_float: #type (info: *OrtKernelInfo, name: *u8, out: *float, size: *u64) -> OrtStatusPtr #c_call; /** \brief Fetch an array of int64_t values stored as an attribute in the graph node * * If `out` is nullptr, the value of `size` is set to the true size of the attribute * array's size, and a success status is returned. * * If the `size` parameter is greater than or equal to the actual attribute array's size, * the value of `size` is set to the true size of the attribute array's size, * the provided memory is filled with the attribute's contents, * and a success status is returned. * * If the `size` parameter is less than the actual attribute array's size and `out` * is not nullptr, the value of `size` is set to the true size of the attribute array's size * and a failure status is returned.) * * \param[in] info instance * \param[in] name name of the attribute to be parsed * \param[out] out pointer to memory where the attribute's contents are to be stored * \param[in, out] size actual size of attribute array * * \snippet{doc} snippets.dox OrtStatus Return Value */ KernelInfoGetAttributeArray_int64: #type (info: *OrtKernelInfo, name: *u8, out: *s64, size: *u64) -> OrtStatusPtr #c_call; /** \brief Create an ::OrtArenaCfg * * Create the configuration of an arena that can eventually be used to define an arena based allocator's behavior. * * Supported keys are (See https://onnxruntime.ai/docs/get-started/with-c.html for details on what the * following parameters mean and how to choose these values.): * "max_mem": Maximum memory that can be allocated by the arena based allocator. * Use 0 for ORT to pick the best value. Default is 0. * "arena_extend_strategy": 0 = kNextPowerOfTwo, 1 = kSameAsRequested. * Use -1 to allow ORT to choose the default. * "initial_chunk_size_bytes": (Possible) Size of the first allocation in the arena. * Only relevant if arena strategy is `kNextPowerOfTwo`. Use -1 to allow ORT to choose the default. * Ultimately, the first allocation size is determined by the allocation memory request. * "max_dead_bytes_per_chunk": Threshold of unused memory in an allocated chunk of arena memory after * crossing which the current chunk is chunked into 2. * "initial_growth_chunk_size_bytes": (Possible) Size of the second allocation in the arena. * Only relevant if arena strategy is `kNextPowerOfTwo`. Use -1 to allow ORT to choose the default. * "max_power_of_two_extend_bytes": The maximum extend size if arena strategy is `kNextPowerOfTwo`. * It is not an allocation limit, it is only a limit for extension when requested byte is less than the limit. * When requested bytes is more than the limit, allocator will still return as requested. * Use -1 to allow ORT to choose the default 1GB for max_power_of_two_extend_bytes. * Ultimately, the allocation size is determined by the allocation memory request. * Further allocation sizes are governed by the arena extend strategy. * * \param[in] arena_config_keys Keys to configure the arena * \param[in] arena_config_values Values to configure the arena * \param[in] num_keys Number of keys in `arena_config_keys` and `arena_config_values` * \param[out] out Newly created ::OrtArenaCfg. Must be freed with OrtApi::ReleaseArenaCfg * * \snippet{doc} snippets.dox OrtStatus Return Value */ CreateArenaCfgV2: #type (arena_config_keys: **u8, arena_config_values: *u64, num_keys: u64, out: **OrtArenaCfg) -> OrtStatusPtr #c_call; /** \brief Set a single run configuration entry as a pair of strings * * If a configuration with same key exists, this will overwrite the configuration with the given config_value * * The config_key and the format of config_value are defined in onnxruntime_run_options_config_keys.h * * \param[in] options * \param[in] config_key A null terminated string representation of the config key * \param[in] config_value A null terminated string representation of the config value * * \snippet{doc} snippets.dox OrtStatus Return Value */ AddRunConfigEntry: #type (options: *OrtRunOptions, config_key: *u8, config_value: *u8) -> OrtStatusPtr #c_call; /** \brief Create an ::OrtPrepackedWeightsContainer * * This container will hold pre-packed buffers of shared initializers for sharing between sessions * (i.e.) if there are shared initializers that can be shared between sessions, the pre-packed buffers * of these (if any) may possibly be shared to provide memory footprint savings. Pass this container * to sessions that you would like to share pre-packed buffers of shared initializers at session * creation time. * * \param[out] out Newly created ::OrtPrepackedWeightsContainer. Must be freed with OrtApi::ReleasePrepackedWeightsContainer * * \snippet{doc} snippets.dox OrtStatus Return Value */ CreatePrepackedWeightsContainer: #type (out: **OrtPrepackedWeightsContainer) -> OrtStatusPtr #c_call; /** \brief Release OrtPrepackedWeightsContainer instance * * \note instance must not be released until the sessions using it are released */ ReleasePrepackedWeightsContainer: #type (input: *OrtPrepackedWeightsContainer) -> void #c_call; /** \brief Create session with prepacked weights container * * Same functionality offered by OrtApi::CreateSession except that a container that contains * pre-packed weights' buffers is written into/read from by the created session. * This is useful when used in conjunction with OrtApi::AddInitializer which injects * shared initializer info into sessions. Wherever possible, the pre-packed versions of these * shared initializers are cached in this container so that multiple sessions can just re-use * these instead of duplicating these in memory. * * \param[in] env OrtEnv instance instance * \param[in] model_path Null terminated string of the path (wchar on Windows, char otherwise) * \param[in] options * \param[in] prepacked_weights_container * \param[out] out Newly created ::OrtSession. Must be freed with OrtApi::ReleaseSession * * \snippet{doc} snippets.dox OrtStatus Return Value */ CreateSessionWithPrepackedWeightsContainer: #type (env: *OrtEnv, model_path: *u16, options: *OrtSessionOptions, prepacked_weights_container: *OrtPrepackedWeightsContainer, out: **OrtSession) -> OrtStatusPtr #c_call; /** \brief Create session from memory with prepacked weights container * * Same functionality offered by OrtApi::CreateSessionFromArray except that a container that contains * pre-packed weights' buffers is written into/read from by the created session. * This is useful when used in conjunction with OrtApi::AddInitializer which injects * shared initializer info into sessions. Wherever possible, the pre-packed versions of these * shared initializers are cached in this container so that multiple sessions can just re-use * these instead of duplicating these in memory. * * \param[in] env * \param[in] model_data Array of bytes holding the model * \param[in] model_data_length Number of bytes in `model_data_model` * \param[in] options * \param[in] prepacked_weights_container * \param[out] out Newly created ::OrtSession. Must be freed with OrtApi::ReleaseSession * * \snippet{doc} snippets.dox OrtStatus Return Value */ CreateSessionFromArrayWithPrepackedWeightsContainer: #type (env: *OrtEnv, model_data: *void, model_data_length: u64, options: *OrtSessionOptions, prepacked_weights_container: *OrtPrepackedWeightsContainer, out: **OrtSession) -> OrtStatusPtr #c_call; /** \brief Append TensorRT execution provider to the session options * * If TensorRT is not available (due to a non TensorRT enabled build), this function will return failure. * * This is slightly different from OrtApi::SessionOptionsAppendExecutionProvider_TensorRT, it takes an * ::OrtTensorRTProviderOptions which is publicly defined. This takes an opaque ::OrtTensorRTProviderOptionsV2 * which must be created with OrtApi::CreateTensorRTProviderOptions. * * For OrtApi::SessionOptionsAppendExecutionProvider_TensorRT, the user needs to instantiate ::OrtTensorRTProviderOptions * as well as allocate/release buffers for some members of ::OrtTensorRTProviderOptions. * Here, OrtApi::CreateTensorRTProviderOptions and Ortapi::ReleaseTensorRTProviderOptions will do the memory management for you. * * \param[in] options * \param[in] tensorrt_options * * \snippet{doc} snippets.dox OrtStatus Return Value */ SessionOptionsAppendExecutionProvider_TensorRT_V2: #type (options: *OrtSessionOptions, tensorrt_options: *OrtTensorRTProviderOptionsV2) -> OrtStatusPtr #c_call; /** \brief Create an OrtTensorRTProviderOptionsV2 * * \param[out] out Newly created ::OrtTensorRTProviderOptionsV2. Must be released with OrtApi::ReleaseTensorRTProviderOptions * * \snippet{doc} snippets.dox OrtStatus Return Value */ CreateTensorRTProviderOptions: #type (out: **OrtTensorRTProviderOptionsV2) -> OrtStatusPtr #c_call; /** \brief Set options in a TensorRT Execution Provider. * * Please refer to https://onnxruntime.ai/docs/execution-providers/TensorRT-ExecutionProvider.html#cc * to know the available keys and values. Key should be in null terminated string format of the member of ::OrtTensorRTProviderOptionsV2 * and value should be its related range. Recreates the options and only sets the supplied values. * * For example, key="trt_max_workspace_size" and value="2147483648" * * \param[in] tensorrt_options * \param[in] provider_options_keys Array of UTF-8 null-terminated string for provider options keys * \param[in] provider_options_values Array of UTF-8 null-terminated string for provider options values * \param[in] num_keys Number of elements in the `provider_option_keys` and `provider_options_values` arrays * * \snippet{doc} snippets.dox OrtStatus Return Value */ UpdateTensorRTProviderOptions: #type (tensorrt_options: *OrtTensorRTProviderOptionsV2, provider_options_keys: **u8, provider_options_values: **u8, num_keys: u64) -> OrtStatusPtr #c_call; /** \brief Get serialized TensorRT provider options string. * * For example, "trt_max_workspace_size=2147483648;trt_max_partition_iterations=10;trt_int8_enable=1;......" * * \param tensorrt_options - OrtTensorRTProviderOptionsV2 instance * \param allocator - a ptr to an instance of OrtAllocator obtained with OrtApi::CreateAllocator or OrtApi::GetAllocatorWithDefaultOptions * the specified allocator will be used to allocate continuous buffers for output strings and lengths. * \param ptr - is a UTF-8 null terminated string allocated using 'allocator'. The caller is responsible for using the same allocator to free it. * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetTensorRTProviderOptionsAsString: #type (tensorrt_options: *OrtTensorRTProviderOptionsV2, allocator: *OrtAllocator, ptr: **u8) -> OrtStatusPtr #c_call; /** \brief Release an ::OrtTensorRTProviderOptionsV2 * * \note This is an exception in the naming convention of other Release* functions, as the name of the method does not have the V2 suffix, but the type does */ ReleaseTensorRTProviderOptions: #type (input: *OrtTensorRTProviderOptionsV2) -> void #c_call; /** \brief Enable custom operators * * See onnxruntime-extensions: https://github.com/microsoft/onnxruntime-extensions.git * * \snippet{doc} snippets.dox OrtStatus Return Value */ EnableOrtCustomOps: #type (options: *OrtSessionOptions) -> OrtStatusPtr #c_call; /** \brief Register a custom allocator * * Enables sharing between multiple sessions that use the same env instance. * Returns an error if an allocator with the same ::OrtMemoryInfo is already registered. * * The behavior of this is exactly the same as OrtApi::CreateAndRegisterAllocator except * instead of ORT creating an allocator based on provided info, in this case * ORT uses the user-provided custom allocator. * See https://onnxruntime.ai/docs/get-started/with-c.html for details. * * \param[in] env * \param[in] allocator User provided allocator * * \snippet{doc} snippets.dox OrtStatus Return Value */ RegisterAllocator: #type (env: *OrtEnv, allocator: *OrtAllocator) -> OrtStatusPtr #c_call; /** \brief Unregister a custom allocator * * It is an error if you provide an ::OrtMemoryInfo not corresponding to any * registered allocators for sharing. * * \param[in] env * \param[in] mem_info * * \snippet{doc} snippets.dox OrtStatus Return Value */ UnregisterAllocator: #type (env: *OrtEnv, mem_info: *OrtMemoryInfo) -> OrtStatusPtr #c_call; /** \brief Sets *out to 1 iff an ::OrtValue is a SparseTensor, and 0 otherwise * * \param[in] value existing ::OrtValue * \param[out] out unless an error occurs, contains 1 iff the value contains an instance * of sparse tensor or 0 otherwise. * * \snippet{doc} snippets.dox OrtStatus Return Value */ IsSparseTensor: #type (value: *OrtValue, out: *s32) -> OrtStatusPtr #c_call; /** \brief Create an ::OrtValue with a sparse tensor that is empty. * * Use FillSparseTensor() functions to populate sparse tensor with non-zero values and * format specific indices data. * Use ReleaseValue to destroy the sparse tensor, this will also release the buffer inside the output value * if any was allocated. * \param[in,out] allocator allocator to use when performing an allocation. Allocation will be performed * by FillSparseTensor() APIs. The lifespan of the allocator instance must eclipse the lifespan * this sparse tensor instance as the same allocator will be used to free memory. * \param[in] dense_shape shape of the original dense tensor * \param[in] dense_shape_len number of shape dimensions being passed * \param[in] type must be one of TENSOR_ELEMENT_DATA_TYPE_xxxx * \param[out] out Should be freed by calling ReleaseValue * * \snippet{doc} snippets.dox OrtStatus Return Value */ CreateSparseTensorAsOrtValue: #type (allocator: *OrtAllocator, dense_shape: *s64, dense_shape_len: u64, type: ONNXTensorElementDataType, out: **OrtValue) -> OrtStatusPtr #c_call; /** * This fills populates an empty tensor that was created using OrtApi::CreateSparseTensorAsOrtValue. * This will allocate required memory and copy the supplied NNZ values and COO indices into that memory allocation. * Memory allocation is performed using the allocator that was specified with OrtApi::CreateSparseTensorAsOrtValue. * * \param[in,out] ort_value ::OrtValue to populate with data * \param[in] data_mem_info serves to identify the location of the data to be copied. If the allocator specified * at the creation time has memory info that is not the same as mem_info argument to this function a X-device copy will be performed. * String data is assumed to be on CPU and will only be copied into a CPU allocated buffer. * \param[in] values_shape pointer to values shape array * \param[in] values_shape_len length of the values_shape * \param[in] values pointer to an array of values. For strings, pass const char**. * \param[in] indices_data pointer to a location of COO indices * \param[in] indices_num number of COO indices * * \snippet{doc} snippets.dox OrtStatus Return Value */ FillSparseTensorCoo: #type (ort_value: *OrtValue, data_mem_info: *OrtMemoryInfo, values_shape: *s64, values_shape_len: u64, values: *void, indices_data: *s64, indices_num: u64) -> OrtStatusPtr #c_call; /** * This fills populates an empty tensor that was created using OrtApi::CreateSparseTensorAsOrtValue. * This will allocate required memory and copy the supplied NNZ values and CSR indices into that memory allocation. * Memory allocation is performed using the allocator that was specified with OrtApi::CreateSparseTensorAsOrtValue. * * \param[in,out] ort_value ::OrtValue to populate with data * \param[in] data_mem_info serves to identify the location of the data to be copied. If the allocator specified * at the creation time has memory info that is not the same as mem_info argument to this function a X-device copy will be performed. * String data is assumed to be on CPU and will only be copied into a CPU allocated buffer. * \param[in] values_shape pointer to values shape array * \param[in] values_shape_len length of the values_shape * \param[in] values - pointer to an array of values. For strings, pass const char**. * \param[in] inner_indices_data pointer to a location of CSR inner indices * \param[in] inner_indices_num number of CSR inner indices * \param[in] outer_indices_data pointer to a location of CSR outer indices * \param[in] outer_indices_num number of CSR outer indices * * \snippet{doc} snippets.dox OrtStatus Return Value */ FillSparseTensorCsr: #type (ort_value: *OrtValue, data_mem_info: *OrtMemoryInfo, values_shape: *s64, values_shape_len: u64, values: *void, inner_indices_data: *s64, inner_indices_num: u64, outer_indices_data: *s64, outer_indices_num: u64) -> OrtStatusPtr #c_call; /** * This fills populates an empty tensor that was created using OrtApi::CreateSparseTensorAsOrtValue. * This will allocate required memory and copy the supplied NNZ values and BlockSparse indices into that memory allocation. * Memory allocation is performed using the allocator that was specified with OrtApi::CreateSparseTensorAsOrtValue. * * \param[in,out] ort_value ::OrtValue to populate with data * \param[in] data_mem_info serves to identify the location of the data to be copied. If the allocator specified * at the creation time has memory info that is not the same as mem_info argument to this function a X-device copy will be performed. * String data is assumed to be on CPU and will only be copied into a CPU allocated buffer. * \param[in] values_shape * \param[in] values_shape_len * \param[in] values structure with values information * \param[in] indices_shape_data pointer to a location of indices shape * \param[in] indices_shape_len length of the block sparse indices shape * \param[in] indices_data pointer to a location of indices data. Shape will determine the length of the indices data. * * \snippet{doc} snippets.dox OrtStatus Return Value */ FillSparseTensorBlockSparse: #type (ort_value: *OrtValue, data_mem_info: *OrtMemoryInfo, values_shape: *s64, values_shape_len: u64, values: *void, indices_shape_data: *s64, indices_shape_len: u64, indices_data: *s32) -> OrtStatusPtr #c_call; /** * Create an ::OrtValue with a sparse tensor. This is the first step. * Next, use UseIndices() functions to supply sparse tensor with * format specific indices data and set its sparse format to a specific enum value. * This will not perform memory allocations. It will * use supplied user buffer which should outlive the created sparse tensor. * Use OrtApi::ReleaseValue to destroy the sparse tensor. It would not release the supplied values buffer. * This function can not be used to map strings from the user allocated memory. Strings must always be copied * and have UTF-8 encoding. Therefore, use OrtApi::CreateSparseTensorAsOrtValue above and then fill it with data * using appropriate Make*() function. * * \param[in] info memory info where sparse values reside. * \param[in,out] p_data pointer to a user allocated buffer with values. To create a full sparse tensor with no non-zero * values, pass nullptr * \param[in] dense_shape shape of the original dense tensor * \param[in] dense_shape_len number of shape dimensions being passed * \param[in] values_shape shape of the values data. To create a fully sparse tensor with no non-zero values, * pass {0} shape. * \param[in] values_shape_len number of values shape dimensions * \param[in] type must be one of TENSOR_ELEMENT_DATA_TYPE_xxxx * \param[out] out Should be freed by calling ReleaseValue * * \snippet{doc} snippets.dox OrtStatus Return Value */ CreateSparseTensorWithValuesAsOrtValue: #type (info: *OrtMemoryInfo, p_data: *void, dense_shape: *s64, dense_shape_len: u64, values_shape: *s64, values_shape_len: u64, type: ONNXTensorElementDataType, out: **OrtValue) -> OrtStatusPtr #c_call; /** * This assigns Coo format indices to the SparseTensor that was created by * OrtApi::CreateSparseTensorWithValuesAsOrtValue above. It also sets OrtSparseFormat to * ORT_SPARSE_COO. This will not allocate any additional memory for data. The life span of * indices_data buffer should eclipse the life span of this ::OrtValue. * * \param[in,out] ort_value ::OrtValue instance constructed with OrtApi::CreateSparseTensorWithValuesAsOrtValue * \param[in,out] indices_data pointer to a user pre-allocated buffer or nullptr for fully sparse tensors. * \param[in] indices_num number of COO indices. Should either be 0 for fully sparse tensors, be equal * to the number of nnz values specified to OrtApi::CreateSparseTensorWithValuesAsOrtValue for 1-D {nnz} indices or * be twice as number of nnz values for a 2-D indices {nnz, 2} * * \snippet{doc} snippets.dox OrtStatus Return Value */ UseCooIndices: #type (ort_value: *OrtValue, indices_data: *s64, indices_num: u64) -> OrtStatusPtr #c_call; /** * The assigns CSR format indices to the SparseTensor that was created by * OrtApi::CreateSparseTensorWithValuesAsOrtValue above. It also sets OrtSparseFormat to * ORT_SPARSE_CSRC. This will not allocate any additional memory for data. The life spans of * inner_data and outer_data buffers should eclipse the life span of this ::OrtValue. * * \param[in,out] ort_value ::OrtValue instance constructed with OrtApi::CreateSparseTensorWithValuesAsOrtValue * \param[in,out] inner_data pointer to a user pre-allocated buffer or nullptr for fully sparse tensors. * \param[in] inner_num number of inner CSR indices. Should either be 0 for fully sparse tensors or be equal * to the number of nnz values specified to OrtApi::CreateSparseTensorWithValuesAsOrtValue. * \param[in,out] outer_data pointer to user pre-allocated buffer or nullptr for fully sparse tensors. * \param[in] outer_num number of CSR outer indices. Should either be 0 for fully sparse tensors or * equal to rows + 1 of the dense shape. * * \snippet{doc} snippets.dox OrtStatus Return Value */ UseCsrIndices: #type (ort_value: *OrtValue, inner_data: *s64, inner_num: u64, outer_data: *s64, outer_num: u64) -> OrtStatusPtr #c_call; /** * The assigns BlockSparse format indices to the SparseTensor that was created by * OrtApi::CreateSparseTensorWithValuesAsOrtValue above. It also sets OrtSparseFormat to * ORT_SPARSE_BLOCK_SPARSE. This will not allocate any additional memory for data. The life span of * indices_data buffer must eclipse the lifespan of this ::OrtValue. * * \param[in,out] ort_value OrtValue instance constructed with OrtApi::CreateSparseTensorWithValuesAsOrtValue * \param[in] indices_shape pointer to indices shape. Use {0} for fully sparse tensors * \param[in] indices_shape_len length of the indices shape * \param[in,out] indices_data pointer to user pre-allocated buffer or nullptr for fully sparse tensors. * * \snippet{doc} snippets.dox OrtStatus Return Value */ UseBlockSparseIndices: #type (ort_value: *OrtValue, indices_shape: *s64, indices_shape_len: u64, indices_data: *s32) -> OrtStatusPtr #c_call; /** \brief Returns sparse tensor format enum iff a given ort value contains an instance of sparse tensor. * * \param[in] ort_value ::OrtValue that contains an instance of sparse tensor * \param[out] out pointer to out parameter * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetSparseTensorFormat: #type (ort_value: *OrtValue, out: *OrtSparseFormat) -> OrtStatusPtr #c_call; /** \brief Returns data type and shape of sparse tensor values (nnz) iff ::OrtValue contains a SparseTensor. * * \param[in] ort_value An ::OrtValue that contains a fully constructed sparse tensor * \param[out] out Must be freed by OrtApi::ReleaseTensorTypeAndShapeInfo * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetSparseTensorValuesTypeAndShape: #type (ort_value: *OrtValue, out: **OrtTensorTypeAndShapeInfo) -> OrtStatusPtr #c_call; /** \brief Returns numeric data for sparse tensor values (nnz). For string values use GetStringTensor*(). * * \param[in] ort_value an instance of ::OrtValue containing sparse tensor * \param[out] out returns a pointer to values data. Do not attempt to free this ptr. * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetSparseTensorValues: #type (ort_value: *OrtValue, out: **void) -> OrtStatusPtr #c_call; /** \brief Returns data type, shape for the type of indices specified by indices_format. * * \param[in] ort_value ::OrtValue containing sparse tensor. * \param[in] indices_format One of the indices formats. It is an error to request a format that the sparse * tensor does not contain. * \param[out] out an instance of ::OrtTensorTypeAndShapeInfo. Must be freed by OrtApi::ReleaseTensorTypeAndShapeInfo * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetSparseTensorIndicesTypeShape: #type (ort_value: *OrtValue, indices_format: OrtSparseIndicesFormat, out: **OrtTensorTypeAndShapeInfo) -> OrtStatusPtr #c_call; /** \brief Returns indices data for the type of the indices specified by indices_format * * \param[in] ort_value ::OrtValue containing sparse tensor. * \param[in] indices_format One of the indices formats. It is an error to request a format that the sparse tensor does not contain. * \param[out] num_indices Pointer to where the number of indices entries is returned * \param[out] indices Returned pointer to the indices data. Do not free the returned pointer as it refers to internal data owned by the ::OrtValue * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetSparseTensorIndices: #type (ort_value: *OrtValue, indices_format: OrtSparseIndicesFormat, num_indices: *u64, indices: **void) -> OrtStatusPtr #c_call; /** * \brief Sets out to 1 iff an optional type OrtValue has an element, 0 otherwise (OrtValue is None) * Use this API to find if the optional type OrtValue is None or not. * If the optional type OrtValue is not None, use the OrtValue just like any other OrtValue. * For example, if you get an OrtValue that corresponds to Optional(tensor) and * if HasValue() returns true, use it as tensor and so on. * \param[in] value Input OrtValue. * \param[out] out indicating if the input OrtValue contains data (1) or if it is a None (0) * * \snippet{doc} snippets.dox OrtStatus Return Value */ HasValue: #type (value: *OrtValue, out: *s32) -> OrtStatusPtr #c_call; /** \brief Used for custom operators, gets the GPU compute stream to use to launch the custom a GPU kernel * \see ::OrtCustomOp * \param[in] context OrtKernelContext instance * \param[out] out Returns pointer to a GPU compute stream that can be used to launch the custom GPU kernel. * If retrieving the GPU compute stream is not relevant (GPU not enabled in the build, kernel partitioned to * some other EP), then a nullptr is returned as the output param. * Do not free or mutate the returned pointer as it refers to internal data owned by the underlying session. * Only use it for custom kernel launching. * * \snippet{doc} snippets.dox OrtStatus Return Value */ KernelContext_GetGPUComputeStream: #type (_context: *OrtKernelContext, out: **void) -> OrtStatusPtr #c_call; /// @} /// \name GetTensorMemoryInfo /// @{ /** \brief Returns a pointer to the ::OrtMemoryInfo of a Tensor * \param[in] value ::OrtValue containing tensor. * \param[out] mem_info ::OrtMemoryInfo of the tensor. Do NOT free the returned pointer. It is valid for the lifetime of the ::OrtValue * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetTensorMemoryInfo: #type (value: *OrtValue, mem_info: **OrtMemoryInfo) -> OrtStatusPtr #c_call; /// @} /// \name GetExecutionProviderApi /// @{ /** \brief Get a pointer to the requested version of the Execution Provider specific * API extensions to the OrtApi * \param[in] provider_name The name of the execution provider name. Currently only the following * values are supported: "DML". * \param[in] version Must be ::ORT_API_VERSION. * \param[out] provider_api A void pointer containing a reference to the execution provider versioned api structure. * For example, the provider_api pointer can be cast to the OrtDmlApi* when the provider_name is "DML". * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetExecutionProviderApi: #type (provider_name: *u8, version: u32, provider_api: **void) -> OrtStatusPtr #c_call; /// \name SessionOptions /// @{ /** \brief Set custom thread creation function * * \param[in] options Session options * \param[in] ort_custom_create_thread_fn Custom thread creation function * * \snippet{doc} snippets.dox OrtStatus Return Value */ SessionOptionsSetCustomCreateThreadFn: #type (options: *OrtSessionOptions, ort_custom_create_thread_fn: OrtCustomCreateThreadFn) -> OrtStatusPtr #c_call; /** \brief Set creation options for custom thread * * \param[in] options Session options * \param[in] ort_custom_thread_creation_options Custom thread creation options (can be nullptr) * * \snippet{doc} snippets.dox OrtStatus Return Value */ SessionOptionsSetCustomThreadCreationOptions: #type (options: *OrtSessionOptions, ort_custom_thread_creation_options: *void) -> OrtStatusPtr #c_call; /** \brief Set custom thread join function * * \param[in] options Session options * \param[in] ort_custom_join_thread_fn Custom join thread function, must not be nullptr when ort_custom_create_thread_fn is set * * \snippet{doc} snippets.dox OrtStatus Return Value */ SessionOptionsSetCustomJoinThreadFn: #type (options: *OrtSessionOptions, ort_custom_join_thread_fn: OrtCustomJoinThreadFn) -> OrtStatusPtr #c_call; /// \name OrtThreadingOptions /// @{ /** \brief Set custom thread creation function for global thread pools * * \param[inout] tp_options * \param[in] ort_custom_create_thread_fn Custom thread creation function * * \snippet{doc} snippets.dox OrtStatus Return Value */ SetGlobalCustomCreateThreadFn: #type (tp_options: *OrtThreadingOptions, ort_custom_create_thread_fn: OrtCustomCreateThreadFn) -> OrtStatusPtr #c_call; /** \brief Set custom thread creation options for global thread pools * * \param[inout] tp_options * \param[in] ort_custom_thread_creation_options Custom thread creation options (can be nullptr) * * \snippet{doc} snippets.dox OrtStatus Return Value */ SetGlobalCustomThreadCreationOptions: #type (tp_options: *OrtThreadingOptions, ort_custom_thread_creation_options: *void) -> OrtStatusPtr #c_call; /** \brief Set custom thread join function for global thread pools * * \param[inout] tp_options * \param[in] ort_custom_join_thread_fn Custom thread join function, must not be nullptr when global ort_custom_create_thread_fn is set * * \snippet{doc} snippets.dox OrtStatus Return Value */ SetGlobalCustomJoinThreadFn: #type (tp_options: *OrtThreadingOptions, ort_custom_join_thread_fn: OrtCustomJoinThreadFn) -> OrtStatusPtr #c_call; /** \brief Synchronize bound inputs. The call may be necessary for some providers, such as cuda, * in case the system that allocated bound memory operated on a different stream. However, the * operation is provider specific and could be a no-op. * * \param[inout] binding_ptr * * \snippet{doc} snippets.dox OrtStatus Return Value */ SynchronizeBoundInputs: #type (binding_ptr: *OrtIoBinding) -> OrtStatusPtr #c_call; /** \brief Synchronize bound outputs. The call may be necessary for some providers, such as cuda, * in case the system that allocated bound memory operated on a different stream. However, the * operation is provider specific and could be a no-op. * * \param[inout] binding_ptr * * \snippet{doc} snippets.dox OrtStatus Return Value */ SynchronizeBoundOutputs: #type (binding_ptr: *OrtIoBinding) -> OrtStatusPtr #c_call; /** \brief Append CUDA execution provider to the session options * * If CUDA is not available (due to a non CUDA enabled build), this function will return failure. * * This is slightly different from OrtApi::SessionOptionsAppendExecutionProvider_CUDA, it takes an * ::OrtCUDAProviderOptions which is publicly defined. This takes an opaque ::OrtCUDAProviderOptionsV2 * which must be created with OrtApi::CreateCUDAProviderOptions. * * For OrtApi::SessionOptionsAppendExecutionProvider_CUDA, the user needs to instantiate ::OrtCUDAProviderOptions * as well as allocate/release buffers for some members of ::OrtCUDAProviderOptions. * Here, OrtApi::CreateCUDAProviderOptions and Ortapi::ReleaseCUDAProviderOptions will do the memory management for you. * * \param[in] options * \param[in] cuda_options * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.11. */ SessionOptionsAppendExecutionProvider_CUDA_V2: #type (options: *OrtSessionOptions, cuda_options: *OrtCUDAProviderOptionsV2) -> OrtStatusPtr #c_call; /** \brief Create an OrtCUDAProviderOptionsV2 * * \param[out] out Newly created ::OrtCUDAProviderOptionsV2. Must be released with OrtApi::ReleaseCudaProviderOptions * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.11. */ CreateCUDAProviderOptions: #type (out: **OrtCUDAProviderOptionsV2) -> OrtStatusPtr #c_call; /** \brief Set options in a CUDA Execution Provider. * * Please refer to https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#configuration-options * to know the available keys and values. Key should be in null terminated string format of the member of ::OrtCUDAProviderOptionsV2 * and value should be its related range. Recreates the options and only sets the supplied values. * * For example, key="device_id" and value="0" * * \param[in] cuda_options * \param[in] provider_options_keys Array of UTF-8 null-terminated string for provider options keys * \param[in] provider_options_values Array of UTF-8 null-terminated string for provider options values * \param[in] num_keys Number of elements in the `provider_option_keys` and `provider_options_values` arrays * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.11. */ UpdateCUDAProviderOptions: #type (cuda_options: *OrtCUDAProviderOptionsV2, provider_options_keys: **u8, provider_options_values: **u8, num_keys: u64) -> OrtStatusPtr #c_call; /** * Get serialized CUDA provider options string. * * For example, "device_id=0;arena_extend_strategy=0;......" * * \param cuda_options - OrtCUDAProviderOptionsV2 instance * \param allocator - a ptr to an instance of OrtAllocator obtained with CreateAllocator() or GetAllocatorWithDefaultOptions() * the specified allocator will be used to allocate continuous buffers for output strings and lengths. * \param ptr - is a UTF-8 null terminated string allocated using 'allocator'. The caller is responsible for using the same allocator to free it. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.11. */ GetCUDAProviderOptionsAsString: #type (cuda_options: *OrtCUDAProviderOptionsV2, allocator: *OrtAllocator, ptr: **u8) -> OrtStatusPtr #c_call; /** \brief Release an ::OrtCUDAProviderOptionsV2 * * \note This is an exception in the naming convention of other Release* functions, as the name of the method does not have the V2 suffix, but the type does * * \since Version 1.11. */ ReleaseCUDAProviderOptions: #type (input: *OrtCUDAProviderOptionsV2) -> void #c_call; /** \brief Append MIGraphX provider to session options * * If MIGraphX is not available (due to a non MIGraphX enabled build, or if MIGraphX is not installed on the system), this function will return failure. * * \param[in] options * \param[in] migraphx_options * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.11. */ SessionOptionsAppendExecutionProvider_MIGraphX: #type (options: *OrtSessionOptions, migraphx_options: *OrtMIGraphXProviderOptions) -> OrtStatusPtr #c_call; /** \brief Replace initialized Tensors with external data with the data provided in initializers. * * The function will find the initialized TensorProtos with external data in the graph with the provided names and * replace them with the provided tensors. The API verifies that the TensorProto being replaced * has an external data reference and has the same name, dimensions and data type as its replacement. The replacement * will occur before any of the optimizations take place. The data will be copied into the graph * since TensorProto can't refer to the user provided buffers. * * Once the model has been loaded, the OrtValue(s) added to SessionOptions instance will be removed * from the internal SessionOptions copy to save memory, the user provided buffers can then be deallocated * and the SessionOptions instance that refers to them can be destroyed. * * \param[in] options * \param[in] initializer_names Array of null terminated UTF-8 encoded strings of the initializers names. * \param[in] initializers Array of ::OrtValue type * \param[in] num_initializers Number of elements in the initializer_names and initializers * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.12. */ AddExternalInitializers: #type (options: *OrtSessionOptions, initializer_names: **u8, initializers: **OrtValue, num_initializers: u64) -> OrtStatusPtr #c_call; /** \brief: Create attribute of onnxruntime operator * * \param[in] name Name of the attribute * \param[in] data Data content of the attribute * \param[in] len Number of bytes stored in data for ORT_OP_ATTR_STRING. Number of elements if data represents an array (e.g., ORT_OP_ATTR_INTS). Otherwise, set to 1. * \param[in] type Data type * \param[out] op_attr Attribute that has been created, which must be released by OrtApi::ReleaseOpAttr * * \since Version 1.12. */ CreateOpAttr: #type (name: *u8, data: *void, len: s32, type: OrtOpAttrType, op_attr: **OrtOpAttr) -> OrtStatusPtr #c_call; /* \brief: Release op attribute * * \param[in] opAttr Attribute created by OrtApi::CreateOpAttr * * \since Version 1.12. */ ReleaseOpAttr: #type (input: *OrtOpAttr) -> void #c_call; /** \brief: Create onnxruntime native operator * * \param[in] info Kernel info * \param[in] op_name Operator name * \param[in] domain Operator domain * \param[in] version Operator opset version * \param[in] type_constraint_names Name of the type constraints, such as "T" or "T1" * \param[in] type_constraint_values Type of each constraints * \param[in] type_constraint_count Number of constraints * \param[in] attr_values Attributes used to initialize the operator * \param[in] attr_count Number of the attributes * \param[in] input_count Number of inputs * \param[in] output_count Number of outputs * \param[out] ort_op Operator that has been created * * \since Version 1.12. */ CreateOp: #type (info: *OrtKernelInfo, op_name: *u8, domain: *u8, version: s32, type_constraint_names: **u8, type_constraint_values: *ONNXTensorElementDataType, type_constraint_count: s32, attr_values: **OrtOpAttr, attr_count: s32, input_count: s32, output_count: s32, ort_op: **OrtOp) -> OrtStatusPtr #c_call; /** \brief: Invoke the operator created by OrtApi::CreateOp * The inputs must follow the order as specified in onnx specification * * \param[in] context Kernel context * \param[in] ort_op Operator that has been created * \param[in] input_values Array of inputs * \param[in] input_count Number of inputs * \param[in] output_values Array of outputs * \param[in] output_count Number of outputs * * \since Version 1.12. */ InvokeOp: #type (_context: *OrtKernelContext, ort_op: *OrtOp, input_values: **OrtValue, input_count: s32, output_values: **OrtValue, output_count: s32) -> OrtStatusPtr #c_call; /* \brief: Release an onnxruntime operator * * \param[in] Op Operator created by OrtApi::CreateOp * * \since Version 1.12. */ ReleaseOp: #type (input: *OrtOp) -> void #c_call; /** \brief: Append execution provider to the session options. * \param[in] options * \param[in] provider_name - provider to add. * \param[in] provider_options_keys - keys to configure the provider options * \param[in] provider_options_values - values to configure the provider options * \param[in] num_keys - number of keys passed in * * Currently supported provider names: * QNNExecutionProvider (or QNN) * OpenVINOExecutionProvider (or OpenVINO) * XnnpackExecutionProvider (or XNNPACK) * WebNNExecutionProvider (or WEBNN) * WebGpuExecutionProvider (or WebGPU) * AzureExecutionProvider (or AZURE) * JsExecutionProvider (or JS) * VitisAIExecutionProvider (or VitisAI) * CoreMLExecutionProvider (or CoreML) * * Note: If an execution provider has a dedicated SessionOptionsAppendExecutionProvider_ function * that should be used to add it. * * QNN supported keys: * "backend_type": Type of QNN backend. Specifies a backend path that is the associated QNN backend library file * name. E.g., given backend type "htp", on Windows, the backend path would be "QnnHtp.dll", and on other * platforms, it would be "libQnnHtp.so". Mutually exclusive with "backend_path". * Available options: * -# "cpu" * -# "gpu" * -# "htp": Default. * -# "saver" * -# "ir" * "backend_path": File path to QNN backend library. Mutually exclusive with "backend_type". * "profiling_level": QNN profiling level. * Available options: * -# "off": Default. * -# "basic" * -# "detailed" * "profiling_file_path": QNN profiling file path if ETW not enabled. * "rpc_control_latency": QNN RPC control latency. * "vtcm_mb": QNN VTCM size in MB. default to 0(not set). * "htp_performance_mode": QNN performance mode. * Available options: * -# "burst" * -# "balanced" * -# "default": Default. * -# "high_performance" * -# "high_power_saver" * -# "low_balanced" * -# "extreme_power_saver" * -# "low_power_saver" * -# "power_saver" * -# "sustained_high_performance" * "dump_qnn_ir_dlc": Use the QnnIr backend library to write .dlc files for each subgraph dispatched to QNN. When * enabled, inference results will be incorrect. Use only for debugging. * -# "0": Default: disabled * -# "1": enabled * "dump_qnn_ir_dlc_dir": Set the directory into which QnnIr will be configured to write QNN graphs as .dlc files. * Default is current working directory. * "qnn_ir_backend_path": File path to the QnnIr backend library. If "dump_qnn_ir_dlc" is enabled, use this path * instead of looking for the Ir backend in the standard location. * "qnn_saver_path": File path to the QNN Saver backend library. If specified, QNN Saver will be enabled and will * dump QNN API calls to disk for replay/debugging. QNN Saver produces incorrect model inference results and * may alter model/EP partitioning. Use only for debugging. * "qnn_context_priority": QNN context priority. * Available options: * -# "low" * -# "normal": Default. * -# "normal_high" * -# "high" * "htp_graph_finalization_optimization_mode": Set the optimization mode for graph finalization on the HTP backend. * Available options: * -# "0": Default. * -# "1": Faster preparation time, less optimal graph. * -# "2": Longer preparation time, more optimal graph. * -# "3": Longest preparation time, most likely even more optimal graph. See QNN SDK documentation for specific * details. * "soc_model": The SoC model number. Refer to the QNN SDK documentation for valid values. * Defaults to "0" (unknown). * "htp_arch": The minimum HTP architecture the driver will use to select compatible QNN operators. * Available options: * -# "0": Default (none). * -# "68" * -# "69" * -# "73" * -# "75" * -# "81" * "device_id": The ID of the device to use when setting 'htp_arch'. Defaults to "0" (for single device). * "enable_htp_fp16_precision": Used for float32 model for HTP backend. * Enable the float32 model to be inferenced with fp16 precision. Otherwise, it will be fp32 precision. * -# "0": With fp32 precision. * -# "1": Default. With fp16 precision. * "offload_graph_io_quantization": Offload graph input quantization and graph output dequantization to another * execution provider (typically CPU EP). * -# "0": Disabled. QNN EP will handle quantization and dequantization of graph I/O. * -# "1": Enabled. This is the default value. * "enable_htp_spill_fill_buffer": Enable HTP spill fill buffer setting. The flag is used while generating context * binary. * -# "0": Default. Disabled. * -# "1": Enabled. * "enable_htp_shared_memory_allocator": Enable the QNN HTP shared memory allocator. Requires libcdsprpc.so/dll to * be available. * -# "0": Default. Disabled. * -# "1": Enabled. * "dump_json_qnn_graph": Set to "1" to dump QNN graphs generated by QNN EP as JSON files. Each graph partition * assigned to QNN EP is dumped to a separate file. * "json_qnn_graph_dir": Directory in which to dump QNN JSON graphs. If not specified, QNN graphs are dumped in the * program's current working directory. Ignored if "dump_json_qnn_graph" is not set. * "op_packages": QNN UDO op_package for QNN EP, allowed format: *   "::[:],::[:]", *   where op_type is the name of the operation, op_package_path is the path to the op package shared library, * interface is the symbol name to register the op life cycle functions, and target is the backend type. For more * details, refer to: https://docs.qualcomm.com/bundle/publicresource/topics/80-63442-50/op_packages.html * [Advanced] "skip_qnn_version_check": Set to "1" to allow a different version of QNN to be used than what was compiled * into ONNX Runtime. Differences in operator support, accuracy, performance, and QNN's ABI may lead to crashes, inaccurate * results, and poor performance. Use with caution and test thoroughly. * * XNNPACK supported keys: * "intra_op_num_threads": number of thread-pool size to use for XNNPACK execution provider. * default value is 0, which means to use the session thread-pool size. * * \since Version 1.12. */ SessionOptionsAppendExecutionProvider: #type (options: *OrtSessionOptions, provider_name: *u8, provider_options_keys: **u8, provider_options_values: **u8, num_keys: u64) -> OrtStatusPtr #c_call; /* \brief: Get a copy of kernel info * * \param[in] info Kernel info * \param[out] info_copy Copy of kernel info * * \since Version 1.12. */ CopyKernelInfo: #type (info: *OrtKernelInfo, info_copy: **OrtKernelInfo) -> OrtStatusPtr #c_call; /* \brief: Release kernel info * * \param[in] KernelInfo A copy of kernel info returned by CopyKernelInfo * * \since Version 1.12. */ ReleaseKernelInfo: #type (input: *OrtKernelInfo) -> void #c_call; /// \name Ort Training /// @{ /** \brief Gets the Training C Api struct * * Call this function to access the ::OrtTrainingApi structure that holds pointers to functions that enable * training with onnxruntime. * \note A NULL pointer will be returned and no error message will be printed if the training api * is not supported with this build. A NULL pointer will be returned and an error message will be * printed if the provided version is unsupported, for example when using a runtime older than the * version created with this header file. * * \param[in] version Must be ::ORT_API_VERSION * \return The ::OrtTrainingApi struct for the version requested. * * \since Version 1.13 */ GetTrainingApi: #type (version: u32) -> *OrtTrainingApi #c_call; /** \brief Append CANN provider to session options * * If CANN is not available (due to a non CANN enabled build, or if CANN is not installed on the system), this function will return failure. * * \param[in] options * \param[in] cann_options * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.13. */ SessionOptionsAppendExecutionProvider_CANN: #type (options: *OrtSessionOptions, cann_options: *OrtCANNProviderOptions) -> OrtStatusPtr #c_call; /** \brief Create an OrtCANNProviderOptions * * \param[out] out created ::OrtCANNProviderOptions. Must be released with OrtApi::ReleaseCANNProviderOptions * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.13. */ CreateCANNProviderOptions: #type (out: **OrtCANNProviderOptions) -> OrtStatusPtr #c_call; /** \brief Set options in a CANN Execution Provider. * * \param[in] cann_options * \param[in] provider_options_keys Array of UTF-8 null-terminated string for provider options keys * \param[in] provider_options_values Array of UTF-8 null-terminated string for provider options values * \param[in] num_keys Number of elements in the `provider_option_keys` and `provider_options_values` arrays * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.13. */ UpdateCANNProviderOptions: #type (cann_options: *OrtCANNProviderOptions, provider_options_keys: **u8, provider_options_values: **u8, num_keys: u64) -> OrtStatusPtr #c_call; /** \brief Get serialized CANN provider options string. * * \param[in] cann_options OrtCANNProviderOptions instance * \param[in] allocator a ptr to an instance of OrtAllocator obtained with CreateAllocator() * or GetAllocatorWithDefaultOptions(), the specified allocator will be used to allocate * continuous buffers for output strings and lengths. * \param[out] ptr is a UTF-8 null terminated string allocated using 'allocator'. * The caller is responsible for using the same allocator to free it. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.13. */ GetCANNProviderOptionsAsString: #type (cann_options: *OrtCANNProviderOptions, allocator: *OrtAllocator, ptr: **u8) -> OrtStatusPtr #c_call; /** \brief Release an OrtCANNProviderOptions * * \param[in] input The pointer of OrtCANNProviderOptions which will been deleted * * \since Version 1.13. */ ReleaseCANNProviderOptions: #type (input: *OrtCANNProviderOptions) -> void #c_call; /* \brief Get OrtDevice type from MemoryInfo * * \since Version 1.14 */ MemoryInfoGetDeviceType: #type (ptr: *OrtMemoryInfo, out: *OrtMemoryInfoDeviceType) -> void #c_call; /* \brief Update the OrtEnv instance with custom log severity level * * \param[in] ort_env The OrtEnv instance being used * \param[in] log_severity_level The log severity level. * * \since Version 1.14. */ UpdateEnvWithCustomLogLevel: #type (ort_env: *OrtEnv, log_severity_level: OrtLoggingLevel) -> OrtStatusPtr #c_call; /* \brief Set affinities for intra op threads * * Affinity string follows format: * logical_processor_id,logical_processor_id;logical_processor_id,logical_processor_id * Semicolon isolates configurations among threads, while comma split processors where ith thread expected to attach to. * e.g. 1,2,3;4,5 * specifies affinities for two threads, with the 1st thread attach to the 1st, 2nd, and 3rd processor, and 2nd thread to the 4th and 5th. * To ease the configuration, an "interval" is also allowed: * e.g. 1-8;8-16;17-24 * orders that the 1st thread runs on first eight processors, 2nd thread runs on next eight processors, and so forth. * Note: * 1. Once set, the number of thread affinities must equal to intra_op_num_threads - 1, * ort does not set affinity on the main thread which is started and managed by the calling app; * 2. For windows, ort will infer the group id from a logical processor id, for example, assuming there are two groups with each has 64 logical processors, * an id of 64 will be inferred as the last processor of the 1st group, while 65 will be interpreted as the 1st processor of the second group. * Hence 64-65 is an invalid configuration, because a windows thread cannot be attached to processors across group boundary. * * \since Version 1.14 */ SetGlobalIntraOpThreadAffinity: #type (tp_options: *OrtThreadingOptions, affinity_string: *u8) -> OrtStatusPtr #c_call; /** \brief Register custom ops from a shared library. * * Loads a shared library (.dll on windows, .so on linux, etc) named 'library_name' and looks for this entry point: * OrtStatus* RegisterCustomOps(OrtSessionOptions * options, const OrtApiBase* api); * It then passes in the provided session options to this function along with the api base. * * The handle to the loaded library is automatically released by ORT when the last OrtSession that references the * library handle is released. If no OrtSession is created, then the library handle is released when the provided * OrtSessionOptions is released. * * \param[in] options The session options. * \param[in] library_name The name of the shared library to load and register. Refer to OS-specific dynamic library * loading utilities (e.g., LoadLibraryEx on Windows or dlopen on Linux/MacOS) for information * on the format of library names and search paths. * * \snippet{doc} snippets.dox OrtStatus Return Value * \since Version 1.14 */ RegisterCustomOpsLibrary_V2: #type (options: *OrtSessionOptions, library_name: *u16) -> OrtStatusPtr #c_call; /** \brief Register custom ops by calling a RegisterCustomOpsFn function. * * Searches for registration_func_name and if found calls it. * * The library containing the function must either be linked against or previously loaded by the executable. * * If you want ONNX Runtime to load the library and manage its lifetime, use RegisterCustomOpsLibrary_V2. * * RegisterCustomOpsUsingFunction can be used in scenarios where it may not be possible for ONNX Runtime to load * the library from a path. e.g. mobile platforms where the library must be linked into the app. * * The registration function must have the signature of RegisterCustomOpsFn: * OrtStatus* (*fn)(OrtSessionOptions* options, const OrtApiBase* api); * * See https://onnxruntime.ai/docs/reference/operators/add-custom-op.html for details on how the registration * function should be implemented. * * \param[in] options OrtSessionOptions that is passed through as the first argument in the call to the * registration function. * \param[in] registration_func_name Name of registration function to use. * * \snippet{doc} snippets.dox OrtStatus Return Value * \since Version 1.14 */ RegisterCustomOpsUsingFunction: #type (options: *OrtSessionOptions, registration_func_name: *u8) -> OrtStatusPtr #c_call; /** \brief Get the number of inputs from ::OrtKernelInfo. * * Used in the CreateKernel callback of an OrtCustomOp to query the number of inputs * during kernel/session creation. * * \param[in] info Instance of ::OrtKernelInfo. * \param[out] out Pointer to variable assigned with the result on success. * * \snippet{doc} snippets.dox OrtStatus Return Value * \since Version 1.14 */ KernelInfo_GetInputCount: #type (info: *OrtKernelInfo, out: *u64) -> OrtStatusPtr #c_call; /** \brief Get the number of outputs from ::OrtKernelInfo. * * Used in the CreateKernel callback of an OrtCustomOp to query the number of outputs * during kernel/session creation. * * \param[in] info Instance of ::OrtKernelInfo. * \param[out] out Pointer to variable assigned with the result on success. * * \snippet{doc} snippets.dox OrtStatus Return Value * \since Version 1.14 */ KernelInfo_GetOutputCount: #type (info: *OrtKernelInfo, out: *u64) -> OrtStatusPtr #c_call; /** \brief Get the name of a ::OrtKernelInfo's input. * * Used in the CreateKernel callback of an OrtCustomOp to query an input's name * during kernel/session creation. * * If `out` is nullptr, the value of `size` is set to the size of the name * string (including null-terminator), and a success status is returned. * * If the `size` parameter is greater than or equal to the name string's size and `out` is not nullptr, * the value of `size` is set to the true size of the string (including null-terminator), * the provided memory is filled with the string's contents, and a success status is returned. * * If the `size` parameter is less than the actual string's size and `out` * is not nullptr, the value of `size` is set to the true size of the string * and a failure status is returned. * * \param[in] info An instance of ::OrtKernelInfo. * \param[in] index The index of the input name to get. Returns a failure status if out-of-bounds. * \param[out] out Memory location into which to write the UTF-8 null-terminated string representing the input's name. * \param[in,out] size Pointer to the size of the `out` buffer. See above comments for details. * * \snippet{doc} snippets.dox OrtStatus Return Value * \since Version 1.14 */ KernelInfo_GetInputName: #type (info: *OrtKernelInfo, index: u64, out: *u8, size: *u64) -> OrtStatusPtr #c_call; /** \brief Get the name of a ::OrtKernelInfo's output. * * Used in the CreateKernel callback of an OrtCustomOp to query an output's name * during kernel/session creation. * * If `out` is nullptr, the value of `size` is set to the size of the name * string (including null-terminator), and a success status is returned. * * If the `size` parameter is greater than or equal to the name string's size and `out` is not nullptr, * the value of `size` is set to the true size of the string (including null-terminator), * the provided memory is filled with the string's contents, and a success status is returned. * * If the `size` parameter is less than the actual string's size and `out` * is not nullptr, the value of `size` is set to the true size of the string * and a failure status is returned. * * \param[in] info An instance of ::OrtKernelInfo. * \param[in] index The index of the output name to get. Returns a failure status if out-of-bounds. * \param[out] out Memory location into which to write the UTF-8 null-terminated string representing the output's * name. * \param[in,out] size Pointer to the size of the `out` buffer. See above comments for details. * * \snippet{doc} snippets.dox OrtStatus Return Value * \since Version 1.14 */ KernelInfo_GetOutputName: #type (info: *OrtKernelInfo, index: u64, out: *u8, size: *u64) -> OrtStatusPtr #c_call; /** \brief Get the type information for a ::OrtKernelInfo's input. * * Used in the CreateKernel callback of an OrtCustomOp to query the shape and type information * of an input during kernel/session creation. * * \param[in] info An instance of ::OrtKernelInfo. * \param[in] index Which input to get the type information for * \param[out] type_info Pointer set to the resulting ::OrtTypeInfo. Must be freed with OrtApi::ReleaseTypeInfo. * * \snippet{doc} snippets.dox OrtStatus Return Value * \since Version 1.14 */ KernelInfo_GetInputTypeInfo: #type (info: *OrtKernelInfo, index: u64, _type_info: **OrtTypeInfo) -> OrtStatusPtr #c_call; /** \brief Get the type information for a ::OrtKernelInfo's output. * * Used in the CreateKernel callback of an OrtCustomOp to query the shape and type information * of an output during kernel/session creation. * * \param[in] info An instance of ::OrtKernelInfo. * \param[in] index Which input to get the type information for * \param[out] type_info Pointer set to the resulting ::OrtTypeInfo. Must be freed with OrtApi::ReleaseTypeInfo. * * \snippet{doc} snippets.dox OrtStatus Return Value * \since Version 1.14 */ KernelInfo_GetOutputTypeInfo: #type (info: *OrtKernelInfo, index: u64, _type_info: **OrtTypeInfo) -> OrtStatusPtr #c_call; /** \brief Get a ::OrtValue tensor stored as an attribute in the graph node. * * Used in the CreateKernel callback of an OrtCustomOp to get a tensor attribute. * * \param[in] info ::OrtKernelInfo instance. * \param[in] name UTF-8 null-terminated string representing the attribute's name. * \param[in] allocator Allocator used to allocate the internal tensor state. * \param[out] out Returns newly created ::OrtValue. Must be freed with OrtApi::ReleaseValue, * which will also free internal tensor state allocated with the provided allocator. * * \snippet{doc} snippets.dox OrtStatus Return Value */ KernelInfoGetAttribute_tensor: #type (info: *OrtKernelInfo, name: *u8, allocator: *OrtAllocator, out: **OrtValue) -> OrtStatusPtr #c_call; /** \brief Checks if the given session configuration entry exists. * * The config_key formats are defined in onnxruntime_session_options_config_keys.h * * Can be used in a custom operator library to check for session configuration entries * that target one or more custom operators in the library. Example: The config entry * custom_op.myop.some_key targets a custom op named "myop". * * \param[in] options The ::OrtSessionOptions instance. * \param[in] config_key A null-terminated UTF-8 string representation of the configuration key. * \param[out] out Pointer set to 1 if the entry exists and 0 otherwise. * * \snippet{doc} snippets.dox OrtStatus Return Value * \since Version 1.14 */ HasSessionConfigEntry: #type (options: *OrtSessionOptions, config_key: *u8, out: *s32) -> OrtStatusPtr #c_call; /** \brief Get a session configuration value. * * Returns a failure status if the configuration key does not exist. * The config_key and the format of config_value are defined in onnxruntime_session_options_config_keys.h * * If `config_value` is nullptr, the value of `size` is set to the true size of the string * value (including null-terminator), and a success status is returned. * * If the `size` parameter is greater than or equal to the actual string value's size, * the value of `size` is set to the true size of the string value, the provided memory * is filled with the value's contents, and a success status is returned. * * If the `size` parameter is less than the actual string value's size and `config_value` * is not nullptr, the value of `size` is set to the true size of the string value * and a failure status is returned. * * Can be used in a custom operator library to get session configuration entries * that target one or more custom operators in the library. Example: The config entry * custom_op.myop.some_key targets a custom op named "myop". * * \param[in] options The session options. * \param[in] config_key A null-terminated UTF-8 string representation of the config key. * \param[in] config_value Pointer to memory where the null-terminated UTF-8 string value will be stored. * \param[in,out] size Pointer to the size of the `config_value` buffer. See above comments for details. * * \snippet{doc} snippets.dox OrtStatus Return Value * \since Version 1.14 */ GetSessionConfigEntry: #type (options: *OrtSessionOptions, config_key: *u8, config_value: *u8, size: *u64) -> OrtStatusPtr #c_call; /** \brief Append dnnl provider to session options * * If oneDNN is not available, this function will return failure. * * \param[in] options * \param[in] dnnl_options * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.15. */ SessionOptionsAppendExecutionProvider_Dnnl: #type (options: *OrtSessionOptions, dnnl_options: *OrtDnnlProviderOptions) -> OrtStatusPtr #c_call; /** \brief Create an OrtDnnlProviderOptions * * \param[out] out Newly created ::OrtDnnlProviderOptions. Must be released with OrtApi::ReleaseDnnlProviderOptions * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.15. */ CreateDnnlProviderOptions: #type (out: **OrtDnnlProviderOptions) -> OrtStatusPtr #c_call; /** \brief Set options in a oneDNN Execution Provider. * * Key should be in null terminated string format of the member of ::OrtDnnlProviderOptions * and value should be its related range. * * For example, key="use_arena" and value="1" * * \param[in] dnnl_options * \param[in] provider_options_keys Array of UTF-8 null-terminated string for provider options keys * \param[in] provider_options_values Array of UTF-8 null-terminated string for provider options values * \param[in] num_keys Number of elements in the `provider_option_keys` and `provider_options_values` arrays * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.15. */ UpdateDnnlProviderOptions: #type (dnnl_options: *OrtDnnlProviderOptions, provider_options_keys: **u8, provider_options_values: **u8, num_keys: u64) -> OrtStatusPtr #c_call; /** * Get serialized oneDNN provider options string. * * For example, "use_arena=1;......" * * \param dnnl_options - OrtDnnlProviderOptions instance * \param allocator - a ptr to an instance of OrtAllocator obtained with CreateAllocator() or GetAllocatorWithDefaultOptions() * the specified allocator will be used to allocate continuous buffers for output strings and lengths. * \param ptr - is a UTF-8 null terminated string allocated using 'allocator'. The caller is responsible for using the same allocator to free it. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.15. */ GetDnnlProviderOptionsAsString: #type (dnnl_options: *OrtDnnlProviderOptions, allocator: *OrtAllocator, ptr: **u8) -> OrtStatusPtr #c_call; /** \brief Release an ::OrtDnnlProviderOptions * * \since Version 1.15. */ ReleaseDnnlProviderOptions: #type (input: *OrtDnnlProviderOptions) -> void #c_call; /** \brief Get the graph node name from ::OrtKernelInfo. * * If `out` is nullptr, the value of `size` is set to the size of the name * string (including null-terminator), and a success status is returned. * * If the `size` parameter is greater than or equal to the name string's size and `out` is not nullptr, * the value of `size` is set to the true size of the string (including null-terminator), * the provided memory is filled with the string's contents, and a success status is returned. * * If the `size` parameter is less than the actual string's size and `out` * is not nullptr, the value of `size` is set to the true size of the string * and a failure status is returned. * * Can be used in a custom operator's CreateKernel callback to get the name of the operator's node name in the graph. * * \param[in] info An instance of ::OrtKernelInfo. * \param[out] out Memory location into which to write the UTF-8 null-terminated string representing the name. * \param[in,out] size Pointer to the size of the `out` buffer. See above comments for details. * * \snippet{doc} snippets.dox OrtStatus Return Value * \since Version 1.15 */ KernelInfo_GetNodeName: #type (info: *OrtKernelInfo, out: *u8, size: *u64) -> OrtStatusPtr #c_call; /** \brief Get the session logger from ::OrtKernelInfo. * * Used in the CreateKernel callback of an OrtCustomOp to get a logger that can be used to log * messages. * * \param[in] info An instance of ::OrtKernelInfo. * \param[out] logger Pointer set to the session's ::OrtLogger. Owned by ONNX Runtime, so do not free. * * \snippet{doc} snippets.dox OrtStatus Return Value * \since Version 1.15 */ KernelInfo_GetLogger: #type (info: *OrtKernelInfo, logger: **OrtLogger) -> OrtStatusPtr #c_call; /** \brief Get the runtime logger from ::OrtKernelContext. * * Used in the KernelCompute callback of an OrtCustomOp to get a logger that can be used to log * messages during inference. * * \param[in] context An instance of ::OrtKernelContext. * \param[out] logger Pointer set to the kernel context's ::OrtLogger. Owned by ONNX Runtime, so do not free. * * \snippet{doc} snippets.dox OrtStatus Return Value * \since Version 1.15 */ KernelContext_GetLogger: #type (_context: *OrtKernelContext, logger: **OrtLogger) -> OrtStatusPtr #c_call; /** \brief Logs a message at the given severity level using the provided ::OrtLogger. * * Only messages with a severity level equal or greater than the ::OrtLogger's logging severity level * are logged. Use OrtApi::Logger_GetLoggingSeverityLevel to get the ::OrtLogger's logging severity * level. * * Can be used in custom operators to log messages with the logger retrieved via OrtApi::KernelInfo_GetLogger. * * \param[in] logger The ::OrtLogger instance. * \param[in] log_severity_level The message's severity level. * \param[in] message The message to log. * \param[in] file_path The filepath of the file in which the message is logged. Usually the value of ORT_FILE. * \param[in] line_number The file line number in which the message is logged. Usually the value of __LINE__. * \param[in] func_name The name of the function in which the message is logged. Usually the value of __FUNCTION__. * * \snippet{doc} snippets.dox OrtStatus Return Value * \since Version 1.15 */ Logger_LogMessage: #type (logger: *OrtLogger, log_severity_level: OrtLoggingLevel, message: *u8, file_path: *u16, line_number: s32, func_name: *u8) -> OrtStatusPtr #c_call; /** \brief Get the logging severity level of the ::OrtLogger. * * Can be used in a custom operator to get the logging severity level of the ::OrtLogger associated with * the ::OrtKernelInfo. * * \param[in] logger The ::OrtLogger instance. * \param[out] out Pointer to variable assigned with the logging severity level on success. * * \snippet{doc} snippets.dox OrtStatus Return Value * \since Version 1.15 */ Logger_GetLoggingSeverityLevel: #type (logger: *OrtLogger, out: *OrtLoggingLevel) -> OrtStatusPtr #c_call; /** \brief Get a ::OrtValue tensor stored as a constant initializer in the graph node. * * Used in the CreateKernel callback of an OrtCustomOp to get a tensor value. * * \param[in] info ::OrtKernelInfo instance. * \param[in] index The node index. * \param[out] is_constant Is it a constant node input or not. * \param[out] out The OrtValue tensor value. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.15. */ KernelInfoGetConstantInput_tensor: #type (info: *OrtKernelInfo, index: u64, _is_constant: *s32, out: **OrtValue) -> OrtStatusPtr #c_call; /** \brief Get Optional Type information from an ::OrtTypeInfo * * This augments ::OrtTypeInfo to return an ::OrtOptionalTypeInfo when the type is optional. * The OrtOptionalTypeInfo also has a nested ::OrtTypeInfo that describes the type of the optional value. * ::OrtOptionalTypeInfo type can only appear within model metadata to describe inputs/outputs. * The actual OrtValues that are supplied in place of optional type inputs should contain * specific type that is described by ::OrtOptionalTypeInfo. * * So the picture: ::OrtTypeInfo -> ::OrtOptionalTypeInfo -> ::OrtTypeInfo (describes the type that can be supplied * in place of the optional type when creating the actual ::OrtValue). * * \param[in] type_info * \param[out] out A pointer to the ::OrtOptionalTypeInfo. Do not free this value, * it is owned by OrtTypeInfo instance. When the type_info does not represent * optional type, nullptr is returned in out. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.15. */ CastTypeInfoToOptionalTypeInfo: #type (_type_info: *OrtTypeInfo, out: **OrtOptionalTypeInfo) -> OrtStatusPtr #c_call; /** \brief Get OrtTypeInfo for the allowed contained type from an ::OrtOptionalTypeInfo. * * This augments ::OrtOptionalTypeInfo to return an ::OrtTypeInfo for the contained type. * The OrtOptionalTypeInfo has a nested ::OrtTypeInfo that describes the type of the optional value. * ::OrtOptionalTypeInfo type can only appear within model metadata to describe inputs/outputs. * The actual OrtValues that are supplied in place of optional type inputs should contain * specific type that is described by the returned ::OrtTypeInfo. * * \param[in] optional_type_info * \param[out] out A copy of ::OrtTypeInfo for what the optional value could be. * The user must free this value with ReleaseTypeInfo. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.15. */ GetOptionalContainedTypeInfo: #type (optional_type_info: *OrtOptionalTypeInfo, out: **OrtTypeInfo) -> OrtStatusPtr #c_call; /** \brief Set a single string in a string tensor * Do not zero terminate the string data. * * \param[in] value A string tensor * \param[in] index - flat index of the element * \param[in] length_in_bytes length of the buffer in utf-8 bytes (without the null terminator) * \param[inout] buffer - address of return value * * \snippet{doc} snippets.dox OrtStatus Return Value */ GetResizedStringTensorElementBuffer: #type (value: *OrtValue, index: u64, length_in_bytes: u64, buffer: **u8) -> OrtStatusPtr #c_call; /** \brief Get Allocator from KernelContext for a specific memoryInfo. Please use C API ReleaseAllocator to release out object * * \param[in] context OrtKernelContext instance * \param[in] mem_info OrtMemoryInfo instance * \param[out] out A pointer to OrtAllocator. Must be released with OrtApi::ReleaseAllocator. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.15. */ KernelContext_GetAllocator: #type (_context: *OrtKernelContext, mem_info: *OrtMemoryInfo, out: **OrtAllocator) -> OrtStatusPtr #c_call; /** \brief Returns a null terminated string of the build info including git info and cxx flags * * \return UTF-8 encoded version string. Do not deallocate the returned buffer. * * \since Version 1.15. */ GetBuildInfoString: #type () -> *u8 #c_call; /** \brief Create an OrtROCMProviderOptions * * \param[out] out Newly created ::OrtROCMProviderOptions. Must be released with OrtApi::ReleaseROCMProviderOptions * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.16. */ CreateROCMProviderOptions: #type (out: **OrtROCMProviderOptions) -> OrtStatusPtr #c_call; /** \brief Set options in a ROCm Execution Provider. * * Please refer to https://onnxruntime.ai/docs/execution-providers/ROCm-ExecutionProvider.html * to know the available keys and values. Key should be in null terminated string format of the member of * ::OrtROCMProviderOptions and value should be its related range. * * For example, key="device_id" and value="0" * * \param[in] rocm_options * \param[in] provider_options_keys Array of UTF-8 null-terminated string for provider options keys * \param[in] provider_options_values Array of UTF-8 null-terminated string for provider options values * \param[in] num_keys Number of elements in the `provider_option_keys` and `provider_options_values` arrays * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.16. */ UpdateROCMProviderOptions: #type (rocm_options: *OrtROCMProviderOptions, provider_options_keys: **u8, provider_options_values: **u8, num_keys: u64) -> OrtStatusPtr #c_call; /** * Get serialized ROCm provider options string. * * For example, "device_id=0;arena_extend_strategy=0;......" * * \param rocm_options - OrtROCMProviderOptions instance * \param allocator - a ptr to an instance of OrtAllocator obtained with CreateAllocator() or GetAllocatorWithDefaultOptions() * the specified allocator will be used to allocate continuous buffers for output strings and lengths. * \param ptr - is a UTF-8 null terminated string allocated using 'allocator'. The caller is responsible for using the same allocator to free it. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.16. */ GetROCMProviderOptionsAsString: #type (rocm_options: *OrtROCMProviderOptions, allocator: *OrtAllocator, ptr: **u8) -> OrtStatusPtr #c_call; /** \brief Release an ::OrtROCMProviderOptions * * \note This is an exception in the naming convention of other Release* functions, as the name of the method does not have the V2 suffix, but the type does * * \since Version 1.16. */ ReleaseROCMProviderOptions: #type (input: *OrtROCMProviderOptions) -> void #c_call; /** \brief Create an allocator with specific type and register it with the ::OrtEnv * This API enhance CreateAndRegisterAllocator that it can create an allocator with specific type, not just CPU allocator * Enables sharing the allocator between multiple sessions that use the same env instance. * Lifetime of the created allocator will be valid for the duration of the environment. * Returns an error if an allocator with the same ::OrtMemoryInfo is already registered. * \param[in] env OrtEnv instance * \param[in] provider_type ExecutionProvider type * \param[in] mem_info OrtMemoryInfo instance * \param[in] arena_cfg Arena configuration * \param[in] provider_options_keys key of the provider options map * \param[in] provider_options_values value of the provider options map * \param[in] num_keys Length of the provider options map */ CreateAndRegisterAllocatorV2: #type (env: *OrtEnv, provider_type: *u8, mem_info: *OrtMemoryInfo, arena_cfg: *OrtArenaCfg, provider_options_keys: **u8, provider_options_values: **u8, num_keys: u64) -> OrtStatusPtr #c_call; /** \brief Run the model asynchronously in a thread owned by intra op thread pool * * \param[in] session * \param[in] run_options If nullptr, will use a default ::OrtRunOptions * \param[in] input_names Array of null terminated UTF8 encoded strings of the input names * \param[in] input Array of ::OrtValue%s of the input values * \param[in] input_len Number of elements in the input_names and inputs arrays * \param[in] output_names Array of null terminated UTF8 encoded strings of the output names * \param[in] output_names_len Number of elements in the output_names and outputs array * \param[out] output OrtValue* array of size output_names_len. * On calling RunAsync, output[i] could either be a null or a pointer to a preallocated OrtValue. * Later, the output array will be passed to run_async_callback with all null(s) filled with valid * OrtValue pointer(s) allocated by onnxruntime. * NOTE: it is customer's duty to finally release the output array and each of its member, * regardless of whether the member (OrtValue*) is allocated by onnxruntime or preallocated by the customer. * \param[in] run_async_callback Callback function on model run completion * \param[in] user_data User data that pass back to run_async_callback */ RunAsync: #type (session: *OrtSession, run_options: *OrtRunOptions, input_names: **u8, input: **OrtValue, input_len: u64, output_names: **u8, output_names_len: u64, output: **OrtValue, run_async_callback: RunAsyncCallbackFn, user_data: *void) -> OrtStatusPtr #c_call; /** * Update TensorRT EP provider option where its data type is pointer, for example 'user_compute_stream'. * If the data type of the provider option can be represented by string please use UpdateTensorRTProviderOptions. * * Note: It's caller's responsibility to properly manage the lifetime of the instance pointed by this pointer. * * \param tensorrt_options - OrtTensorRTProviderOptionsV2 instance * \param key - Name of the provider option * \param value - A pointer to the instance that will be assigned to this provider option * * \since Version 1.16. */ UpdateTensorRTProviderOptionsWithValue: #type (tensorrt_options: *OrtTensorRTProviderOptionsV2, key: *u8, value: *void) -> OrtStatusPtr #c_call; /** * Get TensorRT EP provider option where its data type is pointer. * If the data type of the provider option can be represented by string please use GetTensorRTProviderOptionsAsString. * * \param tensorrt_options - OrtTensorRTProviderOptionsV2 instance * \param key - Name of the provider option * \param ptr - A pointer to the instance that is kept by the provider option * * \since Version 1.16. */ GetTensorRTProviderOptionsByName: #type (tensorrt_options: *OrtTensorRTProviderOptionsV2, key: *u8, ptr: **void) -> OrtStatusPtr #c_call; /** * Update CUDA EP provider option where its data type is pointer, for example 'user_compute_stream'. * If the data type of the provider option can be represented by string please use UpdateCUDAProviderOptions. * * Note: It's caller's responsibility to properly manage the lifetime of the instance pointed by this pointer. * * \param cuda_options - OrtCUDAProviderOptionsV2 instance * \param key - Name of the provider option * \param value - A pointer to the instance that will be assigned to this provider option * * \since Version 1.16. */ UpdateCUDAProviderOptionsWithValue: #type (cuda_options: *OrtCUDAProviderOptionsV2, key: *u8, value: *void) -> OrtStatusPtr #c_call; /** * Get CUDA EP provider option where its data type is pointer. * If the data type of the provider option can be represented by string please use GetCUDAProviderOptionsAsString. * * \param cuda_options - OrtCUDAProviderOptionsV2 instance * \param key - Name of the provider option * \param ptr - A pointer to the instance that is kept by the provider option * * \since Version 1.16. */ GetCUDAProviderOptionsByName: #type (cuda_options: *OrtCUDAProviderOptionsV2, key: *u8, ptr: **void) -> OrtStatusPtr #c_call; /** * Get a EP resource. * E.g. a cuda stream or a cublas handle * * \param context - Kernel context * \param resource_version - Version of the resource * \param resource_id - Type of resource * \param resource - A pointer to returned resource * * \since Version 1.16. */ KernelContext_GetResource: #type (_context: *OrtKernelContext, resource_version: s32, resource_id: s32, resource: **void) -> OrtStatusPtr #c_call; /** \brief Set user logging function * * By default the logger created by the CreateEnv* functions is used to create the session logger as well. * This function allows a user to override this default session logger with a logger of their own choosing. This way * the user doesn't have to create a separate environment with a custom logger. This addresses the problem when * the user already created an env but now wants to use a different logger for a specific session (for debugging or * other reasons). * * \param[in] options * \param[in] user_logging_function A pointer to a logging function. * \param[in] user_logging_param A pointer to arbitrary data passed as the ::OrtLoggingFunction `param` parameter to * `user_logging_function`. This parameter is optional. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.17. */ SetUserLoggingFunction: #type (options: *OrtSessionOptions, user_logging_function: OrtLoggingFunction, user_logging_param: *void) -> OrtStatusPtr #c_call; /** * Get number of input from OrtShapeInferContext * * \param[in] context * \param[out] out The number of inputs * * \since Version 1.17. */ ShapeInferContext_GetInputCount: #type (_context: *OrtShapeInferContext, out: *u64) -> OrtStatusPtr #c_call; /** * Get type and shape info of an input * * \param[in] context * \param[in] index The index of the input * \param[out] info Type shape info of the input * * \since Version 1.17. */ ShapeInferContext_GetInputTypeShape: #type (_context: *OrtShapeInferContext, index: u64, info: **OrtTensorTypeAndShapeInfo) -> OrtStatusPtr #c_call; /** * Get attribute from OrtShapeInferContext. Note that OrtShapeInferContext is a per-node context, one could only read attribute from current node. * * \param[in] context * \param[in] attr_name Name of the attribute * \param[out] attr Handle of the attribute fetched * * \since Version 1.17. */ ShapeInferContext_GetAttribute: #type (_context: *OrtShapeInferContext, attr_name: *u8, attr: **OrtOpAttr) -> OrtStatusPtr #c_call; /** * Set type and shape info of an output * * \param[in] context * \param[in] index The index of the output * \param[out] info Type shape info of the output * * \since Version 1.17. */ ShapeInferContext_SetOutputTypeShape: #type (_context: *OrtShapeInferContext, index: u64, info: *OrtTensorTypeAndShapeInfo) -> OrtStatusPtr #c_call; /** * Set symbolic shape to type shape info * * \param[in] info Type shape info * \param[in] dim_params Symbolic strings * \param[in] dim_params_length Number of strings * * \since Version 1.17. */ SetSymbolicDimensions: #type (info: *OrtTensorTypeAndShapeInfo, dim_params: **u8, dim_params_length: u64) -> OrtStatusPtr #c_call; /** * Read contents of an attribute to data * * \param[in] op_attr * \param[in] type Attribute type * \param[out] data Memory address to save raw content of the attribute * \param[in] len Number of bytes allowed to store in data * \param[out] out Number of bytes required to save the data when the call failed, or the real number of bytes saved to data on success * * \note Does not support reading graph attributes. Refer to Node_GetSubgraphs. * * \since Version 1.17. */ ReadOpAttr: #type (op_attr: *OrtOpAttr, type: OrtOpAttrType, data: *void, len: u64, out: *u64) -> OrtStatusPtr #c_call; /** \brief Set whether to use deterministic compute. * * Default is false. If set to true, this will enable deterministic compute for GPU kernels where possible. * Note that this most likely will have a performance cost. * * \param[in] options * \param[in] value * * \since Version 1.17. */ SetDeterministicCompute: #type (options: *OrtSessionOptions, value: bool) -> OrtStatusPtr #c_call; /** * Run fn in parallel * * \param[in] context * \param[in] fn Function accepting usr_data and an integer as iterator * \param[in] total The number of times fn is to be invoked * \param[in] num_batch Number of batches by which the "total" is to be divided in maximum. When zero, there is no limit * \param[in] usr_data User data to be passed back to fn * * \since Version 1.17. */ KernelContext_ParallelFor: #type (_context: *OrtKernelContext, fn: #type (unknown0: *void, unknown1: u64) -> void #c_call, total: u64, num_batch: u64, usr_data: *void) -> OrtStatusPtr #c_call; /** \brief Append OpenVINO execution provider to the session options * * If OpenVINO is not available (due to a non OpenVINO enabled build, or if OpenVINO is not installed on the system), this function will fail. * * \param[in] options * \param[in] provider_options_keys * \param[in] provider_options_values * \param[in] num_keys * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.17. */ SessionOptionsAppendExecutionProvider_OpenVINO_V2: #type (options: *OrtSessionOptions, provider_options_keys: **u8, provider_options_values: **u8, num_keys: u64) -> OrtStatusPtr #c_call; /** \brief Append VitisAI provider to session options * * If VitisAI is not available (due to a non VitisAI enabled build, or if VitisAI is not installed on the system), this function will return failure. * * \param[in] options * \param[in] provider_options_keys * \param[in] provider_options_values * \param[in] num_keys * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.18. */ SessionOptionsAppendExecutionProvider_VitisAI: #type (options: *OrtSessionOptions, provider_options_keys: **u8, provider_options_values: **u8, num_keys: u64) -> OrtStatusPtr #c_call; /** \brief Get scratch buffer from the corresponding allocator under the specific OrtMemoryInfo object. * NOTE: callers are responsible to release this scratch buffer from the corresponding allocator * \param[in] context OrtKernelContext instance * \param[in] mem_info OrtMemoryInfo instance * \param[in] count_or_bytes How many bytes is this scratch buffer * \param[out] out A pointer to the scratch buffer * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.18. */ KernelContext_GetScratchBuffer: #type (_context: *OrtKernelContext, mem_info: *OrtMemoryInfo, count_or_bytes: u64, out: **void) -> OrtStatusPtr #c_call; /** \brief Get allocator from KernelInfo for a specific memory type. Please use C API ReleaseAllocator to release out object * * \param[in] info OrtKernelInfo instance * \param[in] mem_type OrtMemType object * \param[out] out A pointer to OrtAllocator * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.18. */ KernelInfoGetAllocator: #type (info: *OrtKernelInfo, mem_type: OrtMemType, out: **OrtAllocator) -> OrtStatusPtr #c_call; /** \brief Replace initialized Tensors with external data with the provided files in memory * * The function will find the initialized TensorProtos with external data in the graph with the provided * external file names and the file content in memory. The API gets the external file name, offset, data length * from TensorProto, and locate the tensor data from the file in memory buffer. * It creates a Tensor to replace the existing Tensor in graph. The replacement * will occur before any of the optimizations take place. The data will be copied into the graph * since TensorProto can't refer to the user provided buffers. * * \param[in] options * \param[in] external_initializer_file_names Array of null terminated UTF-8 encoded strings of the file names * which holds the external initializers. * \param[in] external_initializer_file_buffer_array Array of pointers to the buffer of the file content. * The buffer can be freed after session creation. * \param[in] external_initializer_file_lengths Array of size_t to indicate the length of file content * \param[in] num_external_initializer_files Number of external files * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.18. */ AddExternalInitializersFromFilesInMemory: #type (options: *OrtSessionOptions, external_initializer_file_names: **u16, external_initializer_file_buffer_array: **u8, external_initializer_file_lengths: *u64, num_external_initializer_files: u64) -> OrtStatusPtr #c_call; /** \brief Create an OrtLoraAdapter * * The function attempts to locate file specified by adapter_file_path, read it and create an OrtLoraAdapter * instance. The adapter_file_path should be a valid path to a file that contains a valid Lora Adapter * format. The function attempts to validate the format at load time. The file will always be memory mapped, unless * the platform does not support memory mapping, in which case the file will be read into memory. * * \param[in] adapter_file_path adapter file path. * \param[in] allocator optional pointer to a non-CPU device allocator. If specified and a data transfer implementation * is available during adapter creation, the data is copied to the device before Run() is invoked. * Otherwise, the data stays on CPU and is copied to the device if required by the model at inference time. * \param[out] out A pointer to a newly created OrtLoraAdapter instance. Must be released with * OrtApi::ReleaseLoraAdapter. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.20. */ CreateLoraAdapter: #type (adapter_file_path: *u16, allocator: *OrtAllocator, out: **OrtLoraAdapter) -> OrtStatusPtr #c_call; /** \brief Create an OrtLoraAdapter * * The function copies the bytes from the array and creates an OrtLoraAdapter instance. * * * \param[in] bytes pointer to a valid Lora Adapter format buffer. * \param[in] num_bytes length of bytes buffer. * \param[in] allocator optional pointer to a non-CPU device allocator. If specified and a data transfer implementation * is available during adapter creation, the data is copied to the device before Run() is invoked. * Otherwise, the data stays on CPU and is copied to the device if required by the model at inference time. * \param[out] out A pointer to a newly created OrtLoraAdapter instance. Must be released with * OrtApi::ReleaseLoraAdapter. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.20. */ CreateLoraAdapterFromArray: #type (bytes: *void, num_bytes: u64, allocator: *OrtAllocator, out: **OrtLoraAdapter) -> OrtStatusPtr #c_call; /** \brief Release an ::OrtLoraAdapter obtained from OrtApi::CreateLoraAdapter */ ReleaseLoraAdapter: #type (input: *OrtLoraAdapter) -> void #c_call; /** \brief Add the Lora Adapter to the list of active adapters. * * The function adds the Lora Adapter to the list of active adapters. The Lora Adapter must be created with * OrtApi::CreateLoraAdapter or FromArray. The Lora Adapter will be used by the session to run the model. * The instance of the OrtRunOptions can then be used to customize the Run() calls. * More than one OrtLoraAdapter can be active at the same time. Lora Parameters that belong to different * Lora adapters that will be active at the same time must not overlap. * This setting does not affect RunWithBinding. * * \param[in] options OrtRunOptions instance * \param[in] adapter OrtLoraAdapter instance * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.20. */ RunOptionsAddActiveLoraAdapter: #type (options: *OrtRunOptions, adapter: *OrtLoraAdapter) -> OrtStatusPtr #c_call; /** \brief Set DynamicOptions for EPs (Execution Providers) * * Valid options can be found in `include\onnxruntime\core\session\onnxruntime_session_options_config_keys.h` * Look for `kOrtEpDynamicOptions` * * \param[in] sess OrtSession * \param[in] keys Array of null terminated UTF8 encoded strings of EP dynamic option keys * \param[in] values Array of null terminated UTF8 encoded string of EP dynamic option values * \param[in] kv_len Number of elements in the keys and values arrays * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.20. */ SetEpDynamicOptions: #type (sess: *OrtSession, keys: **u8, values: **u8, kv_len: u64) -> OrtStatusPtr #c_call; /** \brief Release an OrtValueInfo instance if it was not added to an OrtGraph. * \since Version 1.22. */ ReleaseValueInfo: #type (input: *OrtValueInfo) -> void #c_call; /** \brief Release an OrtNode if it was not added to an OrtGraph. * \since Version 1.22. */ ReleaseNode: #type (input: *OrtNode) -> void #c_call; /** \brief Release an OrtGraph. * \since Version 1.22. */ ReleaseGraph: #type (input: *OrtGraph) -> void #c_call; /** \brief Release an OrtModel. * \since Version 1.22. */ ReleaseModel: #type (input: *OrtModel) -> void #c_call; /** \brief Get the value name from an OrtValueInfo instance. * \param[in] value_info The OrtValueInfo instance. * \param[out] name The name of the OrtValueInfo * \snippet{doc} snippets.dox OrtStatus Return Value * \since Version 1.22. */ GetValueInfoName: #type (value_info: *OrtValueInfo, name: **u8) -> OrtStatusPtr #c_call; /** \brief Get the type information from an OrtValueInfo instance. * \param[in] value_info The OrtValueInfo instance. * \param[out] type_info The type info of the OrtValueInfo * \snippet{doc} snippets.dox OrtStatus Return Value * \since Version 1.22. */ GetValueInfoTypeInfo: #type (value_info: *OrtValueInfo, _type_info: **OrtTypeInfo) -> OrtStatusPtr #c_call; /** \brief Get the Model Editor API instance * * Get the Model Editor API instance to create a new model or augment an existing model. * * \return Model Editor API struct * * \since Version 1.22. */ GetModelEditorApi: #type () -> *OrtModelEditorApi #c_call; /** \brief Create an OrtValue for a Tensor that uses pre-existing memory. * * ORT will take ownership of the memory and free it using the provided deleter when no longer in use. * * \param[in] deleter OrtAllocator instance that will be used to free the memory. * Only the OrtAllocator:Info and OrtAllocator::Release functions are required. * The OrtMemoryInfo returned by OrtAllocator::Info must match the location of p_data. * \param[in] p_data Pointer to the memory that will be used by the Tensor. ORT will take ownership of the memory. * \param[in] p_data_len Length of the memory in bytes. * \param[in] shape Dimensions of the Tensor. All values should be > 0. * \param[in] shape_len Number of dimensions in the shape array. * \param[in] type Data type of the Tensor. * \param[out] out Newly created ::OrtValue. Must be freed with OrtApi::ReleaseValue * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ CreateTensorWithDataAndDeleterAsOrtValue: #type (deleter: *OrtAllocator, p_data: *void, p_data_len: u64, shape: *s64, shape_len: u64, type: ONNXTensorElementDataType, out: **OrtValue) -> OrtStatusPtr #c_call; /** \brief sets load cancellation flag to abort session loading process. * * \param[in] options instance that was passed to the session at creation time. * \param[in] cancel setting this to true after model loading process was initiated will * attempt to cancel the loading process. If cancellation is successful, CreateSession() * CreateSessionFromArray() or any other session creation API that take session options as an * argument will return an OrtStatus indicating that session loading was canceled at user request, * error code ORT_MODEL_LOAD_CANCELED. * The APIs above would not return any valid Session instance. This is the best case effort and the result * is not guaranteed. The session may have already been created and initialized * before the cancellation request was issued. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ SessionOptionsSetLoadCancellationFlag: #type (options: *OrtSessionOptions, cancel: bool) -> OrtStatusPtr #c_call; /** \brief Get the Compile API instance. * * Get the Compile API instance to compile ONNX models. Execution providers that support compilation fuse a subgraph * into an EPContext node that wraps a provider-specific binary representation of the subgraph. * For more details about the EPContext design, refer to: * \htmlonly * EPContext design document. * \endhtmlonly * * \return Compile API struct instance. * * \since Version 1.22. */ GetCompileApi: #type () -> *OrtCompileApi #c_call; /** \brief Create an OrtKeyValuePairs instance. * * \param[out] out A pointer to a newly created OrtKeyValuePairs instance. * * \note Must be released by calling ReleaseKeyValuePairs. * * \since Version 1.22. */ CreateKeyValuePairs: #type (out: **OrtKeyValuePairs) -> void #c_call; /** \brief Add a key-value pair to the OrtKeyValuePairs instance. * * If a pair with the same key already exists, it is overwritten. * * \param[in] kvps OrtKeyValuePairs instance. * \param[in] key Key to be added. * \param[in] value Value to be added. * * \note The `key` and `value` are copied internally. * * \since Version 1.22. */ AddKeyValuePair: #type (kvps: *OrtKeyValuePairs, key: *u8, value: *u8) -> void #c_call; /** \brief Get the value associated with a key in the OrtKeyValuePairs instance. * * \param[in] kvps OrtKeyValuePairs instance. * \param[in] key Key to be searched. * * \return The value associated with the key, or nullptr if the key does not exist. * * \since Version 1.22. */ GetKeyValue: #type (kvps: *OrtKeyValuePairs, key: *u8) -> *u8 #c_call; /** \brief Get all the key-value pairs from the OrtKeyValuePairs instance. * * \param[in] kvps OrtKeyValuePairs instance. * \param[out] keys Array of keys from `kvps`. * \param[out] values Array of values from `kvps`. * \param[out] num_entries Number of entries in `keys` and `values`. * * \since Version 1.22. */ GetKeyValuePairs: #type (kvps: *OrtKeyValuePairs, keys: ***u8, values: ***u8, num_entries: *u64) -> void #c_call; /** \brief Remove a key-value pair from the OrtKeyValuePairs instance. * * \param[in] kvps OrtKeyValuePairs instance. * \param[in] key Key to be removed. No error if not found. * * \since Version 1.22. */ RemoveKeyValuePair: #type (kvps: *OrtKeyValuePairs, key: *u8) -> void #c_call; /** \brief Release an OrtKeyValuePairs instance. * * \param[in] input OrtKeyValuePairs instance to be released. * * \since Version 1.22. */ ReleaseKeyValuePairs: #type (input: *OrtKeyValuePairs) -> void #c_call; /** \brief Register an execution provider library with ORT. * * The library must export 'CreateEpFactories' and 'ReleaseEpFactory' functions. * See OrtEpApi for more details. * * \param[in] env The OrtEnv instance to register the library in. * \param[in] registration_name The name to register the execution provider library under. * \param[in] path The path to the execution provider library. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ RegisterExecutionProviderLibrary: #type (env: *OrtEnv, registration_name: *u8, path: *u16) -> OrtStatusPtr #c_call; /** \brief Unregister an execution provider library with ORT. * * ORT will call ReleaseEpFactory for all factories created by the library, and unload the library. * * You MUST ensure there are no Session instances using execution providers created by the library * before calling this function. * * \param[in] env The OrtEnv instance to unregister the library from. * \param[in] registration_name The name the execution provider library was registered under. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ UnregisterExecutionProviderLibrary: #type (env: *OrtEnv, registration_name: *u8) -> OrtStatusPtr #c_call; /** \brief Get the list of available OrtEpDevice instances. * * Each OrtEpDevice instance contains details of the execution provider and the device it will use. * * \param[in] env The OrtEnv instance to query. * \param[out] ep_devices The OrtEpDevice instances that the execution provider will use. * \param[out] num_ep_devices The number of OrtEpDevice instances returned. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ GetEpDevices: #type (env: *OrtEnv, ep_devices: ***OrtEpDevice, num_ep_devices: *u64) -> OrtStatusPtr #c_call; /** \brief Append the execution provider that is responsible for the selected OrtEpDevice instances * to the session options. * * \param[in] session_options Session options to add execution provider to. * \param[in] env Environment that execution providers were registered with. * \param[in] ep_devices One or more OrtEpDevice instances to create an execution provider for. * Obtain from GetEpDevices. All OrtEpDevice instances must be from the same execution * provider. It is only necessary to provide multiple OrtEpDevices if you want to use the * same execution provider for multiple devices. * e.g. the EP is capable of running on GPU and NPU. * \param[in] num_ep_devices Number of OrtEpDevice instances. * \param[in] ep_option_keys Optional keys to configure the execution provider. * \param[in] ep_option_vals Optional values to configure the execution provider. * \param[in] num_ep_options Number of execution provide options to add. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ SessionOptionsAppendExecutionProvider_V2: #type (session_options: *OrtSessionOptions, env: *OrtEnv, ep_devices: **OrtEpDevice, num_ep_devices: u64, ep_option_keys: **u8, ep_option_vals: **u8, num_ep_options: u64) -> OrtStatusPtr #c_call; /** \brief Set the execution provider selection policy for the session. * * Allows users to specify a device selection policy for automatic execution provider (EP) selection. * If custom selection is required please use SessionOptionsSetEpSelectionPolicyDelegate instead. * * \param[in] session_options The OrtSessionOptions instance. * \param[in] policy The device selection policy to use (see OrtExecutionProviderDevicePolicy). * * \since Version 1.22 */ SessionOptionsSetEpSelectionPolicy: #type (session_options: *OrtSessionOptions, policy: OrtExecutionProviderDevicePolicy) -> OrtStatusPtr #c_call; /** \brief Set the execution provider selection policy delegate for the session. * * Allows users to provide a custom device selection policy for automatic execution provider (EP) selection. * * \param[in] session_options The OrtSessionOptions instance. * \param[in] delegate Delegate callback for custom selection. * \param[in] delegate_state Optional state that will be passed to the delegate callback. nullptr if not required. * * \since Version 1.22 */ SessionOptionsSetEpSelectionPolicyDelegate: #type (session_options: *OrtSessionOptions, delegate: EpSelectionDelegate, delegate_state: *void) -> OrtStatusPtr #c_call; /** \brief Get the hardware device type. * * \param[in] device The OrtHardwareDevice instance to query. * \return The hardware device type. * * \since Version 1.22. */ HardwareDevice_Type: #type (device: *OrtHardwareDevice) -> OrtHardwareDeviceType #c_call; /** \brief Get the hardware device's vendor identifier. * * \param[in] device The OrtHardwareDevice instance to query. * \return The hardware device vendor identifier. * * \since Version 1.22. */ HardwareDevice_VendorId: #type (device: *OrtHardwareDevice) -> u32 #c_call; /** \brief Get the hardware device's vendor name. * * \param[in] device The OrtHardwareDevice instance to query. * \return The hardware device's vendor name. * * \since Version 1.22. */ HardwareDevice_Vendor: #type (device: *OrtHardwareDevice) -> *u8 #c_call; /** \brief Get the hardware device's unique identifier. * * \param[in] device The OrtHardwareDevice instance to query. * \return The device id. * * \note This is not a unique identifier. It identifies the hardware type when combined with vendor id. * \since Version 1.22. */ HardwareDevice_DeviceId: #type (device: *OrtHardwareDevice) -> u32 #c_call; /** \brief Get hardware device metadata. * * \param[in] device The OrtHardwareDevice instance to query. * \return An OrtKeyValuePairs instance containing the metadata for the device. * Note: ORT owns the instance so the user must not call ReleaseKeyValuePairs with it. * * \since Version 1.22. */ HardwareDevice_Metadata: #type (device: *OrtHardwareDevice) -> *OrtKeyValuePairs #c_call; /** \brief Get the execution provider name. * * \param[in] ep_device The OrtEpDevice instance to query. * \return The execution provider name. * * \since Version 1.22. */ EpDevice_EpName: #type (ep_device: *OrtEpDevice) -> *u8 #c_call; /** \brief Get the execution provider's vendor name. * * \param[in] ep_device The OrtEpDevice instance to query. * \return The execution provider's vendor name. * * \since Version 1.22. */ EpDevice_EpVendor: #type (ep_device: *OrtEpDevice) -> *u8 #c_call; /** \brief Get the metadata for the OrtEpDevice. * * \param[in] ep_device The OrtEpDevice instance to query. * \return An OrtKeyValuePairs instance containing the metadata for the device. * * \since Version 1.22. */ EpDevice_EpMetadata: #type (ep_device: *OrtEpDevice) -> *OrtKeyValuePairs #c_call; /** \brief Get the execution provider options for the OrtEpDevice. * * \param[in] ep_device The OrtEpDevice instance to query. * \return An OrtKeyValuePairs instance containing the execution provider options for the device. * * \since Version 1.22. */ EpDevice_EpOptions: #type (ep_device: *OrtEpDevice) -> *OrtKeyValuePairs #c_call; /** \brief Get the OrtHardwareDevice instance for the OrtEpDevice. * * \param[in] ep_device The OrtEpDevice instance to query. * \return The OrtHardwareDevice instance for the device. * * \since Version 1.22. */ EpDevice_Device: #type (ep_device: *OrtEpDevice) -> *OrtHardwareDevice #c_call; /** \brief Get the OrtEpApi instance for implementing an execution provider. * * \since Version 1.22. */ GetEpApi: #type () -> *OrtEpApi #c_call; /** \brief Compute total size in bytes of the tensor data contained in an OrtValue. * * Returns the total number of bytes used to store the tensor data. For numeric tensors of a * type that occupies at least one byte per element, this is sizeof(element_type) * * total_element_count. For packed sub-byte types (e.g. int4/uint4, which store multiple * elements per byte) it is the actual packed storage size, which is smaller than * sizeof(element_type) * total_element_count. Use this value (not the element count) when * copying or bounds-checking the raw tensor buffer. OrtValues that are not tensors or that are * tensors that contain strings will cause an error to be returned. * * \param[in] ort_value OrtValue instance containing a tensor * \param[out] size The total size of the tensor data in bytes * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23 */ GetTensorSizeInBytes: #type (ort_value: *OrtValue, size: *u64) -> OrtStatusPtr #c_call; /** \brief Calls OrtAllocator::GetStats function * * Return a pointer to the OrtKeyValuePairs structure that contains the statistics of the allocator * and the user should call OrtApi::ReleaseKeyValuePairs. * * NOTE: If the allocator does not implement this function, the OrtKeyValuePairs instance will be empty. * * \param[in] ort_allocator The allocator to get stats from * \param[out] out A pointer to the OrtKeyValuePairs instance that contains the stats * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ AllocatorGetStats: #type (ort_allocator: *OrtAllocator, out: **OrtKeyValuePairs) -> OrtStatusPtr #c_call; /** \brief Create an ::OrtMemoryInfo * * \param[in] name Arbitrary name. * \param[in] device_type Device type. * \param[in] vendor_id PCI Vendor ID. Use 0 for a generic allocator (e.g. WebGPU). * \param[in] device_id Device ID if there are multiple devices of the same type. e.g. 2 GPU devices. * \param[in] mem_type Memory type. Use OrtDeviceMemoryType_DEFAULT for device memory, and * OrtDeviceMemoryType_HOST_ACCESSIBLE (if applicable) for memory used to transfer between the * device and the CPU. Use the device_type and device_id of the GPU/NPU that the memory is also * accessible to. * \param[in] alignment Alignment of the memory if required. Pass 0 for default alignment. * \param[in] allocator_type Allocator type. If OrtAllocatorType::OrtArenaAllocator, the ORT arena will be used. * Caveat: Support for OrtArenaAllocator is currently limited to usage of internal ORT * allocators via CreateAllocator/CreateAndRegisterAllocator/CreateAndRegisterAllocatorV2. * \param[out] out Newly created ::OrtMemoryInfo. Must be freed with OrtApi::ReleaseMemoryInfo * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23 */ CreateMemoryInfo_V2: #type (name: *u8, device_type: OrtMemoryInfoDeviceType, vendor_id: u32, device_id: s32, mem_type: OrtDeviceMemoryType, alignment: u64, allocator_type: OrtAllocatorType, out: **OrtMemoryInfo) -> OrtStatusPtr #c_call; /** \brief Get the device memory type from ::OrtMemoryInfo * * \param[in] ptr The OrtMemoryInfo instance to query. * \return The device memory type. * * \since Version 1.23 */ MemoryInfoGetDeviceMemType: #type (ptr: *OrtMemoryInfo) -> OrtDeviceMemoryType #c_call; /** \brief Get the vendor id from ::OrtMemoryInfo * * \param[in] ptr The OrtMemoryInfo instance to query. * \return The vendor id. * * \since Version 1.23 */ MemoryInfoGetVendorId: #type (ptr: *OrtMemoryInfo) -> u32 #c_call; /** \brief Get the OrtNode that produces the value represented by the given OrtValueInfo. * Optionally returns the associated output index. * * \param[in] value_info The OrtValueInfo instance. * \param[out] producer_node Output parameter set to the OrtNode that produces the OrtValueInfo. * \param[out] producer_output_index Optional output parameter set to the OrtNode instance's output index * that produces the value. Ignored if set to NULL. * \snippet{doc} snippets.dox OrtStatus Return Value * \since Version 1.23. */ ValueInfo_GetValueProducer: #type (value_info: *OrtValueInfo, producer_node: **OrtNode, producer_output_index: *u64) -> OrtStatusPtr #c_call; /** \brief Get the number of consumers of a value as a node input. * * Only nodes are considered "consumers" by this function. To check if an OrtValueInfo is a graph output, * call ValueInfo_IsGraphOutput(). * * A single OrtNode may use a single value for more than one input (e.g., Mul(x, x)), so the returned * `num_consumers` may be larger than the number of unique OrtNode instances that consume the value. * * \param[in] value_info The OrtValueInfo instance. * \param[out] num_consumers Output parameter set to the number of consumers of the value. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ ValueInfo_GetValueNumConsumers: #type (value_info: *OrtValueInfo, num_consumers: *u64) -> OrtStatusPtr #c_call; /** \brief Returns information (OrtNode and input index) for all consumer nodes that use the value as an input. * * Only nodes are considered "consumers" by this function. * * Caller provides 2 pre-allocated arrays that will be filled with the OrtNode and input index values. * Use ValueInfo_GetValueNumConsumers() to get the number of consumers of the value. * * An OrtNode instance may appear multiple times if it uses the given value more than once. * Example: For a node MulNode(x, x) that consumes the value 'x' twice, the following is returned: * - nodes: [MulNode, MulNode] * - input_indices: [0, 1] * * \param[in] value_info The OrtValueInfo instance. * \param[out] nodes Pre-allocated array of size `num_consumers` that is filled with OrtNode instances. * \param[out] input_indices Pre-allocated array of `num_consumers` elements that is filled * with input indices. Index is set to -1 for an "implicit" input to a consumer node * that contains a subgraph (e.g., If, Loop) with nodes that use the value internally. * \param[in] num_consumers The size of the `consumer_nodes` and `consumer_input_indices` arrays. * Typical usage sets this to the value of ValueInfo_GetValueNumConsumers(). * An error status is returned if `num_consumers` is less than the number of actual * consumers. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ ValueInfo_GetValueConsumers: #type (value_info: *OrtValueInfo, nodes: **OrtNode, input_indices: *s64, num_consumers: u64) -> OrtStatusPtr #c_call; /** \brief Get the underlying initializer value, as an OrtValue, from the given OrtValueInfo. * * Sets the output parameter to NULL if the given OrtValueInfo does not represent an initializer. * Does not return an error status in this case. * * Supports initializers defined in an outer scope (i.e., a parent graph). * * Supports initializers stored in an external file. For external initializers, ORT memory maps * the initializer data on the first call to this function. If caller needs custom memory mapping, * use ValueInfo_GetExternalInitializerInfo to get the location of the initializer data. * * \param[in] value_info The OrtValueInfo instance. * \param[out] initializer_value Output parameter set to the initializer value or NULL. Do not cache the OrtValue * as it is released when the owning OrtGraph is released. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ ValueInfo_GetInitializerValue: #type (value_info: *OrtValueInfo, initializer_value: **OrtValue) -> OrtStatusPtr #c_call; /** \brief Get information about an external initializer (e.g., filepath, file offset, byte size). * * Sets the output parameter `info` to NULL if the given OrtValueInfo does not represent an initializer * with external data. In this case, a NULL status (non-error) is returned. * * \param[in] value_info The OrtValueInfo instance. * \param[out] info Output parameter set to an OrtExternalInitializerInfo instance that can be used to query * file path, file offset, etc. ORT sets this to NULL if the OrtValueInfo does not represent * an external initializer. * Must release with ReleaseExternalInitializerInfo. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ ValueInfo_GetExternalInitializerInfo: #type (value_info: *OrtValueInfo, info: **OrtExternalInitializerInfo) -> OrtStatusPtr #c_call; /** \brief Returns a boolean indicating if the given value is a required graph input. * * For ONNX IR version < 4, all graph inputs without a matching initializer are required. * * For ONNX IR version >=4, a graph input with a matching initializer is an optional graph input * with the initializer serving as the default value. * * \param[in] value_info The OrtValueInfo instance representing the graph value. * \param[out] is_required_graph_input Output parameter set to true if the graph value is a required graph input. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ ValueInfo_IsRequiredGraphInput: #type (value_info: *OrtValueInfo, is_required_graph_input: *bool) -> OrtStatusPtr #c_call; /** \brief Returns a boolean indicating if the given value is an optional graph input. * * Optional graph inputs were introduced in ONNX IR version 4. For ONNX IR version >=4, a graph input with a * matching initializer is an optional graph input with the initializer serving as the default value. * The matching initializer is also known as a non-constant initializer. * * \param[in] value_info The OrtValueInfo instance representing the graph value. * \param[out] is_optional_graph_input Output parameter set to true if the graph value is an optional graph input. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ ValueInfo_IsOptionalGraphInput: #type (value_info: *OrtValueInfo, is_optional_graph_input: *bool) -> OrtStatusPtr #c_call; /** \brief Returns a boolean indicating if the given value is a graph output. * * \param[in] value_info The OrtValueInfo instance representing the graph value. * \param[out] is_graph_output Output parameter set to true if the graph value is a graph output. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ ValueInfo_IsGraphOutput: #type (value_info: *OrtValueInfo, is_graph_output: *bool) -> OrtStatusPtr #c_call; /** \brief Returns a boolean indicating if the given value is a constant initializer. * * For ONNX IR version < 4, all initializers are constant. * * For ONNX IR version >=4, an initializer that serves as the default value for a matching graph input is not a * constant initializer. * * \param[in] value_info The OrtValueInfo instance representing the graph value. * \param[out] is_constant_initializer Output parameter set to true if the graph value is a constant initializer. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ ValueInfo_IsConstantInitializer: #type (value_info: *OrtValueInfo, is_constant_initializer: *bool) -> OrtStatusPtr #c_call; /** \brief Returns a boolean indicating if the given value is defined in an outer scope. * * Certain operator types (e.g., If and Loop) contain nested subgraphs. This function enables * determining whether a value is defined in a parent node's graph. * * \param[in] value_info The OrtValueInfo instance representing the graph value. * \param[out] is_from_outer_scope Output parameter set to true if the value is defined in an outer * scope (i.e., a parent graph). * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ ValueInfo_IsFromOuterScope: #type (value_info: *OrtValueInfo, is_from_outer_scope: *bool) -> OrtStatusPtr #c_call; /** \brief Returns a graph's name. * * \param[in] graph The OrtGraph instance. * \param[out] graph_name Output parameter set to the graph's name. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Graph_GetName: #type (graph: *OrtGraph, graph_name: **u8) -> OrtStatusPtr #c_call; /** \brief Get the filepath to the model from which an OrtGraph is constructed. * * \note The model's filepath is empty if the filepath is unknown, such as when the model is loaded from bytes * via CreateSessionFromArray. * * \param[in] graph The OrtGraph instance. * \param[out] model_path Output parameter set to the model's null-terminated filepath. * Set to an empty path string if unknown. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Graph_GetModelPath: #type (graph: *OrtGraph, model_path: **u16) -> OrtStatusPtr #c_call; /** \brief Returns the ONNX IR version. * * \param[in] graph The OrtGraph instance. * \param[out] onnx_ir_version Output parameter set to the ONNX IR version. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Graph_GetOnnxIRVersion: #type (graph: *OrtGraph, onnx_ir_version: *s64) -> OrtStatusPtr #c_call; /** \brief Returns the number of operator sets that the graph's model uses. * * \note An operator set is uniquely identified by the (domain, opset_version) pair. All models must have at * least one entry that specifies which entry of the ONNX operator set is used. The ONNX domain is represented by * an empty string. * * \param[in] graph The OrtGraph instance. * \param[out] num_operator_sets Output parameter set to the number of operator sets that the graph's model uses. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Graph_GetNumOperatorSets: #type (graph: *OrtGraph, num_operator_sets: *u64) -> OrtStatusPtr #c_call; /** \brief Returns the operator sets that the graph's model uses. * * \note An operator set is uniquely identified by the (domain, opset_version) pair. All models must have at * least one entry that specifies which entry of the ONNX operator set is used. The ONNX domain is represented by * an empty string. * * \param[in] graph The OrtGraph instance. * \param[out] domains Pre-allocated array of `num_operator_sets` elements that is filled with * null-terminated domain names. * \param[out] opset_versions Pre-allocated array of `num_operator_sets` elements that is filled with * the opset version of the corresponding domain in the `domains` array. * \param[in] num_operator_sets The size of the `domains` and `opset_versions` arrays. * Typical usage sets this to the result of Graph_GetNumOperatorSets(). * An error status is returned if `num_operator_sets` is less than the actual number * of operator sets. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Graph_GetOperatorSets: #type (graph: *OrtGraph, domains: **u8, opset_versions: *s64, num_operator_sets: u64) -> OrtStatusPtr #c_call; /** \brief Returns the number of graph inputs. * * \note The count includes initializers that are included in the list of graph inputs. * * \param[in] graph The OrtGraph instance. * \param[out] num_inputs Output parameter set to the number of graph inputs. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Graph_GetNumInputs: #type (graph: *OrtGraph, num_inputs: *u64) -> OrtStatusPtr #c_call; /** \brief Returns the graph's inputs as OrtValueInfo instances. * * \note The result includes initializers that are included in the list of graph inputs. * * \param[in] graph The OrtGraph instance. * \param[out] inputs Pre-allocated array of `num_inputs` elements that is filled with the graph's inputs. * \param[in] num_inputs The size of the `inputs` array. * Typical usage sets this to the result of Graph_GetNumInputs(). An error status is * returned if `num_inputs` is less than the number of graph inputs. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Graph_GetInputs: #type (graph: *OrtGraph, inputs: **OrtValueInfo, num_inputs: u64) -> OrtStatusPtr #c_call; /** \brief Returns the number of graph outputs. * * \param[in] graph The OrtGraph instance. * \param[out] num_outputs Output parameter set to the number of graph outputs. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Graph_GetNumOutputs: #type (graph: *OrtGraph, num_outputs: *u64) -> OrtStatusPtr #c_call; /** \brief Returns the graph's outputs as OrtValueInfo instances. * * \param[in] graph The OrtGraph instance. * \param[out] outputs Pre-allocated array of `num_outputs` elements that is filled with the graph's outputs. * \param[in] num_outputs The size of the `outputs` array. * Typical usage sets this to the result of Graph_GetNumOutputs(). An error status is * returned if `num_outputs` is less than the number of graph outputs. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Graph_GetOutputs: #type (graph: *OrtGraph, outputs: **OrtValueInfo, num_outputs: u64) -> OrtStatusPtr #c_call; /** \brief Returns the number of graph initializers. * * Counts constant and non-constant initializers. * * \param[in] graph The OrtGraph instance. * \param[out] num_initializers Output parameter set to the number of graph initializers. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Graph_GetNumInitializers: #type (graph: *OrtGraph, num_initializers: *u64) -> OrtStatusPtr #c_call; /** \brief Returns the graph's initializers as OrtValueInfo instances. * * Includes constant and non-constant initializers. * * For ONNX IR version < 4, all initializers are constant. * * For ONNX IR version >= 4, an initializer with a name that matches a graph input is considered a * non-constant initializer. * * Call ValueInfo_GetInitializerValue to get the initializer's data. * * \param[in] graph The OrtGraph instance. * \param[out] initializers Pre-allocated array of `num_outputs` elements that is filled with the initializers. * \param[in] num_initializers The size of the `initializers` array. Typical usage sets this to the * result of Graph_GetNumInitializers(). An error status is returned if * `num_initializers` is less than the number of graph initializers. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Graph_GetInitializers: #type (graph: *OrtGraph, initializers: **OrtValueInfo, num_initializers: u64) -> OrtStatusPtr #c_call; /** \brief Returns the number of graph nodes. * * \param[in] graph The OrtGraph instance. * \param[out] num_nodes Output parameter set to the number of graph nodes. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Graph_GetNumNodes: #type (graph: *OrtGraph, num_nodes: *u64) -> OrtStatusPtr #c_call; /** \brief Returns the graph's nodes as OrtNode instances. * * The nodes are sorted using a stable topological ordering. Callers are responsible for maintaining their * own node ordering if a different order is required. * * \param[in] graph The OrtGraph instance. * \param[out] nodes Pre-allocated array of `num_nodes` elements that is filled with the graph's nodes. * \param[in] num_nodes The size of the `nodes` array. Typical usage sets this to the * result of Graph_GetNumNodes(). An error status is returned if * `num_nodes` is less than the number of graph nodes. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Graph_GetNodes: #type (graph: *OrtGraph, nodes: **OrtNode, num_nodes: u64) -> OrtStatusPtr #c_call; /** \brief Get the parent node for the given graph, if any exists. * * Certain operator types (e.g., If and Loop) contain nested subgraphs. This function enables * access to the parent node (e.g., the If and Loop node) from a nested subgraph. * * \param[in] graph The OrtGraph instance. * \param[out] node Output parameter that is set to the graph's parent node. * Set to NULL if a parent node does not exist (e.g., for a top-level graph). * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Graph_GetParentNode: #type (graph: *OrtGraph, node: **OrtNode) -> OrtStatusPtr #c_call; /** \brief Returns an OrtGraph that contains a subset of nodes in the source OrtGraph. * * \note The lifetime of "dst_graph" is tied to that of "src_graph", as they both internally reference * the same underlying graph. "dst_graph" preserves the input order of "src_graph", and * its output order corresponds to the outputs produced by the nodes in "nodes" with the given order. * * \param[in] src_graph The source OrtGraph instance. * \param[in] nodes A subset of the nodes/OrtNodes in 'graph'. * \param[in] num_nodes Number of nodes. * \param[out] dst_graph An OrtGraph created from a given set of nodes. Must be released by calling ReleaseGraph. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Graph_GetGraphView: #type (src_graph: *OrtGraph, nodes: **OrtNode, num_nodes: u64, dst_graph: **OrtGraph) -> OrtStatusPtr #c_call; /** \brief Returns a node's identifier. * * The node's identifier is only unique in the node's parent graph. Different nested subgraphs * (e.g., subgraphs contained by If and Loop nodes) may reuse identifiers. * * \param[in] node The OrtNode instance. * \param[out] node_id Output parameter set to the node's identifier. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Node_GetId: #type (node: *OrtNode, node_id: *u64) -> OrtStatusPtr #c_call; /** \brief Returns a node's name. Can be an empty string. * * \param[in] node The OrtNode instance. * \param[out] node_name Output parameter set to the node's name. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Node_GetName: #type (node: *OrtNode, node_name: **u8) -> OrtStatusPtr #c_call; /** \brief Returns a node's operator type (e.g., "Conv"). * * \param[in] node The OrtNode instance. * \param[out] operator_type Output parameter set to the name of the node's operator type. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Node_GetOperatorType: #type (node: *OrtNode, operator_type: **u8) -> OrtStatusPtr #c_call; /** \brief Returns a node's domain name. * * \param[in] node The OrtNode instance. * \param[out] domain_name Output parameter set to the node's domain name. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Node_GetDomain: #type (node: *OrtNode, domain_name: **u8) -> OrtStatusPtr #c_call; /** \brief Get the opset version in which the given node's operator type was first defined. * * \param[in] node The OrtNode instance. * \param[out] since_version The opset version in which the node's operator type was first defined. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Node_GetSinceVersion: #type (node: *OrtNode, since_version: *s32) -> OrtStatusPtr #c_call; /** \brief Returns the number of node inputs. * * \param[in] node The OrtNode instance. * \param[out] num_inputs Output parameter set to the number of node inputs. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Node_GetNumInputs: #type (node: *OrtNode, num_inputs: *u64) -> OrtStatusPtr #c_call; /** \brief Returns the node's inputs as OrtValueInfo instances. * * \param[in] node The OrtNode instance. * \param[out] inputs Pre-allocated array of `num_inputs` elements that is filled with the node's inputs. * \param[in] num_inputs The size of the `inputs` array. * Typical usage sets this to the result of Node_GetNumInputs(). An error status is * returned if `num_inputs` is less than the number of node inputs. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Node_GetInputs: #type (node: *OrtNode, inputs: **OrtValueInfo, num_inputs: u64) -> OrtStatusPtr #c_call; /** \brief Returns the number of node outputs. * * \param[in] node The OrtNode instance. * \param[out] num_outputs Output parameter set to the number of node outputs. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Node_GetNumOutputs: #type (node: *OrtNode, num_outputs: *u64) -> OrtStatusPtr #c_call; /** \brief Returns the node's outputs as OrtValueInfo instances. * * \param[in] node The OrtNode instance. * \param[out] outputs Pre-allocated array of `num_outputs` elements that is filled with the node's outputs. * \param[in] num_outputs The size of the `outputs` array. * Typical usage sets this to the result of Node_GetNumOutputs(). An error status is * returned if `num_outputs` is less than the number of node outputs. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Node_GetOutputs: #type (node: *OrtNode, outputs: **OrtValueInfo, num_outputs: u64) -> OrtStatusPtr #c_call; /** \brief Returns the number of node implicit inputs. * * Certain operator types (e.g., If and Loop) contain nested subgraphs. The internal nodes within the nested subgraphs * may use values from the outer scope. Those "outer scope" values are considered implicit inputs to the node that * contains the subgraphs (e.g., the If or Loop node). * * \param[in] node The OrtNode instance. * \param[out] num_implicit_inputs Output parameter set to the number of node implicit inputs. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Node_GetNumImplicitInputs: #type (node: *OrtNode, num_implicit_inputs: *u64) -> OrtStatusPtr #c_call; /** \brief Get the implicit inputs, as OrtValueInfo instances, that are used within the given node's subgraphs. * * \note Only certain operator types (e.g., If and Loop) contain nested subgraphs. * The internal nodes within the nested subgraphs may use values from the outer scope. Those "outer scope" values * are considered implicit inputs to the node that contains the subgraphs (e.g., the If or Loop node). * * \param[in] node The OrtNode instance. * \param[out] implicit_inputs Pre-allocated array of `num_implicit_inputs` elements that is filled the node's * implicit inputs. * \param[in] num_implicit_inputs The size of the `implicit_inputs` array. Typical usage sets this to the result * of Node_GetNumImplicitInputs(). An error status is returned if * `num_implicit_inputs` is less than the number of node implicit inputs. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Node_GetImplicitInputs: #type (node: *OrtNode, implicit_inputs: **OrtValueInfo, num_implicit_inputs: u64) -> OrtStatusPtr #c_call; /** \brief Returns the number of node attributes. * * \param[in] node The OrtNode instance. * \param[out] num_attributes Output parameter set to the number of node attributes. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Node_GetNumAttributes: #type (node: *OrtNode, num_attributes: *u64) -> OrtStatusPtr #c_call; /** \brief Returns a node's attributes as OrtOpAttr instances. * * \param[in] node The OrtNode instance. * \param[out] attributes Pre-allocated array of `num_attributes` elements that is filled with the node's attributes. * \param[in] num_attributes The size of the `num_attributes` array. * Typical usage sets this to the result of Node_GetNumAttributes(). An error status is * returned if `num_attributes` is less than the number of node attributes. * * \note ONNX Runtime automatically sets optional (unset) attributes to their default values if the default value * is a constant expression that does not depend on other tensor/model characteristics. Conv's 'kernel_shape' * attribute is an example of an optional attribute that does not have a constant default value. This function * does not provide any unset optional attributes without a constant default value. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Node_GetAttributes: #type (node: *OrtNode, attributes: **OrtOpAttr, num_attributes: u64) -> OrtStatusPtr #c_call; /** \brief Gets the OrtNode's attribute as OrtOpAttr by name. * * \param[in] node The OrtNode instance. * \param[in] attribute_name The name of the attribute * \param[out] attribute Output parameter set to the OrtOpAttr instance if an attribute by the given name exists. * For an unset optional attribute, `attribute` is set to NULL and a non-error status is * returned. For an invalid attribute name, `attribute` is set to NULL and an error status with * code ORT_NOT_FOUND is returned. * * \note ONNX Runtime automatically sets optional (unset) attributes to their default values if the default value * is a constant expression that does not depend on other tensor/model characteristics. Conv's 'kernel_shape' * attribute is an example of an optional attribute that does not have a constant default value. This function * does not provide any unset optional attributes without a constant default value. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Node_GetAttributeByName: #type (node: *OrtNode, attribute_name: *u8, attribute: **OrtOpAttr) -> OrtStatusPtr #c_call; /** \brief Get the OrtNode's 'TENSOR' attribute as an OrtValue. * * \param[in] attribute The OrtOpAttr instance. * \param[out] attr_tensor If successful, contains the 'TENSOR' attribute as a newly created OrtValue. Must be freed with OrtApi::ReleaseValue. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ OpAttr_GetTensorAttributeAsOrtValue: #type (attribute: *OrtOpAttr, attr_tensor: **OrtValue) -> OrtStatusPtr #c_call; /** \brief Get the attribute type as OrtOpAttrType from an OrtOpAttr. * * \param[in] attribute The OrtOpAttr instance. * \param[out] type Output the attribute type as OrtOpAttrType. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ OpAttr_GetType: #type (attribute: *OrtOpAttr, type: *OrtOpAttrType) -> OrtStatusPtr #c_call; /** \brief Get the attribute name from an OrtOpAttr. * * \param[in] attribute The OrtOpAttr instance. * \param[out] name Output parameter set to the attribute's name. The name is a null-terminated string. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ OpAttr_GetName: #type (attribute: *OrtOpAttr, name: **u8) -> OrtStatusPtr #c_call; /** \brief Returns the number of subgraphs contained by the given node. * * \note Only certain operator types (e.g., If and Loop) contain nested subgraphs. * * \param[in] node The OrtNode instance. * \param[out] num_subgraphs Output parameter set to the number of node subgraphs. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Node_GetNumSubgraphs: #type (node: *OrtNode, num_subgraphs: *u64) -> OrtStatusPtr #c_call; /** \brief Get the subgraphs, as OrtGraph instances, contained by the given node. * * \note Only certain operator types (e.g., If and Loop) contain nested subgraphs. ONNX nodes store subgraphs in * their attributes, however, this function must be used to obtain subgraphs from an OrtNode. * * \param[in] node The OrtNode instance. * \param[out] subgraphs Pre-allocated array of `num_subgraphs` elements that is filled with the node's subgraphs. * \param[in] num_subgraphs The size of the `num_subgraphs` array. * Typical usage sets this to the result of Node_GetNumSubgraphs(). An error status is * returned if `num_subgraphs` is less than the number of node subgraphs. * \param[out] attribute_names Optional pre-allocated array of `num_subgraphs` elements that is filled with the * attribute names that correspond to the subgraphs. Ignored if set to NULL. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Node_GetSubgraphs: #type (node: *OrtNode, subgraphs: **OrtGraph, num_subgraphs: u64, attribute_names: **u8) -> OrtStatusPtr #c_call; /** \brief Get the node's parent OrtGraph instance. * * Can return NULL if the OrtNode was created without an owning graph. * In another case, this API may also return NULL if `node` is obtained by calling Graph_GetParentNode() * on an OrtGraph that is a subgraph of a control-flow op, and the parent graph has not been created yet, * for example during ORT's GetCapability() when processing the innermost subgraph. * * \param[in] node The OrtNode instance. * \param[out] graph Output parameter set to the node's OrtGraph. Can be set to NULL * if the node is not currently contained by a graph. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Node_GetGraph: #type (node: *OrtNode, graph: **OrtGraph) -> OrtStatusPtr #c_call; /** \brief Returns the execution provider name that this node is assigned to run on. * Returns NULL if the node has not been assigned to any execution provider yet. * For plugin execution providers, the name is the one returned by OrtEp::GetName. * * \param[in] node The OrtNode instance. * \param[out] out Output execution provider type and can be NULL if node has not been assigned. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Node_GetEpName: #type (node: *OrtNode, out: **u8) -> OrtStatusPtr #c_call; /** \brief Release an OrtExternalInitializerInfo instance. * * \param[in] input OrtExternalInitializerInfo instance to be released. * * \since Version 1.23. */ ReleaseExternalInitializerInfo: #type (input: *OrtExternalInitializerInfo) -> void #c_call; /** \brief Get the relative path to the file that stores the initializer's data. * * \note The path is relative to the filesystem directory where the ONNX model was stored. * Caller can use Graph_GetModelPath to get the model's full path and construct the absolute path to the * external initializer file if necessary. * * \param[in] info The OrtExternalInitializerInfo instance. * \return The relative path to the file that stores the initializer's data. Do NOT free this pointer. * * \since Version 1.23. */ ExternalInitializerInfo_GetFilePath: #type (info: *OrtExternalInitializerInfo) -> *u16 #c_call; /** \brief Get the byte offset within the file where the initializer's data is stored. * * \param[in] info The OrtExternalInitializerInfo instance. * \return The byte offset where the initializer's data is stored within the file. * * \since Version 1.23. */ ExternalInitializerInfo_GetFileOffset: #type (info: *OrtExternalInitializerInfo) -> s64 #c_call; /** \brief Get the size in bytes of the initializer's data within the file. * * \param[in] info The OrtExternalInitializerInfo instance. * \return The size in bytes of the initializer's data within the file. * * \since Version 1.23. */ ExternalInitializerInfo_GetByteSize: #type (info: *OrtExternalInitializerInfo) -> u64 #c_call; /** \brief Get a run configuration entry. * * If a run configuration entry with key `config_key` doesn't exist, `config_value` will be set to NULL. * * `config_key`s are defined in onnxruntime_run_options_config_keys.h. * * \param[in] options The OrtRunOptions instance. * \param[in] config_key The configuration entry key. A null-terminated string. * \return The configuration entry value. Either a null-terminated string if the entry was found. nullptr otherwise. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23 */ GetRunConfigEntry: #type (options: *OrtRunOptions, config_key: *u8) -> *u8 #c_call; /** \brief Get the OrtMemoryInfo for the device. * * \param[in] ep_device The OrtEpDevice instance to query. * \param[in] memory_type The memory type to return. * \return A pointer to the OrtMemoryInfo for the device. This may be nullptr if not set. * If memory_type is OrtDeviceMemoryType_DEFAULT and nullptr is returned the EP uses CPU memory. * * \since Version 1.23 */ EpDevice_MemoryInfo: #type (ep_device: *OrtEpDevice, memory_type: OrtDeviceMemoryType) -> *OrtMemoryInfo #c_call; /** \brief Create/replace a shared allocator for the OrtEpDevice in the OrtEnv. * * OrtEpDevice maps to the EP factory, and the factory provides the allocator implementation. * * Both OrtDeviceMemoryType_DEFAULT and OrtDeviceMemoryType_HOST_ACCESSIBLE are optional for an EP to provide. * It is EP implementation dependent as to what is available. * * If a shared allocator already exists for the OrtEpDevice and OrtDeviceMemoryType, it is replaced. This allows * changing the shared allocator configuration from the default. e.g. adding an arena. * * \param[in] env The OrtEnv instance to create the shared allocator in. * \param[in] ep_device The OrtEpDevice instance to create the shared allocator for. * \param[in] mem_type The memory type to use for the shared allocator. * \param[in] allocator_type The type of allocator to create. Only OrtDeviceAllocator is valid currently. * \param[in] allocator_options Optional key-value pairs to configure the allocator. If arena based, see * include/onnxruntime/core/framework/allocator.h for the keys and values that can be * used. * \param[out] allocator A pointer to the created shared allocator. Owned by the OrtEnv instance. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23 */ CreateSharedAllocator: #type (env: *OrtEnv, ep_device: *OrtEpDevice, mem_type: OrtDeviceMemoryType, allocator_type: OrtAllocatorType, allocator_options: *OrtKeyValuePairs, allocator: **OrtAllocator) -> OrtStatusPtr #c_call; /** \brief Get a shared allocator from the OrtEnv. * * By default there is a shared allocator created for all OrtEpDevice instances, so if you get the OrtMemoryInfo * from the OrtEpDevice using EpDevice_MemoryInfo a shared allocator is guaranteed to exist. * * This will also match and return custom allocators added with RegisterAllocator. * * It is not an error to not find a matching allocator. * * \param[in] env The OrtEnv instance to get the shared allocator from. * \param[in] mem_info The OrtMemoryInfo instance to get the shared allocator for. * \param[out] allocator A pointer to the shared allocator, or nullptr if no shared allocator exists for * the given memory info. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23 */ GetSharedAllocator: #type (env: *OrtEnv, mem_info: *OrtMemoryInfo, allocator: **OrtAllocator) -> OrtStatusPtr #c_call; /** \brief Release a shared allocator from the OrtEnv for the OrtEpDevice and memory type. * * This will release the shared allocator for the given OrtEpDevice and memory type. * If no shared allocator exists, this is a no-op. * * \param[in] env The OrtEnv instance to release the shared allocator from. * \param[in] ep_device The OrtEpDevice instance to release the shared allocator for. * \param[in] mem_type The memory type of the shared allocator to release. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23 */ ReleaseSharedAllocator: #type (env: *OrtEnv, ep_device: *OrtEpDevice, mem_type: OrtDeviceMemoryType) -> OrtStatusPtr #c_call; /** \brief Get a const pointer to the raw data inside a tensor * * Used to read the internal tensor data directly. * \note The returned pointer is valid until the OrtValue is destroyed. * * \param[in] value A tensor type (string tensors are not supported) * \param[out] out Filled in with a pointer to the internal storage * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23 */ GetTensorData: #type (value: *OrtValue, out: **void) -> OrtStatusPtr #c_call; /** \brief Get Session configuration entries. * * \param[in] options The session options. * \param[out] out A pointer to a newly created OrtKeyValuePairs instance. * * An OrtKeyValuePairs instance containing all session configuration entries. * Note: the user should call OrtApi::ReleaseKeyValuePairs. * * \since Version 1.23. */ GetSessionOptionsConfigEntries: #type (options: *OrtSessionOptions, out: **OrtKeyValuePairs) -> OrtStatusPtr #c_call; /** \brief Get the OrtMemoryInfo for each input of the session. * * The memory info can be used to determine where the input tensors are required. * * The session must be fully initialized before calling this function as the input locations are not known until * this has occurred. * * \param[in] session The OrtSession instance. * \param[out] inputs_memory_info Pre-allocated array of size `num_inputs` that will be filled with the * OrtMemoryInfo* value for each input. * The order is the same as returned by SessionGetInputName. * \param[in] num_inputs The number of inputs in the session. Must match SessionGetInputCount. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23 */ SessionGetMemoryInfoForInputs: #type (session: *OrtSession, inputs_memory_info: **OrtMemoryInfo, num_inputs: u64) -> OrtStatusPtr #c_call; /** \brief Get the OrtMemoryInfo for each output of the session. * * The memory info can be used to determine the device the output tensors are produced on. * The user can pre-allocate an OrtValue using this information or use IOBinding to keep the data on the device. * ORT will copy the output to CPU otherwise. * * The session must be fully initialized before calling this function as the output locations are not known until * this has occurred. * * \param[in] session The OrtSession instance. * \param[out] outputs_memory_info Pre-allocated array of size `num_outputs` that will be filled with * OrtMemoryInfo* values for each output. * The order is the same as returned by SessionGetOutputName. * \param[in] num_outputs The number of outputs in the session. Must match SessionGetOutputCount. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23 */ SessionGetMemoryInfoForOutputs: #type (session: *OrtSession, outputs_memory_info: **OrtMemoryInfo, num_outputs: u64) -> OrtStatusPtr #c_call; /** \brief Get the OrtEpDevice (if available) for each input of the session. * * An OrtEpDevice will be available if auto EP selection is enabled by calling * SessionOptionsSetEpSelectionPolicy or SessionOptionsSetEpSelectionPolicyDelegate, * or if the OrtEpDevice was manually added to the session using SessionOptionsAppendExecutionProvider_V2. * * If an OrtEpDevice is not available for the input a nullptr is returned. * * The returned OrtEpDevice can be used to create an OrtSyncStream via CreateSyncStreamForEpDevice to asynchronously * provide input to the inference session Run. * * The session must be fully initialized before calling this function as the assigned EPs are not known until * this has occurred. * * \param[in] session The OrtSession instance. * \param[out] inputs_ep_devices Pre-allocated array of size `num_inputs` that will be filled with * OrtEpDevice* values for each input. * The order is the same as returned by SessionGetInputName. * \param[in] num_inputs The number of inputs in the session. Must match SessionGetInputCount. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23 */ SessionGetEpDeviceForInputs: #type (session: *OrtSession, inputs_ep_devices: **OrtEpDevice, num_inputs: u64) -> OrtStatusPtr #c_call; /** \brief Create an OrtSyncStream for the given OrtEpDevice. * * The OrtSyncStream can be used to enable asynchronous operations. * e.g. async usage of CopyTensors to provide input to an OrtSession Run call. * * An error code of ORT_NOT_IMPLEMENTED will be returned if the EP does not support OrtSyncStream. * * \param[in] ep_device The OrtEpDevice instance to create the sync stream for. * \param[in] stream_options Options for OrtSyncStream creation. May be nullptr. * \param[out] stream Output parameter set to the created OrtSyncStream instance. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23 */ CreateSyncStreamForEpDevice: #type (ep_device: *OrtEpDevice, stream_options: *OrtKeyValuePairs, stream: **OrtSyncStream) -> OrtStatusPtr #c_call; /** \brief Get the native handle of the sync stream. * * This returns the native handle for the stream. e.g. cudaStream_t for CUDA streams. * * \param[in] stream The OrtSyncStream instance to get the handle from. * * \returns The native handle of the stream. * * \since Version 1.23 */ SyncStream_GetHandle: #type (stream: *OrtSyncStream) -> *void #c_call; ReleaseSyncStream: #type (input: *OrtSyncStream) -> void #c_call; /** \brief Copy OrtValue instances containing Tensors between devices. * * The overall copy must be between a single source device and a single destination device. i.e. * - all src_tensors must have matching OrtMemoryInfo, * - all dst_tensors must have matching OrtMemoryInfo. * * OrtValue instances can be created by: * - Use GetSharedAllocator to get the shared allocator for the OrtMemoryInfo if you need to allocate memory * on the device. * - Use CreateTensorAsOrtValue, CreateTensorWithDataAsOrtValue or CreateTensorWithDataAndDeleterAsOrtValue * to create an OrtValue containing a tensor depending on whether you have existing data or not, and whether * you want ORT to free the existing data once it is done with the OrtValue. * * \param[in] env The OrtEnv instance to use. The data transfer implementation is provided by an execution provider * that is registered in this OrtEnv. * \param[in] src_tensors Array of OrtValue instances containing the source tensors to copy. * \param[in] dst_tensors Array of OrtValue instances to copy the source tensors to. * \param[in] stream Optional OrtSyncStream that can be used to perform the copy asynchronously. May be nullptr. * \param[in] num_tensors The number of tensors to copy. The size of `src_tensors` and `dst_tensors` must match. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23 */ CopyTensors: #type (env: *OrtEnv, src_tensors: **OrtValue, dst_tensors: **OrtValue, stream: *OrtSyncStream, num_tensors: u64) -> OrtStatusPtr #c_call; /** \brief Get ::OrtModelMetadata from an ::OrtGraph * * \param[in] graph The OrtGraph instance. * \param[out] out Newly created ::OrtModelMetadata. Must be freed using OrtApi::ReleaseModelMetadata. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Graph_GetModelMetadata: #type (graph: *OrtGraph, out: **OrtModelMetadata) -> OrtStatusPtr #c_call; /** \brief Validate a compiled model's compatibility information for one or more EP devices. * * \param[in] ep_devices The EP devices to validate against (e.g., from GetEpDevices). * All devices must belong to the same execution provider. * \param[in] num_ep_devices The number of EP devices provided. * \param[in] compatibility_info The compatibility info string produced when the model was compiled. * \param[out] out_status The resulting compatibility status for the EP devices. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ GetModelCompatibilityForEpDevices: #type (ep_devices: **OrtEpDevice, num_ep_devices: u64, compatibility_info: *u8, out_status: *OrtCompiledModelCompatibility) -> OrtStatusPtr #c_call; /** \brief Creates an OrtExternalInitializerInfo instance. * * \param[in] filepath The relative path to the file that stores the initializer's data. ORT copies this path string. * \param[in] file_offset The byte offset where the initializer's data is stored within the file. * \param[in] byte_size The size in bytes of the initializer's data within the file. * \param[out] out Output parameter set to the new OrtExternalInitializerInfo instance. * Must be released by calling ReleaseExternalInitializerInfo(). * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ CreateExternalInitializerInfo: #type (filepath: *u16, file_offset: s64, byte_size: u64, out: **OrtExternalInitializerInfo) -> OrtStatusPtr #c_call; /// @} /** \brief Fetch whether the tensor has shape information. * \param[in] info The OrtTensorTypeAndShapeInfo instance. * \return true if the tensor has shape information, false otherwise. * * \since Version 1.24 */ TensorTypeAndShape_HasShape: #type (info: *OrtTensorTypeAndShapeInfo) -> bool #c_call; /** \brief Get all config entries from ::OrtKernelInfo. * * Gets all configuration entries from the ::OrtKernelInfo object as key-value pairs. * Config entries are set on the ::OrtSessionOptions and are accessible in custom operator kernels. * * Used in the CreateKernel callback of an OrtCustomOp to access all session configuration entries * during kernel construction. * * \param[in] info An instance of ::OrtKernelInfo. * \param[out] out A pointer to a newly created OrtKeyValuePairs instance containing all config entries. * Note: the user should call OrtApi::ReleaseKeyValuePairs. * * \snippet{doc} snippets.dox OrtStatus Return Value * \since Version 1.24 */ KernelInfo_GetConfigEntries: #type (info: *OrtKernelInfo, out: **OrtKeyValuePairs) -> OrtStatusPtr #c_call; /** \brief Get the graph node's operator domain from ::OrtKernelInfo. * * If `out` is nullptr, the value of `size` is set to the size of the operator domain * string (including null-terminator), and a success status is returned. * * If the `size` parameter is greater than or equal to the string's size and `out` is not nullptr, * the value of `size` is set to the true size of the string (including null-terminator), * the provided memory is filled with the string's contents, and a success status is returned. * * If the `size` parameter is less than the actual string's size and `out` * is not nullptr, the value of `size` is set to the true size of the string * and a failure status with error code ORT_INVALID_ARGUMENT is returned. * * \param[in] info An instance of ::OrtKernelInfo. * \param[out] out Memory location into which to write the UTF-8 null-terminated string representing the * operator domain. * \param[in,out] size Pointer to the size of the `out` buffer. See above comments for details. * * \snippet{doc} snippets.dox OrtStatus Return Value * \since Version 1.24 */ KernelInfo_GetOperatorDomain: #type (info: *OrtKernelInfo, out: *u8, size: *u64) -> OrtStatusPtr #c_call; /** \brief Get the graph node's operator type from ::OrtKernelInfo. * * If `out` is nullptr, the value of `size` is set to the size of the operator type * string (including null-terminator), and a success status is returned. * * If the `size` parameter is greater than or equal to the string's size and `out` is not nullptr, * the value of `size` is set to the true size of the string (including null-terminator), * the provided memory is filled with the string's contents, and a success status is returned. * * If the `size` parameter is less than the actual string's size and `out` * is not nullptr, the value of `size` is set to the true size of the string * and a failure status with error code ORT_INVALID_ARGUMENT is returned. * * \param[in] info An instance of ::OrtKernelInfo. * \param[out] out Memory location into which to write the UTF-8 null-terminated string representing the * operator type. * \param[in,out] size Pointer to the size of the `out` buffer. See above comments for details. * * \snippet{doc} snippets.dox OrtStatus Return Value * \since Version 1.24 */ KernelInfo_GetOperatorType: #type (info: *OrtKernelInfo, out: *u8, size: *u64) -> OrtStatusPtr #c_call; /** \brief Get the opset version in which the given node's operator type was first defined from ::OrtKernelInfo. * * \param[in] info An instance of ::OrtKernelInfo. * \param[out] since_version The opset version in which the node's operator type was first defined. * * \snippet{doc} snippets.dox OrtStatus Return Value * \since Version 1.24 */ KernelInfo_GetOperatorSinceVersion: #type (info: *OrtKernelInfo, since_version: *s32) -> OrtStatusPtr #c_call; /** \brief Get the EP Interop API instance. * * Get the Interop API instance to work with external resources. This API provides functions * for importing external GPU memory and semaphores for zero-copy sharing between ORT inference * and other GPU workloads. * * \return Interop API struct instance. * * \since Version 1.24. */ GetInteropApi: #type () -> *OrtInteropApi #c_call; /** \brief Get the EP device assigned to each session output. * * Returns the OrtEpDevice assigned to each output of the session after graph partitioning. * This allows validation that outputs are placed on the expected device for external resource sharing. * * The EP device for each output is determined by which execution provider will produce that output * during inferencing. This information is useful for: * - Validating that outputs will be placed on the expected device for external resource sharing * - Deciding whether to use external memory handles for outputs * * \param[in] session The OrtSession instance to query. * \param[out] outputs_ep_devices An array to be filled with the EP device for each output. * The array must be allocated by the caller with space for * OrtEpDevice* values for each output. * The order is the same as returned by SessionGetOutputName. * \param[in] num_outputs The number of outputs in the session. Must match SessionGetOutputCount. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24 */ SessionGetEpDeviceForOutputs: #type (session: *OrtSession, outputs_ep_devices: **OrtEpDevice, num_outputs: u64) -> OrtStatusPtr #c_call; /** \brief Get the number of available hardware devices. * * Returns the count of hardware devices discovered on the system. * Use this to allocate an array before calling GetHardwareDevices(). * * \param[in] env The OrtEnv instance where device discovery results are stored. * \param[out] num_devices The number of OrtHardwareDevice instances available. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ GetNumHardwareDevices: #type (env: *OrtEnv, num_devices: *u64) -> OrtStatusPtr #c_call; /** \brief Get the list of available hardware devices. * * Enumerates hardware devices available on the system. * Populates a user-provided array with pointers to OrtHardwareDevice instances. The caller is responsible * for allocating the array with sufficient space (use GetNumHardwareDevices() to get the count). * * The returned pointers reference internal ORT data structures that are discovered once at process * startup and remain valid for the lifetime of the OrtEnv. The caller does not need to release these * pointers, but should not use them after calling ReleaseEnv(). * * \param[in] env The OrtEnv instance where device discovery results are stored. * \param[out] devices User-allocated array to receive pointers to OrtHardwareDevice instances. * The array must have space for at least num_devices elements. * \param[in] num_devices The size of the user-allocated devices array. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ GetHardwareDevices: #type (env: *OrtEnv, devices: **OrtHardwareDevice, num_devices: u64) -> OrtStatusPtr #c_call; /** \brief Check for known incompatibility issues between hardware device and a specific execution provider. * * This function checks for known incompatibility issues between the specified hardware device * and a specific execution provider. * If returned incompatibility details have non-zero reasons, it indicates the device is not compatible. * However, if returned detail have reason == 0, it doesn't guarantee 100% compatibility for all models, * as models may have specific requirements. * * Note: This method should only be called when the OrtEnv has been initialized with execution * providers (after RegisterExecutionProviderLibrary is called). * * \param[in] env The OrtEnv instance with registered execution providers. * \param[in] ep_name The name of the execution provider to check. Required and cannot be null or empty. * \param[in] hw The hardware device to check for incompatibility. * \param[out] details Compatibility details including reasons for incompatibility if any. * Must be freed with OrtApi::ReleaseDeviceEpIncompatibilityDetails. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ GetHardwareDeviceEpIncompatibilityDetails: #type (env: *OrtEnv, ep_name: *u8, hw: *OrtHardwareDevice, details: **OrtDeviceEpIncompatibilityDetails) -> OrtStatusPtr #c_call; /** \brief Get the incompatibility reasons bitmask from OrtDeviceEpIncompatibilityDetails. * * \param[in] details The OrtDeviceEpIncompatibilityDetails instance to query. * \param[out] reasons_bitmask Pointer to store the bitmask of incompatibility reasons. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ DeviceEpIncompatibilityDetails_GetReasonsBitmask: #type (details: *OrtDeviceEpIncompatibilityDetails, reasons_bitmask: *u32) -> OrtStatusPtr #c_call; /** \brief Get the notes from OrtDeviceEpIncompatibilityDetails. * * \param[in] details The OrtDeviceEpIncompatibilityDetails instance to query. * \param[out] notes Pointer to the notes string. May be nullptr if no notes are available. * The returned string is owned by the details object and should not be freed. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ DeviceEpIncompatibilityDetails_GetNotes: #type (details: *OrtDeviceEpIncompatibilityDetails, notes: **u8) -> OrtStatusPtr #c_call; /** \brief Get the execution provider error code from OrtDeviceEpIncompatibilityDetails. * * This allows Independent Hardware Vendors (IHVs) to define their own error codes * to provide additional details about device incompatibility. * * \param[in] details The OrtDeviceEpIncompatibilityDetails instance to query. * \param[out] error_code Pointer to store the EP-specific error code. A value of 0 indicates no error code was set. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ DeviceEpIncompatibilityDetails_GetErrorCode: #type (details: *OrtDeviceEpIncompatibilityDetails, error_code: *s32) -> OrtStatusPtr #c_call; /** \brief Release an OrtDeviceEpIncompatibilityDetails instance. * * \since Version 1.24. */ ReleaseDeviceEpIncompatibilityDetails: #type (input: *OrtDeviceEpIncompatibilityDetails) -> void #c_call; /** \brief Extract EP compatibility info from a precompiled model file. * * Parses the model file to extract the compatibility info string for a specific execution provider * from the model's metadata properties. This is only applicable to models that have been precompiled * for an EP (e.g., via OrtCompileApi). Standard ONNX models do not contain this information. * * The compatibility info string must be valid UTF-8 without embedded NUL characters. * * \note This API performs standalone model parsing, separate from session creation. This means * the protobuf parsing cost is incurred here and again during session creation. It is intended * for scenarios where applications need to check compatibility before deciding whether to proceed * with session creation, such as providing early user feedback. * * \note This operation parses the full ONNX ModelProto from disk. For very large models, consider * using GetCompatibilityInfoFromModelBytes with a pre-loaded buffer if the model is already in memory. * * The compatibility info can then be passed to GetModelCompatibilityForEpDevices to check if a * precompiled model is compatible with the current system. * * \param[in] model_path Path to the ONNX model file. * \param[in] ep_type The execution provider type string. Must be non-empty. * Use OrtApi::EpDevice_EpName to get this value from an OrtEpDevice. * \param[in] allocator Allocator to use for the output string. Use OrtApi::GetAllocatorWithDefaultOptions. * \param[out] compatibility_info Output pointer to the compatibility info string. * Returns nullptr if no compatibility info exists for the specified EP. * Caller must free with OrtApi::AllocatorFree when non-null. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ GetCompatibilityInfoFromModel: #type (model_path: *u16, ep_type: *u8, allocator: *OrtAllocator, compatibility_info: **u8) -> OrtStatusPtr #c_call; /** \brief Extract EP compatibility info from precompiled model bytes in memory. * * Same as GetCompatibilityInfoFromModel but reads from a memory buffer instead of a file. * Useful when precompiled models are loaded from encrypted storage, network, or other non-file sources. * * \note This API performs standalone model parsing, separate from session creation. This means * the protobuf parsing cost is incurred here and again during session creation. It is intended * for scenarios where applications need to check compatibility before deciding whether to proceed * with session creation, such as providing early user feedback. * * \param[in] model_data Pointer to the model data in memory. * \param[in] model_data_length Size of the model data in bytes. * \param[in] ep_type The execution provider type string. Must be non-empty. * \param[in] allocator Allocator to use for the output string. Use OrtApi::GetAllocatorWithDefaultOptions. * \param[out] compatibility_info Output pointer to the compatibility info string. * Returns nullptr if no compatibility info exists for the specified EP. * Caller must free with OrtApi::AllocatorFree when non-null. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ GetCompatibilityInfoFromModelBytes: #type (model_data: *void, model_data_length: u64, ep_type: *u8, allocator: *OrtAllocator, compatibility_info: **u8) -> OrtStatusPtr #c_call; /** \brief Create an OrtEnv instance with the given options. * * \note Invoking this function will return the same instance of the environment as that returned by a previous call * to another env creation function; all arguments to this function will be ignored. * * \param[in] options The OrtEnvCreationOptions instance that contains creation options. * \param[out] out Output parameter set to the new OrtEnv instance. Must be freed with OrtApi::ReleaseEnv. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24 */ CreateEnvWithOptions: #type (options: *OrtEnvCreationOptions, out: **OrtEnv) -> OrtStatusPtr #c_call; /** \brief Get information about the subgraphs assigned to each execution provider (EP) and the nodes within. * * Each returned OrtEpAssignedSubgraph instance contains details of the subgraph/nodes assigned to an execution * provider, including the execution provider's name, and the name, domain, and operator type for every node. * * For compiling execution providers, a single OrtEpAssignedSubgraph instance contains information about the * nodes that are fused and compiled within a single subgraph assigned to the execution provider. * * For execution providers that use kernel registration (e.g., CPU EP), each node with a registered kernel is * contained in its own OrtEpAssignedSubgraph instance. * * \note The caller must enable the collection of this information by enabling the session * configuration entry "session.record_ep_graph_assignment_info" during session creation. * Refer to onnxruntime_session_options_config_keys.h. Otherwise, if not enabled, this function returns a * status with error code ORT_FAIL. * * \note The information reported by this function is obtained immediately after running basic optimizations on the * original graph if the session optimization level is set to ORT_ENABLE_BASIC or higher. If the session * optimization level is set to ORT_DISABLE_ALL, only minimal/required optimizations are run before * the information is collected. * * \param[in] session The OrtSession instance. * \param[out] ep_subgraphs Output parameter set to the array of OrtEpAssignedSubgraph instances. * \param[out] num_ep_subgraphs Output parameter set to the number of elements in the `ep_subgraphs` array. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ Session_GetEpGraphAssignmentInfo: #type (session: *OrtSession, ep_subgraphs: ***OrtEpAssignedSubgraph, num_ep_subgraphs: *u64) -> OrtStatusPtr #c_call; /** \brief Get the name of the execution provider to which the subgraph was assigned. * * \param[in] ep_subgraph The OrtEpAssignedSubgraph instance. * \param[out] out Output parameter set to the execution provider's name as a UTF-8 null-terminated string. * Owned by the OrtEpAssignedSubgraph instance (do not free). * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ EpAssignedSubgraph_GetEpName: #type (ep_subgraph: *OrtEpAssignedSubgraph, out: **u8) -> OrtStatusPtr #c_call; /** \brief Get the nodes in a subgraph assigned to a specific execution provider. * * \param[in] ep_subgraph The OrtEpAssignedSubgraph instance. * \param[out] ep_nodes Output parameter set to the array of OrtEpAssignedNode instances. * \param[out] num_ep_nodes Output parameter set to the number of OrtEpAssignedNode instance returned. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ EpAssignedSubgraph_GetNodes: #type (ep_subgraph: *OrtEpAssignedSubgraph, ep_nodes: ***OrtEpAssignedNode, num_ep_nodes: *u64) -> OrtStatusPtr #c_call; /** \brief Get the name of the node assigned to an execution provider. * * \param[in] ep_node The OrtEpAssignedNode instance. * \param[out] out Output parameter set to the node's name as a UTF-8 null-terminated string. * Owned by the OrtEpAssignedNode instance (do not free). * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ EpAssignedNode_GetName: #type (ep_node: *OrtEpAssignedNode, out: **u8) -> OrtStatusPtr #c_call; /** \brief Get the domain of the node assigned to an execution provider. * * \param[in] ep_node The OrtEpAssignedNode instance. * \param[out] out Output parameter set to the node's domain as a UTF-8 null-terminated string. * Owned by the OrtEpAssignedNode instance (do not free). * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ EpAssignedNode_GetDomain: #type (ep_node: *OrtEpAssignedNode, out: **u8) -> OrtStatusPtr #c_call; /** \brief Get the operator type of the node assigned to an execution provider. * * \param[in] ep_node The OrtEpAssignedNode instance. * \param[out] out Output parameter set to the node's operator type as a UTF-8 null-terminated string. * Owned by the OrtEpAssignedNode instance (do not free). * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ EpAssignedNode_GetOperatorType: #type (ep_node: *OrtEpAssignedNode, out: **u8) -> OrtStatusPtr #c_call; /** \brief Sets OrtSyncStream for the run options * * OrtSyncStream is used to synchronize the execution of the model run for the device * of the stream. It overrides the existing stream for the duration of the Run(). * The stream instance must be alive for the duration of the Run() call. * * \param[in] options * \param[in] sync_stream The synchronization stream. Pass nullptr to clear previous setting. * * \since 1.24 */ RunOptionsSetSyncStream: #type (options: *OrtRunOptions, sync_stream: *OrtSyncStream) -> void #c_call; /** \brief Get the element data type and shape for an OrtValue that represents a Tensor (scalar, dense, or sparse). * * \note This function is an alternative to OrtApi::GetTensorTypeAndShape that does not allocate a new array for * the shape data. The OrtValue instance's internal shape data is returned directly. * * \note Returns an error if the underlying OrtValue is not a Tensor. * * \param[in] value The OrtValue instance. * \param[out] elem_type Output parameter set to the tensor element data type. * \param[out] shape_data Output parameter set to the OrtValue instance's internal shape data array. * For a scalar, `shape_data` is NULL and `shape_data_count` is 0. * Must not be released as it is owned by the OrtValue instance. This pointer becomes invalid * when the OrtValue is released or if the underlying shape data is updated or reallocated. * \param[out] shape_data_count Output parameter set to the number of elements in `shape_data`. * `shape_data_count` is 0 for a scalar. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ GetTensorElementTypeAndShapeDataReference: #type (value: *OrtValue, elem_type: *ONNXTensorElementDataType, shape_data: **s64, shape_data_count: *u64) -> OrtStatusPtr #c_call; /** \brief Enable profiling for this run * * \param[in] options * \param[in] profile_file_prefix The prefix for the profile file. The actual filename will be: * [profile_file_prefix]_[timestamp].json * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.25. */ RunOptionsEnableProfiling: #type (options: *OrtRunOptions, profile_file_prefix: *u16) -> OrtStatusPtr #c_call; /** \brief Disable profiling for this run * * \param[in] options * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.25. */ RunOptionsDisableProfiling: #type (options: *OrtRunOptions) -> OrtStatusPtr #c_call; /** \brief Fetch an array of strings stored as an attribute in the graph node * * If `out` is nullptr, the value of `size` is set to the true size of the attribute * array and a success status is returned. * * Otherwise, the strings and pointer array are allocated using `allocator`. * The caller must free each string and the pointer array with `allocator`. * If the attribute array is empty, `*out` is set to nullptr and `*size` is set to 0. * * \param[in] info instance * \param[in] name name of the attribute to be parsed * \param[in] allocator allocator used to allocate the returned string array and strings * \param[out] out pointer to the returned array of null-terminated UTF-8 strings * \param[out] size actual size of attribute array * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.25. */ KernelInfoGetAttributeArray_string: #type (info: *OrtKernelInfo, name: *u8, allocator: *OrtAllocator, out: ***u8, size: *u64) -> OrtStatusPtr #c_call; /** \brief Set thread pool work callbacks for per-session thread pools. * * Stores callbacks on the Env that will be applied to per-session thread pools * created by subsequent sessions. Does not affect sessions already created or * global thread pools created via OrtApi::CreateEnvWithGlobalThreadPools. * * Requires ORT built with --enable_session_threadpool_callbacks. * * \param[in] env OrtEnv instance. * \param[in] config Versioned callbacks configuration. ORT copies the struct contents; * the caller does not need to keep the struct alive after this call returns. * However, all pointers within the struct must remain valid for the * lifetime of any session that uses these callbacks. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.25. */ SetPerSessionThreadPoolCallbacks: #type (env: *OrtEnv, config: *OrtThreadPoolCallbacksConfig) -> OrtStatusPtr #c_call; /** \brief Check if the memory pattern optimization is enabled in the session options. * * \param[in] options * \param[out] out Set to 1 if the memory pattern optimization is enabled, 0 otherwise. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.27. * * \see OrtApi::EnableMemPattern, OrtApi::DisableMemPattern */ GetMemPatternEnabled: #type (options: *OrtSessionOptions, out: *s32) -> OrtStatusPtr #c_call; /** \brief Get the current execution mode setting. * * \param[in] options * \param[out] out Set to the current execution mode (ORT_SEQUENTIAL or ORT_PARALLEL). * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.27. * * \see OrtApi::SetSessionExecutionMode */ GetSessionExecutionMode: #type (options: *OrtSessionOptions, out: *ExecutionMode) -> OrtStatusPtr #c_call; /** \brief Release a previously captured graph and its associated resources. * * When graph capture is enabled, the EP records information during initial runs (e.g., GPU commands) * and replays them on subsequent runs. This function releases the captured resources for a specific * graph annotation ID, freeing memory. * * \param[in] session The OrtSession instance. * \param[in] graph_annotation_id The annotation ID of the captured graph to release. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.27. */ SessionReleaseCapturedGraph: #type (session: *OrtSession, graph_annotation_id: s32) -> OrtStatusPtr #c_call; /** \brief Retrieve an experimental function pointer by name. * * Experimental functions are not part of the stable ABI and may be added or removed between releases without notice. * Use the companion header onnxruntime_experimental_c_api.h for typedefs, name constants, and (for C++) typed * accessors. * * \param[in] name The null-terminated name of the experimental function to look up. * Names follow the pattern "__SinceV". * Name constants are defined in onnxruntime_experimental_c_api.h. * \return The function pointer cast to ::OrtExperimentalFnPtr, or nullptr if the function is not available in this * build. The caller must cast the returned pointer to the correct function pointer type before calling. * Function pointer typedefs are defined in onnxruntime_experimental_c_api.h. * * \since Version 1.28. */ GetExperimentalFunction: #type (name: *u8) -> OrtExperimentalFnPtr #c_call; /** \brief Get the framework synchronization stream associated with a kernel context. * * This returns the framework stream wrapper for the execution provider stream used by this kernel invocation. * It is intended for APIs that need a stable framework stream object for stream-aware allocation and * synchronization bookkeeping. Use KernelContext_GetGPUComputeStream when launching native GPU work. * * \param[in] context OrtKernelContext instance. * \param[out] out Returns the framework synchronization stream, or nullptr if the kernel has no stream. * Do not free or mutate the returned pointer. It is owned by the underlying session. * The pointer may be stored and used for stream-aware allocation and synchronization * bookkeeping beyond the Compute call (e.g. an allocator may persist it in arena * chunks); it remains valid until the owning Session::Run() completes its teardown. * Do not retain or dereference it after the run that produced this kernel context ends. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.28. */ KernelContext_GetSyncStream: #type (_context: *OrtKernelContext, out: **OrtSyncStream) -> OrtStatusPtr #c_call; /** \brief Set the source ONNX model as a byte buffer for weightless EPContext sessions. * * When creating a session from a weightless EPContext model, the EP may need access to the source model's * initializer data. This function provides the source model as an in-memory byte buffer, for scenarios * where the source model is not available as a file on disk (e.g., loaded from a package or downloaded). * * The caller retains ownership of the buffer and must ensure it remains valid for the lifetime of the session. * * \note If the source model is available as a file on disk, use the session config entry * "ep.context_source_model_path" (kOrtSessionOptionEpContextSourceModelPath) instead. * * \note If both a buffer (via this function) and a file path (via "ep.context_source_model_path") are * provided, the EP should prefer the buffer. The recommended EP precedence is: * buffer > file path > "onnx_model_filename" EPContext node attribute. * * \param[in] options The OrtSessionOptions instance. * \param[in] source_model_data Pointer to the source model byte buffer. * \param[in] source_model_data_length Size of the byte buffer in bytes. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.29. */ SessionOptionsSetWeightlessSourceModelBuffer: #type (options: *OrtSessionOptions, source_model_data: *void, source_model_data_length: u64) -> OrtStatusPtr #c_call; /** \brief Get a preallocated output tensor without allocating an output. * * Returns a borrowed OrtValue that is already allocated for this output. The * value may have been supplied by the caller of Run or IoBinding, or * preallocated by ORT for an internal execution such as a control-flow * subgraph. The returned value is valid only while the current kernel Compute * call is executing and must not be released. If the output is unallocated or * optional, `*output` is set to nullptr. This function never allocates, * resizes, or replaces an output value. * * The caller must validate the returned tensor's shape and element type before * writing to it, and must not write to an incompatible tensor. ORT generally * rejects element type, rank, and static-dimension mismatches for top-level * outputs during pre-run validation. For dynamic output dimensions, however, * the shape check that KernelContext_GetOutput performs is skipped on this * path, so a model with dynamic output shapes can yield a buffer smaller than * the computed output. Calling KernelContext_GetOutput with the computed shape * does not resize or replace an incompatible preallocated tensor; because the * output slot is already allocated, ORT returns an error for the mismatch. * * \param[in] context OrtKernelContext instance. * \param[in] output_index Output index in the current kernel. * \param[out] output Borrowed preallocated output, or nullptr when the * current output is unallocated or optional. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.30. */ KernelContext_GetPreallocatedOutput: #type (_context: *OrtKernelContext, output_index: u64, output: **OrtValue) -> OrtStatusPtr #c_call; } // Specifies some characteristics of inputs/outputs of custom ops: // Specify if the inputs/outputs are one of: // 1) Non-optional (input/output must be present in the node) // 2) Optional (input/output may be absent in the node) // 3) Variadic: A variadic input or output specifies N (i.e., the minimum arity) or more operands. // Only the last input or output of a custom op may be marked as variadic. // The homogeneity of the variadic input or output determines whether all operands must be of the same // tensor element type. OrtCustomOpInputOutputCharacteristic :: enum s32 { INPUT_OUTPUT_REQUIRED :: 0; INPUT_OUTPUT_OPTIONAL :: 1; INPUT_OUTPUT_VARIADIC :: 2; } /* * The OrtCustomOp structure defines a custom op's schema and its kernel callbacks. The callbacks are filled in by * the implementor of the custom op. */ OrtCustomOp :: struct { // Initialize to ORT_API_VERSION. ORT will cap the API version used to select the OrtApi passed // to CreateKernel/CreateKernelV2 callbacks, so custom ops compiled against a newer ORT can load // on an older runtime if they only use APIs available at the runtime version. Newer OrtCustomOp // function pointers are gated by per-function version checks within ORT. version: u32; // This callback creates the kernel, which is a user defined // parameter that is passed to the Kernel* callbacks below. It is // recommended to use CreateKernelV2 which allows for a safe error // propagation by returning an OrtStatusPtr. CreateKernel: #type (op: *OrtCustomOp, api: *OrtApi, info: *OrtKernelInfo) -> *void #c_call; // Returns the name of the op GetName: #type (op: *OrtCustomOp) -> *u8 #c_call; // Returns the type of the execution provider, return nullptr to use CPU execution provider GetExecutionProviderType: #type (op: *OrtCustomOp) -> *u8 #c_call; // Returns the count and types of the input & output tensors GetInputType: #type (op: *OrtCustomOp, index: u64) -> ONNXTensorElementDataType #c_call; GetInputTypeCount: #type (op: *OrtCustomOp) -> u64 #c_call; GetOutputType: #type (op: *OrtCustomOp, index: u64) -> ONNXTensorElementDataType #c_call; GetOutputTypeCount: #type (op: *OrtCustomOp) -> u64 #c_call; // Perform a computation step. It is recommended to use // KernelComputeV2 which allows for a safe error propagation by // returning an OrtStatusPtr. KernelCompute: #type (op_kernel: *void, _context: *OrtKernelContext) -> void #c_call; KernelDestroy: #type (op_kernel: *void) -> void #c_call; // Returns the characteristics of the input & output tensors GetInputCharacteristic: #type (op: *OrtCustomOp, index: u64) -> OrtCustomOpInputOutputCharacteristic #c_call; GetOutputCharacteristic: #type (op: *OrtCustomOp, index: u64) -> OrtCustomOpInputOutputCharacteristic #c_call; // Returns the memory type of the input tensors. This API allows the custom op // to place the inputs on specific devices. By default, it returns // OrtMemTypeDefault, which means the input is placed on the default device for // the execution provider. If the inputs need to be with different memory types, // this function can be overridden to return the specific memory types. GetInputMemoryType: #type (op: *OrtCustomOp, index: u64) -> OrtMemType #c_call; // Returns the minimum number of input arguments expected for the variadic input. // Applicable only for custom ops that have a variadic input. GetVariadicInputMinArity: #type (op: *OrtCustomOp) -> s32 #c_call; // Returns true (non-zero) if all arguments of a variadic input have to be of the same type (homogeneous), // and false (zero) otherwise. // Applicable only for custom ops that have a variadic input. GetVariadicInputHomogeneity: #type (op: *OrtCustomOp) -> s32 #c_call; // Returns the minimum number of output values expected for the variadic output. // Applicable only for custom ops that have a variadic output. GetVariadicOutputMinArity: #type (op: *OrtCustomOp) -> s32 #c_call; // Returns true (non-zero) if all outputs values of a variadic output have to be of the same type (homogeneous), // and false (zero) otherwise. // Applicable only for custom ops that have a variadic output. GetVariadicOutputHomogeneity: #type (op: *OrtCustomOp) -> s32 #c_call; // Create the kernel state which is passed to each compute call. CreateKernelV2: #type (op: *OrtCustomOp, api: *OrtApi, info: *OrtKernelInfo, kernel: **void) -> OrtStatusPtr #c_call; // Perform the computation step. KernelComputeV2: #type (op_kernel: *void, _context: *OrtKernelContext) -> OrtStatusPtr #c_call; InferOutputShapeFn: #type (op: *OrtCustomOp, unknown0: *OrtShapeInferContext) -> OrtStatusPtr #c_call; // Get start range GetStartVersion: #type (op: *OrtCustomOp) -> s32 #c_call; GetEndVersion: #type (op: *OrtCustomOp) -> s32 #c_call; // Get the inplace_map that defines which output can reuse which input // Callers will provide 2 raw int* and pass in their address, this function will fill these 2 arrays // when return, output (*output_index)[i] may reuse the input (*input_index[i]). // The return value is the size of these 2 arrays. // Callers are responsible to delete these 2 arrays after use by calling OrtCustomOp::ReleaseMayInplace(). GetMayInplace: #type (input_index: **s32, output_index: **s32) -> u64 #c_call; // Release the pointer input_index and output_index allocated from GetMayInplace() function. // If GetMayInplace() is defined, this function MUST be defined as well. ReleaseMayInplace: #type (input_index: *s32, output_index: *s32) -> void #c_call; // Same as GetMayInplace() and ReleaseMayInplace() GetAliasMap: #type (input_index: **s32, output_index: **s32) -> u64 #c_call; ReleaseAliasMap: #type (input_index: *s32, output_index: *s32) -> void #c_call; } /** * \brief The OrtModelEditorApi struct provides functions to create or edit an ONNX model. * * See onnxruntime/test/shared_lib/test_model_editor_api.cc for example usage. * * \since Version 1.22. */ OrtModelEditorApi :: struct { /** \brief Create an OrtTypeInfo instance for a Tensor. * * Create an OrtTypeInfo instance for a Tensor to use as graph inputs/outputs with the Model Editor API. * * User can release `tensor_info` after creating the OrtTypeInfo. * * \param[in] tensor_info Tensor type and shape information. * \param[out] type_info TypeInfo instance for the tensor. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ CreateTensorTypeInfo: #type (tensor_info: *OrtTensorTypeAndShapeInfo, _type_info: **OrtTypeInfo) -> OrtStatusPtr #c_call; /** \brief Create an OrtTypeInfo instance for a SparseTensor. * * Create an OrtTypeInfo instance for a SparseTensor to use as graph inputs/outputs with the Model Editor API. * * User can release `tensor_info` after creating the OrtTypeInfo. * * \param[in] tensor_info SparseTensor type and shape information. * \param[out] type_info TypeInfo instance for the tensor. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ CreateSparseTensorTypeInfo: #type (tensor_info: *OrtTensorTypeAndShapeInfo, _type_info: **OrtTypeInfo) -> OrtStatusPtr #c_call; /** \brief Create an OrtTypeInfo instance for a Map. * * Create an OrtTypeInfo instance for a Map to use as graph inputs/outputs with the Model Editor API. * * User can release `map_value_type` after creating the OrtTypeInfo. * * \param[in] map_key_type Key type for the map. * \param[in] map_value_type Value type for the map. * \param[out] type_info TypeInfo instance for the map. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ CreateMapTypeInfo: #type (map_key_type: ONNXTensorElementDataType, map_value_type: *OrtTypeInfo, _type_info: **OrtTypeInfo) -> OrtStatusPtr #c_call; /** \brief Create an OrtTypeInfo instance for a Sequence. * * Create an OrtTypeInfo instance for a Sequence to use as graph inputs/outputs with the Model Editor API. * * User can release `sequence_type` after creating the OrtTypeInfo. * * \param[in] sequence_type Sequence type and shape information. * \param[out] type_info TypeInfo instance for the sequence. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ CreateSequenceTypeInfo: #type (sequence_type: *OrtTypeInfo, _type_info: **OrtTypeInfo) -> OrtStatusPtr #c_call; /** \brief Create an OrtTypeInfo instance for an Optional. * * Create an OrtTypeInfo instance for an Optional to use as graph inputs/outputs with the Model Editor API. * * User can release `contained_type` after creating the OrtTypeInfo. * * \param[in] contained_type Tensor type and shape information. * \param[out] type_info TypeInfo instance for the tensor. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ CreateOptionalTypeInfo: #type (contained_type: *OrtTypeInfo, _type_info: **OrtTypeInfo) -> OrtStatusPtr #c_call; /** \brief Create an OrtValueInfo for use as an OrtGraph input or output. * * \param[in] name The name of the input or output. * \param[in] type_info The type information for the input or output. The provided value is copied. * \param[out] value_info The OrtValueInfo instance. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ CreateValueInfo: #type (name: *u8, _type_info: *OrtTypeInfo, value_info: **OrtValueInfo) -> OrtStatusPtr #c_call; /** \brief Create an OrtNode to add to an OrtGraph. * * Create an OrtNode. * * Create attributes with CreateOpAttr. OrtOpAttr instances are copied. * * \param[in] operator_name The name of the operator. * \param[in] domain_name The domain of the operator. Use an empty string for ONNX operators. * \param[in] node_name The name of the node. * \param[in] input_names The names of the inputs. * \param[in] input_names_len The number of input names. * \param[in] output_names The names of the outputs. * \param[in] output_names_len The number of output names. * \param[in] attributes The optional attributes of the node. * \param[in] attribs_len The number of attributes. May be zero. * \param[out] node The OrtNode instance. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ CreateNode: #type (operator_name: *u8, domain_name: *u8, node_name: *u8, input_names: **u8, input_names_len: u64, output_names: **u8, output_names_len: u64, attributes: **OrtOpAttr, attribs_len: u64, node: **OrtNode) -> OrtStatusPtr #c_call; /** \brief Create an OrtGraph * \snippet{doc} snippets.dox OrtStatus Return Value * \since Version 1.22. */ CreateGraph: #type (graph: **OrtGraph) -> OrtStatusPtr #c_call; /** \brief Set the inputs for the OrtGraph. * * Set the graph inputs. This will replace any existing inputs with the new values. * * Atomicity / all-or-nothing: on success, the OrtGraph takes ownership of every OrtValueInfo in * `inputs`, and each entry in the array is reset to nullptr to make the transfer explicit. On any * failure, the graph's previous inputs are preserved and ownership of NONE of the OrtValueInfo * instances is transferred -- the caller remains responsible for releasing them. Calling * OrtApi::ReleaseValueInfo on an entry whose array slot has been nulled out would cause a double-free. * * \param[in] graph The OrtGraph instance to update. * \param[in] inputs The input OrtValueInfo instances. * \param[in] inputs_len The number of input OrtValueInfo instances. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ SetGraphInputs: #type (graph: *OrtGraph, inputs: **OrtValueInfo, inputs_len: u64) -> OrtStatusPtr #c_call; /** \brief Set the outputs for the OrtGraph. * * Set the graph outputs. This will replace any existing outputs with the new values. * * Atomicity / all-or-nothing: on success, the OrtGraph takes ownership of every OrtValueInfo in * `outputs`, and each entry in the array is reset to nullptr to make the transfer explicit. On any * failure, the graph's previous outputs are preserved and ownership of NONE of the OrtValueInfo * instances is transferred -- the caller remains responsible for releasing them. Calling * OrtApi::ReleaseValueInfo on an entry whose array slot has been nulled out would cause a double-free. * * \param[in] graph The OrtGraph instance to update. * \param[in] outputs The output OrtValueInfo instances. * \param[in] outputs_len The number of output OrtValueInfo instances. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ SetGraphOutputs: #type (graph: *OrtGraph, outputs: **OrtValueInfo, outputs_len: u64) -> OrtStatusPtr #c_call; /** \brief Add an initializer to the OrtGraph * * Atomicity / all-or-nothing: on success, the OrtGraph takes ownership of `tensor` and the caller * must NOT call OrtApi::ReleaseValue on it. On any failure, ownership is NOT transferred and the caller * remains responsible for releasing the OrtValue. Calling OrtApi::ReleaseValue after a successful * transfer would cause a double-free. * Adding the same OrtValue pointer twice (under any name) is rejected with ORT_INVALID_ARGUMENT. * Adding a duplicate initializer name is also rejected. The Model Editor API does not currently * support removing or replacing an initializer once it has been added. * * Two options: * * Allocated memory: * Use OrtApi::CreateTensorAsOrtValue (allocates memory) and populate the tensor with the data. * Set `data_is_external` to false. * * Pre-existing memory: * Use OrtApi::CreateTensorWithDataAsOrtValue or OrtApi::CreateTensorWithDataAndDeleterAsOrtValue to create an OrtValue * with a tensor that contains a pointer to the existing data. * Set `data_is_external` to true. * * The pointer must remain valid for the duration of the inference session. * If using OrtApi::CreateTensorWithDataAsOrtValue you are responsible for freeing the memory after the inference session * is released. * If using OrtApi::CreateTensorWithDataAndDeleterAsOrtValue, ORT will free the memory using the provided deleter as * soon as the OrtValue is no longer in use. * * NOTE: A tensor containing pre-existing memory MUST have 128 bytes of data or more. * For smaller tensors use OrtApi::CreateTensorAsOrtValue. * * ONNX shape inferencing does not support external data. An initializer involved in shape inferencing is * typically small (a single value or limited by the rank of a tensor) and uses less than 128 bytes of * memory, so this limit acts as a simple catch-all rule to avoid issues. * e.g. Reshape's `shape`, Clip's `min` and `max`, various ops `axes`. * * \param[in] graph The OrtGraph instance to update. * \param[in] name The value name for the initializer. * \param[in] tensor The OrtValue instance containing the tensor data. * \param[in] data_is_external Set to true if the data is external and should not be copied. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ AddInitializerToGraph: #type (graph: *OrtGraph, name: *u8, tensor: *OrtValue, data_is_external: bool) -> OrtStatusPtr #c_call; /** \brief Add an OrtNode to an OrtGraph * * Atomicity / all-or-nothing: on success, the OrtGraph takes ownership of `node` and the caller * must NOT call OrtApi::ReleaseNode. On any failure, ownership is NOT transferred and the caller remains * responsible for releasing the OrtNode. Calling OrtApi::ReleaseNode after a successful transfer would * cause a double-free. * Adding the same OrtNode pointer twice is rejected with ORT_INVALID_ARGUMENT. * * \param[in] graph The OrtGraph instance to update. * \param[in] node The OrtNode instance to add to the graph. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ AddNodeToGraph: #type (graph: *OrtGraph, node: *OrtNode) -> OrtStatusPtr #c_call; /** \brief Create an OrtModel. * * Create an OrtModel. * * This can be used to build a new model, or to augment an existing model. * * \param[in] domain_names The domain names for the model. * If augmenting an existing model add additional domains if needed. * \param[in] opset_versions The opset versions for the model. * If augmenting an existing model add additional opset versions if needed. * \param[in] opset_entries_len The number of domain_names and opset_versions entries. * Domain and opset entries should be 1:1 * \param[out] model The OrtModel instance. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ CreateModel: #type (domain_names: **u8, opset_versions: *s32, opset_entries_len: u64, model: **OrtModel) -> OrtStatusPtr #c_call; /** \brief Add an OrtGraph to an OrtModel. * * Add the graph to a model. Each OrtModel may hold at most one OrtGraph; a second call is rejected * with ORT_INVALID_ARGUMENT. * * Atomicity / all-or-nothing: on success, the OrtModel takes ownership of `graph` and the caller * must NOT call OrtApi::ReleaseGraph. On any failure, ownership is NOT transferred and the caller * remains responsible for releasing the OrtGraph. Calling OrtApi::ReleaseGraph after a successful * transfer would cause a double-free. * * \param[in] model The OrtModel instance to update. * \param[in] graph The OrtGraph instance to add to the model. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ AddGraphToModel: #type (model: *OrtModel, graph: *OrtGraph) -> OrtStatusPtr #c_call; /** \brief Create an OrtSession using the OrtModel. * * Create an inference session using the OrtModel instance. * The OrtModel should have been populated with an OrtGraph containing nodes and initializers, and SetGraphInputs * and SetGraphOutputs must have been called. * This will validate the model, run optimizers, and prepare the session for inferencing. * * OrtApi::ReleaseModel must be called to free the OrtModel after session creation. * * \param[in] env The OrtEnv instance. * \param[in] model The OrtModel instance. * \param[in] options The OrtSessionOptions instance. * \param[out] out The OrtSession instance. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ CreateSessionFromModel: #type (env: *OrtEnv, model: *OrtModel, options: *OrtSessionOptions, out: **OrtSession) -> OrtStatusPtr #c_call; /** \brief Create an OrtSession to augment an existing model. * * Create an OrtSession with an existing model that will be augmented with additional nodes and initializers. * Nodes can be added before or after the existing nodes in the model. ONNX Runtime will connect the nodes when the * model is finalized. * * To add nodes and initializers to the existing model, first create an OrtModel using CreateModel(). * Add nodes and initializers to the OrtModel using AddNodeToGraph() and AddInitializerToGraph(). * Graph inputs/outputs should be updated with SetGraphInputs() and SetGraphOutputs() as needed to reflect changes made * by the new nodes. The list of graph inputs/outputs should be for the overall model and not just the new nodes. * * Add the new information from the OrtModel to the original model using ApplyModelToSession(), and prepare the * session for inferencing by calling FinalizeModelEditorSession(). * * \param{in} env The OrtEnv instance. * \param{in} model_path The path to the existing ONNX model to augment. * \param{in} options The OrtSessionOptions instance. * \param{out} out The created OrtSession instance. * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ CreateModelEditorSession: #type (env: *OrtEnv, model_path: *u16, options: *OrtSessionOptions, out: **OrtSession) -> OrtStatusPtr #c_call; /** \brief Create an OrtSession to augment an existing model. * * Create an OrtSession with an existing model that will be augmented with additional nodes and initializers. * Nodes can be added before or after the existing nodes in the model. ONNX Runtime will connect the nodes when the * model is finalized. * * To add nodes and initializers to the existing model, first create an OrtModel using CreateModel(). * Add nodes and initializers to the OrtModel using AddNodeToGraph() and AddInitializerToGraph(). * Graph inputs/outputs should be updated with SetGraphInputs() and SetGraphOutputs() as needed to reflect changes made * by the new nodes. The list of graph inputs/outputs should be for the overall model and not just the new nodes. * * Add the new information from the OrtModel to the original model using ApplyModelToSession(), and prepare the * session for inferencing by calling FinalizeModelEditorSession(). * * \param{in} env The OrtEnv instance. * \param{in} model_data The model data for the existing model to augment. * \param{in} model_data_length The length of the model data. * \param{in} options The OrtSessionOptions instance. * \param{out} out The created OrtSession instance. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ CreateModelEditorSessionFromArray: #type (env: *OrtEnv, model_data: *void, model_data_length: u64, options: *OrtSessionOptions, out: **OrtSession) -> OrtStatusPtr #c_call; /** \brief Query the session for the opset version of a domain. * * When using the Model Editor API to augment a model, any new nodes must conform to the opset version of the * original model. To do that the user must be able to discover that opset version. * Returns an error if the domain is not used in the model. * * \param[in] session OrtSession to query * \param[in] domain Domain to query. The ONNX domain is an empty string. * \param[out] opset The opset version of the domain. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ SessionGetOpsetForDomain: #type (session: *OrtSession, domain: *u8, opset: *s32) -> OrtStatusPtr #c_call; /** \brief Apply changes to augment the ONNX model in a session created using CreateModelEditorSession[FromArray] * * Adds new nodes and updates graph inputs/outputs using `model` to augment the original ONNX model in the session. * All changes will be validated. * Call FinalizeModelEditorSession to prepare the session for inferencing. * * Existing input/outputs will only be updated if the OrtGraph inputs/outputs are set in the OrtModel. * i.e. you don't need to call SetGraphInputs/SetGraphOutputs if they are unchanged. * * ReleaseOrtModel must be called to free the OrtModel after it is applied to the session. * * \param[in] session OrtSession to update. Session must have been created using CreateModelEditorSession[FromArray]. * \param[in] model OrtModel containing new nodes, new initializers, and updated graph input and/or output info. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ ApplyModelToModelEditorSession: #type (session: *OrtSession, model: *OrtModel) -> OrtStatusPtr #c_call; /** \brief Finalize the Model Editor session that was created using CreateModelEditorSession[FromArray]. * * Finalize the Model Editor session that augmented an ONNX model by adding new nodes. * This will run optimizers and prepare the session for inferencing. * * \param[in] session OrtSession to finalize. Session must have been created using CreateModelEditorSession[FromArray]. * \param[in] options OrtSessionOptions to use for the session. * \param[in] prepacked_weights_container Optional OrtPrepackedWeightsContainer to use for the session. Set to nullptr if not used. * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ FinalizeModelEditorSession: #type (session: *OrtSession, options: *OrtSessionOptions, prepacked_weights_container: *OrtPrepackedWeightsContainer) -> OrtStatusPtr #c_call; } /** \brief Flags representing options to enable when compiling a model. */ OrtCompileApiFlags :: enum s32 { OrtCompileApiFlags_NONE :: 0; OrtCompileApiFlags_ERROR_IF_NO_NODES_COMPILED :: 1; OrtCompileApiFlags_ERROR_IF_OUTPUT_FILE_EXISTS :: 2; } /** * \brief The OrtCompileApi struct provides functions to compile ONNX models. * * Execution providers that support compilation fuse a subgraph into an EPContext node that wraps a provider-specific * binary representation of the subgraph. * For more details about the EPContext design, refer to: * \htmlonly * EPContext design document. * \endhtmlonly * * Example (error handling not shown): * OrtStatus* status = NULL; * OrtCompileApi* compile_api = ort_api->GetCompileApi(); * OrtModelCompilationOptions* compile_options = NULL; * * status = compile_api->CreateModelCompilationOptionsFromSessionOptions(env, session_options, &compile_options); * status = compile_api->ModelCompilationOptions_SetInputModelPath(compile_options, ORT_TSTR("model.onnx")); * status = compile_api->ModelCompilationOptions_SetOutputModelPath(compile_options, ORT_TSTR("model.compiled.onnx")); * status = compile_api->CompileModel(env, compile_options); * compile_api->ReleaseModelCompilationOptions(compile_options); * * \since Version 1.22. */ OrtCompileApi :: struct { /// \name OrtModelCompilationOptions /// @{ ReleaseModelCompilationOptions: #type (input: *OrtModelCompilationOptions) -> void #c_call; /** \brief Creates an OrtModelCompilationOptions object from an existing OrtSessionOptions object. * * An OrtModelCompilationOptions object contains the settings used to generate a compiled ONNX model. * The OrtSessionOptions object has the execution providers with which the model will be compiled. * * ReleaseOrtModelCompilationsOptions must be called to free the OrtModelCompilationOptions after calling * CompileModel. * * \note By default, the GraphOptimizationLevel is set to ORT_DISABLE_ALL. Use * ModelCompilationOptions_SetGraphOptimizationLevel to enable graph optimizations. * * \param[in] env OrtEnv object. * \param[in] session_options The OrtSessionOptions instance from which to create the OrtModelCompilationOptions. * \param[out] out The created OrtModelCompilationOptions instance. * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ CreateModelCompilationOptionsFromSessionOptions: #type (env: *OrtEnv, session_options: *OrtSessionOptions, out: **OrtModelCompilationOptions) -> OrtStatusPtr #c_call; /** \brief Sets the file path to the input ONNX model to compile. * * The input model's location (e.g., file path or memory buffer) must be set with either * ModelCompilationOptions_SetInputModelPath or ModelCompilationOptions_SetInputModelFromBuffer. * * \param[in] model_compile_options The OrtModelCompilationOptions instance. * \param[in] input_model_path Null terminated string of the path (wchar on Windows, char otherwise). * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ ModelCompilationOptions_SetInputModelPath: #type (model_compile_options: *OrtModelCompilationOptions, input_model_path: *u16) -> OrtStatusPtr #c_call; /** \brief Sets the buffer that stores the bytes of the loaded ONNX model to compile. * * The input model's location (e.g., file path or memory buffer) must be set with either * ModelCompilationOptions_SetInputModelPath or ModelCompilationOptions_SetInputModelFromBuffer. * * \param[in] model_compile_options The OrtModelCompilationOptions instance. * \param[in] input_model_data Buffer containing the loaded ONNX model bytes. * \param[in] input_model_data_size The number of bytes in the `input_model_data` buffer. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ ModelCompilationOptions_SetInputModelFromBuffer: #type (model_compile_options: *OrtModelCompilationOptions, input_model_data: *void, input_model_data_size: u64) -> OrtStatusPtr #c_call; /** \brief Sets the file path for the output ONNX model generated by CompileModel. * * The output model's location (e.g., file path or memory buffer) can be set with either * ModelCompilationOptions_SetOutputModelPath or ModelCompilationOptions_SetOutputModelBuffer. * * If the output model's location is not set, ONNX Runtime will generate an output file with a path based on * the input model's file path. Examples: * /Path/my_model.onnx -> /Path/my_model_ctx.onnx * /Path/my_model -> /Path/my_model_ctx.onnx * * \param[in] model_compile_options The OrtModelCompilationOptions instance. * \param[in] output_model_path Null terminated string of the path (wchar on Windows, char otherwise). * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ ModelCompilationOptions_SetOutputModelPath: #type (model_compile_options: *OrtModelCompilationOptions, output_model_path: *u16) -> OrtStatusPtr #c_call; /** \brief Optionally sets the file that should store external initializers for the compiled ONNX model. * If not set, initializers are stored within the model. * * Only initializers for nodes that were not compiled are stored in the external initializers file. * Compiled nodes contain their initializer data within the `ep_cache_context` attribute of EPContext nodes. * Refer to ModelCompilationOptions_SetEpContextEmbedMode. * * \param[in] model_compile_options The OrtModelCompilationOptions instance. * \param[in] external_initializers_file_path Null terminated string of the path to the file. * \param[in] external_initializers_size_threshold Initializers larger than this threshold are stored in the file. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ ModelCompilationOptions_SetOutputModelExternalInitializersFile: #type (model_compile_options: *OrtModelCompilationOptions, external_initializers_file_path: *u16, external_initializers_size_threshold: u64) -> OrtStatusPtr #c_call; /** \brief Configures model compilation to store the output compiled ONNX model in a buffer. * * The caller passes an OrtAllocator that ONNX Runtime uses to allocate memory for the buffer. * * The output model's location (e.g., file path or memory buffer) can be set with either * ModelCompilationOptions_SetOutputModelPath or ModelCompilationOptions_SetOutputModelBuffer. * * If the output model's location is not set, ONNX Runtime will generate an output file with a path based on * the input model's file path. Examples: * /Path/my_model.onnx -> /Path/my_model_ctx.onnx * /Path/my_model -> /Path/my_model_ctx.onnx * * \param[in] model_compile_options The OrtModelCompilationOptions instance. * \param[in] allocator The allocator used to allocate the buffer for the compiled model. * \param[out] output_model_buffer_ptr Pointer to the buffer that stores the compiled model. * \param[out] output_model_buffer_size_ptr Pointer set to the size of output model in bytes. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ ModelCompilationOptions_SetOutputModelBuffer: #type (model_compile_options: *OrtModelCompilationOptions, allocator: *OrtAllocator, output_model_buffer_ptr: **void, output_model_buffer_size_ptr: *u64) -> OrtStatusPtr #c_call; /** \brief Enables or disables the embedding of EPContext binary data into the `ep_cache_context` attribute * of EPContext nodes. Defaults to false. * * If enabled, the `ep_cache_context` attribute of EPContext nodes will store the context binary data, which may * include weights for compiled subgraphs. * * If disabled, the `ep_cache_context` attribute of EPContext nodes will contain the path to the file containing the * context binary data. The path is set by the execution provider creating the EPContext node. * * More details relate to EPContext design refers to: * \htmlonly * EPContext design document. * \endhtmlonly * * \param[in] model_compile_options The OrtModelCompilationOptions instance. * \param[in] embed_ep_context_in_model True to embed EPContext binary data into the EPContext node * `ep_cache_context` attributes. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ ModelCompilationOptions_SetEpContextEmbedMode: #type (model_compile_options: *OrtModelCompilationOptions, embed_ep_context_in_model: bool) -> OrtStatusPtr #c_call; /** \brief Compiles an input ONNX model with the given compilation options. * * \param[in] env OrtEnv object. * \param[in] model_options The compilation options that defines compilation options for a model. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ CompileModel: #type (env: *OrtEnv, model_options: *OrtModelCompilationOptions) -> OrtStatusPtr #c_call; /** \brief Sets flags from OrtCompileApiFlags that represent one or more boolean options to enable. * * \param[in] model_compile_options The OrtModelCompilationOptions instance. * \param[in] flags bitwise OR of flags in OrtCompileApiFlags to enable. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ ModelCompilationOptions_SetFlags: #type (model_compile_options: *OrtModelCompilationOptions, flags: u32) -> OrtStatusPtr #c_call; /** Sets information related to EP context binary file. * * EP uses this information to decide the location and context binary file name. * Used while compiling model with input and output in memory buffer * * \param[in] model_compile_options The OrtModelCompilationOptions instance. * \param[in] output_directory Null terminated string of the path (wchar on Windows, char otherwise). * \param[in] model_name Null terminated string of the model name (wchar on Windows, char otherwise). * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ ModelCompilationOptions_SetEpContextBinaryInformation: #type (model_compile_options: *OrtModelCompilationOptions, output_directory: *u16, model_name: *u16) -> OrtStatusPtr #c_call; /** Set the graph optimization level. * * \param[in] model_compile_options The OrtModelCompilationOptions instance. * \param[in] graph_optimization_level The graph optimization level. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ ModelCompilationOptions_SetGraphOptimizationLevel: #type (model_compile_options: *OrtModelCompilationOptions, graph_optimization_level: GraphOptimizationLevel) -> OrtStatusPtr #c_call; /** \brief Sets a OrtWriteBufferFunc function that is called by ORT to write out the output model's serialized * ONNX bytes. * * The provided write function may be called repeatedly until then entire output model has been written out. Each call * to the write function is expected to consume the entire input buffer. * * The output model's destination (e.g., file path, memory buffer, or stream) can be set with any of the functions * that begin with ModelCompilationOptions_SetOutputModel____. * * \param[in] model_compile_options The OrtModelCompilationOptions instance. * \param[in] write_func The OrtWriteBufferFunc function called by ORT when writing out the model. * \param[in] state Opaque state passed as the first argument to OrtWriteBufferFunc. Can be NULL. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ ModelCompilationOptions_SetOutputModelWriteFunc: #type (model_compile_options: *OrtModelCompilationOptions, write_func: OrtWriteBufferFunc, state: *void) -> OrtStatusPtr #c_call; /** \brief Sets a OrtGetInitializerLocationFunc function that is called by ORT for every initializer in the generated * model. Allows implementer to specify whether initializers should be stored within the model or externally. * * \param[in] model_compile_options The OrtModelCompilationOptions instance. * \param[in] get_initializer_location_func The OrtGetInitializerLocationFunc function called by ORT when * to determine the location of the initializer. * \param[in] state Opaque state passed as the first argument to OrtGetInitializerLocationFunc. Can be NULL. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ ModelCompilationOptions_SetOutputModelGetInitializerLocationFunc: #type (model_compile_options: *OrtModelCompilationOptions, get_initializer_location_func: OrtGetInitializerLocationFunc, state: *void) -> OrtStatusPtr #c_call; /** \brief Sets the OrtModel to compile. * * Sets an OrtModel created via the Model Editor API as the input for compilation. * * The input model's source (file path, memory buffer, or OrtModel) must be set with * one of: ModelCompilationOptions_SetInputModelPath, ModelCompilationOptions_SetInputModelFromBuffer, * or ModelCompilationOptions_SetInputModel. * * The OrtModel must have a complete graph with inputs, outputs, and nodes defined. * The caller retains ownership of the OrtModel and must not release it until after * CompileModel returns. * * \param[in] model_compile_options The OrtModelCompilationOptions instance. * \param[in] model The OrtModel to compile. The model is borrowed (not copied or owned). * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ ModelCompilationOptions_SetInputModel: #type (model_compile_options: *OrtModelCompilationOptions, model: *OrtModel) -> OrtStatusPtr #c_call; /** \brief Enable or disable weightless mode for model compilation. * * When enabled, the compiled EPContext model will not embed constant initializer data in the EP's * compiled binary. Instead, the initializer data must be provided when creating a session from the * compiled model, either from the source model (via the "onnx_model_filename" EPContext node attribute * or the "ep.context_source_model_path" session option) or from externalized weights. * * This enables smaller compiled models and allows sharing initializer data across multiple compiled * model variants (e.g., multi-platform caches for different hardware generations). * * ORT verifies that the target EP supports weightless mode during CompileModel() by calling * OrtEp::GetWeightlessSupport(). If the EP does not support weightless mode, CompileModel() * returns an error. * * \param[in] model_compile_options The OrtModelCompilationOptions instance. * \param[in] use_weightless If true, enable weightless mode. If false, disable (default behavior). * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.29. */ ModelCompilationOptions_SetWeightlessEnabled: #type (model_compile_options: *OrtModelCompilationOptions, use_weightless: bool) -> OrtStatusPtr #c_call; } /** * \brief The OrtInteropApi struct provides functions for external resource interop with execution providers. * * This API enables importing external GPU resources (memory and semaphores) for zero-copy sharing * between ORT inference and other GPU workloads (e.g., D3D12 applications, media pipelines). * * The API is designed to be EP-agnostic and can be extended to support various GPU interop mechanisms * (D3D12 shared handles, CUDA external memory, Vulkan, etc.). * * Example usage (error handling not shown): * const OrtInteropApi* interop_api = ort_api->GetInteropApi(); * OrtExternalResourceImporter* importer = NULL; * * status = interop_api->CreateExternalResourceImporterForDevice(ep_device, &importer); * if (importer == nullptr) { * // External resource import is optional for EPs to implement * return; * } * bool can_import = false; * status = interop_api->CanImportMemory(importer, ORT_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE, &can_import); * if (can_import) { * OrtExternalMemoryHandle* mem_handle = NULL; * status = interop_api->ImportMemory(importer, &mem_desc, &mem_handle); * // ... use mem_handle to create tensors ... * interop_api->ReleaseExternalMemoryHandle(mem_handle); * } * interop_api->ReleaseExternalResourceImporter(importer); * * \since Version 1.24. */ OrtInteropApi :: struct { /** \brief Create an external resource importer for a specific EP device. * * The external resource importer is a capability object that provides methods for importing * external GPU memory and semaphores for zero-copy import with an execution provider. * * This is an optional EP capability. If the EP does not support external resource import, * out_importer is set to nullptr and the function returns success (nullptr status). * This allows callers to use the simple "if (status != nullptr) handle_error()" pattern * and check out_importer separately for capability detection. * * \param[in] ep_device The OrtEpDevice instance to create the importer for. * \param[out] out_importer Output parameter set to the created OrtExternalResourceImporter instance, * or nullptr if the EP does not support external resource import. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ CreateExternalResourceImporterForDevice: #type (ep_device: *OrtEpDevice, out_importer: **OrtExternalResourceImporter) -> OrtStatusPtr #c_call; /** \brief Release an OrtExternalResourceImporter instance. * * \param[in] input The OrtExternalResourceImporter instance to release. May be nullptr. * * \since Version 1.24. */ ReleaseExternalResourceImporter: #type (input: *OrtExternalResourceImporter) -> void #c_call; /** \brief Check if the external resource importer can import a specific memory handle type. * * \param[in] importer The OrtExternalResourceImporter instance. * \param[in] handle_type The type of external memory handle to check. * \param[out] out_supported Set to true if the handle type is supported. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ CanImportMemory: #type (importer: *OrtExternalResourceImporter, handle_type: OrtExternalMemoryHandleType, out_supported: *bool) -> OrtStatusPtr #c_call; /** \brief Import external memory into the execution provider. * * \param[in] importer The OrtExternalResourceImporter instance. * \param[in] desc Descriptor containing the external memory handle and properties. * \param[out] out_handle Output parameter set to the created OrtExternalMemoryHandle. * The caller owns the returned handle and must call ReleaseExternalMemoryHandle to free it. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ ImportMemory: #type (importer: *OrtExternalResourceImporter, desc: *OrtExternalMemoryDescriptor, out_handle: **OrtExternalMemoryHandle) -> OrtStatusPtr #c_call; /** \brief Release an OrtExternalMemoryHandle instance. * * \param[in] input The OrtExternalMemoryHandle instance to release. May be nullptr. * * \since Version 1.24. */ ReleaseExternalMemoryHandle: #type (input: *OrtExternalMemoryHandle) -> void #c_call; /** \brief Create a tensor backed by imported external memory. * * The created tensor is a view over the imported memory and does not copy data. * The OrtExternalMemoryHandle must remain valid for the lifetime of the tensor. * * \param[in] importer The OrtExternalResourceImporter instance. * \param[in] mem_handle The imported external memory handle. * \param[in] tensor_desc Descriptor specifying tensor element type, shape, and optional offset. * \param[out] out_tensor Output parameter set to the created OrtValue containing the tensor. * The caller owns the returned tensor and must call ReleaseValue to free it. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ CreateTensorFromMemory: #type (importer: *OrtExternalResourceImporter, mem_handle: *OrtExternalMemoryHandle, tensor_desc: *OrtExternalTensorDescriptor, out_tensor: **OrtValue) -> OrtStatusPtr #c_call; /** \brief Check if the external resource importer can import a specific semaphore type. * * \param[in] importer The OrtExternalResourceImporter instance. * \param[in] type The type of external semaphore to check. * \param[out] out_supported Set to true if the semaphore type is supported. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ CanImportSemaphore: #type (importer: *OrtExternalResourceImporter, type: OrtExternalSemaphoreType, out_supported: *bool) -> OrtStatusPtr #c_call; /** \brief Import an external semaphore into the execution provider. * * The returned OrtExternalSemaphoreHandle can be used with WaitSemaphore and an OrtSyncStream * to synchronize execution with external operations. * * \param[in] importer The OrtExternalResourceImporter instance. * \param[in] desc Descriptor containing the external semaphore handle and type. * \param[out] out_handle Output parameter set to the created OrtExternalSemaphoreHandle. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ ImportSemaphore: #type (importer: *OrtExternalResourceImporter, desc: *OrtExternalSemaphoreDescriptor, out_handle: **OrtExternalSemaphoreHandle) -> OrtStatusPtr #c_call; /** \brief Release an OrtExternalSemaphoreHandle instance. * * \param[in] input The OrtExternalSemaphoreHandle instance to release. May be nullptr. * * \since Version 1.24. */ ReleaseExternalSemaphoreHandle: #type (input: *OrtExternalSemaphoreHandle) -> void #c_call; /** \brief Wait on an external semaphore on the EP's stream. * * Inserts a wait operation into the EP's stream that blocks until the semaphore * reaches the specified value. This is used to synchronize with external GPU work * (e.g., D3D12 timeline fence). * * \param[in] importer The OrtExternalResourceImporter instance. * \param[in] semaphore_handle The imported external semaphore. * \param[in] stream The OrtSyncStream to wait on. * \param[in] value The fence/semaphore value to wait for. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ WaitSemaphore: #type (importer: *OrtExternalResourceImporter, semaphore_handle: *OrtExternalSemaphoreHandle, stream: *OrtSyncStream, value: u64) -> OrtStatusPtr #c_call; /** \brief Signal an external semaphore from the EP's stream. * * Inserts a signal operation into the EP's stream that sets the semaphore * to the specified value when reached. This is used to notify external GPU work * (e.g., D3D12 timeline fence) that ORT inference is complete. * * \param[in] importer The OrtExternalResourceImporter instance. * \param[in] semaphore_handle The imported external semaphore. * \param[in] stream The OrtSyncStream to signal from. * \param[in] value The fence/semaphore value to signal. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ SignalSemaphore: #type (importer: *OrtExternalResourceImporter, semaphore_handle: *OrtExternalSemaphoreHandle, stream: *OrtSyncStream, value: u64) -> OrtStatusPtr #c_call; /** \brief Initialize graphics interop for an execution provider device. * * Requests the EP factory to set up graphics interop for the given ep_device using the * provided config. How the factory uses the config (e.g. creating a context, affecting * later stream creation) is implementation-defined. The config (OrtGraphicsInteropConfig) * supplies the graphics API and optional handles; the command_queue member is optional. * Passing command_queue and calling this before CreateSyncStreamForEpDevice for the same * ep_device may allow the factory to enable more efficient GPU-side sync; see the EP * documentation for details. * * Initialization is tied to the OrtEpDevice instance and applies across all sessions * that use that ep_device (i.e. it is global per ep_device, not per-session). * * \param[in] ep_device The OrtEpDevice to initialize graphics interop for. * \param[in] config Configuration (OrtGraphicsInteropConfig): required fields are version (ORT_API_VERSION) * and graphics_api; optional handles include command_queue and additional_options. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.25. */ InitGraphicsInteropForEpDevice: #type (ep_device: *OrtEpDevice, config: *OrtGraphicsInteropConfig) -> OrtStatusPtr #c_call; /** \brief Deinitialize graphics interop for an execution provider device. * * This function cleans up the graphics interop context that was created by InitGraphicsInteropForEpDevice. * Should be called when graphics interop is no longer needed for the ep_device. * * The caller must release all resources that use the interop context before calling this function: * - OrtSyncStream instances created for this ep_device via CreateSyncStreamForEpDevice * - OrtExternalSemaphoreHandle and OrtExternalResourceImporter instances created for this ep_device * Failure to do so may lead to undefined behavior if the implementation destroys the underlying context. * * \param[in] ep_device The OrtEpDevice to deinitialize graphics interop for. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.25. */ DeinitGraphicsInteropForEpDevice: #type (ep_device: *OrtEpDevice) -> OrtStatusPtr #c_call; } OrtEpGraphSupportInfo :: struct {} OrtMemoryDevice :: struct {} OrtNodeComputeContext :: struct {} OrtOpSchema :: struct {} OrtOpSchemaTypeConstraint :: struct {} OrtProfilingEventsContainer :: struct {} OrtProfilingEvent :: struct {} /** \brief Base struct for imported external memory handles. * * EPs derive from this struct to add EP-specific fields (e.g., CUdeviceptr for CUDA). * EP is responsible for creating and releasing instances of the derived type. * * Example derived type for CUDA EP: * \code * struct MyCudaExternalMemoryHandle : OrtExternalMemoryHandle { * CUexternalMemory ext_memory; * CUdeviceptr mapped_ptr; * bool is_dedicated; * }; * \endcode * * \since Version 1.24. */ OrtExternalMemoryHandle :: struct { version: u32; ///< Must be ORT_API_VERSION ep_device: *OrtEpDevice; ///< EP device that created this handle descriptor: OrtExternalMemoryDescriptor; ///< External memory descriptor /** \brief Release callback for this handle. EP sets this to its release function. * * ORT calls this when ReleaseExternalMemoryHandle is invoked. The EP's callback * should cast the handle to its derived type and delete it. */ Release: #type (handle: *OrtExternalMemoryHandle) -> void #c_call; } /** \brief Base struct for imported external semaphore handles. * * EPs derive from this struct to add EP-specific fields (e.g., CUexternalSemaphore for CUDA). * EP is responsible for creating and releasing instances of the derived type. * * Example derived type for CUDA EP: * \code * struct MyCudaExternalSemaphoreHandle : OrtExternalSemaphoreHandle { * CUexternalSemaphore ext_semaphore; * }; * \endcode * * \since Version 1.24. */ OrtExternalSemaphoreHandle :: struct { version: u32; ///< Must be ORT_API_VERSION ep_device: *OrtEpDevice; ///< EP device that created this handle descriptor: OrtExternalSemaphoreDescriptor; ///< External semaphore descriptor /** \brief Release callback for this handle. EP sets this to its release function. * * ORT calls this when ReleaseExternalSemaphoreHandle is invoked. The EP's callback * should cast the handle to its derived type and delete it. */ Release: #type (handle: *OrtExternalSemaphoreHandle) -> void #c_call; } // Opaque types for kernel-based EPs OrtKernelRegistry :: struct {} OrtKernelDefBuilder :: struct {} OrtKernelDef :: struct {} OrtDataType :: struct {} OrtSharedPrePackedWeightCache :: struct {} /** \brief Struct that an EP implements for IDataTransfer to copy between devices it uses and CPU. * * \since Version 1.23. */ OrtDataTransferImpl :: struct { ort_version_supported: u32; ///< Must be initialized to ORT_API_VERSION /** \brief Release the OrtDataTransferImpl instance. * * This is called by ORT when the OrtDataTransferImpl instance is no longer needed. * The implementation should release any resources held by the instance. * * \param[in] this_ptr Pointer to the OrtDataTransferImpl instance. * * \since Version 1.23. */ Release: #type (this_ptr: *OrtDataTransferImpl) -> void #c_call; /** \brief Check if the implementation can copy between the source and destination memory devices. * * \param[in] this_ptr Pointer to the OrtDataTransferImpl instance. * \param[in] src_memory_device Source OrtMemoryDevice to copy from. * \param[in] dst_memory_device Destination OrtMemoryDevice to copy to. * \return True if the implementation can copy between the devices. * * \since Version 1.23. */ CanCopy: #type (this_ptr: *OrtDataTransferImpl, src_memory_device: *OrtMemoryDevice, dst_memory_device: *OrtMemoryDevice) -> bool #c_call; /** \brief Copy tensors from src_tensors to dst_tensors using the provided streams. * * The implementation can use the provided streams to perform asynchronous copies if supported. * If a stream is not available, the copy is performed synchronously. * * \param[in] this_ptr Pointer to the OrtDataTransferImpl instance. * \param[in] src_tensors Array of source OrtValue pointers to copy from. * \param[in] dst_tensors Array of destination OrtValue pointers to copy to. * \param[in] streams Array of OrtSyncStream pointers for the copy operations, if the execution provider is stream * aware. nullptr if it is not. * \param[in] num_tensors Number of tensors to copy. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ CopyTensors: #type (this_ptr: *OrtDataTransferImpl, src_tensors: **OrtValue, dst_tensors: **OrtValue, streams: **OrtSyncStream, num_tensors: u64) -> OrtStatusPtr #c_call; } /** \brief Struct that an EP implements for Stream Notifications. * * \since Version 1.23. */ OrtSyncNotificationImpl :: struct { ort_version_supported: u32; ///< Must be initialized to ORT_API_VERSION /** \brief Release the OrtSyncNotificationImpl instance. * * This is called by ORT when the OrtSyncNotificationImpl instance is no longer needed. * The implementation should release any resources held by the instance. * * \param[in] this_ptr Pointer to the OrtSyncNotificationImpl instance. * * \since Version 1.23. */ Release: #type (this_ptr: *OrtSyncNotificationImpl) -> void #c_call; /** \brief Called by ORT to activate the notification. * * \param[in] this_ptr Pointer to the OrtSyncNotificationImpl instance. * * \since Version 1.23. */ Activate: #type (this_ptr: *OrtSyncNotificationImpl) -> OrtStatusPtr #c_call; /** \brief Wait for a device to device operation to complete. * * \param[in] this_ptr Pointer to the OrtSyncNotificationImpl instance. * \param[in] consumer_stream The OrtSyncStream instance that will wait on this notification to be activated. * * \since Version 1.23. */ WaitOnDevice: #type (this_ptr: *OrtSyncNotificationImpl, consumer_stream: *OrtSyncStream) -> OrtStatusPtr #c_call; /** \brief Wait for a device to host operation to complete. * * \param[in] this_ptr Pointer to the OrtSyncNotificationImpl instance. * * \since Version 1.23. */ WaitOnHost: #type (this_ptr: *OrtSyncNotificationImpl) -> OrtStatusPtr #c_call; } /** \brief Struct that an EP implements if it wishes to implement Stream support. * * This struct provides the overrides for onnxruntime::Stream's virtual methods. * * \since Version 1.23. */ OrtSyncStreamImpl :: struct { ort_version_supported: u32; ///< Must be initialized to ORT_API_VERSION /** \brief Release the OrtSyncStreamImpl instance. * * This is called by ORT when the OrtSyncStreamImpl instance is no longer needed. * The implementation should release any resources held by the instance. * * \param[in] this_ptr Pointer to the OrtSyncStreamImpl instance. * * \since Version 1.23. */ Release: #type (this_ptr: *OrtSyncStreamImpl) -> void #c_call; /** \brief Get the handle of the stream. * * This returns the native handle for the stream. e.g. cudaStream_t for CUDA streams. * * \param[in] this_ptr Pointer to the OrtSyncStreamImpl instance. * \return The handle of the stream. * * \since Version 1.23. */ GetHandle: #type (this_ptr: *OrtSyncStreamImpl) -> *void #c_call; /** \brief Create an OrtSyncNotificationImpl for the OrtSyncStreamImpl instance. * * \param[in] this_ptr Pointer to the OrtSyncStreamImpl instance * \param[out] notification The new OrtSyncNotificationImpl instance. * * \since Version 1.23. */ CreateNotification: #type (this_ptr: *OrtSyncStreamImpl, notification: **OrtSyncNotificationImpl) -> OrtStatusPtr #c_call; /** \brief Flush the stream. * * This is called by ORT to flush the stream, ensuring that all operations submitted to the stream are completed. * * \param[in] this_ptr Pointer to the OrtSyncStreamImpl instance. * * \since Version 1.23. */ Flush: #type (this_ptr: *OrtSyncStreamImpl) -> OrtStatusPtr #c_call; /** \brief Notify the stream that a session run has ended. * * This is called by ORT to notify the stream that a session run has ended, allowing the stream to perform any * necessary cleanup or finalization. * * \param[in] this_ptr Pointer to the OrtSyncStreamImpl instance. * * \since Version 1.23. */ OnSessionRunEnd: #type (this_ptr: *OrtSyncStreamImpl) -> OrtStatusPtr #c_call; } /** \brief Struct that an EP implements for external resource import (memory + semaphore import). * * This capability object provides methods for importing external GPU memory and semaphores * for zero-copy import. EPs that support D3D12, CUDA, HIP, or Vulkan external resource APIs * can implement this interface. * * \since Version 1.24. */ OrtExternalResourceImporterImpl :: struct { ort_version_supported: u32; ///< Must be initialized to ORT_API_VERSION /** \brief Check if the implementation can import external memory of the given handle type. * * \param[in] this_ptr Pointer to the OrtExternalResourceImporterImpl instance. * \param[in] handle_type The type of external memory handle to check. * \return True if the handle type is supported. * * \since Version 1.24. */ CanImportMemory: #type (this_ptr: *OrtExternalResourceImporterImpl, handle_type: OrtExternalMemoryHandleType) -> bool #c_call; /** \brief Import external memory. * * The EP creates a derived type of OrtExternalMemoryHandle and returns a pointer to the base. * EP is responsible for the lifetime of the handle (release via ReleaseMemory). * * \param[in] this_ptr Pointer to the OrtExternalResourceImporterImpl instance. * \param[in] desc Descriptor containing the external memory handle and properties. * \param[out] out_handle Output parameter set to the created OrtExternalMemoryHandle (EP's derived type). * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ ImportMemory: #type (this_ptr: *OrtExternalResourceImporterImpl, desc: *OrtExternalMemoryDescriptor, out_handle: **OrtExternalMemoryHandle) -> OrtStatusPtr #c_call; /** \brief Release an imported external memory handle. * * The EP deletes its derived type instance. * * \param[in] this_ptr Pointer to the OrtExternalResourceImporterImpl instance. * \param[in] handle The OrtExternalMemoryHandle to release (EP casts to its derived type). * * \since Version 1.24. */ ReleaseMemory: #type (this_ptr: *OrtExternalResourceImporterImpl, handle: *OrtExternalMemoryHandle) -> void #c_call; /** \brief Create a tensor backed by imported external memory. * * The created tensor is a view over the imported memory and does not copy data. * * \param[in] this_ptr Pointer to the OrtExternalResourceImporterImpl instance. * \param[in] mem_handle The imported external memory handle (EP casts to its derived type). * \param[in] tensor_desc Descriptor specifying tensor element type, shape, and optional offset. * \param[out] out_tensor Output parameter set to the created OrtValue containing the tensor. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ CreateTensorFromMemory: #type (this_ptr: *OrtExternalResourceImporterImpl, mem_handle: *OrtExternalMemoryHandle, tensor_desc: *OrtExternalTensorDescriptor, out_tensor: **OrtValue) -> OrtStatusPtr #c_call; /** \brief Check if the implementation can import external semaphores of the given type. * * \param[in] this_ptr Pointer to the OrtExternalResourceImporterImpl instance. * \param[in] type The type of external semaphore to check. * \return True if the semaphore type is supported. * * \since Version 1.24. */ CanImportSemaphore: #type (this_ptr: *OrtExternalResourceImporterImpl, type: OrtExternalSemaphoreType) -> bool #c_call; /** \brief Import an external semaphore. * * The EP creates a derived type of OrtExternalSemaphoreHandle and returns a pointer to the base. * EP is responsible for the lifetime of the handle (release via ReleaseSemaphore). * * \param[in] this_ptr Pointer to the OrtExternalResourceImporterImpl instance. * \param[in] desc Descriptor containing the external semaphore handle and type. * \param[out] out_handle Output parameter set to the created OrtExternalSemaphoreHandle (EP's derived type). * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ ImportSemaphore: #type (this_ptr: *OrtExternalResourceImporterImpl, desc: *OrtExternalSemaphoreDescriptor, out_handle: **OrtExternalSemaphoreHandle) -> OrtStatusPtr #c_call; /** \brief Release an imported external semaphore handle. * * The EP deletes its derived type instance. * * \param[in] this_ptr Pointer to the OrtExternalResourceImporterImpl instance. * \param[in] handle The OrtExternalSemaphoreHandle to release (EP casts to its derived type). * * \since Version 1.24. */ ReleaseSemaphore: #type (this_ptr: *OrtExternalResourceImporterImpl, handle: *OrtExternalSemaphoreHandle) -> void #c_call; /** \brief Wait on an external semaphore on the EP's stream. * * Inserts a wait operation into the EP's stream that blocks until the semaphore * reaches the specified value. * * \param[in] this_ptr Pointer to the OrtExternalResourceImporterImpl instance. * \param[in] handle The imported external semaphore (EP casts to its derived type). * \param[in] stream The OrtSyncStream to wait on. * \param[in] value The fence/semaphore value to wait for. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ WaitSemaphore: #type (this_ptr: *OrtExternalResourceImporterImpl, handle: *OrtExternalSemaphoreHandle, stream: *OrtSyncStream, value: u64) -> OrtStatusPtr #c_call; /** \brief Signal an external semaphore from the EP's stream. * * Inserts a signal operation into the EP's stream that sets the semaphore * to the specified value when reached. * * \param[in] this_ptr Pointer to the OrtExternalResourceImporterImpl instance. * \param[in] handle The imported external semaphore (EP casts to its derived type). * \param[in] stream The OrtSyncStream to signal from. * \param[in] value The fence/semaphore value to signal. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ SignalSemaphore: #type (this_ptr: *OrtExternalResourceImporterImpl, handle: *OrtExternalSemaphoreHandle, stream: *OrtSyncStream, value: u64) -> OrtStatusPtr #c_call; /** \brief Release the OrtExternalResourceImporterImpl instance. * * This is called by ORT when the OrtExternalResourceImporterImpl instance is no longer needed. * The implementation should release any resources held by the instance. * * \param[in] this_ptr Pointer to the OrtExternalResourceImporterImpl instance. * * \since Version 1.24. */ Release: #type (this_ptr: *OrtExternalResourceImporterImpl) -> void #c_call; } /** \brief The event category for profiling events reported by an execution provider. * * \since Version 1.25. */ OrtProfilingEventCategory :: enum s32 { OrtProfilingEventCategory_SESSION :: 0; OrtProfilingEventCategory_NODE :: 1; OrtProfilingEventCategory_KERNEL :: 2; OrtProfilingEventCategory_API :: 3; } /** \brief Struct that an EP implements for profiling support. * * An execution provider optionally implements this struct to participate in ONNX Runtime's profiling system. * The EP creates and returns an instance of this struct via OrtEp::CreateProfiler. * * ORT calls the function pointers at appropriate times during a profiling session: * - StartProfiling once when profiling begins. * - [Optional] StartEvent / StopEvent around each ORT event (operator executions, session events, etc.). * - EndProfiling once when profiling ends to collect EP events. * - Release when ORT no longer needs the profiler. * * Profiling scenarios: * - ORT session profiling: Captures session initialization and one or more runs with a single ORT session. * - Enabled via OrtApi::EnableProfiling(session_options). * - There is one ORT session, one OrtEp, and one OrtEpProfilerImpl * - Concurrency notes: An application may use a single ORT session (and the single OrtEpProfilerImpl) to run * multiple inferences concurrently. The OrtEpProfilerImpl::StartEvent and OrtEpProfilerImpl::StopEvent * functions will be called with ORT events from multiple concurrent runs. The OrtEpProfilerImpl::EndProfiling * function is expected to return all EP events from all runs with correct correlations with the original ORT * events. * - ORT run profiling: Captures events for a given run. An application can either enable session profiling or run * profiling, but not both at the same time. * - Enabled via OrtApi::RunOptionsEnableProfiling(run_options). * - There is one ORT session, one OrtEp, and multiple OrtEpProfilerImpl instances (one per profiled run). * - Concurrency notes: each OrtEpProfilerImpl only receives calls for its specific run. * OrtEpProfilerImpl::EndProfiling must only return EP events for its specific run. * * \since Version 1.25. */ OrtEpProfilerImpl :: struct { ort_version_supported: u32; ///< Must be initialized to ORT_API_VERSION. /** \brief Release the OrtEpProfilerImpl instance. * * Called by ORT when the profiler is no longer needed. * The implementation should release any resources held by the instance. * * \param[in] this_ptr Pointer to the OrtEpProfilerImpl instance. * * \note Implementation of this function is required. * * \since Version 1.25. */ Release: #type (this_ptr: *OrtEpProfilerImpl) -> void #c_call; /** \brief Called when profiling starts. * * Allows the EP profiler to initialize profiling utilities and record the profiling start time. * * An EP profiler should record its own clock's current time when this function is called. This allows the EP to * later compute ORT-relative event timestamps by combining `ep_profiling_start_offset_ns` with the EP's own * elapsed time since this call. The formula is: * * event_timestamp_us = (ep_profiling_start_offset_ns + (ep_event_time_ns - ep_profiling_start_time_ns)) / 1000 * * where `ep_event_time_ns` and `ep_profiling_start_time_ns` are measured using the EP's own clock. * * \param[in] this_ptr Pointer to the OrtEpProfilerImpl instance. * \param[in] ep_profiling_start_offset_ns The elapsed time in nanoseconds (using ORT's profiling clock) between * ORT's profiling start and this call to StartProfiling. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \note An error OrtStatus returned from this function is logged by ORT (does not end execution). * \note Implementation of this function is required. * * \since Version 1.25. */ StartProfiling: #type (this_ptr: *OrtEpProfilerImpl, ep_profiling_start_offset_ns: s64) -> OrtStatusPtr #c_call; /** \brief Called when an ORT event (e.g., session initialization, node kernel execution, etc.) begins. * * ORT pairs every StartEvent call with a corresponding call to StopEvent with the same ORT event correlation ID. * EP profiler implementations may use the calls to StartEvent and StopEvent to maintain a stack of ORT event * correlation IDs that can be correlated with EP events (e.g., GPU kernel events). For example: * * OrtEpProfilerImpl::StartEvent(x) -> EP ort event stack: [x] <- top of stack * [EP events are tagged with 'x'] * OrtEpProfilerImpl::StartEvent(y) -> EP ort event stack: [x, y] <- top of stack * [EP events are tagged with 'y'] * OrtEpProfilerImpl::StopEvent(y) -> EP ort event stack: [x] <- top of stack * OrtEpProfilerImpl::StartEvent(z) -> EP ort event stack: [x, z] <- top of stack * [EP events are tagged with 'z'] * OrtEpProfilerImpl::StopEvent(z) -> EP ort event stack: [x] <- top of stack * OrtEpProfilerImpl::StopEvent(x) -> EP ort event stack: [ ] <- top of stack * * Tagging EP events with the ORT event correlation ID enables the EP to annotate its own events * with metadata from the parent ORT event (e.g., operator name). * * \note **Threading:** For a given ORT event, StartEvent, the kernel's Compute() entry point, and StopEvent * are all invoked on the same CPU thread (Compute() may asynchronously launch device work). * Different ORT events may run on different threads (e.g., inter-op parallelism), so correlation * stacks (e.g., for CUPTI) should use thread-local storage. * * \note The ORT event correlation ID is an absolute, epoch-based timestamp in microseconds. It is computed * from the ORT event's start time using std::chrono::high_resolution_clock (platform-defined epoch). * Because it is absolute rather than relative to profiling start, it is practically unique across * concurrent profiling sessions within the same process (collisions require sub-microsecond event * concurrency) and can be used directly as a correlation ID for EP profiling utilities * (e.g., CUPTI or ROCTracer). * * \param[in] this_ptr Pointer to the OrtEpProfilerImpl instance. * \param[in] ort_event_correlation_id Absolute, epoch-based correlation ID for the ORT event that is starting. * The same value is passed to the corresponding StopEvent call. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \note An error OrtStatus returned from this function is logged by ORT (does not end execution). * \note Implementation of this function is optional. If set to NULL, it is not called. * * \since Version 1.25. */ StartEvent: #type (this_ptr: *OrtEpProfilerImpl, ort_event_correlation_id: u64) -> OrtStatusPtr #c_call; /** \brief Called when a profiled ORT event (e.g., session initialization, node kernel execution, etc.) ends. * * ORT pairs every StartEvent call with a corresponding call to StopEvent with the same ORT event correlation ID. * EP profiler implementations may use the calls to StartEvent and StopEvent to maintain a stack of ORT event * correlation IDs that can be correlated with EP events (e.g., GPU kernel events). For example: * * OrtEpProfilerImpl::StartEvent(x) -> EP ort event stack: [x] <- top of stack * [EP events are tagged with 'x'] * OrtEpProfilerImpl::StartEvent(y) -> EP ort event stack: [x, y] <- top of stack * [EP events are tagged with 'y'] * OrtEpProfilerImpl::StopEvent(y) -> EP ort event stack: [x] <- top of stack * OrtEpProfilerImpl::StartEvent(z) -> EP ort event stack: [x, z] <- top of stack * [EP events are tagged with 'z'] * OrtEpProfilerImpl::StopEvent(z) -> EP ort event stack: [x] <- top of stack * OrtEpProfilerImpl::StopEvent(x) -> EP ort event stack: [ ] <- top of stack * * Tagging EP events with the ORT event correlation ID enables the EP to annotate its own events * with metadata from the parent ORT event (e.g., operator name). * * \note **Threading:** For a given ORT event, StartEvent, the kernel's Compute() entry point, and StopEvent * are all invoked on the same CPU thread (Compute() may asynchronously launch device work). * Different ORT events may run on different threads (e.g., inter-op parallelism), so correlation * stacks (e.g., for CUPTI) should use thread-local storage. * * \note The ORT event correlation ID is an absolute, epoch-based timestamp in microseconds. It is computed * from the ORT event's start time using std::chrono::high_resolution_clock (platform-defined epoch). * Because it is absolute rather than relative to profiling start, it is practically unique across * concurrent profiling sessions within the same process (collisions require sub-microsecond event * concurrency) and can be used directly as a correlation ID for EP profiling utilities * (e.g., CUPTI or ROCTracer). * * \param[in] this_ptr Pointer to the OrtEpProfilerImpl instance. * \param[in] ort_event_correlation_id Absolute, epoch-based correlation ID for the ORT event that is ending. * The same value was passed to the corresponding StartEvent call. * \param[in] ort_event Opaque pointer to the ORT profiling event. Valid only during this call. * Use OrtEpApi accessor functions to read event fields. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \note An error OrtStatus returned from this function is logged by ORT (does not end execution). * \note Implementation of this function is optional. If set to NULL, it is not called. * * \since Version 1.25. */ StopEvent: #type (this_ptr: *OrtEpProfilerImpl, ort_event_correlation_id: u64, ort_event: *OrtProfilingEvent) -> OrtStatusPtr #c_call; /** \brief Called when profiling ends to collect the EP's new profiling events since the call to StartProfiling. * * An EP profiler converts its events to OrtProfilingEvent instances and adds them into the provided * OrtProfilingEventsContainer container. Call OrtEpApi::CreateProfilingEvent to create a new * OrtProfilingEvent instance. Then call OrtEpApi::ProfilingEventsContainer_AddEvents to add one or more * events to the container. * * After this function returns, ORT appends the EP's events to the profiling timeline. * * \param[in] this_ptr The OrtEpProfilerImpl instance. * \param[in] events_container Event container to which the EP profiler adds its new events. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \note An error OrtStatus returned from this function is logged by ORT (does not end execution). * \note Implementation of this function is required. * * \since Version 1.25. */ EndProfiling: #type (this_ptr: *OrtEpProfilerImpl, events_container: *OrtProfilingEventsContainer) -> OrtStatusPtr #c_call; } /** * \brief The OrtNodeFusionOptions struct specifies options for fusing nodes supported by an execution provider. * * Refer to OrtEpApi::EpGraphSupportInfo_AddNodesToFuse. * * \since Version 1.23. */ OrtNodeFusionOptions :: struct { /** \brief The ONNX Runtime version the OrtNodeFusionOptions was compiled with. * * Implementation should set to ORT_API_VERSION. * ORT will use this to ensure it does not use members that were not available when the EP library was compiled. * * \since Version 1.23. */ ort_version_supported: u32; /** \brief If set to true, specify that the execution provider does not require ONNX Runtime to provide constant * initializers as inputs to the fused node during model inference. This is used when the execution * provider saves a copy of constant initializers, and allows ONNX Runtime to release constant initializers that * are not used by any execution provider. * * If not specified, defaults to false. That is, ONNX Runtime provides constant initializers as inputs to * the fused node by default. * * \since Version 1.23. */ drop_constant_initializers: bool; } /** * \brief The OrtNodeComputeInfo struct provides functions that an OrtEp implements to specify the compute * function for a compiled OrtGraph instance. * \since Version 1.23. */ OrtNodeComputeInfo :: struct { /** \brief The ONNX Runtime version the OrtNodeComputeInfo was compiled with. * * Implementation should set to ORT_API_VERSION. * ORT will use this to ensure it does not call functions that were not available when the EP library was compiled. * * \since Version 1.23. */ ort_version_supported: u32; /** \brief Creates an opaque compute state object that is then passed to the Compute() function during inference. * \param[in] this_ptr The OrtNodeComputeInfo instance. * \param[in] compute_context OrtNodeComputeContext instance that contains compiled/fused node's name and host * memory allocation functions. Can optionally be used to build the compute state. * \param[out] compute_state Output parameter that is assigned the opaque computation state. ONNX Runtime calls * ReleaseState() (after calling Compute()) to allow the implementer to release the * compute state. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ CreateState: #type (this_ptr: *OrtNodeComputeInfo, compute_context: *OrtNodeComputeContext, compute_state: **void) -> *OrtStatus #c_call; /** \brief Computation function called to execute the fused node compiled by an OrtEp instance. * \param[in] this_ptr The OrtNodeComputeInfo instance. * \param[in] compute_state The opaque computation state returned by CreateState(). * \param[in] kernel_context The OrtKernelContext instance used to access inputs/outputs. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ Compute: #type (this_ptr: *OrtNodeComputeInfo, compute_state: *void, kernel_context: *OrtKernelContext) -> *OrtStatus #c_call; /** \brief Releases the compute state returned by CreateState(). * \param[in] this_ptr The OrtNodeComputeInfo instance. * \param[inout] compute_state The opaque compute state returned by CreateState(). * * \since Version 1.23. */ ReleaseState: #type (this_ptr: *OrtNodeComputeInfo, compute_state: *void) -> void #c_call; } /** * \brief Contains functions that an OrtEp implements to specify the computation for an operator kernel. * \since Version 1.24. */ OrtKernelImpl :: struct { ort_version_supported: u32; ///< Must be initialized to ORT_API_VERSION flags: u32; ///< EP must initialize to 0. Used internally by ORT. /** \brief Computation function called to execute the kernel on an EP. * * \note Implementation of this function is required. * * \param[in] this_ptr The OrtKernelImpl instance. * \param[in] context The OrtKernelContext instance that provides access to the inputs and outputs. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ Compute: #type (this_ptr: *OrtKernelImpl, _context: *OrtKernelContext) -> OrtStatusPtr #c_call; /** \brief Called by ORT to release the OrtKernelImpl instance and its resources. * * \note Implementation of this function is required. * * \param[in] this_ptr The OrtKernelImpl instance. * * \since Version 1.24. */ Release: #type (this_ptr: *OrtKernelImpl) -> void #c_call; /** \brief Optional function to pre-pack a constant tensor (i.e., a weight) to the kernel's preferred data layout. * * For example, a Conv kernel can define this function to pack input W to the channel-last data layout * before inference. * * Pre-packing can operate in three different modes: no pre-packing mode, sharing mode, and non-sharing mode. * 1) No pre-packing mode: The kernel can forgo any weight pre-packing for the given `input_index` by setting * `is_packed` to false and returning a successful OrtStatus. In this mode, the kernel's * OrtKernelImpl::SetSharedPrePackedWeight() function is not called for that specific * `input_index`. * 2) Sharing mode: Sharing is allowed if the `prepacked_weight_cache` argument is not NULL and the EP stores * weight data in CPU-accessible memory. In this case, the kernel can optionally choose * to share the packed weight with other kernels that use the same weight * (compared by content hash). To do so, the kernel must allocate the packed weight with the * provided `allocator`, then it stores the packed weight data into `prepacked_weight_cache` * via SharedPrePackedWeightCache_StoreWeightData(), sets `is_packed` to true, and returns a * successful OrtStatus. ORT will subsequently call OrtKernelImpl::SetSharedPrePackedWeight() * to provide this kernel with the actual shared weight data, whose memory location could * differ (i.e., if shared data was allocated by a previously processed kernel). * 3) Non-sharing mode: In non-sharing mode, the `prepacked_weight_cache` argument is ignored. In this mode, * the implementation allocates the packed data with the provided `allocator`, sets * `is_packed` to true, and returns a successful OrtStatus. The kernel is ultimately * responsible for releasing the packed data for the weight with `allocator`. * ORT may release the original (unpacked) weight, which must not be accessed in * OrtKernelImpl::Compute(). Note that in this mode, the kernel's * OrtKernelImpl::SetSharedPrePackedWeight() function is not called by ORT for that specific * `input_index`. * * \note This function is based on the internal OpKernel::PrePack() virtual function used within ORT. * * \param[in] this_ptr The OrtKernelImpl instance. * \param[in] tensor The OrtValue instance representing the constant tensor (weight). Do not cache in the kernel. * \param[in] input_index The input index of the tensor in this kernel. * \param[in] allocator Allocator for allocating the pre-packed data. Its use is required in sharing mode and * recommended, but not required, in the non-sharing mode. This will be an allocator set by * the application for the session/environment (e.g., via CreateAndRegisterAllocator[V2] * or RegisterAllocator), or an allocator on the OrtEpDevice (read-only or default) otherwise. * The allocator remains valid throughout the lifetime of the OrtKernelImpl instance. * \param[in] prepacked_weight_cache May be NULL. If not NULL, the kernel may choose to share a packed weight by * first storing it in the OrtSharedPrePackedWeightCache instance and then * receiving the actual shared weight data in the call to * OrtKernelImpl::SetSharedPrePackedWeight(). See the above description for * "sharing mode". * \param[out] is_packed Output parameter that the implementation sets to true if the kernel packed the tensor data. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \note Implementation of this function is optional. If not implemented (set to NULL), ORT assumes the kernel * does not pre-pack weight data (i.e., `is_packed` defaults to false). * * \since Version 1.24. */ PrePackWeight: #type (this_ptr: *OrtKernelImpl, tensor: *OrtValue, input_index: s32, allocator: *OrtAllocator, prepacked_weight_cache: *OrtSharedPrePackedWeightCache, is_packed: *bool) -> OrtStatusPtr #c_call; /** \brief Optional function that receives data for a shared pre-packed weight from ORT. * * ORT calls this function after calling OrtKernelImpl::PrePackWeight for a specific `input_index` if: * - OrtKernelImpl::PrePackWeight set the output parameter `is_packed` to true. * - OrtKernelImpl::PrePackWeight stored weight data to share into the provided OrtSharedPrePackedWeightCache * parameter (`prepacked_weight_cache`) via the API SharedPrePackedWeightCache_StoreWeightData. * * Refer to the description of the "sharing-mode" in the documentation for OrtKernelImpl::PrePackWeight(). * * \note ORT will not call this function for an `input_index` that a previous call to * OrtKernelImpl::PrePackWeight() did not elect to pre-pack and share. * * \note This function is based on the internal OpKernel::UseSharedPrePackedBuffers() virtual function used * within ORT. * * \param[in] this_ptr The OrtKernelImpl instance. * \param[in] buffer_data_ptrs An array of buffer data pointers that collectively hold the pre-packed data for a * single shared weight. The buffers are provided in the same order and with the same * contents (in a potentially different memory location) as the buffers * passed into SharedPrePackedWeightCache_StoreWeightData() within the * OrtKernelImpl::PrePackWeight() call for the same `input_index`. * \param[in] buffer_data_sizes An array of buffer byte sizes, one per element in `buffer_data_ptrs`. * \param[in] num_buffers The number of buffers used to store the data for the shared pre-packed weight. * Specifies the number of elements in the `buffer_data_ptrs` and `buffer_data_sizes` arrays. * \param[in] input_index The input index of the tensor in this kernel. This index identifies the identity of * the weight. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \note Implementation of this function is generally optional. It is only required if OrtKernelImpl::PrePack() * elects to share pre-packed weights. * * \since Version 1.24. */ SetSharedPrePackedWeight: #type (this_ptr: *OrtKernelImpl, buffer_data_ptrs: **void, buffer_data_sizes: *u64, num_buffers: u64, input_index: s32) -> OrtStatusPtr #c_call; } /** \brief Type definition for a function that creates an OrtKernelImpl instance for an operator kernel. * * \param[in] kernel_create_func_state Opaque state initially provided by the EP that registered the kernel. * Refer to OrtEpApi::KernelRegistry_AddKernel(). May be null. * \param[in] info The OrtKernelInfo instance that provides access to the kernel's input and output characteristics. * \param[out] kernel_out Output parameter set to the new OrtKernelImpl instance. On success, ownership of this * OrtKernelImpl instance transfers to ORT, which will call OrtKernelImpl::Release() to * release the instance when it is no longer used. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ OrtKernelCreateFunc :: #type (kernel_create_func_state: *void, info: *OrtKernelInfo, kernel_out: **OrtKernelImpl) -> *OrtStatus #c_call; /** * \brief Contains helper functions for a Loop OrtKernelImpl created via OrtEpApi::CreateLoopKernel. * \since Version 1.24. */ OrtLoopKernelHelper :: struct { ort_version_supported: u32; ///< Must be initialized to ORT_API_VERSION /** \brief Called by ORT to release the OrtLoopKernelHelper instance and its resources. * * \param[in] this_ptr The OrtLoopKernelHelper instance. * * \since Version 1.24. */ Release: #type (this_ptr: *OrtLoopKernelHelper) -> void #c_call; /** \brief Helper function that concatenates OrtValue instances from each loop iteration into a single * pre-allocated output buffer. * * \note Implementing this function is required for all Loop opset versions. * * \param[in] this_ptr The OrtLoopKernelHelper instance. * \param[in] stream_handle Optional native stream handle that enables asynchronous operations. May be NULL. * \param[in] per_iteration_outputs Array of OrtValue instances from each iteration. All OrtValue elements have the * same shape. * \param[in] num_per_iteration_outputs The number of OrtValue* elements in the `per_iteration_outputs` array. * \param[out] output The pre-allocated output buffer. Memory is allocated on the device for the EP running the * Loop node. * \param[in] output_size_in_bytes The size in bytes of the `output` buffer. It is guaranteed to be large enough * to hold the concatenated data of each element in `per_iteration_outputs`. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ ConcatOutput: #type (this_ptr: *OrtLoopKernelHelper, stream_handle: *void, per_iteration_outputs: **OrtValue, num_per_iteration_outputs: u64, output: *void, output_size_in_bytes: u64) -> OrtStatusPtr #c_call; } /** * \brief Contains helper functions for a Scan OrtKernelImpl created via OrtEpApi::CreateScanKernel. * \since Version 1.24. */ OrtScanKernelHelper :: struct { ort_version_supported: u32; ///< Must be initialized to ORT_API_VERSION /** \brief Called by ORT to release the OrtScanKernelHelper instance and its resources. * * \param[in] this_ptr The OrtScanKernelHelper instance. * * \since Version 1.24. */ Release: #type (this_ptr: *OrtScanKernelHelper) -> void #c_call; /** \brief Helper function that transposes an OrtValue instance during execution of a Scan kernel. * * \note Called for Scan (opset >= 9) when the 'scan_input_axes' or 'scan_output_axes' attributes contain * non-zero values. Implementing this function is required for Scan opset versions >= 9. * * \param[in] this_ptr The OrtScanKernelHelper instance. * \param[in] permutation An array of integers that defines how the input tensor's axes should be permuted. * \param[in] num_permutation_elems The number of integer elements in the `permutation` array. * \param[in] input The input OrtValue tensor to transpose. * \param[in] stream An optional OrtSyncStream instance to be used for asynchronous operations. May be NULL. * \param[out] output The pre-allocated output OrtValue instance into which to store the results of the * transpose operation. Must not be released as it is owned by ORT. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ Transpose: #type (this_ptr: *OrtScanKernelHelper, permutation: *u64, num_permutation_elems: u64, input: *OrtValue, stream: *OrtSyncStream, output: *OrtValue) -> OrtStatusPtr #c_call; } /** * \brief Discriminator for the resource count type stored in an OrtResourceCount. * * New resource accounting types can be added by appending new enum values. * The OrtResourceCount union storage is large enough to hold all current and future types. * * \since Version 1.26. */ OrtResourceCountKind :: enum s32 { OrtResourceCountKind_None :: 0; OrtResourceCountKind_TotalBytes :: 1; } /** * \brief ABI-stable tagged union representing a resource cost or budget. * * This struct is a C-safe variant that can be passed by value across the plugin DLL boundary. * The `kind` field selects which member of the `value` union is active. The * `value.reserved_words` storage reserves space for future resource types without changing * the struct layout. * * Adding new resource types requires only: (a) a new OrtResourceCountKind enum value, * (b) a new union member. No new C API functions are needed. * * \since Version 1.26. */ OrtResourceCount :: struct { kind: u32; /**< OrtResourceCountKind discriminator. */ reserved: u32; /**< Must be zero. Ensures natural alignment for the value union. */ value: struct { reserved_words: [6] u64; // largest member, moved to the start of the struct/union to support #overlay. /**< 48 bytes fixed storage for future resource types. */ #overlay (reserved_words) total_bytes: u64; /**< Active when kind == OrtResourceCountKind_TotalBytes. */ }; } /** * \brief The OrtEpApi struct provides functions that are relevant to the implementation of an execution provider. * * \since Version 1.22. */ OrtEpApi :: struct { /** \brief Create an OrtEpDevice for the EP and an OrtHardwareDevice. * \param[in] ep_factory Execution provider factory that is creating the instance. * \param[in] hardware_device Hardware device that the EP can utilize. * \param[in] ep_metadata Optional OrtKeyValuePairs instance for execution provider metadata that may be used * during execution provider selection and passed to CreateEp. * ep_device will copy this instance and the user should call ReleaseKeyValuePairs. * \param[in] ep_options Optional OrtKeyValuePairs instance for execution provider options that will be added * to the Session configuration options if the execution provider is selected. * ep_device will copy this instance and the user should call ReleaseKeyValuePairs. * \param ep_device OrtExecutionDevice that is created. * * \since Version 1.22. */ CreateEpDevice: #type (ep_factory: *OrtEpFactory, hardware_device: *OrtHardwareDevice, ep_metadata: *OrtKeyValuePairs, ep_options: *OrtKeyValuePairs, ep_device: **OrtEpDevice) -> OrtStatusPtr #c_call; ReleaseEpDevice: #type (input: *OrtEpDevice) -> void #c_call; /** \brief Specify nodes that are supported by an OrtEp and should be fused into one node. * * Because the nodes will be fused into one "fused node", there must not exist an unsupported node in * a path between two of the provided nodes. Otherwise, the graph will become invalid. * * This function can be called multiple times. A subsequent call to this function will force the next set of * nodes to be fused into a different node. * * \param[in] graph_support_info OrtEpGraphSupportInfo instance to which to add the supported nodes. * \param[in] nodes Array of nodes supported by the EP that should be fused/compiled. * \param[in] num_nodes The number of supported nodes. * \param[in] node_fusion_options Optional node fusion options. Ignored if set to NULL. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ EpGraphSupportInfo_AddNodesToFuse: #type (graph_support_info: *OrtEpGraphSupportInfo, nodes: **OrtNode, num_nodes: u64, node_fusion_options: *OrtNodeFusionOptions) -> OrtStatusPtr #c_call; /** \brief Specify a node that is supported by an OrtEp and should be run with a registered EP kernel. * * \param[in] graph_support_info OrtEpGraphSupportInfo instance to which to add the supported node. * \param[in] node The supported OrtNode instance. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ EpGraphSupportInfo_AddSingleNode: #type (graph_support_info: *OrtEpGraphSupportInfo, node: *OrtNode) -> OrtStatusPtr #c_call; /** \brief Query a OrtNodeComputeContext for the name of the node that encapsulates the compiled/fused node. * * Used in OrtNodeComputeInfo::CreateComputeState(). * * \param[in] context The OrtNodeComputeContext instance to query. * \return The node's name. * * \note Returned string is owned by ORT and valid only while OrtNodeComputeInfo::CreateComputeState() is called. * * \since Version 1.23. */ NodeComputeContext_NodeName: #type (_context: *OrtNodeComputeContext) -> *u8 #c_call; /** \brief Register an allocator with the OrtEpDevice. * * This allows an EP to provide OrtMemoryInfo for DEFAULT and HOST_ACCESSIBLE memory type as needed. * The registered values will be used in calls to OrtEpFactory::CreateAllocator to ensure the required allocator/s * are available for EP usage. * * Multiple calls for the same entry type will replace a previous entry. * * Available entries: * - OrtDeviceAllocator with type of OrtDeviceMemoryType_DEFAULT * - OrtDeviceAllocator with type of OrtDeviceMemoryType_HOST_ACCESSIBLE * - OrtReadOnlyAllocator with type of OrtDeviceMemoryType_DEFAULT * - if provided this allocator will only be used to copy initializers to the device the EP uses. * ORT will use the OrtDeviceAllocator if not provided. * * \param[in] ep_device The OrtEpDevice instance to register the OrtMemoryInfo with. * \param[in] allocator_memory_info The OrtMemoryInfo information for the allocator. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ EpDevice_AddAllocatorInfo: #type (ep_device: *OrtEpDevice, allocator_memory_info: *OrtMemoryInfo) -> OrtStatusPtr #c_call; /** \brief Get the OrtMemoryDevice from an OrtMemoryInfo instance. * * This is required for OrtDataTransferImpl (which implements onnxruntime::IDataTransfer) where the OrtMemoryDevice * is used in the CanCopy and CopyTensors functions. * * \param[in] memory_info The OrtMemoryInfo instance to get the memory device from. * \return The OrtMemoryDevice associated with the OrtMemoryInfo instance. * * \since Version 1.23. */ MemoryInfo_GetMemoryDevice: #type (memory_info: *OrtMemoryInfo) -> *OrtMemoryDevice #c_call; /** \brief Get the OrtMemoryDevice from an OrtValue instance if it contains a Tensor. * * \param[in] value The OrtValue instance to get the memory device from. * \return Memory device if OrtValue contains a Tensor, nullptr otherwise. * * \since Version 1.23. */ Value_GetMemoryDevice: #type (value: *OrtValue) -> *OrtMemoryDevice #c_call; /** \brief Compare two OrtMemoryDevice instances for equality. * * This is used to check if two memory devices are the same. * Used to implement DataTransferImpl::CanCopy. * * \param[in] a The first OrtMemoryDevice instance to compare. * \param[in] b The second OrtMemoryDevice instance to compare. * \return True if the two OrtMemoryDevice instances are equal, false otherwise. * * \since Version 1.23. */ MemoryDevice_AreEqual: #type (a: *OrtMemoryDevice, b: *OrtMemoryDevice) -> bool #c_call; /** \brief Get the OrtMemoryInfoDeviceType value from an OrtMemoryDevice instance. * * \param[in] memory_device OrtMemoryDevice instance. * \return The OrtMemoryInfoDeviceType value. * * \since Version 1.23. */ MemoryDevice_GetDeviceType: #type (memory_device: *OrtMemoryDevice) -> OrtMemoryInfoDeviceType #c_call; /** \brief Get the OrtDeviceMemoryType value from an OrtMemoryDevice instance. * * \param[in] memory_device OrtMemoryDevice instance. * \return The OrtDeviceMemoryType value. * * \since Version 1.23. */ MemoryDevice_GetMemoryType: #type (memory_device: *OrtMemoryDevice) -> OrtDeviceMemoryType #c_call; /** \brief Get the vendor ID from an OrtMemoryDevice instance. * * The vendor ID is used to identify the vendor of the device, and is typically set to the PCI vendor ID. * * If the device is not vendor specific (e.g. CPU memory) the vendor ID is set to 0. * * \param[in] memory_device OrtMemoryDevice instance. * \return The vendor ID value. * * \since Version 1.23. */ MemoryDevice_GetVendorId: #type (memory_device: *OrtMemoryDevice) -> u32 #c_call; /** \brief Get the device ID from an OrtMemoryDevice instance. * * \param[in] memory_device OrtMemoryDevice instance. * \return The device ID. * * \since Version 1.23. */ MemoryDevice_GetDeviceId: #type (memory_device: *OrtMemoryDevice) -> u32 #c_call; /** \brief Get the OrtSyncStreamImpl associated with an OrtSyncStream instance. * * This allows an the plugin library to connect its OrtSyncStreamImpl instance with an OrtSyncStream if needed. * * \param[in] stream The OrtSyncStream instance to find an OrtSyncStreamImpl for. * \return The associated OrtSyncStreamImpl if found. nullptr otherwise. * * \since Version 1.23. * * \remarks There should always be an OrtSyncStreamImpl associated with an OrtSyncStream instance that the EP gets. */ SyncStream_GetImpl: #type (stream: *OrtSyncStream) -> *OrtSyncStreamImpl #c_call; /** \brief Get the current sync ID for a stream. * * \param[in] stream The OrtSyncStream to get the sync ID for. * \return Current sync ID. * * \since Version 1.23. */ SyncStream_GetSyncId: #type (stream: *OrtSyncStream) -> u64 #c_call; /** \brief Get the sync ID for the last time the consumer_stream waited on the producer_stream. * * When two streams are synchronized, the sync id represents the event used in that synchronization. * * \param[in] producer_stream The OrtSyncStream that produced the data. * \param[in] consumer_stream The OrtSyncStream that waited on the producer_stream. * \return ID for last sync. 0 if no sync has occurred between the two streams. * * \since Version 1.23. */ GetSyncIdForLastWaitOnSyncStream: #type (producer_stream: *OrtSyncStream, consumer_stream: *OrtSyncStream) -> u64 #c_call; /** \brief Create an OrtHardwareDevice. * * \note Called within OrtEpFactory::GetSupportedDevices to create a new hardware device (e.g., virtual). * * \param[in] type The hardware device type. * \param[in] vendor_id The hardware device's vendor identifier. * \param[in] device_id The hardware device's identifier. * \param[in] vendor_name The hardware device's vendor name as a null-terminated string. Copied by ORT. * \param[in] metadata Optional OrtKeyValuePairs instance for hardware device metadata that may be queried by * applications via OrtApi::GetEpDevices(). * Refer to onnxruntime_ep_device_ep_metadata_keys.h for common OrtHardwareDevice metadata keys. * \param[out] hardware_device Output parameter set to the new OrtHardwareDevice instance that is created. * Must be release with ReleaseHardwareDevice(). * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ CreateHardwareDevice: #type (type: OrtHardwareDeviceType, vendor_id: u32, device_id: u32, vendor_name: *u8, metadata: *OrtKeyValuePairs, hardware_device: **OrtHardwareDevice) -> OrtStatusPtr #c_call; ReleaseHardwareDevice: #type (input: *OrtHardwareDevice) -> void #c_call; /** \brief Creates an empty kernel registry. A kernel registry contains kernel creation information for * every operator kernel supported by an EP. * * \remarks Refer to OrtEp::GetKernelRegistry, which returns an EP's kernel registry to ORT. * * \param[out] kernel_registry Output parameter set to the new OrtKernelRegistry instance. * Must be released with OrtEpApi::ReleaseKernelRegistry. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ CreateKernelRegistry: #type (kernel_registry: **OrtKernelRegistry) -> OrtStatusPtr #c_call; ReleaseKernelRegistry: #type (input: *OrtKernelRegistry) -> void #c_call; /** \brief Adds kernel creation information for a supported operator kernel to the given kernel registry. * * \remarks Refer to OrtEp::GetKernelRegistry, which returns an EP's kernel registry to ORT. * * \param[in] kernel_registry The OrtKernelRegistry instance. * \param[in] kernel_def The kernel definition, which includes operator type, version, EP name, type constraints, etc. * \param[in] kernel_create_func Function that creates an instance of the operator kernel as a OrtKernelImpl instance. * \param[in] kernel_create_func_state Custom state passed to the kernel creation function. Can be null. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ KernelRegistry_AddKernel: #type (kernel_registry: *OrtKernelRegistry, kernel_def: *OrtKernelDef, kernel_create_func: OrtKernelCreateFunc, kernel_create_func_state: *void) -> OrtStatusPtr #c_call; /** \brief Creates a kernel definition builder used to create instances of OrtKernelDef. * * \param[out] kernel_def_builder_out Output parameter set to the new OrtKernelDefBuilder instance. * Must be released with OrtEpApi::ReleaseKernelDefBuilder(). * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ CreateKernelDefBuilder: #type (kernel_def_builder_out: **OrtKernelDefBuilder) -> OrtStatusPtr #c_call; ReleaseKernelDefBuilder: #type (input: *OrtKernelDefBuilder) -> void #c_call; /** \brief Sets the kernel's operator type. * * \param[in] kernel_def_builder The OrtKernelDefBuilder instance. * \param[in] op_type A null-terminated string representing the operator type. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ KernelDefBuilder_SetOperatorType: #type (kernel_def_builder: *OrtKernelDefBuilder, op_type: *u8) -> OrtStatusPtr #c_call; /** \brief Sets the kernel's domain. * * \param[in] kernel_def_builder The OrtKernelDefBuilder instance. * \param[in] domain A null-terminated string representing the operator's domain. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ KernelDefBuilder_SetDomain: #type (kernel_def_builder: *OrtKernelDefBuilder, domain: *u8) -> OrtStatusPtr #c_call; /** \brief Sets the kernel's opset version range that is supported. * * \param[in] kernel_def_builder The OrtKernelDefBuilder instance. * \param[in] since_version_start The starting opset version that is supported. * \param[in] since_version_end The ending opset version (inclusive) that is supported. * Can be set equal to the starting version to indicate that only one * version is supported. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ KernelDefBuilder_SetSinceVersion: #type (kernel_def_builder: *OrtKernelDefBuilder, since_version_start: s32, since_version_end: s32) -> OrtStatusPtr #c_call; /** \brief Sets the name of the kernel's intended execution provider. * * \param[in] kernel_def_builder The OrtKernelDefBuilder instance. * \param[in] ep_name A null-terminated string representing the execution provider's name. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ KernelDefBuilder_SetExecutionProvider: #type (kernel_def_builder: *OrtKernelDefBuilder, ep_name: *u8) -> OrtStatusPtr #c_call; /** \brief Sets the memory type for a kernel input. * * \param[in] kernel_def_builder The OrtKernelDefBuilder instance. * \param[in] input_index The index of the input. * \param[in] mem_type The input's memory type. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ KernelDefBuilder_SetInputMemType: #type (kernel_def_builder: *OrtKernelDefBuilder, input_index: u64, mem_type: OrtMemType) -> OrtStatusPtr #c_call; /** \brief Sets the memory type for a kernel output. * * \param[in] kernel_def_builder The OrtKernelDefBuilder instance. * \param[in] output_index The index of the output. * \param[in] mem_type The output's memory type. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ KernelDefBuilder_SetOutputMemType: #type (kernel_def_builder: *OrtKernelDefBuilder, output_index: u64, mem_type: OrtMemType) -> OrtStatusPtr #c_call; /** \brief Adds type constraints for a kernel argument represented as a string (e.g., "T"). * * \param[in] kernel_def_builder The OrtKernelDefBuilder instance. * \param[in] arg_name A null-terminated string representing the argument to constrain (e.g., "T"). * \param[in] types Array of OrtDataType instances representing allowed types for the argument. * Must contain `num_types` elements. * \param[in] num_types The number of OrtDataType elements in the `types` array. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ KernelDefBuilder_AddTypeConstraint: #type (kernel_def_builder: *OrtKernelDefBuilder, arg_name: *u8, types: **OrtDataType, num_types: u64) -> OrtStatusPtr #c_call; /** \brief Adds aliases for the given input and output pairs. * * \note Used for operators like Identity and Reshape to allow ORT to reuse the input buffer for the output * without modification. * * \param[in] kernel_def_builder The OrtKernelDefBuilder instance. * \param[in] input_indices Array of input indices. Array must contain `num_io_indices` elements. * \param[in] output_indices Array of output indices. Each output index is aliased with a corresponding * input index in `input_indices`. Array must contain `num_io_indices` elements. * \param[in] num_io_indices The number of input/output index pairs to alias. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ KernelDefBuilder_AddInputOutputAliases: #type (kernel_def_builder: *OrtKernelDefBuilder, input_indices: *s32, output_indices: *s32, num_io_indices: u64) -> OrtStatusPtr #c_call; /** \brief Adds mutable aliases for the given input and output pairs. * * \note Allows ORT to reuse and *modify* an input buffer (in-place) for the output buffer. * This is also known as "MayInplace" within the ORT codebase. * * \param[in] kernel_def_builder The OrtKernelDefBuilder instance. * \param[in] input_indices Array of input indices. Array must contain `num_io_indices` elements. * \param[in] output_indices Array of output indices. Each output index is aliased with a corresponding * input index in `input_indices`. Array must contain `num_io_indices` elements. * \param[in] num_io_indices The number of input/output index pairs to alias. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ KernelDefBuilder_AddInputOutputMutableAliases: #type (kernel_def_builder: *OrtKernelDefBuilder, input_indices: *s32, output_indices: *s32, num_io_indices: u64) -> OrtStatusPtr #c_call; /** \brief Creates a OrtKernelDef instance from the given kernel definition builder. * * \param[in] kernel_def_builder The OrtKernelDefBuilder instance. * \param[out] kernel_def_out The new OrtKernelDef instance. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ KernelDefBuilder_Build: #type (kernel_def_builder: *OrtKernelDefBuilder, kernel_def_out: **OrtKernelDef) -> OrtStatusPtr #c_call; ReleaseKernelDef: #type (input: *OrtKernelDef) -> void #c_call; /** \brief Returns the operator type from the kernel definition. * * \param[in] kernel_def The OrtKernelDef instance. * \return A null-terminated string representing the operator type. * * \since Version 1.24. */ KernelDef_GetOperatorType: #type (kernel_def: *OrtKernelDef) -> *u8 #c_call; /** \brief Returns the operator's domain from the kernel definition. * * \param[in] kernel_def The OrtKernelDef instance. * \return A null-terminated string representing the operator's domain. * * \since Version 1.24. */ KernelDef_GetDomain: #type (kernel_def: *OrtKernelDef) -> *u8 #c_call; /** \brief Gets the kernel's opset version range that is supported. * * \param[in] kernel_def The OrtKernelDef instance. * \param[out] start_version Output parameter set to the starting opset version that is supported. * \param[out] end_version Output parameter set to the ending opset version (inclusive) that is supported. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ KernelDef_GetSinceVersion: #type (kernel_def: *OrtKernelDef, start_version: *s32, end_version: *s32) -> OrtStatusPtr #c_call; /** \brief Returns the name of the kernel's intended execution provider. * * \param[in] kernel_def The OrtKernelDef instance. * \return A null-terminated string representing the name of the execution provider. * * \since Version 1.24. */ KernelDef_GetExecutionProvider: #type (kernel_def: *OrtKernelDef) -> *u8 #c_call; /** \brief Gets the memory type for a kernel input. * * \param[in] kernel_def The OrtKernelDef instance. * \param[in] input_index The index of the input. * \param[out] mem_type Output parameter set to the input's memory type. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ KernelDef_GetInputMemType: #type (kernel_def: *OrtKernelDef, input_index: u64, mem_type: *OrtMemType) -> OrtStatusPtr #c_call; /** \brief Gets the memory type for a kernel output. * * \param[in] kernel_def The OrtKernelDef instance. * \param[in] output_index The index of the output. * \param[out] mem_type Output parameter set to the output's memory type. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ KernelDef_GetOutputMemType: #type (kernel_def: *OrtKernelDef, output_index: u64, mem_type: *OrtMemType) -> OrtStatusPtr #c_call; /** \brief Gets the OrtDataType that represents the data type for a tensor of the given element type. * * \param[in] elem_type The tensor's element type. * \param[out] out Output parameter set to the OrtDataType. Owned by ORT and must not be released. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ GetTensorDataType: #type (elem_type: ONNXTensorElementDataType, out: **OrtDataType) -> OrtStatusPtr #c_call; /** \brief Gets the kernel definition for a given node, if any exists for the calling execution provider. * * Used within OrtEp::GetCapability() to get the registered kernel definition for the given node. * The kernel definition is set to NULL if there is no registered kernel definition for the node * and execution provider. * * \param[in] graph_support_info The OrtEpGraphSupportInfo instance to query. * \param[in] node The node for which to look up a kernel definition. * \param[out] out_kernel_def Output parameter set to the OrtKernelDef or NULL. * Owned by ORT and must not be released. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ EpGraphSupportInfo_LookUpKernel: #type (graph_support_info: *OrtEpGraphSupportInfo, node: *OrtNode, out_kernel_def: **OrtKernelDef) -> OrtStatusPtr #c_call; /** \brief Sets one or more data buffers that collectively hold the pre-packed data for a single shared weight. * * \note Used within the implementation of OrtKernelImpl::PrePackWeight() when the kernel wants to share pre-packed * weight data with other kernels. The buffer data MUST be allocated with the OrtAllocator provided to * OrtKernelImpl::PrePack. * * \note Ownership of weight data transfers to the OrtSharedPrePackedWeightCache instance on success. * If this function returns an error status, the caller retains ownership of the weight data. * * \note Subsequent calls with the same OrtSharedPrePackedWeightCache instance release and replace the old data. * * \param[in] prepacked_weight_cache The OrtSharedPrePackedWeightCache instance. * \param[in] buffer_data_ptrs An array of buffer data pointers that collectively hold the pre-packed data for a * single shared weight. Note that sometimes a single weight may have multiple pre-packed * buffers and it is up to the kernel implementation to determine how to split the data * into multiple buffers (if desired). * \param[in] buffer_data_sizes An array of buffer byte sizes, one per element in `buffer_data_ptrs`. * \param[in] num_buffers The number of buffers used to store the data for the shared pre-packed weight. * Specifies the number of elements in the `buffer_data_ptrs` and `buffer_data_sizes` arrays. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ SharedPrePackedWeightCache_StoreWeightData: #type (prepacked_weight_cache: *OrtSharedPrePackedWeightCache, buffer_data_ptrs: **void, buffer_data_sizes: *u64, num_buffers: u64) -> OrtStatusPtr #c_call; /** \brief Get the OrtEp instance to which the node is assigned from the OrtKernelInfo. * * \note Used within OrtKernelImpl implementations to obtain a reference to the OrtEp. * * \param[in] info The ::OrtKernelInfo instance. * \param[out] ep Output parameter set to the OrtEp instance associated with the OrtKernelInfo. * * \snippet{doc} snippets.dox OrtStatus Return Value * \since Version 1.24 */ KernelInfo_GetEp: #type (info: *OrtKernelInfo, ep: **OrtEp) -> OrtStatusPtr #c_call; /** \brief Set the details of an OrtDeviceEpIncompatibilityDetails instance. * * Used by execution provider factories to set incompatibility details in their * GetHardwareDeviceIncompatibilityDetails implementation. ORT creates and initializes the object * before passing it to the EP, so calling this function is optional. The EP uses this function * to set incompatibility information when the device is not compatible. * * \param[in,out] details The OrtDeviceEpIncompatibilityDetails instance to update. * \param[in] reasons_bitmask Bitmask of OrtDeviceEpIncompatibilityReason values. (0 = no incompatibility). * \param[in] error_code Optional EP-specific error code (0 = no error). * \param[in] notes Optional human-readable notes. Can be null. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ DeviceEpIncompatibilityDetails_SetDetails: #type (details: *OrtDeviceEpIncompatibilityDetails, reasons_bitmask: u32, error_code: s32, notes: *u8) -> OrtStatusPtr #c_call; /** \brief Creates an OrtKernelImpl instance for an If operator. * * Control flow operators require access to ORT session internals to orchestrate subgraph operations. * This function allows an EP to create a properly configured OrtKernelImpl with access to ORT internals that * the EP can add to its kernel registry. * * An EP is required to create an OrtKernelDef that keeps input[0] ('cond') on the CPU (i.e., OrtMemTypeCPUInput) * as this input is used by CPU logic. The output should remain on the device (i.e., OrtMemTypeDefault), which is * the default setting, to avoid copying to/from CPU. * * Example kernel definition (CXX API): * Ort::KernelDef kernel_def = Ort::KernelDefBuilder() * .SetDomain("").SetOperatorType("If").SetSinceVersion(21, 22) * .SetExecutionProvider("MyEp") * .SetInputMemType(0, OrtMemTypeCPUInput) // 'cond' on CPU * .SetOutputMemType(0, OrtMemTypeDefault) // output on EP device * .AddTypeConstraint("B", ...) * .AddTypeConstraint("V", ...).Build(); * * \param[in] kernel_info The ::OrtKernelInfo instance for an If node. This function returns error ORT_FAIL * if the opset version specified by `kernel_info` is unsupported. * \param[out] kernel_out Output parameter set to the OrtKernelImpl instance for the If node. * Must be released via OrtEpApi::ReleaseKernelImpl, unless ownership is transferred * to ORT (see OrtKernelCreateFunc and OrtEpApi::KernelRegistry_AddKernel). * * \snippet{doc} snippets.dox OrtStatus Return Value * \since Version 1.24 */ CreateIfKernel: #type (kernel_info: *OrtKernelInfo, kernel_out: **OrtKernelImpl) -> OrtStatusPtr #c_call; /** \brief Creates an OrtKernelImpl instance for a Loop operator. * * Control flow operators require access to ORT session internals to orchestrate subgraph operations. * This function allows an EP to create a properly configured OrtKernelImpl with access to ORT internals that * the EP can add to its kernel registry. * * An EP is required to create an OrtKernelDef that keeps input[0] ('M') and input[1] ('cond') on the CPU * (i.e., OrtMemTypeCPUInput) as these inputs are used by CPU logic. Input[2] ('v_initial') and the output should * remain on the device (i.e., OrtMemTypeDefault), which is the default setting, to avoid copying to/from CPU. * * Example kernel definition (CXX API): * Ort::KernelDef kernel_def = Ort::KernelDefBuilder() * .SetDomain("").SetOperatorType("Loop").SetSinceVersion(21, 22) * .SetExecutionProvider("MyEp") * .SetInputMemType(0, OrtMemTypeCPUInput) // 'M' on CPU * .SetInputMemType(1, OrtMemTypeCPUInput) // 'cond' on CPU * .SetInputMemType(2, OrtMemTypeDefault) // 'v_initial' on EP device * .SetOutputMemType(0, OrtMemTypeDefault) // output on EP device * .AddTypeConstraint("I", ...) * .AddTypeConstraint("B", ...) * .AddTypeConstraint("V", ...).Build(); * * \param[in] kernel_info The ::OrtKernelInfo instance for a Loop node. This function returns error ORT_FAIL * if the opset version specified by `kernel_info` is unsupported. * \param[in] helper A OrtLoopKernelHelper instance that contains helper functions that ORT calls during kernel * execution to operate on tensors allocated with the EP's device memory. * ORT will call OrtLoopKernelHelper::Release() to release the helper and its resources. * \param[out] kernel_out Output parameter set to the OrtKernelImpl instance for the Loop node. * Must be released via OrtEpApi::ReleaseKernelImpl, unless ownership is transferred * to ORT (see OrtKernelCreateFunc and OrtEpApi::KernelRegistry_AddKernel). * * \snippet{doc} snippets.dox OrtStatus Return Value * \since Version 1.24 */ CreateLoopKernel: #type (kernel_info: *OrtKernelInfo, helper: *OrtLoopKernelHelper, kernel_out: **OrtKernelImpl) -> OrtStatusPtr #c_call; /** \brief Creates an OrtKernelImpl instance for a Scan operator. Does not support opset versions older than 9. * * Control flow operators require access to ORT session internals to orchestrate subgraph operations. * This function allows an EP to create a properly configured OrtKernelImpl with access to ORT internals that * the EP can add to its kernel registry. * * It is recommended that an EP create an OrtKernelDef that keeps the inputs and outputs on the EP's * device (i.e., OrtMemTypeDefault), which is the default setting, to avoid copying to/from CPU. * * Example kernel definition (CXX API): * Ort::KernelDef kernel_def = Ort::KernelDefBuilder() * .SetDomain("").SetOperatorType("Scan").SetSinceVersion(21, 22) * .SetExecutionProvider("MyEp") * .SetInputMemType(0, OrtMemTypeDefault) // input[0] on EP device * .SetOutputMemType(0, OrtMemTypeDefault) // output[0] on EP device * .AddTypeConstraint("V", ...).Build(); * * \param[in] kernel_info The ::OrtKernelInfo instance for a Scan node. This function returns error ORT_FAIL * if the opset version specified by `kernel_info` is unsupported. * \param[in] helper A OrtScanKernelHelper instance that contains helper functions that ORT calls during kernel * execution to operate on tensors allocated with the EP's device memory. * ORT will call OrtScanKernelHelper::Release() to release the helper and its resources. * \param[out] kernel_out Output parameter set to the OrtKernelImpl instance for the Scan node. * Must be released via OrtEpApi::ReleaseKernelImpl, unless ownership is transferred * to ORT (see OrtKernelCreateFunc and OrtEpApi::KernelRegistry_AddKernel). * * \snippet{doc} snippets.dox OrtStatus Return Value * \since Version 1.24 */ CreateScanKernel: #type (kernel_info: *OrtKernelInfo, helper: *OrtScanKernelHelper, kernel_out: **OrtKernelImpl) -> OrtStatusPtr #c_call; ReleaseKernelImpl: #type (input: *OrtKernelImpl) -> void #c_call; /** \brief Gets a new OrtKeyValuePairs instance containing a copy of all configuration entries set on the environment. * * \note An application provides environment-level configuration options for execution provider libraries by * using keys with the prefix 'ep_factory.\\.'. Ex: the key 'ep_factory.my_ep.some_ep_key' represents * a key named 'some_ep_key' that is meant to be consumed by an execution provider named 'my_ep'. Refer to * the specific execution provider's documentation for valid keys and values. * * \note Refer to onnxruntime_env_config_keys.h for common configuration entry keys and their supported values. * * \param[out] config_entries Output parameter set to the OrtKeyValuePairs instance containing all configuration entries. * Must be released via OrtApi::ReleaseKeyValuePairs. * * \snippet{doc} snippets.dox OrtStatus Return Value * \since Version 1.24 */ GetEnvConfigEntries: #type (config_entries: **OrtKeyValuePairs) -> OrtStatusPtr #c_call; /** \brief Get an operator schema from the global schema registry. * * Looks up a schema by name, maximum inclusive version, and domain. * The returned pointer is owned by the caller and must be released via ReleaseOpSchema. * If the schema is not found, *out_schema is set to nullptr (no allocation occurs). * * Available schemas include standard ONNX operators (domain "" or "ai.onnx"), ONNX ML operators * (domain "ai.onnx.ml"), and ORT contrib operators (domain "com.microsoft"). * * \param[in] name A null-terminated string for the operator name. * \param[in] max_inclusive_version The maximum inclusive opset version. * \param[in] domain A null-terminated string for the operator domain. * \param[out] out_schema Output parameter set to the schema pointer, or nullptr if not found. * Must be released via OrtEpApi::ReleaseOpSchema. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.25. */ GetOpSchema: #type (name: *u8, max_inclusive_version: s32, domain: *u8, out_schema: **OrtOpSchema) -> OrtStatusPtr #c_call; ReleaseOpSchema: #type (input: *OrtOpSchema) -> void #c_call; /** \brief Get the first ONNX opset version that introduced this operator schema. * * If an operator has had no changes that break backwards compatibility, the `since_version` is * just the first opset version that introduced the operator. However, if the operator has had breaking changes, * then `since_version` corresponds to the opset version that introduced the breaking change. * * For example, suppose operator "Foo" was added in version 3 and had a breaking change in version 6. * Then, there will be an operator schema entry for "Foo" with a since_version of 3 and another updated * operator schema entry for "Foo" with a since_version of 6. * * \param[in] schema The OrtOpSchema instance. * \param[out] out Output parameter set to the ONNX opset version. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.25. */ OpSchema_GetSinceVersion: #type (schema: *OrtOpSchema, out: *s32) -> OrtStatusPtr #c_call; /** \brief Get the number of inputs defined by the operator schema. * * \param[in] schema The OrtOpSchema instance. * \param[out] out Output parameter set to the number of inputs. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.25. */ OpSchema_GetNumInputs: #type (schema: *OrtOpSchema, out: *u64) -> OrtStatusPtr #c_call; /** \brief Get the name of the i-th input formal parameter from an operator schema. * * \param[in] schema The OrtOpSchema instance. * \param[in] index Zero-based index of the input parameter. * \param[out] out Output parameter set to the name of the input parameter (null-terminated UTF8 string). * Valid as long as the OrtOpSchema exists. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.25. */ OpSchema_GetInputName: #type (schema: *OrtOpSchema, index: u64, out: **u8) -> OrtStatusPtr #c_call; /** \brief Get the type constraint for the i-th input formal parameter from an operator schema. * * Returns a non-owning pointer to the OrtOpSchemaTypeConstraint associated with the given input. * The returned pointer is valid as long as the parent OrtOpSchema is alive. * If the input has no type constraint, *out is set to nullptr. * * Multiple inputs sharing the same type constraint (e.g., both using "T") return the same pointer. * * \param[in] schema The OrtOpSchema instance. * \param[in] index Zero-based index of the input parameter. * \param[out] out Output parameter set to the type constraint, or NULL if the input has no type constraint. * Valid as long as the OrtOpSchema exists. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.25. */ OpSchema_GetInputTypeConstraint: #type (schema: *OrtOpSchema, index: u64, out: **OrtOpSchemaTypeConstraint) -> OrtStatusPtr #c_call; /** \brief Get the number of outputs defined by the operator schema. * * \param[in] schema The OrtOpSchema instance. * \param[out] out Output parameter set to the number of outputs. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.25. */ OpSchema_GetNumOutputs: #type (schema: *OrtOpSchema, out: *u64) -> OrtStatusPtr #c_call; /** \brief Get the name of the i-th output formal parameter from an operator schema. * * \param[in] schema The OrtOpSchema instance. * \param[in] index Zero-based index of the output parameter. * \param[out] out Output parameter set to the name of the output parameter (null-terminated UTF8 string). * Valid as long as the OrtOpSchema exists. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.25. */ OpSchema_GetOutputName: #type (schema: *OrtOpSchema, index: u64, out: **u8) -> OrtStatusPtr #c_call; /** \brief Get the type constraint for the i-th output formal parameter from an operator schema. * * Returns a non-owning pointer to the OrtOpSchemaTypeConstraint associated with the given output. * The returned pointer is valid as long as the parent OrtOpSchema is alive. * If the output has no type constraint, *out is set to nullptr. * * Multiple outputs sharing the same type constraint return the same pointer. * Pointer equality can be used to check if two outputs share a type constraint. * * \param[in] schema The OrtOpSchema instance. * \param[in] index Zero-based index of the output parameter. * \param[out] out Output parameter set to the type constraint, or NULL if the output has no type constraint. * Valid as long as the OrtOpSchema exists. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.25. */ OpSchema_GetOutputTypeConstraint: #type (schema: *OrtOpSchema, index: u64, out: **OrtOpSchemaTypeConstraint) -> OrtStatusPtr #c_call; /** \brief Get the number of unique type constraints in the operator schema. * * \param[in] schema The OrtOpSchema instance. * \param[out] out Output set to the number of type constraints. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.25. */ OpSchema_GetTypeConstraintCount: #type (schema: *OrtOpSchema, out: *u64) -> OrtStatusPtr #c_call; /** \brief Get the i-th type constraint from the operator schema. * * Returns a non-owning pointer to the OrtOpSchemaTypeConstraint at the given index. * The returned pointer is valid as long as the parent OrtOpSchema is alive. * * Constraints are returned in the order they are declared in the ONNX operator schema * definition. The order is stable but has no semantic significance. * * Use this API to iterate all type constraints (e.g., to register allowed types for * each constraint). Use OpSchema_GetInputTypeConstraint / OpSchema_GetOutputTypeConstraint * to look up the constraint for a specific input or output. * * \param[in] schema The OrtOpSchema instance. * \param[in] index Zero-based index of the type constraint. * \param[out] out Output parameter set to the type constraint. * Valid as long as the OrtOpSchema exists. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.25. */ OpSchema_GetTypeConstraint: #type (schema: *OrtOpSchema, index: u64, out: **OrtOpSchemaTypeConstraint) -> OrtStatusPtr #c_call; /** \brief Get the type parameter name of a type constraint (e.g., "T", "T1"). * * \param[in] type_constraint The OrtOpSchemaTypeConstraint instance. * \param[out] out Output parameter set to the type parameter name. * Valid as long as the parent OrtOpSchema exists. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.25. */ OpSchemaTypeConstraint_GetTypeParamName: #type (type_constraint: *OrtOpSchemaTypeConstraint, out: **u8) -> OrtStatusPtr #c_call; /** \brief Get the allowed type strings for a type constraint. * * Returns an array of null-terminated strings representing the allowed data types * (e.g., "tensor(float)", "tensor(double)"). The array and its contents are valid * as long as the parent OrtOpSchema exists. * * \param[in] type_constraint The OrtOpSchemaTypeConstraint instance. * \param[out] out_types Output parameter set to the output array of type strings. * Valid as long as the parent OrtOpSchema exists. * \param[out] num_types Output parameter set to the number of elements in the output array. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.25. */ OpSchemaTypeConstraint_GetAllowedTypes: #type (type_constraint: *OrtOpSchemaTypeConstraint, out_types: ***u8, num_types: *u64) -> OrtStatusPtr #c_call; /** \brief Get the input indices that use a type constraint. * * Returns an array of zero-based input indices whose formal parameter type string * matches this type constraint. The array is valid as long as the parent OrtOpSchema exists. * * \param[in] type_constraint The OrtOpSchemaTypeConstraint instance. * \param[out] out_indices Output parameter set to the output array of input indices. * \param[out] count Output parameter set to the number of elements in the output array. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.25. */ OpSchemaTypeConstraint_GetInputIndices: #type (type_constraint: *OrtOpSchemaTypeConstraint, out_indices: **u64, count: *u64) -> OrtStatusPtr #c_call; /** \brief Get the output indices that use a type constraint. * * Returns an array of zero-based output indices whose formal parameter type string * matches this type constraint. The array is valid as long as the parent OrtOpSchema exists. * * \param[in] type_constraint The OrtOpSchemaTypeConstraint instance. * \param[out] out_indices Output parameter set to the output array of output indices. * \param[out] count Output parameter set to the number of elements in the output array. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.25. */ OpSchemaTypeConstraint_GetOutputIndices: #type (type_constraint: *OrtOpSchemaTypeConstraint, out_indices: **u64, count: *u64) -> OrtStatusPtr #c_call; /** \brief Create a profiling event. * * An EP profiler calls this to create an event to pass to OrtEpApi::ProfilingEventsContainer_AddEvents. * The returned event must be released via OrtEpApi::ReleaseProfilingEvent after it has been added. * * \param[in] category The event category (e.g., session, node, kernel, or API). * \param[in] process_id Process ID. Set to -1 if does not apply. * \param[in] thread_id Thread ID. Set to -1 if does not apply. * \param[in] event_name Null-terminated string representing the event name. ORT copies this string. * \param[in] timestamp_us Starting timestamp in microseconds relative to the profiling start time. * An OrtEpProfilerImpl should record its own clock's profiling start time and * use the `ep_profiling_start_offset_ns` value passed to OrtEpProfilerImpl::StartProfiling * to compute this value as: * timestamp_us = (ep_profiling_start_offset_ns + * (ep_event_time_ns - ep_profiling_start_time_ns)) / 1000 * \param[in] duration_us Duration in microseconds. * \param[in] arg_keys Array of null-terminated argument key strings. Can be NULL if num_args is 0. * ORT copies these strings. * \param[in] arg_values Array of null-terminated argument value strings. Can be NULL if num_args is 0. * ORT copies these strings. * \param[in] num_args Number of key-value argument pairs. * \param[out] out Output parameter set to the created profiling event. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.25. */ CreateProfilingEvent: #type (category: OrtProfilingEventCategory, process_id: s32, thread_id: s32, event_name: *u8, timestamp_us: s64, duration_us: s64, arg_keys: **u8, arg_values: **u8, num_args: u64, out: **OrtProfilingEvent) -> OrtStatusPtr #c_call; /** \brief Release an opaque profiling event created via CreateProfilingEvent. * * \since Version 1.25. */ ReleaseProfilingEvent: #type (input: *OrtProfilingEvent) -> void #c_call; /** \brief Get the event category of a profiling event. * * \param[in] event The OrtProfilingEvent instance. * \param[out] out Output parameter set to the event category. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.25. */ ProfilingEvent_GetCategory: #type (event: *OrtProfilingEvent, out: *OrtProfilingEventCategory) -> OrtStatusPtr #c_call; /** \brief Get the event name of a profiling event. * * \param[in] event The OrtProfilingEvent instance. * \param[out] out Output parameter set to the event name as a null-terminated UTF-8 string. * Do not free as it is owned by the OrtProfilingEvent instance. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.25. */ ProfilingEvent_GetName: #type (event: *OrtProfilingEvent, out: **u8) -> OrtStatusPtr #c_call; /** \brief Get the start timestamp of a profiling event in microseconds. * * \param[in] event The OrtProfilingEvent instance. * \param[out] out Output parameter set to the start timestamp of the profiling event in microseconds relative to * the profiling start time. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.25. */ ProfilingEvent_GetTimestampUs: #type (event: *OrtProfilingEvent, out: *s64) -> OrtStatusPtr #c_call; /** \brief Get the duration of a profiling event in microseconds. * * \param[in] event The OrtProfilingEvent instance. * \param[out] out Output parameter set to the event duration in microseconds. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.25. */ ProfilingEvent_GetDurationUs: #type (event: *OrtProfilingEvent, out: *s64) -> OrtStatusPtr #c_call; /** \brief Get the value of an event argument by its key. * * The value is set to NULL if the key is not found. * * \param[in] event The OrtProfilingEvent instance. * \param[in] key Null-terminated argument key to look up. * \param[out] out Output parameter set to the argument value string, or NULL if not found. * The value is a null-terminated UTF-8 string. * Do not free as the string is owned by the OrtProfilingEvent instance. * * \snippet{doc} snippets.dox OrtStatus Return Value * \since Version 1.25. */ ProfilingEvent_GetArgValue: #type (event: *OrtProfilingEvent, key: *u8, out: **u8) -> OrtStatusPtr #c_call; /** \brief Add EP profiling events to an events container. * * An EP profiler calls this function to report new EP profiling events (e.g., GPU kernel timings) during * OrtEpProfilerImpl::EndProfiling(). ORT copies the EP event data during this call. The EP retains ownership of the * OrtProfilingEvent instances and must release them via ReleaseProfilingEvent after this call returns. * This function may be called multiple times within a single EndProfiling call to add EP events in batches. * * \param[in] events_container The OrtProfilingEventsContainer instance provided by ORT * to OrtEpProfilerImpl::EndProfiling(). * \param[in] events Array of pointers to opaque OrtProfilingEvent instances. * \param[in] num_events Number of events in the `events` array. Must be greater than 0. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.25. */ ProfilingEventsContainer_AddEvents: #type (events_container: *OrtProfilingEventsContainer, events: **OrtProfilingEvent, num_events: u64) -> OrtStatusPtr #c_call; /** \brief Get the weightless source model byte buffer from session options. * * Returns the buffer and size set by SessionOptionsSetWeightlessSourceModelBuffer, or NULL/0 if not set. * The EP can use this during CreateEp or Compile to access the source model for weightless * EPContext model sessions. * * \note If the source model is provided as a file path, the EP should read the * "ep.context_source_model_path" (kOrtSessionOptionEpContextSourceModelPath) session config entry * via GetSessionConfigEntry instead. * * \note Recommended EP precedence for locating the source model: * buffer (this API) > file path ("ep.context_source_model_path") > "onnx_model_filename" EPContext * node attribute. * * \param[in] session_options The OrtSessionOptions instance. * \param[out] source_model_data Output parameter set to the source model buffer, or NULL if not set. * \param[out] source_model_data_length Output parameter set to the buffer size, or 0 if not set. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.29. */ SessionOptionsGetWeightlessSourceModelBuffer: #type (session_options: *OrtSessionOptions, source_model_data: **void, source_model_data_length: *u64) -> OrtStatusPtr #c_call; } /** * \brief The data layout type. * * EPs may specify a preferred data layout type. ORT's default layout type is OrtEpDataLayout_NCHW, or * OrtEpDataLayout_Default. * * \since Version 1.23. */ OrtEpDataLayout :: enum s32 { OrtEpDataLayout_NCHW :: 0; OrtEpDataLayout_NHWC :: 1; OrtEpDataLayout_Default :: 0; } /** * \brief Node assignment policies for graph capture validation. * * When graph capture is enabled, ORT validates that nodes are assigned to EPs in a way that is * compatible with graph capture. An EP can specify which validation policy ORT should apply. * * \since Version 1.26. */ OrtGraphCaptureNodeAssignmentPolicy :: enum s32 { OrtGraphCaptureNodeAssignmentPolicy_ALL_NODES_ON_EP :: 0; OrtGraphCaptureNodeAssignmentPolicy_ALLOW_CPU_FOR_SHAPES :: 1; } /** * \brief Describes the scope of an EP's weightless mode support. * * Returned by OrtEp::GetWeightlessSupport() to indicate which types of initializers * the EP can operate on without copying. * * \since Version 1.29. */ OrtWeightlessSupport :: enum s32 { OrtWeightlessSupport_NONE :: 0; OrtWeightlessSupport_EXTERNAL_ONLY :: 1; OrtWeightlessSupport_ALL :: 2; } /** \addtogroup Global * @{ */ OrtEp :: struct { /** \brief The ONNX Runtime API version the execution provider was compiled with. * * Implementation should set this to ORT_API_VERSION. * ORT uses this to avoid calling functions that were not available when the EP was compiled. * * \since Version 1.22. */ ort_version_supported: u32; /** \brief Get the execution provider name. * * The returned string should be a null-terminated, UTF-8 encoded string. ORT will copy it. * * \param[in] this_ptr The OrtEp instance. * \return The execution provider name. * * \since Version 1.22. */ GetName: #type (this_ptr: *OrtEp) -> *u8 #c_call; /** \brief Get information about the nodes supported by the OrtEp instance. * * IMPORTANT: This is not the final version of this API function. This is currently experimental but will * be stabilized by the ONNX Runtime 1.23 release. * * \param[in] this_ptr The OrtEp instance. * \param[in] graph The OrtGraph instance for which to populate node support. The OrtGraph could be a nested subgraph * contained by a node (e.g., an If or Loop node). ONNX Runtime calls this function separately * for each nested subgraph. * \param[inout] graph_support_info OrtEpGraphSupportInfo instance that the implementer must fill out in order to * specify the supported nodes. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ GetCapability: #type (this_ptr: *OrtEp, graph: *OrtGraph, graph_support_info: *OrtEpGraphSupportInfo) -> OrtStatusPtr #c_call; /** \brief Compile OrtGraph instances assigned to the OrtEp. Implementer must set a OrtNodeComputeInfo instance * for each OrtGraph in order to define its computation function. * * If the session is configured to generate a pre-compiled model, the execution provider must return EPContext nodes, * as OrtNode instances, that ONNX Runtime uses to create a pre-compiled model, known as an "EPContext model". * An EPContext model contains EPContext nodes. Each EPContext node encapsulates the pre-compiled binary data for a * OrtGraph compiled for a specific execution provider. For more details about the EPContext design, refer to: * \htmlonly * EPContext design document. * \endhtmlonly * * \param[in] this_ptr The OrtEp instance. * \param[in] graphs Array of `count` OrtGraph instances to compile. Each graph contains only the nodes for * which the execution provider indicated support. Nested subgraphs contained by a * node, such as an If or Loop, have separate OrtGraph instances. * \param[in] fused_nodes Array of `count` fused nodes that will replace the compiled graphs. * Each fused node is an OrtNode initialized with the intended fused node name and * input/output information. * \param[in] count The number of OrtGraph instances to compile. * \param[out] node_compute_infos Array of `count` OrtNodeComputeInfo instances that define each OrtGraph instance's * computation function. The implementer allocates the OrtNodeComputeInfo instances. * ORT calls ReleaseNodeComputeInfos() to release multiple instances in a batch. * \param[out] ep_context_nodes Output array of `count` OrtNode instances, each representing an EPContext * node for a compiled OrtGraph. The execution provider must use * OrtModelEditorApi::CreateNode to create the OrtNode instances. ONNX Runtime takes * ownership of the OrtNode instances, so the execution provider must NOT call * OrtApi::ReleaseNode. Should be ignored if the session is not configured to generate an * EPContext model. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \note Do NOT cache the provided OrtGraph instances in any of the OrtNodeComputeInfo functions because the * graphs are only valid for the duration of the call to Compile. Any graph/node/input/output * names that are needed by the OrtNodeComputeInfo functions must be copied and stored by the OrtEp. * * \note As of version 1.24, implementation of this function is optional if the EP does not compile nodes and * uses a kernel registry instead. * * \since Version 1.23. */ Compile: #type (this_ptr: *OrtEp, graphs: **OrtGraph, fused_nodes: **OrtNode, count: u64, node_compute_infos: **OrtNodeComputeInfo, ep_context_nodes: **OrtNode) -> OrtStatusPtr #c_call; /** \brief Release OrtNodeComputeInfo instances. * * \param[in] this_ptr The OrtEp instance. * \param[inout] node_compute_infos The OrtNodeComputeInfo instances to release. * \param[in] num_node_compute_infos The number of OrtNodeComputeInfo instances. * * \note As of version 1.24, implementation of this function is optional if the EP does not compile nodes and * uses a kernel registry instead. * * \since Version 1.23. */ ReleaseNodeComputeInfos: #type (this_ptr: *OrtEp, node_compute_infos: **OrtNodeComputeInfo, num_node_compute_infos: u64) -> void #c_call; /** \brief Get the EP's preferred data layout. * * \note Implementation of this function is optional. * If not implemented, ORT will assume that this EP prefers the data layout `OrtEpDataLayout::NCHW`. * * \param[in] this_ptr The OrtEp instance. * \param[out] preferred_data_layout The EP's preferred data layout. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ GetPreferredDataLayout: #type (this_ptr: *OrtEp, preferred_data_layout: *OrtEpDataLayout) -> OrtStatusPtr #c_call; /** \brief Given an op with domain `domain` and type `op_type`, determine whether an associated node's data layout * should be converted to `target_data_layout`. * If the EP prefers a non-default data layout (see `GetPreferredDataLayout()`), this function will be called * during layout transformation with `target_data_layout` set to the EP's preferred data layout. * * \note Implementation of this function is optional. * If an EP prefers a non-default data layout, it may implement this to customize the specific op data layout * preferences at a finer granularity. * * \param[in] this_ptr The OrtEp instance. * \param[in] domain The op domain. An empty string means the ONNX domain. * \param[in] op_type The op type. * \param[in] target_data_layout The target data layout. * \param[out] should_convert Whether the associated node's data layout should be converted to `target_data_layout`. * If greater than 0, convert. * If 0, don't convert. * Otherwise, if less than 0, leave the decision to ORT. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ ShouldConvertDataLayoutForOp: #type (this_ptr: *OrtEp, domain: *u8, op_type: *u8, target_data_layout: OrtEpDataLayout, should_convert: *s32) -> OrtStatusPtr #c_call; /** \brief Set dynamic options on this EP. * * Dynamic options can be set by the user at any time after session creation with `OrtApi::SetEpDynamicOptions()`. * * \param[in] this_ptr The OrtEp instance. * \param[in] option_keys The dynamic option keys. * \param[in] option_values The dynamic option values. * \param[in] num_options The number of dynamic options. * * \note Implementation of this function is optional. * An EP should only implement this if it needs to handle any dynamic options. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ SetDynamicOptions: #type (this_ptr: *OrtEp, option_keys: **u8, option_values: **u8, num_options: u64) -> OrtStatusPtr #c_call; /** \brief Called by ORT to notify the EP of the start of a run. * * \param[in] this_ptr The OrtEp instance. * \param[in] run_options The run options for this run. * * \note Implementation of this function is optional. * When graph capture/replay is enabled and a graph has already been captured, ORT skips * normal execution and calls ReplayGraph() directly, so this callback is not invoked for replay runs. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ OnRunStart: #type (this_ptr: *OrtEp, run_options: *OrtRunOptions) -> OrtStatusPtr #c_call; /** \brief Called by ORT to notify the EP of the end of a run. * * \param[in] this_ptr The OrtEp instance. * \param[in] run_options The run options for this run. * \param[in] sync_stream Whether any associated stream should be synchronized during this call. * Only applicable if there is such a stream. * * \note Implementation of this function is optional. * When graph capture/replay is enabled and a graph has already been captured, ORT skips * normal execution and calls ReplayGraph() directly, so this callback is not invoked for replay runs. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ OnRunEnd: #type (this_ptr: *OrtEp, run_options: *OrtRunOptions, sync_stream: bool) -> OrtStatusPtr #c_call; /** \brief Create an OrtAllocator for the given OrtMemoryInfo for an OrtSession. * * The OrtMemoryInfo instance will match one of the values set in the OrtEpDevice using EpDevice_AddAllocatorInfo. * Any allocator specific options should be read from the session options. * * If nullptr OrtEpFactory::CreateAllocator will be used. * * \param[in] this_ptr The OrtEpFactory instance. * \param[in] memory_info The OrtMemoryInfo to create the allocator for. May be nullptr. * \param[out] allocator The created OrtAllocator instance. Set to nullptr if the default CPU allocator is used. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ CreateAllocator: #type (this_ptr: *OrtEp, memory_info: *OrtMemoryInfo, allocator: **OrtAllocator) -> OrtStatusPtr #c_call; /** \brief Create a synchronization stream for the given memory device for an OrtSession. * * This is used to create a synchronization stream for the execution provider and is used to synchronize * operations on the device during model execution. * Any stream specific options should be read from the session options. * * If nullptr OrtEpFactory::CreateSyncStreamForDevice will be used. * * \param[in] this_ptr The OrtEpFactory instance. * \param[in] memory_device The OrtMemoryDevice to create the synchronization stream for. * \param[out] stream The created OrtSyncStreamImpl instance. nullptr if the execution provider is not stream aware. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ CreateSyncStreamForDevice: #type (this_ptr: *OrtEp, memory_device: *OrtMemoryDevice, stream: **OrtSyncStreamImpl) -> OrtStatusPtr #c_call; /** \brief Get a string with details about the EP stack used to produce a compiled model. * * This function gets a compatibility information string that contains details about the execution provider * used to compile a given model. This string can later be used with ValidateCompiledModelCompatibilityInfo * to determine if a compiled model is compatible with the EP. * * The returned string should be a null-terminated, UTF-8 encoded string. ORT will copy it. * * \param[in] this_ptr The OrtEp instance. * \param[in] graph The OrtGraph instance for which to generate compatibility information. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ GetCompiledModelCompatibilityInfo: #type (this_ptr: *OrtEp, graph: *OrtGraph) -> *u8 #c_call; /** \brief Gets the execution provider's kernel registry, if any. * * A kernel registry contains kernel creation information for operator kernels supported by an EP. * * \param[in] this_ptr The OrtEp instance. * \param[out] kernel_registry Output parameter set to the EP's kernel registry, which must remain valid throughout * the lifetime of the EP. Can be NULL if the EP doesn't use a kernel registry. * \snippet{doc} snippets.dox OrtStatus Return Value * * \note Implementation of this function is optional. If set to NULL, ORT assumes the EP compiles nodes. * * \since Version 1.24. */ GetKernelRegistry: #type (this_ptr: *OrtEp, kernel_registry: **OrtKernelRegistry) -> OrtStatusPtr #c_call; /** \brief Gets whether the execution provider supports concurrent run calls made on the session. * * \param[in] this_ptr The OrtEp instance. * \param[out] is_supported Whether concurrent runs are supported. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \note Implementation of this function is optional and it may be set to NULL. * If not implemented, ORT assumes that concurrent runs are supported. * * \since Version 1.24. */ IsConcurrentRunSupported: #type (this_ptr: *OrtEp, is_supported: *bool) -> OrtStatusPtr #c_call; /** \brief Called by ORT to block until the device has completed all preceding requested tasks. * * Currently this is primarily used by the IOBinding object to ensure that all inputs have been copied * to the device before execution begins. * * \param[in] this_ptr The OrtEp instance. * * \note Implementation of this function is optional. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.25. */ Sync: #type (this_ptr: *OrtEp) -> OrtStatusPtr #c_call; /** \brief Return a new profiler for the execution provider. * * If the EP supports profiling, it should create and return an OrtEpProfilerImpl instance. * ORT takes ownership of each non-NULL instance returned and will call OrtEpProfilerImpl::Release when * it is no longer needed. * * ORT may call this function multiple times over the lifetime of a single OrtEp instance, for example * during EP registration and again per run if run-level profiling is enabled. Each call is independent and * the EP must return a new profiler instance (or NULL if profiling is not supported). * * \param[in] this_ptr The OrtEp instance. * \param[out] profiler Output parameter set to a new OrtEpProfilerImpl instance created by the EP. * Set to NULL if the EP does not support profiling. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \note Implementation of this function is optional. If set to NULL, ORT assumes the EP does not * support profiling. * * \since Version 1.25. */ CreateProfiler: #type (this_ptr: *OrtEp, profiler: **OrtEpProfilerImpl) -> OrtStatusPtr #c_call; /** \brief Indicate whether the graph capturing mode (e.g., CUDA graph) is enabled for the provider. * * Graph capture allows an EP to record a sequence of device (e.g., GPU) operations during an initial run and replay * them on subsequent runs, bypassing per-kernel CPU launch overhead. * * Applications enable graph capture via EP-specific provider options (e.g., `enable_cuda_graph=1` * for the CUDA EP). An EP should return true from this function if it has been configured to enable * graph capture/replay. * * **ORT graph capture/replay summary:** * During OrtSession initialization, ORT calls OrtEp::IsGraphCaptureEnabled() on each EP in the order specified during * provider registration with the session. If an EP returns true, ORT validates that the graph is suitable for * graph capture, and if so, caches the EP for graph capture during the next run. The graph validation ensures * that there are no control flow nodes and that node-to-EP assignments are compatible with the policy specified * by the EP via OrtEp::GetGraphCaptureNodeAssignmentPolicy(). * Note that an OrtSession only supports graph capture for one EP (i.e., the first EP to claim support). * * During the first call to OrtApi::Run() for the OrtSession, ORT performs multiple internal runs of the model * until the EP indicates that the graph has been captured by returning `true` from `OrtEp::IsGraphCaptured()`. * If the EP is unable to capture the graph within 8 runs, the call to OrtApi::Run() returns an error OrtStatus. * Each internal run invokes `OrtEp::OnRunStart()`, normal execution, and `OrtEp::OnRunEnd()`. EPs should use * these run callbacks to track the number of necessary warm-up runs and begin/end graph capture when ready. * * After successful graph capture, subsequent calls to OrtApi::Run() skip normal execution and ORT instead calls * `OrtEp::ReplayGraph()` directly. * * Applications can capture and replay multiple graphs (e.g., one per distinct input shape) by setting the * `"gpu_graph_id"` run config entry via `OrtApi::AddRunConfigEntry()` to different integer values. ORT passes * the value as the `graph_annotation_id` parameter to `OrtEp::IsGraphCaptured()` and `OrtEp::ReplayGraph()`. * * \param[in] this_ptr The OrtEp instance. * \return true if graph capture mode is enabled, false otherwise. * * \note Implementation of this function is optional. If set to NULL, ORT assumes graph capture is not enabled. * \note If this function returns true, `OrtEp::IsGraphCaptured` and `OrtEp::ReplayGraph` must also be implemented. * If either is NULL, ORT will log a warning and ignore this EP for graph capture. * * \since Version 1.26. */ IsGraphCaptureEnabled: #type (this_ptr: *OrtEp) -> bool #c_call; /** \brief Indicate whether a graph has been captured and instantiated. * * ORT calls this before each `Session::Run()`. If true, ORT calls `ReplayGraph()` instead of * normal execution. After a run where this returns false, ORT automatically retries until it * returns true (handling warm-up runs transparently). * * \param[in] this_ptr The OrtEp instance. * \param[in] graph_annotation_id Identifies which captured graph to query. * Applications can set this value via `OrtApi::AddRunConfigEntry()` with the key `"gpu_graph_id"`. * The default value is 0 when the run config entry is not set. * Setting different IDs allows the EP to capture and manage multiple graphs (e.g., one per * distinct input shape). A value of -1 means graph capture/replay should be skipped for this run. * \return true if the graph has been captured, false otherwise. * * \note This function must be implemented if `OrtEp::IsGraphCaptureEnabled` is implemented and may return true. * * \since Version 1.26. */ IsGraphCaptured: #type (this_ptr: *OrtEp, graph_annotation_id: s32) -> bool #c_call; /** \brief Run the instantiated (captured) graph. * * Called by ORT instead of normal execution when `IsGraphCaptured()` returns true. * * \param[in] this_ptr The OrtEp instance. * \param[in] graph_annotation_id Identifies which captured graph to replay. * Applications can set this value via `OrtApi::AddRunConfigEntry()` with the key `"gpu_graph_id"`. * The default value is 0 when the run config entry is not set. * A value of -1 means graph replay should be skipped for this run. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \note This function must be implemented if `OrtEp::IsGraphCaptureEnabled` is implemented and may return true. * * \since Version 1.26. */ ReplayGraph: #type (this_ptr: *OrtEp, graph_annotation_id: s32) -> OrtStatusPtr #c_call; /** \brief Get the node assignment validation policy for graph capture. * * When graph capture is enabled, ORT validates that nodes are assigned to EPs in a way that is * compatible with graph capture. This function tells ORT which validation policy to apply. * * \param[in] this_ptr The OrtEp instance. * \return The node assignment policy for graph capture. * * \note Implementation of this function is optional. If set to NULL, ORT uses * OrtGraphCaptureNodeAssignmentPolicy_ALL_NODES_ON_EP (strictest validation). * * \since Version 1.26. */ GetGraphCaptureNodeAssignmentPolicy: #type (this_ptr: *OrtEp) -> OrtGraphCaptureNodeAssignmentPolicy #c_call; /** \brief Query the available device resource for partitioning budget. * * Called by ORT during graph partitioning when no explicit resource budget threshold * has been configured via session options. The EP should query its device for the * currently available resource (e.g., free GPU memory) and return it as an OrtResourceCount. * * If the EP does not support resource querying, set this function pointer to NULL. * ORT will skip threshold-based budget enforcement in that case. * * \param[in] this_ptr The OrtEp instance. * \param[out] available The available device resource. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \note Implementation of this function is optional. If set to NULL, no automatic * resource threshold is established and budget enforcement requires an explicit * threshold from session options. * * \since Version 1.26. */ GetAvailableResource: #type (this_ptr: *OrtEp, available: *OrtResourceCount) -> OrtStatusPtr #c_call; /** \brief Called by ORT when session initialization is complete. * * This provides an opportunity for execution providers to optionally synchronize and * clean up temporary resources to reduce memory usage and ensure the first inference run is fast. * * \param[in] this_ptr The OrtEp instance. * * \note Implementation of this function is optional. If set to NULL, ORT assumes no * post-initialization work is needed and treats it as a no-op success. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.27. */ OnSessionInitializationEnd: #type (this_ptr: *OrtEp) -> OrtStatusPtr #c_call; /** \brief Get the EP's default memory device. * * The EP's default memory device identifies the hardware the EP operates on. ORT uses it to: * - Determine if data copies are needed between EPs (inserting memcpy nodes at EP boundaries) * - Determine if the EP is CPU-based (which affects synchronization and data transfer decisions) * - Bind execution streams to the correct device * * If the implementation allows an EP to be created with multiple EpDevices this should return the OrtMemoryDevice * that ORT should consider as default for this EP instance. * * An OrtMemoryDevice is obtained from an OrtMemoryInfo via `OrtEpApi::MemoryInfo_GetMemoryDevice()`. * Typically, an EP creates OrtMemoryInfo instances and registers them with its OrtEpDevice(s) via * `OrtEpApi::EpDevice_AddAllocatorInfo()`. The OrtMemoryDevice returned here must correspond to an * OrtMemoryInfo registered as an `OrtDeviceAllocator` entry (either `OrtDeviceMemoryType_DEFAULT` or * `OrtDeviceMemoryType_HOST_ACCESSIBLE`). An OrtMemoryDevice from an `OrtReadOnlyAllocator` entry is * not accepted as the EP's default/identity device. * * The returned pointer must remain valid for the lifetime of the OrtEp instance * (typically by storing the parent OrtMemoryInfo as a member of the EP). * * If this function is not implemented (NULL), or if it sets `device` to NULL, ORT infers * the default memory device from the first OrtEpDevice's `OrtDeviceAllocator` entry with * `OrtDeviceMemoryType_DEFAULT` registered via `EpDevice_AddAllocatorInfo`. EPs created against * multiple OrtEpDevices whose default memory devices differ should implement this function to * disambiguate; otherwise the first OrtEpDevice's default memory device is used and the others * are ignored for identity purposes. If no such allocator entry is registered, the EP defaults * to a CPU memory device. * * \param[in] this_ptr The OrtEp instance. * \param[out] device Set to the EP's default OrtMemoryDevice, or NULL to use the default behavior (described above). * * \snippet{doc} snippets.dox OrtStatus Return Value * * \note Implementation of this function is optional. If set to NULL (not implemented), ORT * infers the default memory device using the default behavior described above. * * \since Version 1.27. */ GetDefaultMemoryDevice: #type (this_ptr: *OrtEp, device: **OrtMemoryDevice) -> OrtStatusPtr #c_call; /** \brief Release a previously captured graph and its associated resources. * * Called when the caller no longer needs the captured graph for the given annotation ID. * This allows the EP to free buffers and other resources tied to this graph. * * \param[in] this_ptr The EP instance. * \param[in] graph_annotation_id The annotation ID of the graph to release. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \note Implementation of this function is optional. If set to NULL, ORT assumes * no captured graph release is needed and treats it as a no-op success. * * \note Thread safety: For EPs that support concurrent Run() calls, this method may be * called concurrently with Run(). The EP is responsible for ensuring thread safety * of its own state in that case. For non-concurrent EPs, the session serializes * calls via its internal mutex. * * \since Version 1.27. */ ReleaseCapturedGraph: #type (this_ptr: *OrtEp, graph_annotation_id: s32) -> OrtStatusPtr #c_call; /** \brief Query the execution provider's weightless mode support. * * When weightless mode is enabled (via the "ep.enable_weightless" session option), ORT calls this function * to determine the scope of the EP's weightless support. The EP returns an OrtWeightlessSupport value * indicating whether it supports weightless mode for all initializers, external initializers only, or not * at all. * * The EP's response may depend on the underlying hardware or driver capabilities. For example, an EP may * support weightless mode for all initializers on newer hardware but only for external initializers on * older hardware that requires weight transformation. * * EPs that support weightless mode should set drop_constant_initializers to false in OrtNodeFusionOptions * so that ORT provides the initializer data as inputs to the compiled/fused node. The EP can then access * these initializers at Compute() time via KernelContext_GetInput(). * * \note Extending the lifetime of initializer data obtained via ValueInfo_GetInitializerValue() during * Compile() so that the EP can cache and reuse data pointers directly (without going through * KernelContext) is planned but not yet implemented. Until then, KernelContext_GetInput() is the * only supported way to access initializer data at Compute() time. * * \param[in] this_ptr The OrtEp instance. * \param[out] support Output parameter set to the EP's weightless support scope. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \note Implementation of this function is optional. If set to NULL, ORT assumes the EP does not * support weightless mode (equivalent to OrtWeightlessSupport_NONE). * * \since Version 1.29. */ GetWeightlessSupport: #type (this_ptr: *OrtEp, support: *OrtWeightlessSupport) -> OrtStatusPtr #c_call; } /** \brief The function signature that ORT will call to create OrtEpFactory instances. * * This must be available in a function called 'CreateEpFactories' in the execution provider library. * * \param[in] registered_name The name the execution library is registered with by RegisterExecutionProviderLibrary * \param[in] ort_api_base The OrtApiBase instance that is used by the factory to get the OrtApi instance for the * version of ORT that the library was compiled against. * \param[in] default_logger The default ORT logger that can be used for logging outside of an inference session. * \param[in,out] factories The implementation should create and add OrtEpFactory instances to this * pre-allocated array. * i.e. usage is `factories[0] = new MyEpFactory();` * \param[in] max_factories The maximum number of OrtEpFactory instances that can be added to `factories`. * Current default is to allow 4 factories. This can be increased in the future if needed. * \param[out] num_factories The number of OrtEpFactory instances created by the factory and added to `factories`. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ CreateEpApiFactoriesFn :: #type (registered_name: *u8, ort_api_base: *OrtApiBase, default_logger: *OrtLogger, factories: **OrtEpFactory, max_factories: u64, num_factories: *u64) -> *OrtStatus #c_call; /** \brief The function signature that ORT will call to release an OrtEpFactory instance. * * This must be available in a function called 'ReleaseEpFactory' in the execution provider library. * * \param[in] factory The OrtEpFactory instance to release. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ ReleaseEpApiFactoryFn :: #type (factory: *OrtEpFactory) -> *OrtStatus #c_call; /** * \brief The OrtEpFactory provides functions to create and manage execution providers. * \since Version 1.22. */ OrtEpFactory :: struct { /** \brief The ONNX Runtime version the execution provider was compiled with. * * Implementation should set to ORT_API_VERSION. * ORT will use this to ensure it does not call functions that were not available when the library was compiled. * * \since Version 1.22. */ ort_version_supported: u32; /** \brief Get the name of the execution provider that the factory creates. * * The returned string should be a null-terminated, UTF-8 encoded string. ORT will copy it. * * \param[in] this_ptr The OrtEpFactory instance. * \return The name of the execution provider the factory creates. * * \since Version 1.22. */ GetName: #type (this_ptr: *OrtEpFactory) -> *u8 #c_call; GetVendor: #type (this_ptr: *OrtEpFactory) -> *u8 #c_call; // return EP vendor /** \brief Get information from the execution provider about OrtHardwareDevice support. * * \param[in] this_ptr The OrtEpFactory instance. * Non-const as the factory is passed through to the CreateEp call via the OrtEpDevice. * \param[in] devices The OrtHardwareDevice instances that are available. * \param[in] num_devices The number of OrtHardwareDevice instances. * \param[out] ep_devices OrtEpDevice instances for each OrtHardwareDevice that the EP can use. * The implementation should call OrtEpApi::CreateEpDevice to create, and add the OrtEpDevice * instances to this pre-allocated array. ORT will take ownership of the values returned. * i.e. usage is `ep_devices[0] = ;` * \param[in] max_ep_devices The maximum number of OrtEpDevices that can be added to ep_devices. * Current default is 8. This can be increased if needed. * \param[out] num_ep_devices The number of EP devices added to ep_devices. * \return true if the factory can create an execution provider that uses `device`. * * \since Version 1.22. */ GetSupportedDevices: #type (this_ptr: *OrtEpFactory, devices: **OrtHardwareDevice, num_devices: u64, ep_devices: **OrtEpDevice, max_ep_devices: u64, num_ep_devices: *u64) -> OrtStatusPtr #c_call; /** \brief Function to create an OrtEp instance for use in a Session. * * ORT will call ReleaseEp to release the instance when it is no longer needed. * * \param[in] this_ptr The OrtEpFactory instance. * \param[in] devices The OrtHardwareDevice instances that the execution provider was selected to use. * May be a subset of the OrtHardwareDevice instances that the execution provider's factory * set as supported in the call to OrtEpFactory::GetSupportedDevices. * \param[in] ep_metadata_pairs Execution provider metadata that was provided to OrtEpApi::CreateEpDevice, for each * device. * \param[in] num_devices The number of devices the execution provider was selected for. * \param[in] session_options The OrtSessionOptions instance that contains the configuration options for the * session. This will include ep_options from GetSupportedDevices as well as any * user provided overrides. * Execution provider options will have been added with a prefix of 'ep.[ep name].'. * The OrtSessionOptions instance will NOT be valid after this call and should not be * stored for later use. * \param[in] logger The OrtLogger instance for the session that the execution provider should use for logging. * \param[out] ep The OrtEp instance created by the factory. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.22. */ CreateEp: #type (this_ptr: *OrtEpFactory, devices: **OrtHardwareDevice, ep_metadata_pairs: **OrtKeyValuePairs, num_devices: u64, session_options: *OrtSessionOptions, logger: *OrtLogger, ep: **OrtEp) -> OrtStatusPtr #c_call; /** \brief Release the OrtEp instance. * * \param[in] this_ptr The OrtEpFactory instance. * \param[in] ep The OrtEp instance to release. * * \since Version 1.22. */ ReleaseEp: #type (this_ptr: *OrtEpFactory, ep: *OrtEp) -> void #c_call; /** \brief Get the vendor id who owns the execution provider that the factory creates. * * This is typically the PCI vendor ID. See https://pcisig.com/membership/member-companies * * \param[in] this_ptr The OrtEpFactory instance. * \return vendor_id The vendor ID of the execution provider the factory creates. * * \since Version 1.23. */ GetVendorId: #type (this_ptr: *OrtEpFactory) -> u32 #c_call; /** \brief Get the version of the execution provider that the factory creates. * * The version string should adhere to the Semantic Versioning 2.0 specification * (https://github.com/semver/semver/blob/v2.0.0/semver.md). * * The returned string should be a null-terminated, UTF-8 encoded string. ORT will copy it. * * \param[in] this_ptr The OrtEpFactory instance. * \return The execution provider version string. * * \since Version 1.23. */ GetVersion: #type (this_ptr: *OrtEpFactory) -> *u8 #c_call; /** \brief Validate the compatibility of a compiled model with the execution provider factory for one or more devices. * * Given a compatibility info string produced during model compilation, the EP factory should determine whether the * compiled model is compatible with the EP factory when targeting the provided hardware devices. All devices provided * must belong to the same execution provider instance that this factory creates. * * The EP factory implementation should consider the set of devices (e.g., multi-adapter or multi-GPU scenarios) when * evaluating compatibility and set `model_compatibility` accordingly. * * \param[in] this_ptr The OrtEpFactory instance. * \param[in] devices Array of OrtHardwareDevice pointers that the EP would run on. All must map to this EP. * \param[in] num_devices Number of entries in `devices`. * \param[in] compatibility_info The compatibility information string produced when the model was compiled. * \param[out] model_compatibility OrtCompiledModelCompatibility value describing the compatibility of the model with the EP. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ ValidateCompiledModelCompatibilityInfo: #type (this_ptr: *OrtEpFactory, devices: **OrtHardwareDevice, num_devices: u64, compatibility_info: *u8, model_compatibility: *OrtCompiledModelCompatibility) -> OrtStatusPtr #c_call; /** \brief Create an OrtAllocator that can be shared across sessions for the given OrtMemoryInfo. * * The factory that creates the EP is responsible for providing the allocators required by the EP. * The OrtMemoryInfo instance will match one of the values set in the OrtEpDevice using EpDevice_AddAllocatorInfo. * * \param[in] this_ptr The OrtEpFactory instance. * \param[in] memory_info The OrtMemoryInfo to create the allocator for. May be nullptr. * \param[in] allocator_options Optional key-value pairs for allocator options, can be nullptr. * \param[out] allocator The created OrtAllocator instance. Set to nullptr if the default CPU allocator is used. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ CreateAllocator: #type (this_ptr: *OrtEpFactory, memory_info: *OrtMemoryInfo, allocator_options: *OrtKeyValuePairs, allocator: **OrtAllocator) -> OrtStatusPtr #c_call; /** \brief Release an OrtAllocator created by the factory. * * \since Version 1.23. */ ReleaseAllocator: #type (this_ptr: *OrtEpFactory, allocator: *OrtAllocator) -> void #c_call; /** \brief Create an OrtDataTransferImpl instance for the factory. * * This is used to create an IDataTransfer implementation that can be used to copy data between devices * that the execution provider supports. * * \param[in] this_ptr The OrtEpFactory instance. * \param[out] data_transfer The created OrtDataTransferImpl instance. Set to nullptr if not required. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ CreateDataTransfer: #type (this_ptr: *OrtEpFactory, data_transfer: **OrtDataTransferImpl) -> OrtStatusPtr #c_call; /** \brief Check if execution providers created by the factory are stream aware. * * \param[in] this_ptr The OrtEpFactory instance. * \return True if the factory creates execution providers that are stream aware and it implements CreateSyncStreamForDevice. * * \since Version 1.23. */ IsStreamAware: #type (this_ptr: *OrtEpFactory) -> bool #c_call; /** \brief Create a synchronization stream for the given memory device. * * This is used to create a synchronization stream for the memory device that can be used for operations outside of * a session. * * \param[in] this_ptr The OrtEpFactory instance. * \param[in] memory_device The OrtMemoryDevice to create the synchronization stream for. * \param[in] stream_options Options for stream creation. May be nullptr. * \param[out] stream The created OrtSyncStreamImpl instance. nullptr if the execution provider is not stream aware. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.23. */ CreateSyncStreamForDevice: #type (this_ptr: *OrtEpFactory, memory_device: *OrtMemoryDevice, stream_options: *OrtKeyValuePairs, stream: **OrtSyncStreamImpl) -> OrtStatusPtr #c_call; /** \brief Check for known incompatibility reasons between a hardware device and this execution provider. * * This function allows an execution provider to check if a specific hardware device is compatible * with the execution provider. The EP can set specific incompatibility reasons via the * OrtDeviceEpIncompatibilityDetails parameter using OrtEpApi::DeviceEpIncompatibilityDetails_SetDetails. * * \param[in] this_ptr The OrtEpFactory instance. * \param[in] hw The hardware device to check for incompatibility. * \param[in,out] details Pre-allocated incompatibility details object created and initialized by ORT. * The EP can use OrtEpApi::DeviceEpIncompatibilityDetails_SetDetails to set * incompatibility information. If the device is compatible, the EP can * leave the object unchanged (it defaults to no incompatibility). * * \note Implementation of this function is optional. * If not implemented, ORT will assume the device is compatible with this EP. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ GetHardwareDeviceIncompatibilityDetails: #type (this_ptr: *OrtEpFactory, hw: *OrtHardwareDevice, details: *OrtDeviceEpIncompatibilityDetails) -> OrtStatusPtr #c_call; /** \brief Create an OrtExternalResourceImporterImpl for external resource import. * * This is used to create an external resource importer that enables zero-copy import of * external GPU memory (e.g., D3D12 shared resources) and synchronization primitives * (e.g., D3D12 timeline fences). * * EPs that support external resource import (via CUDA, HIP, Vulkan, or D3D12 APIs) can * implement this to allow applications to share GPU resources without copies. * * \param[in] this_ptr The OrtEpFactory instance. * \param[in] ep_device The OrtEpDevice to create the external resource importer for. * \param[out] out_importer The created OrtExternalResourceImporterImpl instance. * Set to nullptr if external resource import is not supported. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \note Implementation of this function is optional. * An EP factory should only implement this if it supports external resource import. * If not implemented or not supported, return ORT_NOT_IMPLEMENTED or set out_importer to nullptr. * * \since Version 1.24. */ CreateExternalResourceImporterForDevice: #type (this_ptr: *OrtEpFactory, ep_device: *OrtEpDevice, out_importer: **OrtExternalResourceImporterImpl) -> OrtStatusPtr #c_call; /** \brief Returns the number of OrtCustomOpDomains that this factory provides. * * \param[in] this_ptr The OrtEpFactory instance. * \param[out] num_domains Output parameter set to the number of provided OrtCustomOpDomain instances. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ GetNumCustomOpDomains: #type (this_ptr: *OrtEpFactory, num_domains: *u64) -> OrtStatusPtr #c_call; /** \brief Gets the EP-specific OrtCustomOpDomains. * * This function is used when running inference on a model that contains EP-specific custom operations. * * Workflow: * 1. The EP factory implements this function to supply a list of OrtCustomOpDomain instances. * 2. The application either 1) calls SessionOptionsAppendExecutionProvider_V2() with an OrtEpDevice containing * the plugin EP's factory or 2) enables auto ep selection. * 3. 1) SessionOptionsAppendExecutionProvider_V2() appends the provided OrtCustomOpDomains to the * session options or 2) ORT registers the OrtCustomOpDomains provided by the EP devices * that could be potentially selected. * * As a result, any session created from these session options will have these custom op domains registered * in ORT, ensuring that the custom ops are properly recognized and validated when the model is loaded. * * Plugin EPs can provide two types of custom ops: * 1. A full OrtCustomOp with a concrete kernel implementation * - A Plugin EP can supply an OrtCustomOp and a corresponding CustomKernel::Compute() implementation. * - In GetCapability(), it calls EpGraphSupportInfo_AddSingleNode() to inform ORT * that the custom node should NOT be fused or compiled. Instead, ORT should invoke * the custom node's Compute() function at runtime. * * 2. A "placeholder" OrtCustomOp with an empty kernel implementation * - A compile-based Plugin EP can supply an OrtCustomOp whose CustomKernel::Compute() * does nothing. The purpose is to satisfy model validation during model loading by * registering the custom op as a valid operator in the session. * - In GetCapability(), the EP should call EpGraphSupportInfo_AddNodesToFuse() to * notify ORT that this custom node should be fused and compiled by the EP. * - In Compile(), the EP executes its compiled bits to perform inference for * the fused custom node. * * Note: The OrtCustomOpDomain instances must be valid while any session is using them. EP factory has the responsibility to release OrtCustomOpDomain instances it creates. It happens * automatically if using the C++ Ort::CustomOpDomain class. * * \param[in] this_ptr The OrtEpFactory instance. * \param[out] domains Array of `num_domains` elements pre-allocated by ORT that should be filled with OrtCustomOpDomain instances created by the EP. The `num_domains` is the value returned by GetNumCustomOpDomains(). * \param[in] num_domains The size of the `domains` array pre-allocated by ORT. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.24. */ GetCustomOpDomains: #type (this_ptr: *OrtEpFactory, domains: **OrtCustomOpDomain, num_domains: u64) -> OrtStatusPtr #c_call; /** \brief Initialize graphics interop for the EP factory. * * This function sets up graphics interop context that enables synchronization between * external graphics API workloads (D3D12, Vulkan) and ONNX Runtime inference. * * The factory stores the graphics context configuration and uses it when creating * synchronization streams via CreateSyncStreamForDevice. This approach * is more graceful than passing the command queue directly during stream creation. * * The implementation is EP-specific. EPs may create a specialized interop context using * platform-specific APIs to enable GPU-GPU synchronization. * * Key design points: * - Single init function with all required params (avoids multiple init signatures) * - Factory stores context and uses it in stream creation * - Paired with DeinitGraphicsInterop for cleanup * * \param[in] this_ptr The OrtEpFactory instance. * \param[in] ep_device The OrtEpDevice to initialize graphics interop for. * \param[in] config Configuration specifying the graphics API and required handles. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \note Implementation of this function is optional. * EPs that don't support graphics interop should set this to nullptr or return ORT_NOT_IMPLEMENTED. * * \since Version 1.25. */ InitGraphicsInterop: #type (this_ptr: *OrtEpFactory, ep_device: *OrtEpDevice, config: *OrtGraphicsInteropConfig) -> OrtStatusPtr #c_call; /** \brief Deinitialize graphics interop for the EP factory. * * This function cleans up any graphics interop context that was set up by InitGraphicsInterop. * Should be called when graphics interop is no longer needed. * * \param[in] this_ptr The OrtEpFactory instance. * \param[in] ep_device The OrtEpDevice to deinitialize graphics interop for. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \note Implementation of this function is optional. * EPs that don't support graphics interop should set this to nullptr or return ORT_NOT_IMPLEMENTED. * * \since Version 1.25. */ DeinitGraphicsInterop: #type (this_ptr: *OrtEpFactory, ep_device: *OrtEpDevice) -> OrtStatusPtr #c_call; /** \brief Select the best model variant candidate from metadata. * * Evaluates each candidate's metadata against the given hardware device and optional session options, * and returns the index of the best match. * * Each candidate is an OrtKeyValuePairs representing one model variant. The KVP uses indexed keys * so that the EP can inspect each model's metadata independently. A variant always has num_models >= 1. * * Required and optional keys: * - "num_models" — number of models in this variant (>= 1) (required) * - "\.ep_compatibility_info" — compatibility string for model i (required per model) * - "\.role" — role/purpose of model i (e.g., "prefill", "decode") (optional) * - "\.future_meaningful_info" — additional EP-meaningful metadata for model i (optional) * * where \ is a zero-based index (e.g., "0.ep_compatibility_info", "1.ep_compatibility_info"). * * The implementer should loop from 0 to num_models - 1 and validate each "\.ep_compatibility_info" entry. * An advanced implementation may additionally consider "role" or other metadata when ranking candidates. * * **Why this function exists:** * * The existing ValidateCompiledModelCompatibilityInfo() alone is not sufficient for some EPs to determine the best * compatible model when there are multiple candidates. For example, an EP may support multiple compilation modes * (e.g., "speed optimized" vs "memory optimized") that produce different compatibility strings. The EP can implement * this function to evaluate the candidate metadata and select the best compatible variant based on its own criteria, * the target device, and the session options. * * If all candidates are unsupported, this function succeeds and sets `selected_index` to SIZE_MAX. * * \note The implementer should validate each "\.ep_compatibility_info" in the candidate (e.g., by calling * ValidateCompiledModelCompatibilityInfo for each one) before determining the best match. * * \param[in] this_ptr The OrtEpFactory instance. * \param[in] device The target hardware device that the EP would run on. Must map to this EP. * \param[in] candidates Array of OrtKeyValuePairs pointers (one per model variant). * \param[in] num_candidates Number of candidates (i.e., number of model variants to evaluate). * \param[in] session_options Optional session options to consider when selecting the best candidate. * May be nullptr if no session-level preferences are relevant. * \param[out] selected_index Selected candidate index, or SIZE_MAX if all unsupported. * * \snippet{doc} snippets.dox OrtStatus Return Value * * \since Version 1.28. */ SelectBestModelCandidate: #type (this_ptr: *OrtEpFactory, device: *OrtHardwareDevice, candidates: **OrtKeyValuePairs, num_candidates: u64, session_options: *OrtSessionOptions, selected_index: *u64) -> OrtStatusPtr #c_call; } #scope_file #import "Basic"; // For assert #run { { info := type_info(OrtAllocator); for info.members { if it.name == { case "version"; assert(it.offset_in_bytes == 0, "OrtAllocator.version has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtAllocator.version has unexpected size % instead of 4", it.type.runtime_size); case "Alloc"; assert(it.offset_in_bytes == 8, "OrtAllocator.Alloc has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtAllocator.Alloc has unexpected size % instead of 8", it.type.runtime_size); case "Free"; assert(it.offset_in_bytes == 16, "OrtAllocator.Free has unexpected offset % instead of 16", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtAllocator.Free has unexpected size % instead of 8", it.type.runtime_size); case "Info"; assert(it.offset_in_bytes == 24, "OrtAllocator.Info has unexpected offset % instead of 24", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtAllocator.Info has unexpected size % instead of 8", it.type.runtime_size); case "Reserve"; assert(it.offset_in_bytes == 32, "OrtAllocator.Reserve has unexpected offset % instead of 32", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtAllocator.Reserve has unexpected size % instead of 8", it.type.runtime_size); case "GetStats"; assert(it.offset_in_bytes == 40, "OrtAllocator.GetStats has unexpected offset % instead of 40", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtAllocator.GetStats has unexpected size % instead of 8", it.type.runtime_size); case "AllocOnStream"; assert(it.offset_in_bytes == 48, "OrtAllocator.AllocOnStream has unexpected offset % instead of 48", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtAllocator.AllocOnStream has unexpected size % instead of 8", it.type.runtime_size); case "Shrink"; assert(it.offset_in_bytes == 56, "OrtAllocator.Shrink has unexpected offset % instead of 56", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtAllocator.Shrink has unexpected size % instead of 8", it.type.runtime_size); } } assert(size_of(OrtAllocator) == 64, "OrtAllocator has size % instead of 64", size_of(OrtAllocator)); } { info := type_info(OrtCUDAProviderOptions); for info.members { if it.name == { case "device_id"; assert(it.offset_in_bytes == 0, "OrtCUDAProviderOptions.device_id has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtCUDAProviderOptions.device_id has unexpected size % instead of 4", it.type.runtime_size); case "cudnn_conv_algo_search"; assert(it.offset_in_bytes == 4, "OrtCUDAProviderOptions.cudnn_conv_algo_search has unexpected offset % instead of 4", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtCUDAProviderOptions.cudnn_conv_algo_search has unexpected size % instead of 4", it.type.runtime_size); case "gpu_mem_limit"; assert(it.offset_in_bytes == 8, "OrtCUDAProviderOptions.gpu_mem_limit has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCUDAProviderOptions.gpu_mem_limit has unexpected size % instead of 8", it.type.runtime_size); case "arena_extend_strategy"; assert(it.offset_in_bytes == 16, "OrtCUDAProviderOptions.arena_extend_strategy has unexpected offset % instead of 16", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtCUDAProviderOptions.arena_extend_strategy has unexpected size % instead of 4", it.type.runtime_size); case "do_copy_in_default_stream"; assert(it.offset_in_bytes == 20, "OrtCUDAProviderOptions.do_copy_in_default_stream has unexpected offset % instead of 20", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtCUDAProviderOptions.do_copy_in_default_stream has unexpected size % instead of 4", it.type.runtime_size); case "has_user_compute_stream"; assert(it.offset_in_bytes == 24, "OrtCUDAProviderOptions.has_user_compute_stream has unexpected offset % instead of 24", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtCUDAProviderOptions.has_user_compute_stream has unexpected size % instead of 4", it.type.runtime_size); case "user_compute_stream"; assert(it.offset_in_bytes == 32, "OrtCUDAProviderOptions.user_compute_stream has unexpected offset % instead of 32", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCUDAProviderOptions.user_compute_stream has unexpected size % instead of 8", it.type.runtime_size); case "default_memory_arena_cfg"; assert(it.offset_in_bytes == 40, "OrtCUDAProviderOptions.default_memory_arena_cfg has unexpected offset % instead of 40", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCUDAProviderOptions.default_memory_arena_cfg has unexpected size % instead of 8", it.type.runtime_size); case "tunable_op_enable"; assert(it.offset_in_bytes == 48, "OrtCUDAProviderOptions.tunable_op_enable has unexpected offset % instead of 48", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtCUDAProviderOptions.tunable_op_enable has unexpected size % instead of 4", it.type.runtime_size); case "tunable_op_tuning_enable"; assert(it.offset_in_bytes == 52, "OrtCUDAProviderOptions.tunable_op_tuning_enable has unexpected offset % instead of 52", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtCUDAProviderOptions.tunable_op_tuning_enable has unexpected size % instead of 4", it.type.runtime_size); case "tunable_op_max_tuning_duration_ms"; assert(it.offset_in_bytes == 56, "OrtCUDAProviderOptions.tunable_op_max_tuning_duration_ms has unexpected offset % instead of 56", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtCUDAProviderOptions.tunable_op_max_tuning_duration_ms has unexpected size % instead of 4", it.type.runtime_size); } } assert(size_of(OrtCUDAProviderOptions) == 64, "OrtCUDAProviderOptions has size % instead of 64", size_of(OrtCUDAProviderOptions)); } { info := type_info(OrtROCMProviderOptions); for info.members { if it.name == { case "device_id"; assert(it.offset_in_bytes == 0, "OrtROCMProviderOptions.device_id has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtROCMProviderOptions.device_id has unexpected size % instead of 4", it.type.runtime_size); case "miopen_conv_exhaustive_search"; assert(it.offset_in_bytes == 4, "OrtROCMProviderOptions.miopen_conv_exhaustive_search has unexpected offset % instead of 4", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtROCMProviderOptions.miopen_conv_exhaustive_search has unexpected size % instead of 4", it.type.runtime_size); case "gpu_mem_limit"; assert(it.offset_in_bytes == 8, "OrtROCMProviderOptions.gpu_mem_limit has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtROCMProviderOptions.gpu_mem_limit has unexpected size % instead of 8", it.type.runtime_size); case "arena_extend_strategy"; assert(it.offset_in_bytes == 16, "OrtROCMProviderOptions.arena_extend_strategy has unexpected offset % instead of 16", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtROCMProviderOptions.arena_extend_strategy has unexpected size % instead of 4", it.type.runtime_size); case "do_copy_in_default_stream"; assert(it.offset_in_bytes == 20, "OrtROCMProviderOptions.do_copy_in_default_stream has unexpected offset % instead of 20", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtROCMProviderOptions.do_copy_in_default_stream has unexpected size % instead of 4", it.type.runtime_size); case "has_user_compute_stream"; assert(it.offset_in_bytes == 24, "OrtROCMProviderOptions.has_user_compute_stream has unexpected offset % instead of 24", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtROCMProviderOptions.has_user_compute_stream has unexpected size % instead of 4", it.type.runtime_size); case "user_compute_stream"; assert(it.offset_in_bytes == 32, "OrtROCMProviderOptions.user_compute_stream has unexpected offset % instead of 32", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtROCMProviderOptions.user_compute_stream has unexpected size % instead of 8", it.type.runtime_size); case "default_memory_arena_cfg"; assert(it.offset_in_bytes == 40, "OrtROCMProviderOptions.default_memory_arena_cfg has unexpected offset % instead of 40", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtROCMProviderOptions.default_memory_arena_cfg has unexpected size % instead of 8", it.type.runtime_size); case "enable_hip_graph"; assert(it.offset_in_bytes == 48, "OrtROCMProviderOptions.enable_hip_graph has unexpected offset % instead of 48", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtROCMProviderOptions.enable_hip_graph has unexpected size % instead of 4", it.type.runtime_size); case "tunable_op_enable"; assert(it.offset_in_bytes == 52, "OrtROCMProviderOptions.tunable_op_enable has unexpected offset % instead of 52", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtROCMProviderOptions.tunable_op_enable has unexpected size % instead of 4", it.type.runtime_size); case "tunable_op_tuning_enable"; assert(it.offset_in_bytes == 56, "OrtROCMProviderOptions.tunable_op_tuning_enable has unexpected offset % instead of 56", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtROCMProviderOptions.tunable_op_tuning_enable has unexpected size % instead of 4", it.type.runtime_size); case "tunable_op_max_tuning_duration_ms"; assert(it.offset_in_bytes == 60, "OrtROCMProviderOptions.tunable_op_max_tuning_duration_ms has unexpected offset % instead of 60", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtROCMProviderOptions.tunable_op_max_tuning_duration_ms has unexpected size % instead of 4", it.type.runtime_size); } } assert(size_of(OrtROCMProviderOptions) == 64, "OrtROCMProviderOptions has size % instead of 64", size_of(OrtROCMProviderOptions)); } { info := type_info(OrtTensorRTProviderOptions); for info.members { if it.name == { case "device_id"; assert(it.offset_in_bytes == 0, "OrtTensorRTProviderOptions.device_id has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtTensorRTProviderOptions.device_id has unexpected size % instead of 4", it.type.runtime_size); case "has_user_compute_stream"; assert(it.offset_in_bytes == 4, "OrtTensorRTProviderOptions.has_user_compute_stream has unexpected offset % instead of 4", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtTensorRTProviderOptions.has_user_compute_stream has unexpected size % instead of 4", it.type.runtime_size); case "user_compute_stream"; assert(it.offset_in_bytes == 8, "OrtTensorRTProviderOptions.user_compute_stream has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtTensorRTProviderOptions.user_compute_stream has unexpected size % instead of 8", it.type.runtime_size); case "trt_max_partition_iterations"; assert(it.offset_in_bytes == 16, "OrtTensorRTProviderOptions.trt_max_partition_iterations has unexpected offset % instead of 16", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtTensorRTProviderOptions.trt_max_partition_iterations has unexpected size % instead of 4", it.type.runtime_size); case "trt_min_subgraph_size"; assert(it.offset_in_bytes == 20, "OrtTensorRTProviderOptions.trt_min_subgraph_size has unexpected offset % instead of 20", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtTensorRTProviderOptions.trt_min_subgraph_size has unexpected size % instead of 4", it.type.runtime_size); case "trt_max_workspace_size"; assert(it.offset_in_bytes == 24, "OrtTensorRTProviderOptions.trt_max_workspace_size has unexpected offset % instead of 24", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtTensorRTProviderOptions.trt_max_workspace_size has unexpected size % instead of 8", it.type.runtime_size); case "trt_fp16_enable"; assert(it.offset_in_bytes == 32, "OrtTensorRTProviderOptions.trt_fp16_enable has unexpected offset % instead of 32", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtTensorRTProviderOptions.trt_fp16_enable has unexpected size % instead of 4", it.type.runtime_size); case "trt_int8_enable"; assert(it.offset_in_bytes == 36, "OrtTensorRTProviderOptions.trt_int8_enable has unexpected offset % instead of 36", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtTensorRTProviderOptions.trt_int8_enable has unexpected size % instead of 4", it.type.runtime_size); case "trt_int8_calibration_table_name"; assert(it.offset_in_bytes == 40, "OrtTensorRTProviderOptions.trt_int8_calibration_table_name has unexpected offset % instead of 40", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtTensorRTProviderOptions.trt_int8_calibration_table_name has unexpected size % instead of 8", it.type.runtime_size); case "trt_int8_use_native_calibration_table"; assert(it.offset_in_bytes == 48, "OrtTensorRTProviderOptions.trt_int8_use_native_calibration_table has unexpected offset % instead of 48", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtTensorRTProviderOptions.trt_int8_use_native_calibration_table has unexpected size % instead of 4", it.type.runtime_size); case "trt_dla_enable"; assert(it.offset_in_bytes == 52, "OrtTensorRTProviderOptions.trt_dla_enable has unexpected offset % instead of 52", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtTensorRTProviderOptions.trt_dla_enable has unexpected size % instead of 4", it.type.runtime_size); case "trt_dla_core"; assert(it.offset_in_bytes == 56, "OrtTensorRTProviderOptions.trt_dla_core has unexpected offset % instead of 56", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtTensorRTProviderOptions.trt_dla_core has unexpected size % instead of 4", it.type.runtime_size); case "trt_dump_subgraphs"; assert(it.offset_in_bytes == 60, "OrtTensorRTProviderOptions.trt_dump_subgraphs has unexpected offset % instead of 60", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtTensorRTProviderOptions.trt_dump_subgraphs has unexpected size % instead of 4", it.type.runtime_size); case "trt_engine_cache_enable"; assert(it.offset_in_bytes == 64, "OrtTensorRTProviderOptions.trt_engine_cache_enable has unexpected offset % instead of 64", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtTensorRTProviderOptions.trt_engine_cache_enable has unexpected size % instead of 4", it.type.runtime_size); case "trt_engine_cache_path"; assert(it.offset_in_bytes == 72, "OrtTensorRTProviderOptions.trt_engine_cache_path has unexpected offset % instead of 72", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtTensorRTProviderOptions.trt_engine_cache_path has unexpected size % instead of 8", it.type.runtime_size); case "trt_engine_decryption_enable"; assert(it.offset_in_bytes == 80, "OrtTensorRTProviderOptions.trt_engine_decryption_enable has unexpected offset % instead of 80", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtTensorRTProviderOptions.trt_engine_decryption_enable has unexpected size % instead of 4", it.type.runtime_size); case "trt_engine_decryption_lib_path"; assert(it.offset_in_bytes == 88, "OrtTensorRTProviderOptions.trt_engine_decryption_lib_path has unexpected offset % instead of 88", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtTensorRTProviderOptions.trt_engine_decryption_lib_path has unexpected size % instead of 8", it.type.runtime_size); case "trt_force_sequential_engine_build"; assert(it.offset_in_bytes == 96, "OrtTensorRTProviderOptions.trt_force_sequential_engine_build has unexpected offset % instead of 96", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtTensorRTProviderOptions.trt_force_sequential_engine_build has unexpected size % instead of 4", it.type.runtime_size); } } assert(size_of(OrtTensorRTProviderOptions) == 104, "OrtTensorRTProviderOptions has size % instead of 104", size_of(OrtTensorRTProviderOptions)); } { info := type_info(OrtMIGraphXProviderOptions); for info.members { if it.name == { case "device_id"; assert(it.offset_in_bytes == 0, "OrtMIGraphXProviderOptions.device_id has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtMIGraphXProviderOptions.device_id has unexpected size % instead of 4", it.type.runtime_size); case "migraphx_fp16_enable"; assert(it.offset_in_bytes == 4, "OrtMIGraphXProviderOptions.migraphx_fp16_enable has unexpected offset % instead of 4", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtMIGraphXProviderOptions.migraphx_fp16_enable has unexpected size % instead of 4", it.type.runtime_size); case "migraphx_fp8_enable"; assert(it.offset_in_bytes == 8, "OrtMIGraphXProviderOptions.migraphx_fp8_enable has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtMIGraphXProviderOptions.migraphx_fp8_enable has unexpected size % instead of 4", it.type.runtime_size); case "migraphx_int8_enable"; assert(it.offset_in_bytes == 12, "OrtMIGraphXProviderOptions.migraphx_int8_enable has unexpected offset % instead of 12", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtMIGraphXProviderOptions.migraphx_int8_enable has unexpected size % instead of 4", it.type.runtime_size); case "migraphx_use_native_calibration_table"; assert(it.offset_in_bytes == 16, "OrtMIGraphXProviderOptions.migraphx_use_native_calibration_table has unexpected offset % instead of 16", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtMIGraphXProviderOptions.migraphx_use_native_calibration_table has unexpected size % instead of 4", it.type.runtime_size); case "migraphx_int8_calibration_table_name"; assert(it.offset_in_bytes == 24, "OrtMIGraphXProviderOptions.migraphx_int8_calibration_table_name has unexpected offset % instead of 24", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtMIGraphXProviderOptions.migraphx_int8_calibration_table_name has unexpected size % instead of 8", it.type.runtime_size); case "migraphx_save_compiled_model"; assert(it.offset_in_bytes == 32, "OrtMIGraphXProviderOptions.migraphx_save_compiled_model has unexpected offset % instead of 32", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtMIGraphXProviderOptions.migraphx_save_compiled_model has unexpected size % instead of 4", it.type.runtime_size); case "migraphx_save_model_path"; assert(it.offset_in_bytes == 40, "OrtMIGraphXProviderOptions.migraphx_save_model_path has unexpected offset % instead of 40", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtMIGraphXProviderOptions.migraphx_save_model_path has unexpected size % instead of 8", it.type.runtime_size); case "migraphx_load_compiled_model"; assert(it.offset_in_bytes == 48, "OrtMIGraphXProviderOptions.migraphx_load_compiled_model has unexpected offset % instead of 48", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtMIGraphXProviderOptions.migraphx_load_compiled_model has unexpected size % instead of 4", it.type.runtime_size); case "migraphx_load_model_path"; assert(it.offset_in_bytes == 56, "OrtMIGraphXProviderOptions.migraphx_load_model_path has unexpected offset % instead of 56", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtMIGraphXProviderOptions.migraphx_load_model_path has unexpected size % instead of 8", it.type.runtime_size); case "migraphx_exhaustive_tune"; assert(it.offset_in_bytes == 64, "OrtMIGraphXProviderOptions.migraphx_exhaustive_tune has unexpected offset % instead of 64", it.offset_in_bytes); assert(it.type.runtime_size == 1, "OrtMIGraphXProviderOptions.migraphx_exhaustive_tune has unexpected size % instead of 1", it.type.runtime_size); case "migraphx_mem_limit"; assert(it.offset_in_bytes == 72, "OrtMIGraphXProviderOptions.migraphx_mem_limit has unexpected offset % instead of 72", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtMIGraphXProviderOptions.migraphx_mem_limit has unexpected size % instead of 8", it.type.runtime_size); case "migraphx_arena_extend_strategy"; assert(it.offset_in_bytes == 80, "OrtMIGraphXProviderOptions.migraphx_arena_extend_strategy has unexpected offset % instead of 80", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtMIGraphXProviderOptions.migraphx_arena_extend_strategy has unexpected size % instead of 4", it.type.runtime_size); } } assert(size_of(OrtMIGraphXProviderOptions) == 88, "OrtMIGraphXProviderOptions has size % instead of 88", size_of(OrtMIGraphXProviderOptions)); } { info := type_info(OrtOpenVINOProviderOptions); for info.members { if it.name == { case "device_type"; assert(it.offset_in_bytes == 0, "OrtOpenVINOProviderOptions.device_type has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtOpenVINOProviderOptions.device_type has unexpected size % instead of 8", it.type.runtime_size); case "enable_npu_fast_compile"; assert(it.offset_in_bytes == 8, "OrtOpenVINOProviderOptions.enable_npu_fast_compile has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 1, "OrtOpenVINOProviderOptions.enable_npu_fast_compile has unexpected size % instead of 1", it.type.runtime_size); case "device_id"; assert(it.offset_in_bytes == 16, "OrtOpenVINOProviderOptions.device_id has unexpected offset % instead of 16", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtOpenVINOProviderOptions.device_id has unexpected size % instead of 8", it.type.runtime_size); case "num_of_threads"; assert(it.offset_in_bytes == 24, "OrtOpenVINOProviderOptions.num_of_threads has unexpected offset % instead of 24", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtOpenVINOProviderOptions.num_of_threads has unexpected size % instead of 8", it.type.runtime_size); case "cache_dir"; assert(it.offset_in_bytes == 32, "OrtOpenVINOProviderOptions.cache_dir has unexpected offset % instead of 32", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtOpenVINOProviderOptions.cache_dir has unexpected size % instead of 8", it.type.runtime_size); case "_context"; assert(it.offset_in_bytes == 40, "OrtOpenVINOProviderOptions._context has unexpected offset % instead of 40", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtOpenVINOProviderOptions._context has unexpected size % instead of 8", it.type.runtime_size); case "enable_opencl_throttling"; assert(it.offset_in_bytes == 48, "OrtOpenVINOProviderOptions.enable_opencl_throttling has unexpected offset % instead of 48", it.offset_in_bytes); assert(it.type.runtime_size == 1, "OrtOpenVINOProviderOptions.enable_opencl_throttling has unexpected size % instead of 1", it.type.runtime_size); case "enable_dynamic_shapes"; assert(it.offset_in_bytes == 49, "OrtOpenVINOProviderOptions.enable_dynamic_shapes has unexpected offset % instead of 49", it.offset_in_bytes); assert(it.type.runtime_size == 1, "OrtOpenVINOProviderOptions.enable_dynamic_shapes has unexpected size % instead of 1", it.type.runtime_size); } } assert(size_of(OrtOpenVINOProviderOptions) == 56, "OrtOpenVINOProviderOptions has size % instead of 56", size_of(OrtOpenVINOProviderOptions)); } { info := type_info(OrtApiBase); for info.members { if it.name == { case "GetApi"; assert(it.offset_in_bytes == 0, "OrtApiBase.GetApi has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApiBase.GetApi has unexpected size % instead of 8", it.type.runtime_size); case "GetVersionString"; assert(it.offset_in_bytes == 8, "OrtApiBase.GetVersionString has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApiBase.GetVersionString has unexpected size % instead of 8", it.type.runtime_size); } } assert(size_of(OrtApiBase) == 16, "OrtApiBase has size % instead of 16", size_of(OrtApiBase)); } { info := type_info(OrtCustomHandleType); for info.members { if it.name == { case "__place_holder"; assert(it.offset_in_bytes == 0, "OrtCustomHandleType.__place_holder has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 1, "OrtCustomHandleType.__place_holder has unexpected size % instead of 1", it.type.runtime_size); } } assert(size_of(OrtCustomHandleType) == 1, "OrtCustomHandleType has size % instead of 1", size_of(OrtCustomHandleType)); } { info := type_info(OrtThreadPoolCallbacksConfig); for info.members { if it.name == { case "version"; assert(it.offset_in_bytes == 0, "OrtThreadPoolCallbacksConfig.version has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtThreadPoolCallbacksConfig.version has unexpected size % instead of 4", it.type.runtime_size); case "on_enqueue"; assert(it.offset_in_bytes == 8, "OrtThreadPoolCallbacksConfig.on_enqueue has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtThreadPoolCallbacksConfig.on_enqueue has unexpected size % instead of 8", it.type.runtime_size); case "on_start_work"; assert(it.offset_in_bytes == 16, "OrtThreadPoolCallbacksConfig.on_start_work has unexpected offset % instead of 16", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtThreadPoolCallbacksConfig.on_start_work has unexpected size % instead of 8", it.type.runtime_size); case "on_stop_work"; assert(it.offset_in_bytes == 24, "OrtThreadPoolCallbacksConfig.on_stop_work has unexpected offset % instead of 24", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtThreadPoolCallbacksConfig.on_stop_work has unexpected size % instead of 8", it.type.runtime_size); case "on_abandon"; assert(it.offset_in_bytes == 32, "OrtThreadPoolCallbacksConfig.on_abandon has unexpected offset % instead of 32", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtThreadPoolCallbacksConfig.on_abandon has unexpected size % instead of 8", it.type.runtime_size); case "user_context"; assert(it.offset_in_bytes == 40, "OrtThreadPoolCallbacksConfig.user_context has unexpected offset % instead of 40", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtThreadPoolCallbacksConfig.user_context has unexpected size % instead of 8", it.type.runtime_size); } } assert(size_of(OrtThreadPoolCallbacksConfig) == 48, "OrtThreadPoolCallbacksConfig has size % instead of 48", size_of(OrtThreadPoolCallbacksConfig)); } { info := type_info(OrtExternalMemoryDescriptor); for info.members { if it.name == { case "version"; assert(it.offset_in_bytes == 0, "OrtExternalMemoryDescriptor.version has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtExternalMemoryDescriptor.version has unexpected size % instead of 4", it.type.runtime_size); case "handle_type"; assert(it.offset_in_bytes == 4, "OrtExternalMemoryDescriptor.handle_type has unexpected offset % instead of 4", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtExternalMemoryDescriptor.handle_type has unexpected size % instead of 4", it.type.runtime_size); case "native_handle"; assert(it.offset_in_bytes == 8, "OrtExternalMemoryDescriptor.native_handle has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtExternalMemoryDescriptor.native_handle has unexpected size % instead of 8", it.type.runtime_size); case "size_bytes"; assert(it.offset_in_bytes == 16, "OrtExternalMemoryDescriptor.size_bytes has unexpected offset % instead of 16", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtExternalMemoryDescriptor.size_bytes has unexpected size % instead of 8", it.type.runtime_size); case "offset_bytes"; assert(it.offset_in_bytes == 24, "OrtExternalMemoryDescriptor.offset_bytes has unexpected offset % instead of 24", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtExternalMemoryDescriptor.offset_bytes has unexpected size % instead of 8", it.type.runtime_size); } } assert(size_of(OrtExternalMemoryDescriptor) == 32, "OrtExternalMemoryDescriptor has size % instead of 32", size_of(OrtExternalMemoryDescriptor)); } { info := type_info(OrtExternalSemaphoreDescriptor); for info.members { if it.name == { case "version"; assert(it.offset_in_bytes == 0, "OrtExternalSemaphoreDescriptor.version has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtExternalSemaphoreDescriptor.version has unexpected size % instead of 4", it.type.runtime_size); case "type"; assert(it.offset_in_bytes == 4, "OrtExternalSemaphoreDescriptor.type has unexpected offset % instead of 4", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtExternalSemaphoreDescriptor.type has unexpected size % instead of 4", it.type.runtime_size); case "native_handle"; assert(it.offset_in_bytes == 8, "OrtExternalSemaphoreDescriptor.native_handle has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtExternalSemaphoreDescriptor.native_handle has unexpected size % instead of 8", it.type.runtime_size); } } assert(size_of(OrtExternalSemaphoreDescriptor) == 16, "OrtExternalSemaphoreDescriptor has size % instead of 16", size_of(OrtExternalSemaphoreDescriptor)); } { info := type_info(OrtGraphicsInteropConfig); for info.members { if it.name == { case "version"; assert(it.offset_in_bytes == 0, "OrtGraphicsInteropConfig.version has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtGraphicsInteropConfig.version has unexpected size % instead of 4", it.type.runtime_size); case "graphics_api"; assert(it.offset_in_bytes == 4, "OrtGraphicsInteropConfig.graphics_api has unexpected offset % instead of 4", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtGraphicsInteropConfig.graphics_api has unexpected size % instead of 4", it.type.runtime_size); case "command_queue"; assert(it.offset_in_bytes == 8, "OrtGraphicsInteropConfig.command_queue has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtGraphicsInteropConfig.command_queue has unexpected size % instead of 8", it.type.runtime_size); case "additional_options"; assert(it.offset_in_bytes == 16, "OrtGraphicsInteropConfig.additional_options has unexpected offset % instead of 16", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtGraphicsInteropConfig.additional_options has unexpected size % instead of 8", it.type.runtime_size); } } assert(size_of(OrtGraphicsInteropConfig) == 24, "OrtGraphicsInteropConfig has size % instead of 24", size_of(OrtGraphicsInteropConfig)); } { info := type_info(OrtExternalTensorDescriptor); for info.members { if it.name == { case "version"; assert(it.offset_in_bytes == 0, "OrtExternalTensorDescriptor.version has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtExternalTensorDescriptor.version has unexpected size % instead of 4", it.type.runtime_size); case "element_type"; assert(it.offset_in_bytes == 4, "OrtExternalTensorDescriptor.element_type has unexpected offset % instead of 4", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtExternalTensorDescriptor.element_type has unexpected size % instead of 4", it.type.runtime_size); case "shape"; assert(it.offset_in_bytes == 8, "OrtExternalTensorDescriptor.shape has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtExternalTensorDescriptor.shape has unexpected size % instead of 8", it.type.runtime_size); case "rank"; assert(it.offset_in_bytes == 16, "OrtExternalTensorDescriptor.rank has unexpected offset % instead of 16", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtExternalTensorDescriptor.rank has unexpected size % instead of 8", it.type.runtime_size); case "offset_bytes"; assert(it.offset_in_bytes == 24, "OrtExternalTensorDescriptor.offset_bytes has unexpected offset % instead of 24", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtExternalTensorDescriptor.offset_bytes has unexpected size % instead of 8", it.type.runtime_size); } } assert(size_of(OrtExternalTensorDescriptor) == 32, "OrtExternalTensorDescriptor has size % instead of 32", size_of(OrtExternalTensorDescriptor)); } { info := type_info(OrtEnvCreationOptions); for info.members { if it.name == { case "version"; assert(it.offset_in_bytes == 0, "OrtEnvCreationOptions.version has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtEnvCreationOptions.version has unexpected size % instead of 4", it.type.runtime_size); case "logging_severity_level"; assert(it.offset_in_bytes == 4, "OrtEnvCreationOptions.logging_severity_level has unexpected offset % instead of 4", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtEnvCreationOptions.logging_severity_level has unexpected size % instead of 4", it.type.runtime_size); case "log_id"; assert(it.offset_in_bytes == 8, "OrtEnvCreationOptions.log_id has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEnvCreationOptions.log_id has unexpected size % instead of 8", it.type.runtime_size); case "custom_logging_function"; assert(it.offset_in_bytes == 16, "OrtEnvCreationOptions.custom_logging_function has unexpected offset % instead of 16", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEnvCreationOptions.custom_logging_function has unexpected size % instead of 8", it.type.runtime_size); case "custom_logging_param"; assert(it.offset_in_bytes == 24, "OrtEnvCreationOptions.custom_logging_param has unexpected offset % instead of 24", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEnvCreationOptions.custom_logging_param has unexpected size % instead of 8", it.type.runtime_size); case "threading_options"; assert(it.offset_in_bytes == 32, "OrtEnvCreationOptions.threading_options has unexpected offset % instead of 32", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEnvCreationOptions.threading_options has unexpected size % instead of 8", it.type.runtime_size); case "config_entries"; assert(it.offset_in_bytes == 40, "OrtEnvCreationOptions.config_entries has unexpected offset % instead of 40", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEnvCreationOptions.config_entries has unexpected size % instead of 8", it.type.runtime_size); } } assert(size_of(OrtEnvCreationOptions) == 48, "OrtEnvCreationOptions has size % instead of 48", size_of(OrtEnvCreationOptions)); } { info := type_info(OrtApi); for info.members { if it.name == { case "CreateStatus"; assert(it.offset_in_bytes == 0, "OrtApi.CreateStatus has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateStatus has unexpected size % instead of 8", it.type.runtime_size); case "GetErrorCode"; assert(it.offset_in_bytes == 8, "OrtApi.GetErrorCode has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetErrorCode has unexpected size % instead of 8", it.type.runtime_size); case "GetErrorMessage"; assert(it.offset_in_bytes == 16, "OrtApi.GetErrorMessage has unexpected offset % instead of 16", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetErrorMessage has unexpected size % instead of 8", it.type.runtime_size); case "CreateEnv"; assert(it.offset_in_bytes == 24, "OrtApi.CreateEnv has unexpected offset % instead of 24", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateEnv has unexpected size % instead of 8", it.type.runtime_size); case "CreateEnvWithCustomLogger"; assert(it.offset_in_bytes == 32, "OrtApi.CreateEnvWithCustomLogger has unexpected offset % instead of 32", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateEnvWithCustomLogger has unexpected size % instead of 8", it.type.runtime_size); case "EnableTelemetryEvents"; assert(it.offset_in_bytes == 40, "OrtApi.EnableTelemetryEvents has unexpected offset % instead of 40", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.EnableTelemetryEvents has unexpected size % instead of 8", it.type.runtime_size); case "DisableTelemetryEvents"; assert(it.offset_in_bytes == 48, "OrtApi.DisableTelemetryEvents has unexpected offset % instead of 48", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.DisableTelemetryEvents has unexpected size % instead of 8", it.type.runtime_size); case "CreateSession"; assert(it.offset_in_bytes == 56, "OrtApi.CreateSession has unexpected offset % instead of 56", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateSession has unexpected size % instead of 8", it.type.runtime_size); case "CreateSessionFromArray"; assert(it.offset_in_bytes == 64, "OrtApi.CreateSessionFromArray has unexpected offset % instead of 64", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateSessionFromArray has unexpected size % instead of 8", it.type.runtime_size); case "Run"; assert(it.offset_in_bytes == 72, "OrtApi.Run has unexpected offset % instead of 72", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Run has unexpected size % instead of 8", it.type.runtime_size); case "CreateSessionOptions"; assert(it.offset_in_bytes == 80, "OrtApi.CreateSessionOptions has unexpected offset % instead of 80", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateSessionOptions has unexpected size % instead of 8", it.type.runtime_size); case "SetOptimizedModelFilePath"; assert(it.offset_in_bytes == 88, "OrtApi.SetOptimizedModelFilePath has unexpected offset % instead of 88", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SetOptimizedModelFilePath has unexpected size % instead of 8", it.type.runtime_size); case "CloneSessionOptions"; assert(it.offset_in_bytes == 96, "OrtApi.CloneSessionOptions has unexpected offset % instead of 96", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CloneSessionOptions has unexpected size % instead of 8", it.type.runtime_size); case "SetSessionExecutionMode"; assert(it.offset_in_bytes == 104, "OrtApi.SetSessionExecutionMode has unexpected offset % instead of 104", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SetSessionExecutionMode has unexpected size % instead of 8", it.type.runtime_size); case "EnableProfiling"; assert(it.offset_in_bytes == 112, "OrtApi.EnableProfiling has unexpected offset % instead of 112", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.EnableProfiling has unexpected size % instead of 8", it.type.runtime_size); case "DisableProfiling"; assert(it.offset_in_bytes == 120, "OrtApi.DisableProfiling has unexpected offset % instead of 120", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.DisableProfiling has unexpected size % instead of 8", it.type.runtime_size); case "EnableMemPattern"; assert(it.offset_in_bytes == 128, "OrtApi.EnableMemPattern has unexpected offset % instead of 128", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.EnableMemPattern has unexpected size % instead of 8", it.type.runtime_size); case "DisableMemPattern"; assert(it.offset_in_bytes == 136, "OrtApi.DisableMemPattern has unexpected offset % instead of 136", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.DisableMemPattern has unexpected size % instead of 8", it.type.runtime_size); case "EnableCpuMemArena"; assert(it.offset_in_bytes == 144, "OrtApi.EnableCpuMemArena has unexpected offset % instead of 144", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.EnableCpuMemArena has unexpected size % instead of 8", it.type.runtime_size); case "DisableCpuMemArena"; assert(it.offset_in_bytes == 152, "OrtApi.DisableCpuMemArena has unexpected offset % instead of 152", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.DisableCpuMemArena has unexpected size % instead of 8", it.type.runtime_size); case "SetSessionLogId"; assert(it.offset_in_bytes == 160, "OrtApi.SetSessionLogId has unexpected offset % instead of 160", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SetSessionLogId has unexpected size % instead of 8", it.type.runtime_size); case "SetSessionLogVerbosityLevel"; assert(it.offset_in_bytes == 168, "OrtApi.SetSessionLogVerbosityLevel has unexpected offset % instead of 168", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SetSessionLogVerbosityLevel has unexpected size % instead of 8", it.type.runtime_size); case "SetSessionLogSeverityLevel"; assert(it.offset_in_bytes == 176, "OrtApi.SetSessionLogSeverityLevel has unexpected offset % instead of 176", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SetSessionLogSeverityLevel has unexpected size % instead of 8", it.type.runtime_size); case "SetSessionGraphOptimizationLevel"; assert(it.offset_in_bytes == 184, "OrtApi.SetSessionGraphOptimizationLevel has unexpected offset % instead of 184", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SetSessionGraphOptimizationLevel has unexpected size % instead of 8", it.type.runtime_size); case "SetIntraOpNumThreads"; assert(it.offset_in_bytes == 192, "OrtApi.SetIntraOpNumThreads has unexpected offset % instead of 192", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SetIntraOpNumThreads has unexpected size % instead of 8", it.type.runtime_size); case "SetInterOpNumThreads"; assert(it.offset_in_bytes == 200, "OrtApi.SetInterOpNumThreads has unexpected offset % instead of 200", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SetInterOpNumThreads has unexpected size % instead of 8", it.type.runtime_size); case "CreateCustomOpDomain"; assert(it.offset_in_bytes == 208, "OrtApi.CreateCustomOpDomain has unexpected offset % instead of 208", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateCustomOpDomain has unexpected size % instead of 8", it.type.runtime_size); case "CustomOpDomain_Add"; assert(it.offset_in_bytes == 216, "OrtApi.CustomOpDomain_Add has unexpected offset % instead of 216", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CustomOpDomain_Add has unexpected size % instead of 8", it.type.runtime_size); case "AddCustomOpDomain"; assert(it.offset_in_bytes == 224, "OrtApi.AddCustomOpDomain has unexpected offset % instead of 224", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.AddCustomOpDomain has unexpected size % instead of 8", it.type.runtime_size); case "RegisterCustomOpsLibrary"; assert(it.offset_in_bytes == 232, "OrtApi.RegisterCustomOpsLibrary has unexpected offset % instead of 232", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.RegisterCustomOpsLibrary has unexpected size % instead of 8", it.type.runtime_size); case "SessionGetInputCount"; assert(it.offset_in_bytes == 240, "OrtApi.SessionGetInputCount has unexpected offset % instead of 240", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionGetInputCount has unexpected size % instead of 8", it.type.runtime_size); case "SessionGetOutputCount"; assert(it.offset_in_bytes == 248, "OrtApi.SessionGetOutputCount has unexpected offset % instead of 248", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionGetOutputCount has unexpected size % instead of 8", it.type.runtime_size); case "SessionGetOverridableInitializerCount"; assert(it.offset_in_bytes == 256, "OrtApi.SessionGetOverridableInitializerCount has unexpected offset % instead of 256", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionGetOverridableInitializerCount has unexpected size % instead of 8", it.type.runtime_size); case "SessionGetInputTypeInfo"; assert(it.offset_in_bytes == 264, "OrtApi.SessionGetInputTypeInfo has unexpected offset % instead of 264", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionGetInputTypeInfo has unexpected size % instead of 8", it.type.runtime_size); case "SessionGetOutputTypeInfo"; assert(it.offset_in_bytes == 272, "OrtApi.SessionGetOutputTypeInfo has unexpected offset % instead of 272", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionGetOutputTypeInfo has unexpected size % instead of 8", it.type.runtime_size); case "SessionGetOverridableInitializerTypeInfo"; assert(it.offset_in_bytes == 280, "OrtApi.SessionGetOverridableInitializerTypeInfo has unexpected offset % instead of 280", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionGetOverridableInitializerTypeInfo has unexpected size % instead of 8", it.type.runtime_size); case "SessionGetInputName"; assert(it.offset_in_bytes == 288, "OrtApi.SessionGetInputName has unexpected offset % instead of 288", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionGetInputName has unexpected size % instead of 8", it.type.runtime_size); case "SessionGetOutputName"; assert(it.offset_in_bytes == 296, "OrtApi.SessionGetOutputName has unexpected offset % instead of 296", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionGetOutputName has unexpected size % instead of 8", it.type.runtime_size); case "SessionGetOverridableInitializerName"; assert(it.offset_in_bytes == 304, "OrtApi.SessionGetOverridableInitializerName has unexpected offset % instead of 304", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionGetOverridableInitializerName has unexpected size % instead of 8", it.type.runtime_size); case "CreateRunOptions"; assert(it.offset_in_bytes == 312, "OrtApi.CreateRunOptions has unexpected offset % instead of 312", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateRunOptions has unexpected size % instead of 8", it.type.runtime_size); case "RunOptionsSetRunLogVerbosityLevel"; assert(it.offset_in_bytes == 320, "OrtApi.RunOptionsSetRunLogVerbosityLevel has unexpected offset % instead of 320", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.RunOptionsSetRunLogVerbosityLevel has unexpected size % instead of 8", it.type.runtime_size); case "RunOptionsSetRunLogSeverityLevel"; assert(it.offset_in_bytes == 328, "OrtApi.RunOptionsSetRunLogSeverityLevel has unexpected offset % instead of 328", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.RunOptionsSetRunLogSeverityLevel has unexpected size % instead of 8", it.type.runtime_size); case "RunOptionsSetRunTag"; assert(it.offset_in_bytes == 336, "OrtApi.RunOptionsSetRunTag has unexpected offset % instead of 336", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.RunOptionsSetRunTag has unexpected size % instead of 8", it.type.runtime_size); case "RunOptionsGetRunLogVerbosityLevel"; assert(it.offset_in_bytes == 344, "OrtApi.RunOptionsGetRunLogVerbosityLevel has unexpected offset % instead of 344", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.RunOptionsGetRunLogVerbosityLevel has unexpected size % instead of 8", it.type.runtime_size); case "RunOptionsGetRunLogSeverityLevel"; assert(it.offset_in_bytes == 352, "OrtApi.RunOptionsGetRunLogSeverityLevel has unexpected offset % instead of 352", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.RunOptionsGetRunLogSeverityLevel has unexpected size % instead of 8", it.type.runtime_size); case "RunOptionsGetRunTag"; assert(it.offset_in_bytes == 360, "OrtApi.RunOptionsGetRunTag has unexpected offset % instead of 360", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.RunOptionsGetRunTag has unexpected size % instead of 8", it.type.runtime_size); case "RunOptionsSetTerminate"; assert(it.offset_in_bytes == 368, "OrtApi.RunOptionsSetTerminate has unexpected offset % instead of 368", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.RunOptionsSetTerminate has unexpected size % instead of 8", it.type.runtime_size); case "RunOptionsUnsetTerminate"; assert(it.offset_in_bytes == 376, "OrtApi.RunOptionsUnsetTerminate has unexpected offset % instead of 376", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.RunOptionsUnsetTerminate has unexpected size % instead of 8", it.type.runtime_size); case "CreateTensorAsOrtValue"; assert(it.offset_in_bytes == 384, "OrtApi.CreateTensorAsOrtValue has unexpected offset % instead of 384", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateTensorAsOrtValue has unexpected size % instead of 8", it.type.runtime_size); case "CreateTensorWithDataAsOrtValue"; assert(it.offset_in_bytes == 392, "OrtApi.CreateTensorWithDataAsOrtValue has unexpected offset % instead of 392", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateTensorWithDataAsOrtValue has unexpected size % instead of 8", it.type.runtime_size); case "IsTensor"; assert(it.offset_in_bytes == 400, "OrtApi.IsTensor has unexpected offset % instead of 400", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.IsTensor has unexpected size % instead of 8", it.type.runtime_size); case "GetTensorMutableData"; assert(it.offset_in_bytes == 408, "OrtApi.GetTensorMutableData has unexpected offset % instead of 408", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetTensorMutableData has unexpected size % instead of 8", it.type.runtime_size); case "FillStringTensor"; assert(it.offset_in_bytes == 416, "OrtApi.FillStringTensor has unexpected offset % instead of 416", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.FillStringTensor has unexpected size % instead of 8", it.type.runtime_size); case "GetStringTensorDataLength"; assert(it.offset_in_bytes == 424, "OrtApi.GetStringTensorDataLength has unexpected offset % instead of 424", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetStringTensorDataLength has unexpected size % instead of 8", it.type.runtime_size); case "GetStringTensorContent"; assert(it.offset_in_bytes == 432, "OrtApi.GetStringTensorContent has unexpected offset % instead of 432", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetStringTensorContent has unexpected size % instead of 8", it.type.runtime_size); case "CastTypeInfoToTensorInfo"; assert(it.offset_in_bytes == 440, "OrtApi.CastTypeInfoToTensorInfo has unexpected offset % instead of 440", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CastTypeInfoToTensorInfo has unexpected size % instead of 8", it.type.runtime_size); case "GetOnnxTypeFromTypeInfo"; assert(it.offset_in_bytes == 448, "OrtApi.GetOnnxTypeFromTypeInfo has unexpected offset % instead of 448", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetOnnxTypeFromTypeInfo has unexpected size % instead of 8", it.type.runtime_size); case "CreateTensorTypeAndShapeInfo"; assert(it.offset_in_bytes == 456, "OrtApi.CreateTensorTypeAndShapeInfo has unexpected offset % instead of 456", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateTensorTypeAndShapeInfo has unexpected size % instead of 8", it.type.runtime_size); case "SetTensorElementType"; assert(it.offset_in_bytes == 464, "OrtApi.SetTensorElementType has unexpected offset % instead of 464", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SetTensorElementType has unexpected size % instead of 8", it.type.runtime_size); case "SetDimensions"; assert(it.offset_in_bytes == 472, "OrtApi.SetDimensions has unexpected offset % instead of 472", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SetDimensions has unexpected size % instead of 8", it.type.runtime_size); case "GetTensorElementType"; assert(it.offset_in_bytes == 480, "OrtApi.GetTensorElementType has unexpected offset % instead of 480", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetTensorElementType has unexpected size % instead of 8", it.type.runtime_size); case "GetDimensionsCount"; assert(it.offset_in_bytes == 488, "OrtApi.GetDimensionsCount has unexpected offset % instead of 488", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetDimensionsCount has unexpected size % instead of 8", it.type.runtime_size); case "GetDimensions"; assert(it.offset_in_bytes == 496, "OrtApi.GetDimensions has unexpected offset % instead of 496", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetDimensions has unexpected size % instead of 8", it.type.runtime_size); case "GetSymbolicDimensions"; assert(it.offset_in_bytes == 504, "OrtApi.GetSymbolicDimensions has unexpected offset % instead of 504", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetSymbolicDimensions has unexpected size % instead of 8", it.type.runtime_size); case "GetTensorShapeElementCount"; assert(it.offset_in_bytes == 512, "OrtApi.GetTensorShapeElementCount has unexpected offset % instead of 512", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetTensorShapeElementCount has unexpected size % instead of 8", it.type.runtime_size); case "GetTensorTypeAndShape"; assert(it.offset_in_bytes == 520, "OrtApi.GetTensorTypeAndShape has unexpected offset % instead of 520", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetTensorTypeAndShape has unexpected size % instead of 8", it.type.runtime_size); case "GetTypeInfo"; assert(it.offset_in_bytes == 528, "OrtApi.GetTypeInfo has unexpected offset % instead of 528", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetTypeInfo has unexpected size % instead of 8", it.type.runtime_size); case "GetValueType"; assert(it.offset_in_bytes == 536, "OrtApi.GetValueType has unexpected offset % instead of 536", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetValueType has unexpected size % instead of 8", it.type.runtime_size); case "CreateMemoryInfo"; assert(it.offset_in_bytes == 544, "OrtApi.CreateMemoryInfo has unexpected offset % instead of 544", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateMemoryInfo has unexpected size % instead of 8", it.type.runtime_size); case "CreateCpuMemoryInfo"; assert(it.offset_in_bytes == 552, "OrtApi.CreateCpuMemoryInfo has unexpected offset % instead of 552", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateCpuMemoryInfo has unexpected size % instead of 8", it.type.runtime_size); case "CompareMemoryInfo"; assert(it.offset_in_bytes == 560, "OrtApi.CompareMemoryInfo has unexpected offset % instead of 560", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CompareMemoryInfo has unexpected size % instead of 8", it.type.runtime_size); case "MemoryInfoGetName"; assert(it.offset_in_bytes == 568, "OrtApi.MemoryInfoGetName has unexpected offset % instead of 568", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.MemoryInfoGetName has unexpected size % instead of 8", it.type.runtime_size); case "MemoryInfoGetId"; assert(it.offset_in_bytes == 576, "OrtApi.MemoryInfoGetId has unexpected offset % instead of 576", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.MemoryInfoGetId has unexpected size % instead of 8", it.type.runtime_size); case "MemoryInfoGetMemType"; assert(it.offset_in_bytes == 584, "OrtApi.MemoryInfoGetMemType has unexpected offset % instead of 584", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.MemoryInfoGetMemType has unexpected size % instead of 8", it.type.runtime_size); case "MemoryInfoGetType"; assert(it.offset_in_bytes == 592, "OrtApi.MemoryInfoGetType has unexpected offset % instead of 592", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.MemoryInfoGetType has unexpected size % instead of 8", it.type.runtime_size); case "AllocatorAlloc"; assert(it.offset_in_bytes == 600, "OrtApi.AllocatorAlloc has unexpected offset % instead of 600", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.AllocatorAlloc has unexpected size % instead of 8", it.type.runtime_size); case "AllocatorFree"; assert(it.offset_in_bytes == 608, "OrtApi.AllocatorFree has unexpected offset % instead of 608", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.AllocatorFree has unexpected size % instead of 8", it.type.runtime_size); case "AllocatorGetInfo"; assert(it.offset_in_bytes == 616, "OrtApi.AllocatorGetInfo has unexpected offset % instead of 616", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.AllocatorGetInfo has unexpected size % instead of 8", it.type.runtime_size); case "GetAllocatorWithDefaultOptions"; assert(it.offset_in_bytes == 624, "OrtApi.GetAllocatorWithDefaultOptions has unexpected offset % instead of 624", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetAllocatorWithDefaultOptions has unexpected size % instead of 8", it.type.runtime_size); case "AddFreeDimensionOverride"; assert(it.offset_in_bytes == 632, "OrtApi.AddFreeDimensionOverride has unexpected offset % instead of 632", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.AddFreeDimensionOverride has unexpected size % instead of 8", it.type.runtime_size); case "GetValue"; assert(it.offset_in_bytes == 640, "OrtApi.GetValue has unexpected offset % instead of 640", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetValue has unexpected size % instead of 8", it.type.runtime_size); case "GetValueCount"; assert(it.offset_in_bytes == 648, "OrtApi.GetValueCount has unexpected offset % instead of 648", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetValueCount has unexpected size % instead of 8", it.type.runtime_size); case "CreateValue"; assert(it.offset_in_bytes == 656, "OrtApi.CreateValue has unexpected offset % instead of 656", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateValue has unexpected size % instead of 8", it.type.runtime_size); case "CreateOpaqueValue"; assert(it.offset_in_bytes == 664, "OrtApi.CreateOpaqueValue has unexpected offset % instead of 664", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateOpaqueValue has unexpected size % instead of 8", it.type.runtime_size); case "GetOpaqueValue"; assert(it.offset_in_bytes == 672, "OrtApi.GetOpaqueValue has unexpected offset % instead of 672", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetOpaqueValue has unexpected size % instead of 8", it.type.runtime_size); case "KernelInfoGetAttribute_float"; assert(it.offset_in_bytes == 680, "OrtApi.KernelInfoGetAttribute_float has unexpected offset % instead of 680", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.KernelInfoGetAttribute_float has unexpected size % instead of 8", it.type.runtime_size); case "KernelInfoGetAttribute_int64"; assert(it.offset_in_bytes == 688, "OrtApi.KernelInfoGetAttribute_int64 has unexpected offset % instead of 688", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.KernelInfoGetAttribute_int64 has unexpected size % instead of 8", it.type.runtime_size); case "KernelInfoGetAttribute_string"; assert(it.offset_in_bytes == 696, "OrtApi.KernelInfoGetAttribute_string has unexpected offset % instead of 696", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.KernelInfoGetAttribute_string has unexpected size % instead of 8", it.type.runtime_size); case "KernelContext_GetInputCount"; assert(it.offset_in_bytes == 704, "OrtApi.KernelContext_GetInputCount has unexpected offset % instead of 704", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.KernelContext_GetInputCount has unexpected size % instead of 8", it.type.runtime_size); case "KernelContext_GetOutputCount"; assert(it.offset_in_bytes == 712, "OrtApi.KernelContext_GetOutputCount has unexpected offset % instead of 712", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.KernelContext_GetOutputCount has unexpected size % instead of 8", it.type.runtime_size); case "KernelContext_GetInput"; assert(it.offset_in_bytes == 720, "OrtApi.KernelContext_GetInput has unexpected offset % instead of 720", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.KernelContext_GetInput has unexpected size % instead of 8", it.type.runtime_size); case "KernelContext_GetOutput"; assert(it.offset_in_bytes == 728, "OrtApi.KernelContext_GetOutput has unexpected offset % instead of 728", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.KernelContext_GetOutput has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseEnv"; assert(it.offset_in_bytes == 736, "OrtApi.ReleaseEnv has unexpected offset % instead of 736", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseEnv has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseStatus"; assert(it.offset_in_bytes == 744, "OrtApi.ReleaseStatus has unexpected offset % instead of 744", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseStatus has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseMemoryInfo"; assert(it.offset_in_bytes == 752, "OrtApi.ReleaseMemoryInfo has unexpected offset % instead of 752", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseMemoryInfo has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseSession"; assert(it.offset_in_bytes == 760, "OrtApi.ReleaseSession has unexpected offset % instead of 760", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseSession has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseValue"; assert(it.offset_in_bytes == 768, "OrtApi.ReleaseValue has unexpected offset % instead of 768", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseValue has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseRunOptions"; assert(it.offset_in_bytes == 776, "OrtApi.ReleaseRunOptions has unexpected offset % instead of 776", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseRunOptions has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseTypeInfo"; assert(it.offset_in_bytes == 784, "OrtApi.ReleaseTypeInfo has unexpected offset % instead of 784", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseTypeInfo has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseTensorTypeAndShapeInfo"; assert(it.offset_in_bytes == 792, "OrtApi.ReleaseTensorTypeAndShapeInfo has unexpected offset % instead of 792", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseTensorTypeAndShapeInfo has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseSessionOptions"; assert(it.offset_in_bytes == 800, "OrtApi.ReleaseSessionOptions has unexpected offset % instead of 800", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseSessionOptions has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseCustomOpDomain"; assert(it.offset_in_bytes == 808, "OrtApi.ReleaseCustomOpDomain has unexpected offset % instead of 808", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseCustomOpDomain has unexpected size % instead of 8", it.type.runtime_size); case "GetDenotationFromTypeInfo"; assert(it.offset_in_bytes == 816, "OrtApi.GetDenotationFromTypeInfo has unexpected offset % instead of 816", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetDenotationFromTypeInfo has unexpected size % instead of 8", it.type.runtime_size); case "CastTypeInfoToMapTypeInfo"; assert(it.offset_in_bytes == 824, "OrtApi.CastTypeInfoToMapTypeInfo has unexpected offset % instead of 824", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CastTypeInfoToMapTypeInfo has unexpected size % instead of 8", it.type.runtime_size); case "CastTypeInfoToSequenceTypeInfo"; assert(it.offset_in_bytes == 832, "OrtApi.CastTypeInfoToSequenceTypeInfo has unexpected offset % instead of 832", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CastTypeInfoToSequenceTypeInfo has unexpected size % instead of 8", it.type.runtime_size); case "GetMapKeyType"; assert(it.offset_in_bytes == 840, "OrtApi.GetMapKeyType has unexpected offset % instead of 840", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetMapKeyType has unexpected size % instead of 8", it.type.runtime_size); case "GetMapValueType"; assert(it.offset_in_bytes == 848, "OrtApi.GetMapValueType has unexpected offset % instead of 848", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetMapValueType has unexpected size % instead of 8", it.type.runtime_size); case "GetSequenceElementType"; assert(it.offset_in_bytes == 856, "OrtApi.GetSequenceElementType has unexpected offset % instead of 856", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetSequenceElementType has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseMapTypeInfo"; assert(it.offset_in_bytes == 864, "OrtApi.ReleaseMapTypeInfo has unexpected offset % instead of 864", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseMapTypeInfo has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseSequenceTypeInfo"; assert(it.offset_in_bytes == 872, "OrtApi.ReleaseSequenceTypeInfo has unexpected offset % instead of 872", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseSequenceTypeInfo has unexpected size % instead of 8", it.type.runtime_size); case "SessionEndProfiling"; assert(it.offset_in_bytes == 880, "OrtApi.SessionEndProfiling has unexpected offset % instead of 880", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionEndProfiling has unexpected size % instead of 8", it.type.runtime_size); case "SessionGetModelMetadata"; assert(it.offset_in_bytes == 888, "OrtApi.SessionGetModelMetadata has unexpected offset % instead of 888", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionGetModelMetadata has unexpected size % instead of 8", it.type.runtime_size); case "ModelMetadataGetProducerName"; assert(it.offset_in_bytes == 896, "OrtApi.ModelMetadataGetProducerName has unexpected offset % instead of 896", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ModelMetadataGetProducerName has unexpected size % instead of 8", it.type.runtime_size); case "ModelMetadataGetGraphName"; assert(it.offset_in_bytes == 904, "OrtApi.ModelMetadataGetGraphName has unexpected offset % instead of 904", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ModelMetadataGetGraphName has unexpected size % instead of 8", it.type.runtime_size); case "ModelMetadataGetDomain"; assert(it.offset_in_bytes == 912, "OrtApi.ModelMetadataGetDomain has unexpected offset % instead of 912", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ModelMetadataGetDomain has unexpected size % instead of 8", it.type.runtime_size); case "ModelMetadataGetDescription"; assert(it.offset_in_bytes == 920, "OrtApi.ModelMetadataGetDescription has unexpected offset % instead of 920", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ModelMetadataGetDescription has unexpected size % instead of 8", it.type.runtime_size); case "ModelMetadataLookupCustomMetadataMap"; assert(it.offset_in_bytes == 928, "OrtApi.ModelMetadataLookupCustomMetadataMap has unexpected offset % instead of 928", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ModelMetadataLookupCustomMetadataMap has unexpected size % instead of 8", it.type.runtime_size); case "ModelMetadataGetVersion"; assert(it.offset_in_bytes == 936, "OrtApi.ModelMetadataGetVersion has unexpected offset % instead of 936", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ModelMetadataGetVersion has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseModelMetadata"; assert(it.offset_in_bytes == 944, "OrtApi.ReleaseModelMetadata has unexpected offset % instead of 944", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseModelMetadata has unexpected size % instead of 8", it.type.runtime_size); case "CreateEnvWithGlobalThreadPools"; assert(it.offset_in_bytes == 952, "OrtApi.CreateEnvWithGlobalThreadPools has unexpected offset % instead of 952", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateEnvWithGlobalThreadPools has unexpected size % instead of 8", it.type.runtime_size); case "DisablePerSessionThreads"; assert(it.offset_in_bytes == 960, "OrtApi.DisablePerSessionThreads has unexpected offset % instead of 960", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.DisablePerSessionThreads has unexpected size % instead of 8", it.type.runtime_size); case "CreateThreadingOptions"; assert(it.offset_in_bytes == 968, "OrtApi.CreateThreadingOptions has unexpected offset % instead of 968", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateThreadingOptions has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseThreadingOptions"; assert(it.offset_in_bytes == 976, "OrtApi.ReleaseThreadingOptions has unexpected offset % instead of 976", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseThreadingOptions has unexpected size % instead of 8", it.type.runtime_size); case "ModelMetadataGetCustomMetadataMapKeys"; assert(it.offset_in_bytes == 984, "OrtApi.ModelMetadataGetCustomMetadataMapKeys has unexpected offset % instead of 984", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ModelMetadataGetCustomMetadataMapKeys has unexpected size % instead of 8", it.type.runtime_size); case "AddFreeDimensionOverrideByName"; assert(it.offset_in_bytes == 992, "OrtApi.AddFreeDimensionOverrideByName has unexpected offset % instead of 992", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.AddFreeDimensionOverrideByName has unexpected size % instead of 8", it.type.runtime_size); case "GetAvailableProviders"; assert(it.offset_in_bytes == 1000, "OrtApi.GetAvailableProviders has unexpected offset % instead of 1000", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetAvailableProviders has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseAvailableProviders"; assert(it.offset_in_bytes == 1008, "OrtApi.ReleaseAvailableProviders has unexpected offset % instead of 1008", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseAvailableProviders has unexpected size % instead of 8", it.type.runtime_size); case "GetStringTensorElementLength"; assert(it.offset_in_bytes == 1016, "OrtApi.GetStringTensorElementLength has unexpected offset % instead of 1016", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetStringTensorElementLength has unexpected size % instead of 8", it.type.runtime_size); case "GetStringTensorElement"; assert(it.offset_in_bytes == 1024, "OrtApi.GetStringTensorElement has unexpected offset % instead of 1024", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetStringTensorElement has unexpected size % instead of 8", it.type.runtime_size); case "FillStringTensorElement"; assert(it.offset_in_bytes == 1032, "OrtApi.FillStringTensorElement has unexpected offset % instead of 1032", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.FillStringTensorElement has unexpected size % instead of 8", it.type.runtime_size); case "AddSessionConfigEntry"; assert(it.offset_in_bytes == 1040, "OrtApi.AddSessionConfigEntry has unexpected offset % instead of 1040", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.AddSessionConfigEntry has unexpected size % instead of 8", it.type.runtime_size); case "CreateAllocator"; assert(it.offset_in_bytes == 1048, "OrtApi.CreateAllocator has unexpected offset % instead of 1048", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateAllocator has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseAllocator"; assert(it.offset_in_bytes == 1056, "OrtApi.ReleaseAllocator has unexpected offset % instead of 1056", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseAllocator has unexpected size % instead of 8", it.type.runtime_size); case "RunWithBinding"; assert(it.offset_in_bytes == 1064, "OrtApi.RunWithBinding has unexpected offset % instead of 1064", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.RunWithBinding has unexpected size % instead of 8", it.type.runtime_size); case "CreateIoBinding"; assert(it.offset_in_bytes == 1072, "OrtApi.CreateIoBinding has unexpected offset % instead of 1072", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateIoBinding has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseIoBinding"; assert(it.offset_in_bytes == 1080, "OrtApi.ReleaseIoBinding has unexpected offset % instead of 1080", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseIoBinding has unexpected size % instead of 8", it.type.runtime_size); case "BindInput"; assert(it.offset_in_bytes == 1088, "OrtApi.BindInput has unexpected offset % instead of 1088", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.BindInput has unexpected size % instead of 8", it.type.runtime_size); case "BindOutput"; assert(it.offset_in_bytes == 1096, "OrtApi.BindOutput has unexpected offset % instead of 1096", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.BindOutput has unexpected size % instead of 8", it.type.runtime_size); case "BindOutputToDevice"; assert(it.offset_in_bytes == 1104, "OrtApi.BindOutputToDevice has unexpected offset % instead of 1104", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.BindOutputToDevice has unexpected size % instead of 8", it.type.runtime_size); case "GetBoundOutputNames"; assert(it.offset_in_bytes == 1112, "OrtApi.GetBoundOutputNames has unexpected offset % instead of 1112", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetBoundOutputNames has unexpected size % instead of 8", it.type.runtime_size); case "GetBoundOutputValues"; assert(it.offset_in_bytes == 1120, "OrtApi.GetBoundOutputValues has unexpected offset % instead of 1120", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetBoundOutputValues has unexpected size % instead of 8", it.type.runtime_size); case "ClearBoundInputs"; assert(it.offset_in_bytes == 1128, "OrtApi.ClearBoundInputs has unexpected offset % instead of 1128", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ClearBoundInputs has unexpected size % instead of 8", it.type.runtime_size); case "ClearBoundOutputs"; assert(it.offset_in_bytes == 1136, "OrtApi.ClearBoundOutputs has unexpected offset % instead of 1136", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ClearBoundOutputs has unexpected size % instead of 8", it.type.runtime_size); case "TensorAt"; assert(it.offset_in_bytes == 1144, "OrtApi.TensorAt has unexpected offset % instead of 1144", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.TensorAt has unexpected size % instead of 8", it.type.runtime_size); case "CreateAndRegisterAllocator"; assert(it.offset_in_bytes == 1152, "OrtApi.CreateAndRegisterAllocator has unexpected offset % instead of 1152", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateAndRegisterAllocator has unexpected size % instead of 8", it.type.runtime_size); case "SetLanguageProjection"; assert(it.offset_in_bytes == 1160, "OrtApi.SetLanguageProjection has unexpected offset % instead of 1160", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SetLanguageProjection has unexpected size % instead of 8", it.type.runtime_size); case "SessionGetProfilingStartTimeNs"; assert(it.offset_in_bytes == 1168, "OrtApi.SessionGetProfilingStartTimeNs has unexpected offset % instead of 1168", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionGetProfilingStartTimeNs has unexpected size % instead of 8", it.type.runtime_size); case "SetGlobalIntraOpNumThreads"; assert(it.offset_in_bytes == 1176, "OrtApi.SetGlobalIntraOpNumThreads has unexpected offset % instead of 1176", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SetGlobalIntraOpNumThreads has unexpected size % instead of 8", it.type.runtime_size); case "SetGlobalInterOpNumThreads"; assert(it.offset_in_bytes == 1184, "OrtApi.SetGlobalInterOpNumThreads has unexpected offset % instead of 1184", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SetGlobalInterOpNumThreads has unexpected size % instead of 8", it.type.runtime_size); case "SetGlobalSpinControl"; assert(it.offset_in_bytes == 1192, "OrtApi.SetGlobalSpinControl has unexpected offset % instead of 1192", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SetGlobalSpinControl has unexpected size % instead of 8", it.type.runtime_size); case "AddInitializer"; assert(it.offset_in_bytes == 1200, "OrtApi.AddInitializer has unexpected offset % instead of 1200", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.AddInitializer has unexpected size % instead of 8", it.type.runtime_size); case "CreateEnvWithCustomLoggerAndGlobalThreadPools"; assert(it.offset_in_bytes == 1208, "OrtApi.CreateEnvWithCustomLoggerAndGlobalThreadPools has unexpected offset % instead of 1208", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateEnvWithCustomLoggerAndGlobalThreadPools has unexpected size % instead of 8", it.type.runtime_size); case "SessionOptionsAppendExecutionProvider_CUDA"; assert(it.offset_in_bytes == 1216, "OrtApi.SessionOptionsAppendExecutionProvider_CUDA has unexpected offset % instead of 1216", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionOptionsAppendExecutionProvider_CUDA has unexpected size % instead of 8", it.type.runtime_size); case "SessionOptionsAppendExecutionProvider_ROCM"; assert(it.offset_in_bytes == 1224, "OrtApi.SessionOptionsAppendExecutionProvider_ROCM has unexpected offset % instead of 1224", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionOptionsAppendExecutionProvider_ROCM has unexpected size % instead of 8", it.type.runtime_size); case "SessionOptionsAppendExecutionProvider_OpenVINO"; assert(it.offset_in_bytes == 1232, "OrtApi.SessionOptionsAppendExecutionProvider_OpenVINO has unexpected offset % instead of 1232", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionOptionsAppendExecutionProvider_OpenVINO has unexpected size % instead of 8", it.type.runtime_size); case "SetGlobalDenormalAsZero"; assert(it.offset_in_bytes == 1240, "OrtApi.SetGlobalDenormalAsZero has unexpected offset % instead of 1240", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SetGlobalDenormalAsZero has unexpected size % instead of 8", it.type.runtime_size); case "CreateArenaCfg"; assert(it.offset_in_bytes == 1248, "OrtApi.CreateArenaCfg has unexpected offset % instead of 1248", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateArenaCfg has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseArenaCfg"; assert(it.offset_in_bytes == 1256, "OrtApi.ReleaseArenaCfg has unexpected offset % instead of 1256", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseArenaCfg has unexpected size % instead of 8", it.type.runtime_size); case "ModelMetadataGetGraphDescription"; assert(it.offset_in_bytes == 1264, "OrtApi.ModelMetadataGetGraphDescription has unexpected offset % instead of 1264", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ModelMetadataGetGraphDescription has unexpected size % instead of 8", it.type.runtime_size); case "SessionOptionsAppendExecutionProvider_TensorRT"; assert(it.offset_in_bytes == 1272, "OrtApi.SessionOptionsAppendExecutionProvider_TensorRT has unexpected offset % instead of 1272", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionOptionsAppendExecutionProvider_TensorRT has unexpected size % instead of 8", it.type.runtime_size); case "SetCurrentGpuDeviceId"; assert(it.offset_in_bytes == 1280, "OrtApi.SetCurrentGpuDeviceId has unexpected offset % instead of 1280", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SetCurrentGpuDeviceId has unexpected size % instead of 8", it.type.runtime_size); case "GetCurrentGpuDeviceId"; assert(it.offset_in_bytes == 1288, "OrtApi.GetCurrentGpuDeviceId has unexpected offset % instead of 1288", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetCurrentGpuDeviceId has unexpected size % instead of 8", it.type.runtime_size); case "KernelInfoGetAttributeArray_float"; assert(it.offset_in_bytes == 1296, "OrtApi.KernelInfoGetAttributeArray_float has unexpected offset % instead of 1296", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.KernelInfoGetAttributeArray_float has unexpected size % instead of 8", it.type.runtime_size); case "KernelInfoGetAttributeArray_int64"; assert(it.offset_in_bytes == 1304, "OrtApi.KernelInfoGetAttributeArray_int64 has unexpected offset % instead of 1304", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.KernelInfoGetAttributeArray_int64 has unexpected size % instead of 8", it.type.runtime_size); case "CreateArenaCfgV2"; assert(it.offset_in_bytes == 1312, "OrtApi.CreateArenaCfgV2 has unexpected offset % instead of 1312", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateArenaCfgV2 has unexpected size % instead of 8", it.type.runtime_size); case "AddRunConfigEntry"; assert(it.offset_in_bytes == 1320, "OrtApi.AddRunConfigEntry has unexpected offset % instead of 1320", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.AddRunConfigEntry has unexpected size % instead of 8", it.type.runtime_size); case "CreatePrepackedWeightsContainer"; assert(it.offset_in_bytes == 1328, "OrtApi.CreatePrepackedWeightsContainer has unexpected offset % instead of 1328", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreatePrepackedWeightsContainer has unexpected size % instead of 8", it.type.runtime_size); case "ReleasePrepackedWeightsContainer"; assert(it.offset_in_bytes == 1336, "OrtApi.ReleasePrepackedWeightsContainer has unexpected offset % instead of 1336", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleasePrepackedWeightsContainer has unexpected size % instead of 8", it.type.runtime_size); case "CreateSessionWithPrepackedWeightsContainer"; assert(it.offset_in_bytes == 1344, "OrtApi.CreateSessionWithPrepackedWeightsContainer has unexpected offset % instead of 1344", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateSessionWithPrepackedWeightsContainer has unexpected size % instead of 8", it.type.runtime_size); case "CreateSessionFromArrayWithPrepackedWeightsContainer"; assert(it.offset_in_bytes == 1352, "OrtApi.CreateSessionFromArrayWithPrepackedWeightsContainer has unexpected offset % instead of 1352", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateSessionFromArrayWithPrepackedWeightsContainer has unexpected size % instead of 8", it.type.runtime_size); case "SessionOptionsAppendExecutionProvider_TensorRT_V2"; assert(it.offset_in_bytes == 1360, "OrtApi.SessionOptionsAppendExecutionProvider_TensorRT_V2 has unexpected offset % instead of 1360", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionOptionsAppendExecutionProvider_TensorRT_V2 has unexpected size % instead of 8", it.type.runtime_size); case "CreateTensorRTProviderOptions"; assert(it.offset_in_bytes == 1368, "OrtApi.CreateTensorRTProviderOptions has unexpected offset % instead of 1368", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateTensorRTProviderOptions has unexpected size % instead of 8", it.type.runtime_size); case "UpdateTensorRTProviderOptions"; assert(it.offset_in_bytes == 1376, "OrtApi.UpdateTensorRTProviderOptions has unexpected offset % instead of 1376", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.UpdateTensorRTProviderOptions has unexpected size % instead of 8", it.type.runtime_size); case "GetTensorRTProviderOptionsAsString"; assert(it.offset_in_bytes == 1384, "OrtApi.GetTensorRTProviderOptionsAsString has unexpected offset % instead of 1384", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetTensorRTProviderOptionsAsString has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseTensorRTProviderOptions"; assert(it.offset_in_bytes == 1392, "OrtApi.ReleaseTensorRTProviderOptions has unexpected offset % instead of 1392", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseTensorRTProviderOptions has unexpected size % instead of 8", it.type.runtime_size); case "EnableOrtCustomOps"; assert(it.offset_in_bytes == 1400, "OrtApi.EnableOrtCustomOps has unexpected offset % instead of 1400", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.EnableOrtCustomOps has unexpected size % instead of 8", it.type.runtime_size); case "RegisterAllocator"; assert(it.offset_in_bytes == 1408, "OrtApi.RegisterAllocator has unexpected offset % instead of 1408", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.RegisterAllocator has unexpected size % instead of 8", it.type.runtime_size); case "UnregisterAllocator"; assert(it.offset_in_bytes == 1416, "OrtApi.UnregisterAllocator has unexpected offset % instead of 1416", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.UnregisterAllocator has unexpected size % instead of 8", it.type.runtime_size); case "IsSparseTensor"; assert(it.offset_in_bytes == 1424, "OrtApi.IsSparseTensor has unexpected offset % instead of 1424", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.IsSparseTensor has unexpected size % instead of 8", it.type.runtime_size); case "CreateSparseTensorAsOrtValue"; assert(it.offset_in_bytes == 1432, "OrtApi.CreateSparseTensorAsOrtValue has unexpected offset % instead of 1432", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateSparseTensorAsOrtValue has unexpected size % instead of 8", it.type.runtime_size); case "FillSparseTensorCoo"; assert(it.offset_in_bytes == 1440, "OrtApi.FillSparseTensorCoo has unexpected offset % instead of 1440", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.FillSparseTensorCoo has unexpected size % instead of 8", it.type.runtime_size); case "FillSparseTensorCsr"; assert(it.offset_in_bytes == 1448, "OrtApi.FillSparseTensorCsr has unexpected offset % instead of 1448", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.FillSparseTensorCsr has unexpected size % instead of 8", it.type.runtime_size); case "FillSparseTensorBlockSparse"; assert(it.offset_in_bytes == 1456, "OrtApi.FillSparseTensorBlockSparse has unexpected offset % instead of 1456", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.FillSparseTensorBlockSparse has unexpected size % instead of 8", it.type.runtime_size); case "CreateSparseTensorWithValuesAsOrtValue"; assert(it.offset_in_bytes == 1464, "OrtApi.CreateSparseTensorWithValuesAsOrtValue has unexpected offset % instead of 1464", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateSparseTensorWithValuesAsOrtValue has unexpected size % instead of 8", it.type.runtime_size); case "UseCooIndices"; assert(it.offset_in_bytes == 1472, "OrtApi.UseCooIndices has unexpected offset % instead of 1472", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.UseCooIndices has unexpected size % instead of 8", it.type.runtime_size); case "UseCsrIndices"; assert(it.offset_in_bytes == 1480, "OrtApi.UseCsrIndices has unexpected offset % instead of 1480", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.UseCsrIndices has unexpected size % instead of 8", it.type.runtime_size); case "UseBlockSparseIndices"; assert(it.offset_in_bytes == 1488, "OrtApi.UseBlockSparseIndices has unexpected offset % instead of 1488", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.UseBlockSparseIndices has unexpected size % instead of 8", it.type.runtime_size); case "GetSparseTensorFormat"; assert(it.offset_in_bytes == 1496, "OrtApi.GetSparseTensorFormat has unexpected offset % instead of 1496", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetSparseTensorFormat has unexpected size % instead of 8", it.type.runtime_size); case "GetSparseTensorValuesTypeAndShape"; assert(it.offset_in_bytes == 1504, "OrtApi.GetSparseTensorValuesTypeAndShape has unexpected offset % instead of 1504", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetSparseTensorValuesTypeAndShape has unexpected size % instead of 8", it.type.runtime_size); case "GetSparseTensorValues"; assert(it.offset_in_bytes == 1512, "OrtApi.GetSparseTensorValues has unexpected offset % instead of 1512", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetSparseTensorValues has unexpected size % instead of 8", it.type.runtime_size); case "GetSparseTensorIndicesTypeShape"; assert(it.offset_in_bytes == 1520, "OrtApi.GetSparseTensorIndicesTypeShape has unexpected offset % instead of 1520", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetSparseTensorIndicesTypeShape has unexpected size % instead of 8", it.type.runtime_size); case "GetSparseTensorIndices"; assert(it.offset_in_bytes == 1528, "OrtApi.GetSparseTensorIndices has unexpected offset % instead of 1528", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetSparseTensorIndices has unexpected size % instead of 8", it.type.runtime_size); case "HasValue"; assert(it.offset_in_bytes == 1536, "OrtApi.HasValue has unexpected offset % instead of 1536", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.HasValue has unexpected size % instead of 8", it.type.runtime_size); case "KernelContext_GetGPUComputeStream"; assert(it.offset_in_bytes == 1544, "OrtApi.KernelContext_GetGPUComputeStream has unexpected offset % instead of 1544", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.KernelContext_GetGPUComputeStream has unexpected size % instead of 8", it.type.runtime_size); case "GetTensorMemoryInfo"; assert(it.offset_in_bytes == 1552, "OrtApi.GetTensorMemoryInfo has unexpected offset % instead of 1552", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetTensorMemoryInfo has unexpected size % instead of 8", it.type.runtime_size); case "GetExecutionProviderApi"; assert(it.offset_in_bytes == 1560, "OrtApi.GetExecutionProviderApi has unexpected offset % instead of 1560", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetExecutionProviderApi has unexpected size % instead of 8", it.type.runtime_size); case "SessionOptionsSetCustomCreateThreadFn"; assert(it.offset_in_bytes == 1568, "OrtApi.SessionOptionsSetCustomCreateThreadFn has unexpected offset % instead of 1568", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionOptionsSetCustomCreateThreadFn has unexpected size % instead of 8", it.type.runtime_size); case "SessionOptionsSetCustomThreadCreationOptions"; assert(it.offset_in_bytes == 1576, "OrtApi.SessionOptionsSetCustomThreadCreationOptions has unexpected offset % instead of 1576", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionOptionsSetCustomThreadCreationOptions has unexpected size % instead of 8", it.type.runtime_size); case "SessionOptionsSetCustomJoinThreadFn"; assert(it.offset_in_bytes == 1584, "OrtApi.SessionOptionsSetCustomJoinThreadFn has unexpected offset % instead of 1584", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionOptionsSetCustomJoinThreadFn has unexpected size % instead of 8", it.type.runtime_size); case "SetGlobalCustomCreateThreadFn"; assert(it.offset_in_bytes == 1592, "OrtApi.SetGlobalCustomCreateThreadFn has unexpected offset % instead of 1592", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SetGlobalCustomCreateThreadFn has unexpected size % instead of 8", it.type.runtime_size); case "SetGlobalCustomThreadCreationOptions"; assert(it.offset_in_bytes == 1600, "OrtApi.SetGlobalCustomThreadCreationOptions has unexpected offset % instead of 1600", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SetGlobalCustomThreadCreationOptions has unexpected size % instead of 8", it.type.runtime_size); case "SetGlobalCustomJoinThreadFn"; assert(it.offset_in_bytes == 1608, "OrtApi.SetGlobalCustomJoinThreadFn has unexpected offset % instead of 1608", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SetGlobalCustomJoinThreadFn has unexpected size % instead of 8", it.type.runtime_size); case "SynchronizeBoundInputs"; assert(it.offset_in_bytes == 1616, "OrtApi.SynchronizeBoundInputs has unexpected offset % instead of 1616", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SynchronizeBoundInputs has unexpected size % instead of 8", it.type.runtime_size); case "SynchronizeBoundOutputs"; assert(it.offset_in_bytes == 1624, "OrtApi.SynchronizeBoundOutputs has unexpected offset % instead of 1624", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SynchronizeBoundOutputs has unexpected size % instead of 8", it.type.runtime_size); case "SessionOptionsAppendExecutionProvider_CUDA_V2"; assert(it.offset_in_bytes == 1632, "OrtApi.SessionOptionsAppendExecutionProvider_CUDA_V2 has unexpected offset % instead of 1632", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionOptionsAppendExecutionProvider_CUDA_V2 has unexpected size % instead of 8", it.type.runtime_size); case "CreateCUDAProviderOptions"; assert(it.offset_in_bytes == 1640, "OrtApi.CreateCUDAProviderOptions has unexpected offset % instead of 1640", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateCUDAProviderOptions has unexpected size % instead of 8", it.type.runtime_size); case "UpdateCUDAProviderOptions"; assert(it.offset_in_bytes == 1648, "OrtApi.UpdateCUDAProviderOptions has unexpected offset % instead of 1648", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.UpdateCUDAProviderOptions has unexpected size % instead of 8", it.type.runtime_size); case "GetCUDAProviderOptionsAsString"; assert(it.offset_in_bytes == 1656, "OrtApi.GetCUDAProviderOptionsAsString has unexpected offset % instead of 1656", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetCUDAProviderOptionsAsString has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseCUDAProviderOptions"; assert(it.offset_in_bytes == 1664, "OrtApi.ReleaseCUDAProviderOptions has unexpected offset % instead of 1664", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseCUDAProviderOptions has unexpected size % instead of 8", it.type.runtime_size); case "SessionOptionsAppendExecutionProvider_MIGraphX"; assert(it.offset_in_bytes == 1672, "OrtApi.SessionOptionsAppendExecutionProvider_MIGraphX has unexpected offset % instead of 1672", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionOptionsAppendExecutionProvider_MIGraphX has unexpected size % instead of 8", it.type.runtime_size); case "AddExternalInitializers"; assert(it.offset_in_bytes == 1680, "OrtApi.AddExternalInitializers has unexpected offset % instead of 1680", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.AddExternalInitializers has unexpected size % instead of 8", it.type.runtime_size); case "CreateOpAttr"; assert(it.offset_in_bytes == 1688, "OrtApi.CreateOpAttr has unexpected offset % instead of 1688", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateOpAttr has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseOpAttr"; assert(it.offset_in_bytes == 1696, "OrtApi.ReleaseOpAttr has unexpected offset % instead of 1696", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseOpAttr has unexpected size % instead of 8", it.type.runtime_size); case "CreateOp"; assert(it.offset_in_bytes == 1704, "OrtApi.CreateOp has unexpected offset % instead of 1704", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateOp has unexpected size % instead of 8", it.type.runtime_size); case "InvokeOp"; assert(it.offset_in_bytes == 1712, "OrtApi.InvokeOp has unexpected offset % instead of 1712", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.InvokeOp has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseOp"; assert(it.offset_in_bytes == 1720, "OrtApi.ReleaseOp has unexpected offset % instead of 1720", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseOp has unexpected size % instead of 8", it.type.runtime_size); case "SessionOptionsAppendExecutionProvider"; assert(it.offset_in_bytes == 1728, "OrtApi.SessionOptionsAppendExecutionProvider has unexpected offset % instead of 1728", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionOptionsAppendExecutionProvider has unexpected size % instead of 8", it.type.runtime_size); case "CopyKernelInfo"; assert(it.offset_in_bytes == 1736, "OrtApi.CopyKernelInfo has unexpected offset % instead of 1736", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CopyKernelInfo has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseKernelInfo"; assert(it.offset_in_bytes == 1744, "OrtApi.ReleaseKernelInfo has unexpected offset % instead of 1744", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseKernelInfo has unexpected size % instead of 8", it.type.runtime_size); case "GetTrainingApi"; assert(it.offset_in_bytes == 1752, "OrtApi.GetTrainingApi has unexpected offset % instead of 1752", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetTrainingApi has unexpected size % instead of 8", it.type.runtime_size); case "SessionOptionsAppendExecutionProvider_CANN"; assert(it.offset_in_bytes == 1760, "OrtApi.SessionOptionsAppendExecutionProvider_CANN has unexpected offset % instead of 1760", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionOptionsAppendExecutionProvider_CANN has unexpected size % instead of 8", it.type.runtime_size); case "CreateCANNProviderOptions"; assert(it.offset_in_bytes == 1768, "OrtApi.CreateCANNProviderOptions has unexpected offset % instead of 1768", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateCANNProviderOptions has unexpected size % instead of 8", it.type.runtime_size); case "UpdateCANNProviderOptions"; assert(it.offset_in_bytes == 1776, "OrtApi.UpdateCANNProviderOptions has unexpected offset % instead of 1776", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.UpdateCANNProviderOptions has unexpected size % instead of 8", it.type.runtime_size); case "GetCANNProviderOptionsAsString"; assert(it.offset_in_bytes == 1784, "OrtApi.GetCANNProviderOptionsAsString has unexpected offset % instead of 1784", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetCANNProviderOptionsAsString has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseCANNProviderOptions"; assert(it.offset_in_bytes == 1792, "OrtApi.ReleaseCANNProviderOptions has unexpected offset % instead of 1792", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseCANNProviderOptions has unexpected size % instead of 8", it.type.runtime_size); case "MemoryInfoGetDeviceType"; assert(it.offset_in_bytes == 1800, "OrtApi.MemoryInfoGetDeviceType has unexpected offset % instead of 1800", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.MemoryInfoGetDeviceType has unexpected size % instead of 8", it.type.runtime_size); case "UpdateEnvWithCustomLogLevel"; assert(it.offset_in_bytes == 1808, "OrtApi.UpdateEnvWithCustomLogLevel has unexpected offset % instead of 1808", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.UpdateEnvWithCustomLogLevel has unexpected size % instead of 8", it.type.runtime_size); case "SetGlobalIntraOpThreadAffinity"; assert(it.offset_in_bytes == 1816, "OrtApi.SetGlobalIntraOpThreadAffinity has unexpected offset % instead of 1816", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SetGlobalIntraOpThreadAffinity has unexpected size % instead of 8", it.type.runtime_size); case "RegisterCustomOpsLibrary_V2"; assert(it.offset_in_bytes == 1824, "OrtApi.RegisterCustomOpsLibrary_V2 has unexpected offset % instead of 1824", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.RegisterCustomOpsLibrary_V2 has unexpected size % instead of 8", it.type.runtime_size); case "RegisterCustomOpsUsingFunction"; assert(it.offset_in_bytes == 1832, "OrtApi.RegisterCustomOpsUsingFunction has unexpected offset % instead of 1832", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.RegisterCustomOpsUsingFunction has unexpected size % instead of 8", it.type.runtime_size); case "KernelInfo_GetInputCount"; assert(it.offset_in_bytes == 1840, "OrtApi.KernelInfo_GetInputCount has unexpected offset % instead of 1840", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.KernelInfo_GetInputCount has unexpected size % instead of 8", it.type.runtime_size); case "KernelInfo_GetOutputCount"; assert(it.offset_in_bytes == 1848, "OrtApi.KernelInfo_GetOutputCount has unexpected offset % instead of 1848", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.KernelInfo_GetOutputCount has unexpected size % instead of 8", it.type.runtime_size); case "KernelInfo_GetInputName"; assert(it.offset_in_bytes == 1856, "OrtApi.KernelInfo_GetInputName has unexpected offset % instead of 1856", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.KernelInfo_GetInputName has unexpected size % instead of 8", it.type.runtime_size); case "KernelInfo_GetOutputName"; assert(it.offset_in_bytes == 1864, "OrtApi.KernelInfo_GetOutputName has unexpected offset % instead of 1864", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.KernelInfo_GetOutputName has unexpected size % instead of 8", it.type.runtime_size); case "KernelInfo_GetInputTypeInfo"; assert(it.offset_in_bytes == 1872, "OrtApi.KernelInfo_GetInputTypeInfo has unexpected offset % instead of 1872", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.KernelInfo_GetInputTypeInfo has unexpected size % instead of 8", it.type.runtime_size); case "KernelInfo_GetOutputTypeInfo"; assert(it.offset_in_bytes == 1880, "OrtApi.KernelInfo_GetOutputTypeInfo has unexpected offset % instead of 1880", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.KernelInfo_GetOutputTypeInfo has unexpected size % instead of 8", it.type.runtime_size); case "KernelInfoGetAttribute_tensor"; assert(it.offset_in_bytes == 1888, "OrtApi.KernelInfoGetAttribute_tensor has unexpected offset % instead of 1888", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.KernelInfoGetAttribute_tensor has unexpected size % instead of 8", it.type.runtime_size); case "HasSessionConfigEntry"; assert(it.offset_in_bytes == 1896, "OrtApi.HasSessionConfigEntry has unexpected offset % instead of 1896", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.HasSessionConfigEntry has unexpected size % instead of 8", it.type.runtime_size); case "GetSessionConfigEntry"; assert(it.offset_in_bytes == 1904, "OrtApi.GetSessionConfigEntry has unexpected offset % instead of 1904", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetSessionConfigEntry has unexpected size % instead of 8", it.type.runtime_size); case "SessionOptionsAppendExecutionProvider_Dnnl"; assert(it.offset_in_bytes == 1912, "OrtApi.SessionOptionsAppendExecutionProvider_Dnnl has unexpected offset % instead of 1912", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionOptionsAppendExecutionProvider_Dnnl has unexpected size % instead of 8", it.type.runtime_size); case "CreateDnnlProviderOptions"; assert(it.offset_in_bytes == 1920, "OrtApi.CreateDnnlProviderOptions has unexpected offset % instead of 1920", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateDnnlProviderOptions has unexpected size % instead of 8", it.type.runtime_size); case "UpdateDnnlProviderOptions"; assert(it.offset_in_bytes == 1928, "OrtApi.UpdateDnnlProviderOptions has unexpected offset % instead of 1928", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.UpdateDnnlProviderOptions has unexpected size % instead of 8", it.type.runtime_size); case "GetDnnlProviderOptionsAsString"; assert(it.offset_in_bytes == 1936, "OrtApi.GetDnnlProviderOptionsAsString has unexpected offset % instead of 1936", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetDnnlProviderOptionsAsString has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseDnnlProviderOptions"; assert(it.offset_in_bytes == 1944, "OrtApi.ReleaseDnnlProviderOptions has unexpected offset % instead of 1944", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseDnnlProviderOptions has unexpected size % instead of 8", it.type.runtime_size); case "KernelInfo_GetNodeName"; assert(it.offset_in_bytes == 1952, "OrtApi.KernelInfo_GetNodeName has unexpected offset % instead of 1952", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.KernelInfo_GetNodeName has unexpected size % instead of 8", it.type.runtime_size); case "KernelInfo_GetLogger"; assert(it.offset_in_bytes == 1960, "OrtApi.KernelInfo_GetLogger has unexpected offset % instead of 1960", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.KernelInfo_GetLogger has unexpected size % instead of 8", it.type.runtime_size); case "KernelContext_GetLogger"; assert(it.offset_in_bytes == 1968, "OrtApi.KernelContext_GetLogger has unexpected offset % instead of 1968", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.KernelContext_GetLogger has unexpected size % instead of 8", it.type.runtime_size); case "Logger_LogMessage"; assert(it.offset_in_bytes == 1976, "OrtApi.Logger_LogMessage has unexpected offset % instead of 1976", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Logger_LogMessage has unexpected size % instead of 8", it.type.runtime_size); case "Logger_GetLoggingSeverityLevel"; assert(it.offset_in_bytes == 1984, "OrtApi.Logger_GetLoggingSeverityLevel has unexpected offset % instead of 1984", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Logger_GetLoggingSeverityLevel has unexpected size % instead of 8", it.type.runtime_size); case "KernelInfoGetConstantInput_tensor"; assert(it.offset_in_bytes == 1992, "OrtApi.KernelInfoGetConstantInput_tensor has unexpected offset % instead of 1992", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.KernelInfoGetConstantInput_tensor has unexpected size % instead of 8", it.type.runtime_size); case "CastTypeInfoToOptionalTypeInfo"; assert(it.offset_in_bytes == 2000, "OrtApi.CastTypeInfoToOptionalTypeInfo has unexpected offset % instead of 2000", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CastTypeInfoToOptionalTypeInfo has unexpected size % instead of 8", it.type.runtime_size); case "GetOptionalContainedTypeInfo"; assert(it.offset_in_bytes == 2008, "OrtApi.GetOptionalContainedTypeInfo has unexpected offset % instead of 2008", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetOptionalContainedTypeInfo has unexpected size % instead of 8", it.type.runtime_size); case "GetResizedStringTensorElementBuffer"; assert(it.offset_in_bytes == 2016, "OrtApi.GetResizedStringTensorElementBuffer has unexpected offset % instead of 2016", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetResizedStringTensorElementBuffer has unexpected size % instead of 8", it.type.runtime_size); case "KernelContext_GetAllocator"; assert(it.offset_in_bytes == 2024, "OrtApi.KernelContext_GetAllocator has unexpected offset % instead of 2024", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.KernelContext_GetAllocator has unexpected size % instead of 8", it.type.runtime_size); case "GetBuildInfoString"; assert(it.offset_in_bytes == 2032, "OrtApi.GetBuildInfoString has unexpected offset % instead of 2032", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetBuildInfoString has unexpected size % instead of 8", it.type.runtime_size); case "CreateROCMProviderOptions"; assert(it.offset_in_bytes == 2040, "OrtApi.CreateROCMProviderOptions has unexpected offset % instead of 2040", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateROCMProviderOptions has unexpected size % instead of 8", it.type.runtime_size); case "UpdateROCMProviderOptions"; assert(it.offset_in_bytes == 2048, "OrtApi.UpdateROCMProviderOptions has unexpected offset % instead of 2048", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.UpdateROCMProviderOptions has unexpected size % instead of 8", it.type.runtime_size); case "GetROCMProviderOptionsAsString"; assert(it.offset_in_bytes == 2056, "OrtApi.GetROCMProviderOptionsAsString has unexpected offset % instead of 2056", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetROCMProviderOptionsAsString has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseROCMProviderOptions"; assert(it.offset_in_bytes == 2064, "OrtApi.ReleaseROCMProviderOptions has unexpected offset % instead of 2064", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseROCMProviderOptions has unexpected size % instead of 8", it.type.runtime_size); case "CreateAndRegisterAllocatorV2"; assert(it.offset_in_bytes == 2072, "OrtApi.CreateAndRegisterAllocatorV2 has unexpected offset % instead of 2072", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateAndRegisterAllocatorV2 has unexpected size % instead of 8", it.type.runtime_size); case "RunAsync"; assert(it.offset_in_bytes == 2080, "OrtApi.RunAsync has unexpected offset % instead of 2080", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.RunAsync has unexpected size % instead of 8", it.type.runtime_size); case "UpdateTensorRTProviderOptionsWithValue"; assert(it.offset_in_bytes == 2088, "OrtApi.UpdateTensorRTProviderOptionsWithValue has unexpected offset % instead of 2088", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.UpdateTensorRTProviderOptionsWithValue has unexpected size % instead of 8", it.type.runtime_size); case "GetTensorRTProviderOptionsByName"; assert(it.offset_in_bytes == 2096, "OrtApi.GetTensorRTProviderOptionsByName has unexpected offset % instead of 2096", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetTensorRTProviderOptionsByName has unexpected size % instead of 8", it.type.runtime_size); case "UpdateCUDAProviderOptionsWithValue"; assert(it.offset_in_bytes == 2104, "OrtApi.UpdateCUDAProviderOptionsWithValue has unexpected offset % instead of 2104", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.UpdateCUDAProviderOptionsWithValue has unexpected size % instead of 8", it.type.runtime_size); case "GetCUDAProviderOptionsByName"; assert(it.offset_in_bytes == 2112, "OrtApi.GetCUDAProviderOptionsByName has unexpected offset % instead of 2112", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetCUDAProviderOptionsByName has unexpected size % instead of 8", it.type.runtime_size); case "KernelContext_GetResource"; assert(it.offset_in_bytes == 2120, "OrtApi.KernelContext_GetResource has unexpected offset % instead of 2120", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.KernelContext_GetResource has unexpected size % instead of 8", it.type.runtime_size); case "SetUserLoggingFunction"; assert(it.offset_in_bytes == 2128, "OrtApi.SetUserLoggingFunction has unexpected offset % instead of 2128", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SetUserLoggingFunction has unexpected size % instead of 8", it.type.runtime_size); case "ShapeInferContext_GetInputCount"; assert(it.offset_in_bytes == 2136, "OrtApi.ShapeInferContext_GetInputCount has unexpected offset % instead of 2136", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ShapeInferContext_GetInputCount has unexpected size % instead of 8", it.type.runtime_size); case "ShapeInferContext_GetInputTypeShape"; assert(it.offset_in_bytes == 2144, "OrtApi.ShapeInferContext_GetInputTypeShape has unexpected offset % instead of 2144", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ShapeInferContext_GetInputTypeShape has unexpected size % instead of 8", it.type.runtime_size); case "ShapeInferContext_GetAttribute"; assert(it.offset_in_bytes == 2152, "OrtApi.ShapeInferContext_GetAttribute has unexpected offset % instead of 2152", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ShapeInferContext_GetAttribute has unexpected size % instead of 8", it.type.runtime_size); case "ShapeInferContext_SetOutputTypeShape"; assert(it.offset_in_bytes == 2160, "OrtApi.ShapeInferContext_SetOutputTypeShape has unexpected offset % instead of 2160", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ShapeInferContext_SetOutputTypeShape has unexpected size % instead of 8", it.type.runtime_size); case "SetSymbolicDimensions"; assert(it.offset_in_bytes == 2168, "OrtApi.SetSymbolicDimensions has unexpected offset % instead of 2168", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SetSymbolicDimensions has unexpected size % instead of 8", it.type.runtime_size); case "ReadOpAttr"; assert(it.offset_in_bytes == 2176, "OrtApi.ReadOpAttr has unexpected offset % instead of 2176", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReadOpAttr has unexpected size % instead of 8", it.type.runtime_size); case "SetDeterministicCompute"; assert(it.offset_in_bytes == 2184, "OrtApi.SetDeterministicCompute has unexpected offset % instead of 2184", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SetDeterministicCompute has unexpected size % instead of 8", it.type.runtime_size); case "KernelContext_ParallelFor"; assert(it.offset_in_bytes == 2192, "OrtApi.KernelContext_ParallelFor has unexpected offset % instead of 2192", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.KernelContext_ParallelFor has unexpected size % instead of 8", it.type.runtime_size); case "SessionOptionsAppendExecutionProvider_OpenVINO_V2"; assert(it.offset_in_bytes == 2200, "OrtApi.SessionOptionsAppendExecutionProvider_OpenVINO_V2 has unexpected offset % instead of 2200", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionOptionsAppendExecutionProvider_OpenVINO_V2 has unexpected size % instead of 8", it.type.runtime_size); case "SessionOptionsAppendExecutionProvider_VitisAI"; assert(it.offset_in_bytes == 2208, "OrtApi.SessionOptionsAppendExecutionProvider_VitisAI has unexpected offset % instead of 2208", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionOptionsAppendExecutionProvider_VitisAI has unexpected size % instead of 8", it.type.runtime_size); case "KernelContext_GetScratchBuffer"; assert(it.offset_in_bytes == 2216, "OrtApi.KernelContext_GetScratchBuffer has unexpected offset % instead of 2216", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.KernelContext_GetScratchBuffer has unexpected size % instead of 8", it.type.runtime_size); case "KernelInfoGetAllocator"; assert(it.offset_in_bytes == 2224, "OrtApi.KernelInfoGetAllocator has unexpected offset % instead of 2224", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.KernelInfoGetAllocator has unexpected size % instead of 8", it.type.runtime_size); case "AddExternalInitializersFromFilesInMemory"; assert(it.offset_in_bytes == 2232, "OrtApi.AddExternalInitializersFromFilesInMemory has unexpected offset % instead of 2232", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.AddExternalInitializersFromFilesInMemory has unexpected size % instead of 8", it.type.runtime_size); case "CreateLoraAdapter"; assert(it.offset_in_bytes == 2240, "OrtApi.CreateLoraAdapter has unexpected offset % instead of 2240", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateLoraAdapter has unexpected size % instead of 8", it.type.runtime_size); case "CreateLoraAdapterFromArray"; assert(it.offset_in_bytes == 2248, "OrtApi.CreateLoraAdapterFromArray has unexpected offset % instead of 2248", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateLoraAdapterFromArray has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseLoraAdapter"; assert(it.offset_in_bytes == 2256, "OrtApi.ReleaseLoraAdapter has unexpected offset % instead of 2256", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseLoraAdapter has unexpected size % instead of 8", it.type.runtime_size); case "RunOptionsAddActiveLoraAdapter"; assert(it.offset_in_bytes == 2264, "OrtApi.RunOptionsAddActiveLoraAdapter has unexpected offset % instead of 2264", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.RunOptionsAddActiveLoraAdapter has unexpected size % instead of 8", it.type.runtime_size); case "SetEpDynamicOptions"; assert(it.offset_in_bytes == 2272, "OrtApi.SetEpDynamicOptions has unexpected offset % instead of 2272", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SetEpDynamicOptions has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseValueInfo"; assert(it.offset_in_bytes == 2280, "OrtApi.ReleaseValueInfo has unexpected offset % instead of 2280", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseValueInfo has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseNode"; assert(it.offset_in_bytes == 2288, "OrtApi.ReleaseNode has unexpected offset % instead of 2288", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseNode has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseGraph"; assert(it.offset_in_bytes == 2296, "OrtApi.ReleaseGraph has unexpected offset % instead of 2296", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseGraph has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseModel"; assert(it.offset_in_bytes == 2304, "OrtApi.ReleaseModel has unexpected offset % instead of 2304", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseModel has unexpected size % instead of 8", it.type.runtime_size); case "GetValueInfoName"; assert(it.offset_in_bytes == 2312, "OrtApi.GetValueInfoName has unexpected offset % instead of 2312", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetValueInfoName has unexpected size % instead of 8", it.type.runtime_size); case "GetValueInfoTypeInfo"; assert(it.offset_in_bytes == 2320, "OrtApi.GetValueInfoTypeInfo has unexpected offset % instead of 2320", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetValueInfoTypeInfo has unexpected size % instead of 8", it.type.runtime_size); case "GetModelEditorApi"; assert(it.offset_in_bytes == 2328, "OrtApi.GetModelEditorApi has unexpected offset % instead of 2328", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetModelEditorApi has unexpected size % instead of 8", it.type.runtime_size); case "CreateTensorWithDataAndDeleterAsOrtValue"; assert(it.offset_in_bytes == 2336, "OrtApi.CreateTensorWithDataAndDeleterAsOrtValue has unexpected offset % instead of 2336", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateTensorWithDataAndDeleterAsOrtValue has unexpected size % instead of 8", it.type.runtime_size); case "SessionOptionsSetLoadCancellationFlag"; assert(it.offset_in_bytes == 2344, "OrtApi.SessionOptionsSetLoadCancellationFlag has unexpected offset % instead of 2344", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionOptionsSetLoadCancellationFlag has unexpected size % instead of 8", it.type.runtime_size); case "GetCompileApi"; assert(it.offset_in_bytes == 2352, "OrtApi.GetCompileApi has unexpected offset % instead of 2352", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetCompileApi has unexpected size % instead of 8", it.type.runtime_size); case "CreateKeyValuePairs"; assert(it.offset_in_bytes == 2360, "OrtApi.CreateKeyValuePairs has unexpected offset % instead of 2360", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateKeyValuePairs has unexpected size % instead of 8", it.type.runtime_size); case "AddKeyValuePair"; assert(it.offset_in_bytes == 2368, "OrtApi.AddKeyValuePair has unexpected offset % instead of 2368", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.AddKeyValuePair has unexpected size % instead of 8", it.type.runtime_size); case "GetKeyValue"; assert(it.offset_in_bytes == 2376, "OrtApi.GetKeyValue has unexpected offset % instead of 2376", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetKeyValue has unexpected size % instead of 8", it.type.runtime_size); case "GetKeyValuePairs"; assert(it.offset_in_bytes == 2384, "OrtApi.GetKeyValuePairs has unexpected offset % instead of 2384", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetKeyValuePairs has unexpected size % instead of 8", it.type.runtime_size); case "RemoveKeyValuePair"; assert(it.offset_in_bytes == 2392, "OrtApi.RemoveKeyValuePair has unexpected offset % instead of 2392", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.RemoveKeyValuePair has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseKeyValuePairs"; assert(it.offset_in_bytes == 2400, "OrtApi.ReleaseKeyValuePairs has unexpected offset % instead of 2400", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseKeyValuePairs has unexpected size % instead of 8", it.type.runtime_size); case "RegisterExecutionProviderLibrary"; assert(it.offset_in_bytes == 2408, "OrtApi.RegisterExecutionProviderLibrary has unexpected offset % instead of 2408", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.RegisterExecutionProviderLibrary has unexpected size % instead of 8", it.type.runtime_size); case "UnregisterExecutionProviderLibrary"; assert(it.offset_in_bytes == 2416, "OrtApi.UnregisterExecutionProviderLibrary has unexpected offset % instead of 2416", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.UnregisterExecutionProviderLibrary has unexpected size % instead of 8", it.type.runtime_size); case "GetEpDevices"; assert(it.offset_in_bytes == 2424, "OrtApi.GetEpDevices has unexpected offset % instead of 2424", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetEpDevices has unexpected size % instead of 8", it.type.runtime_size); case "SessionOptionsAppendExecutionProvider_V2"; assert(it.offset_in_bytes == 2432, "OrtApi.SessionOptionsAppendExecutionProvider_V2 has unexpected offset % instead of 2432", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionOptionsAppendExecutionProvider_V2 has unexpected size % instead of 8", it.type.runtime_size); case "SessionOptionsSetEpSelectionPolicy"; assert(it.offset_in_bytes == 2440, "OrtApi.SessionOptionsSetEpSelectionPolicy has unexpected offset % instead of 2440", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionOptionsSetEpSelectionPolicy has unexpected size % instead of 8", it.type.runtime_size); case "SessionOptionsSetEpSelectionPolicyDelegate"; assert(it.offset_in_bytes == 2448, "OrtApi.SessionOptionsSetEpSelectionPolicyDelegate has unexpected offset % instead of 2448", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionOptionsSetEpSelectionPolicyDelegate has unexpected size % instead of 8", it.type.runtime_size); case "HardwareDevice_Type"; assert(it.offset_in_bytes == 2456, "OrtApi.HardwareDevice_Type has unexpected offset % instead of 2456", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.HardwareDevice_Type has unexpected size % instead of 8", it.type.runtime_size); case "HardwareDevice_VendorId"; assert(it.offset_in_bytes == 2464, "OrtApi.HardwareDevice_VendorId has unexpected offset % instead of 2464", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.HardwareDevice_VendorId has unexpected size % instead of 8", it.type.runtime_size); case "HardwareDevice_Vendor"; assert(it.offset_in_bytes == 2472, "OrtApi.HardwareDevice_Vendor has unexpected offset % instead of 2472", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.HardwareDevice_Vendor has unexpected size % instead of 8", it.type.runtime_size); case "HardwareDevice_DeviceId"; assert(it.offset_in_bytes == 2480, "OrtApi.HardwareDevice_DeviceId has unexpected offset % instead of 2480", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.HardwareDevice_DeviceId has unexpected size % instead of 8", it.type.runtime_size); case "HardwareDevice_Metadata"; assert(it.offset_in_bytes == 2488, "OrtApi.HardwareDevice_Metadata has unexpected offset % instead of 2488", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.HardwareDevice_Metadata has unexpected size % instead of 8", it.type.runtime_size); case "EpDevice_EpName"; assert(it.offset_in_bytes == 2496, "OrtApi.EpDevice_EpName has unexpected offset % instead of 2496", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.EpDevice_EpName has unexpected size % instead of 8", it.type.runtime_size); case "EpDevice_EpVendor"; assert(it.offset_in_bytes == 2504, "OrtApi.EpDevice_EpVendor has unexpected offset % instead of 2504", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.EpDevice_EpVendor has unexpected size % instead of 8", it.type.runtime_size); case "EpDevice_EpMetadata"; assert(it.offset_in_bytes == 2512, "OrtApi.EpDevice_EpMetadata has unexpected offset % instead of 2512", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.EpDevice_EpMetadata has unexpected size % instead of 8", it.type.runtime_size); case "EpDevice_EpOptions"; assert(it.offset_in_bytes == 2520, "OrtApi.EpDevice_EpOptions has unexpected offset % instead of 2520", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.EpDevice_EpOptions has unexpected size % instead of 8", it.type.runtime_size); case "EpDevice_Device"; assert(it.offset_in_bytes == 2528, "OrtApi.EpDevice_Device has unexpected offset % instead of 2528", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.EpDevice_Device has unexpected size % instead of 8", it.type.runtime_size); case "GetEpApi"; assert(it.offset_in_bytes == 2536, "OrtApi.GetEpApi has unexpected offset % instead of 2536", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetEpApi has unexpected size % instead of 8", it.type.runtime_size); case "GetTensorSizeInBytes"; assert(it.offset_in_bytes == 2544, "OrtApi.GetTensorSizeInBytes has unexpected offset % instead of 2544", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetTensorSizeInBytes has unexpected size % instead of 8", it.type.runtime_size); case "AllocatorGetStats"; assert(it.offset_in_bytes == 2552, "OrtApi.AllocatorGetStats has unexpected offset % instead of 2552", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.AllocatorGetStats has unexpected size % instead of 8", it.type.runtime_size); case "CreateMemoryInfo_V2"; assert(it.offset_in_bytes == 2560, "OrtApi.CreateMemoryInfo_V2 has unexpected offset % instead of 2560", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateMemoryInfo_V2 has unexpected size % instead of 8", it.type.runtime_size); case "MemoryInfoGetDeviceMemType"; assert(it.offset_in_bytes == 2568, "OrtApi.MemoryInfoGetDeviceMemType has unexpected offset % instead of 2568", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.MemoryInfoGetDeviceMemType has unexpected size % instead of 8", it.type.runtime_size); case "MemoryInfoGetVendorId"; assert(it.offset_in_bytes == 2576, "OrtApi.MemoryInfoGetVendorId has unexpected offset % instead of 2576", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.MemoryInfoGetVendorId has unexpected size % instead of 8", it.type.runtime_size); case "ValueInfo_GetValueProducer"; assert(it.offset_in_bytes == 2584, "OrtApi.ValueInfo_GetValueProducer has unexpected offset % instead of 2584", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ValueInfo_GetValueProducer has unexpected size % instead of 8", it.type.runtime_size); case "ValueInfo_GetValueNumConsumers"; assert(it.offset_in_bytes == 2592, "OrtApi.ValueInfo_GetValueNumConsumers has unexpected offset % instead of 2592", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ValueInfo_GetValueNumConsumers has unexpected size % instead of 8", it.type.runtime_size); case "ValueInfo_GetValueConsumers"; assert(it.offset_in_bytes == 2600, "OrtApi.ValueInfo_GetValueConsumers has unexpected offset % instead of 2600", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ValueInfo_GetValueConsumers has unexpected size % instead of 8", it.type.runtime_size); case "ValueInfo_GetInitializerValue"; assert(it.offset_in_bytes == 2608, "OrtApi.ValueInfo_GetInitializerValue has unexpected offset % instead of 2608", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ValueInfo_GetInitializerValue has unexpected size % instead of 8", it.type.runtime_size); case "ValueInfo_GetExternalInitializerInfo"; assert(it.offset_in_bytes == 2616, "OrtApi.ValueInfo_GetExternalInitializerInfo has unexpected offset % instead of 2616", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ValueInfo_GetExternalInitializerInfo has unexpected size % instead of 8", it.type.runtime_size); case "ValueInfo_IsRequiredGraphInput"; assert(it.offset_in_bytes == 2624, "OrtApi.ValueInfo_IsRequiredGraphInput has unexpected offset % instead of 2624", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ValueInfo_IsRequiredGraphInput has unexpected size % instead of 8", it.type.runtime_size); case "ValueInfo_IsOptionalGraphInput"; assert(it.offset_in_bytes == 2632, "OrtApi.ValueInfo_IsOptionalGraphInput has unexpected offset % instead of 2632", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ValueInfo_IsOptionalGraphInput has unexpected size % instead of 8", it.type.runtime_size); case "ValueInfo_IsGraphOutput"; assert(it.offset_in_bytes == 2640, "OrtApi.ValueInfo_IsGraphOutput has unexpected offset % instead of 2640", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ValueInfo_IsGraphOutput has unexpected size % instead of 8", it.type.runtime_size); case "ValueInfo_IsConstantInitializer"; assert(it.offset_in_bytes == 2648, "OrtApi.ValueInfo_IsConstantInitializer has unexpected offset % instead of 2648", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ValueInfo_IsConstantInitializer has unexpected size % instead of 8", it.type.runtime_size); case "ValueInfo_IsFromOuterScope"; assert(it.offset_in_bytes == 2656, "OrtApi.ValueInfo_IsFromOuterScope has unexpected offset % instead of 2656", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ValueInfo_IsFromOuterScope has unexpected size % instead of 8", it.type.runtime_size); case "Graph_GetName"; assert(it.offset_in_bytes == 2664, "OrtApi.Graph_GetName has unexpected offset % instead of 2664", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Graph_GetName has unexpected size % instead of 8", it.type.runtime_size); case "Graph_GetModelPath"; assert(it.offset_in_bytes == 2672, "OrtApi.Graph_GetModelPath has unexpected offset % instead of 2672", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Graph_GetModelPath has unexpected size % instead of 8", it.type.runtime_size); case "Graph_GetOnnxIRVersion"; assert(it.offset_in_bytes == 2680, "OrtApi.Graph_GetOnnxIRVersion has unexpected offset % instead of 2680", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Graph_GetOnnxIRVersion has unexpected size % instead of 8", it.type.runtime_size); case "Graph_GetNumOperatorSets"; assert(it.offset_in_bytes == 2688, "OrtApi.Graph_GetNumOperatorSets has unexpected offset % instead of 2688", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Graph_GetNumOperatorSets has unexpected size % instead of 8", it.type.runtime_size); case "Graph_GetOperatorSets"; assert(it.offset_in_bytes == 2696, "OrtApi.Graph_GetOperatorSets has unexpected offset % instead of 2696", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Graph_GetOperatorSets has unexpected size % instead of 8", it.type.runtime_size); case "Graph_GetNumInputs"; assert(it.offset_in_bytes == 2704, "OrtApi.Graph_GetNumInputs has unexpected offset % instead of 2704", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Graph_GetNumInputs has unexpected size % instead of 8", it.type.runtime_size); case "Graph_GetInputs"; assert(it.offset_in_bytes == 2712, "OrtApi.Graph_GetInputs has unexpected offset % instead of 2712", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Graph_GetInputs has unexpected size % instead of 8", it.type.runtime_size); case "Graph_GetNumOutputs"; assert(it.offset_in_bytes == 2720, "OrtApi.Graph_GetNumOutputs has unexpected offset % instead of 2720", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Graph_GetNumOutputs has unexpected size % instead of 8", it.type.runtime_size); case "Graph_GetOutputs"; assert(it.offset_in_bytes == 2728, "OrtApi.Graph_GetOutputs has unexpected offset % instead of 2728", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Graph_GetOutputs has unexpected size % instead of 8", it.type.runtime_size); case "Graph_GetNumInitializers"; assert(it.offset_in_bytes == 2736, "OrtApi.Graph_GetNumInitializers has unexpected offset % instead of 2736", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Graph_GetNumInitializers has unexpected size % instead of 8", it.type.runtime_size); case "Graph_GetInitializers"; assert(it.offset_in_bytes == 2744, "OrtApi.Graph_GetInitializers has unexpected offset % instead of 2744", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Graph_GetInitializers has unexpected size % instead of 8", it.type.runtime_size); case "Graph_GetNumNodes"; assert(it.offset_in_bytes == 2752, "OrtApi.Graph_GetNumNodes has unexpected offset % instead of 2752", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Graph_GetNumNodes has unexpected size % instead of 8", it.type.runtime_size); case "Graph_GetNodes"; assert(it.offset_in_bytes == 2760, "OrtApi.Graph_GetNodes has unexpected offset % instead of 2760", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Graph_GetNodes has unexpected size % instead of 8", it.type.runtime_size); case "Graph_GetParentNode"; assert(it.offset_in_bytes == 2768, "OrtApi.Graph_GetParentNode has unexpected offset % instead of 2768", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Graph_GetParentNode has unexpected size % instead of 8", it.type.runtime_size); case "Graph_GetGraphView"; assert(it.offset_in_bytes == 2776, "OrtApi.Graph_GetGraphView has unexpected offset % instead of 2776", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Graph_GetGraphView has unexpected size % instead of 8", it.type.runtime_size); case "Node_GetId"; assert(it.offset_in_bytes == 2784, "OrtApi.Node_GetId has unexpected offset % instead of 2784", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Node_GetId has unexpected size % instead of 8", it.type.runtime_size); case "Node_GetName"; assert(it.offset_in_bytes == 2792, "OrtApi.Node_GetName has unexpected offset % instead of 2792", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Node_GetName has unexpected size % instead of 8", it.type.runtime_size); case "Node_GetOperatorType"; assert(it.offset_in_bytes == 2800, "OrtApi.Node_GetOperatorType has unexpected offset % instead of 2800", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Node_GetOperatorType has unexpected size % instead of 8", it.type.runtime_size); case "Node_GetDomain"; assert(it.offset_in_bytes == 2808, "OrtApi.Node_GetDomain has unexpected offset % instead of 2808", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Node_GetDomain has unexpected size % instead of 8", it.type.runtime_size); case "Node_GetSinceVersion"; assert(it.offset_in_bytes == 2816, "OrtApi.Node_GetSinceVersion has unexpected offset % instead of 2816", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Node_GetSinceVersion has unexpected size % instead of 8", it.type.runtime_size); case "Node_GetNumInputs"; assert(it.offset_in_bytes == 2824, "OrtApi.Node_GetNumInputs has unexpected offset % instead of 2824", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Node_GetNumInputs has unexpected size % instead of 8", it.type.runtime_size); case "Node_GetInputs"; assert(it.offset_in_bytes == 2832, "OrtApi.Node_GetInputs has unexpected offset % instead of 2832", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Node_GetInputs has unexpected size % instead of 8", it.type.runtime_size); case "Node_GetNumOutputs"; assert(it.offset_in_bytes == 2840, "OrtApi.Node_GetNumOutputs has unexpected offset % instead of 2840", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Node_GetNumOutputs has unexpected size % instead of 8", it.type.runtime_size); case "Node_GetOutputs"; assert(it.offset_in_bytes == 2848, "OrtApi.Node_GetOutputs has unexpected offset % instead of 2848", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Node_GetOutputs has unexpected size % instead of 8", it.type.runtime_size); case "Node_GetNumImplicitInputs"; assert(it.offset_in_bytes == 2856, "OrtApi.Node_GetNumImplicitInputs has unexpected offset % instead of 2856", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Node_GetNumImplicitInputs has unexpected size % instead of 8", it.type.runtime_size); case "Node_GetImplicitInputs"; assert(it.offset_in_bytes == 2864, "OrtApi.Node_GetImplicitInputs has unexpected offset % instead of 2864", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Node_GetImplicitInputs has unexpected size % instead of 8", it.type.runtime_size); case "Node_GetNumAttributes"; assert(it.offset_in_bytes == 2872, "OrtApi.Node_GetNumAttributes has unexpected offset % instead of 2872", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Node_GetNumAttributes has unexpected size % instead of 8", it.type.runtime_size); case "Node_GetAttributes"; assert(it.offset_in_bytes == 2880, "OrtApi.Node_GetAttributes has unexpected offset % instead of 2880", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Node_GetAttributes has unexpected size % instead of 8", it.type.runtime_size); case "Node_GetAttributeByName"; assert(it.offset_in_bytes == 2888, "OrtApi.Node_GetAttributeByName has unexpected offset % instead of 2888", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Node_GetAttributeByName has unexpected size % instead of 8", it.type.runtime_size); case "OpAttr_GetTensorAttributeAsOrtValue"; assert(it.offset_in_bytes == 2896, "OrtApi.OpAttr_GetTensorAttributeAsOrtValue has unexpected offset % instead of 2896", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.OpAttr_GetTensorAttributeAsOrtValue has unexpected size % instead of 8", it.type.runtime_size); case "OpAttr_GetType"; assert(it.offset_in_bytes == 2904, "OrtApi.OpAttr_GetType has unexpected offset % instead of 2904", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.OpAttr_GetType has unexpected size % instead of 8", it.type.runtime_size); case "OpAttr_GetName"; assert(it.offset_in_bytes == 2912, "OrtApi.OpAttr_GetName has unexpected offset % instead of 2912", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.OpAttr_GetName has unexpected size % instead of 8", it.type.runtime_size); case "Node_GetNumSubgraphs"; assert(it.offset_in_bytes == 2920, "OrtApi.Node_GetNumSubgraphs has unexpected offset % instead of 2920", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Node_GetNumSubgraphs has unexpected size % instead of 8", it.type.runtime_size); case "Node_GetSubgraphs"; assert(it.offset_in_bytes == 2928, "OrtApi.Node_GetSubgraphs has unexpected offset % instead of 2928", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Node_GetSubgraphs has unexpected size % instead of 8", it.type.runtime_size); case "Node_GetGraph"; assert(it.offset_in_bytes == 2936, "OrtApi.Node_GetGraph has unexpected offset % instead of 2936", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Node_GetGraph has unexpected size % instead of 8", it.type.runtime_size); case "Node_GetEpName"; assert(it.offset_in_bytes == 2944, "OrtApi.Node_GetEpName has unexpected offset % instead of 2944", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Node_GetEpName has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseExternalInitializerInfo"; assert(it.offset_in_bytes == 2952, "OrtApi.ReleaseExternalInitializerInfo has unexpected offset % instead of 2952", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseExternalInitializerInfo has unexpected size % instead of 8", it.type.runtime_size); case "ExternalInitializerInfo_GetFilePath"; assert(it.offset_in_bytes == 2960, "OrtApi.ExternalInitializerInfo_GetFilePath has unexpected offset % instead of 2960", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ExternalInitializerInfo_GetFilePath has unexpected size % instead of 8", it.type.runtime_size); case "ExternalInitializerInfo_GetFileOffset"; assert(it.offset_in_bytes == 2968, "OrtApi.ExternalInitializerInfo_GetFileOffset has unexpected offset % instead of 2968", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ExternalInitializerInfo_GetFileOffset has unexpected size % instead of 8", it.type.runtime_size); case "ExternalInitializerInfo_GetByteSize"; assert(it.offset_in_bytes == 2976, "OrtApi.ExternalInitializerInfo_GetByteSize has unexpected offset % instead of 2976", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ExternalInitializerInfo_GetByteSize has unexpected size % instead of 8", it.type.runtime_size); case "GetRunConfigEntry"; assert(it.offset_in_bytes == 2984, "OrtApi.GetRunConfigEntry has unexpected offset % instead of 2984", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetRunConfigEntry has unexpected size % instead of 8", it.type.runtime_size); case "EpDevice_MemoryInfo"; assert(it.offset_in_bytes == 2992, "OrtApi.EpDevice_MemoryInfo has unexpected offset % instead of 2992", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.EpDevice_MemoryInfo has unexpected size % instead of 8", it.type.runtime_size); case "CreateSharedAllocator"; assert(it.offset_in_bytes == 3000, "OrtApi.CreateSharedAllocator has unexpected offset % instead of 3000", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateSharedAllocator has unexpected size % instead of 8", it.type.runtime_size); case "GetSharedAllocator"; assert(it.offset_in_bytes == 3008, "OrtApi.GetSharedAllocator has unexpected offset % instead of 3008", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetSharedAllocator has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseSharedAllocator"; assert(it.offset_in_bytes == 3016, "OrtApi.ReleaseSharedAllocator has unexpected offset % instead of 3016", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseSharedAllocator has unexpected size % instead of 8", it.type.runtime_size); case "GetTensorData"; assert(it.offset_in_bytes == 3024, "OrtApi.GetTensorData has unexpected offset % instead of 3024", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetTensorData has unexpected size % instead of 8", it.type.runtime_size); case "GetSessionOptionsConfigEntries"; assert(it.offset_in_bytes == 3032, "OrtApi.GetSessionOptionsConfigEntries has unexpected offset % instead of 3032", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetSessionOptionsConfigEntries has unexpected size % instead of 8", it.type.runtime_size); case "SessionGetMemoryInfoForInputs"; assert(it.offset_in_bytes == 3040, "OrtApi.SessionGetMemoryInfoForInputs has unexpected offset % instead of 3040", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionGetMemoryInfoForInputs has unexpected size % instead of 8", it.type.runtime_size); case "SessionGetMemoryInfoForOutputs"; assert(it.offset_in_bytes == 3048, "OrtApi.SessionGetMemoryInfoForOutputs has unexpected offset % instead of 3048", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionGetMemoryInfoForOutputs has unexpected size % instead of 8", it.type.runtime_size); case "SessionGetEpDeviceForInputs"; assert(it.offset_in_bytes == 3056, "OrtApi.SessionGetEpDeviceForInputs has unexpected offset % instead of 3056", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionGetEpDeviceForInputs has unexpected size % instead of 8", it.type.runtime_size); case "CreateSyncStreamForEpDevice"; assert(it.offset_in_bytes == 3064, "OrtApi.CreateSyncStreamForEpDevice has unexpected offset % instead of 3064", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateSyncStreamForEpDevice has unexpected size % instead of 8", it.type.runtime_size); case "SyncStream_GetHandle"; assert(it.offset_in_bytes == 3072, "OrtApi.SyncStream_GetHandle has unexpected offset % instead of 3072", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SyncStream_GetHandle has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseSyncStream"; assert(it.offset_in_bytes == 3080, "OrtApi.ReleaseSyncStream has unexpected offset % instead of 3080", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseSyncStream has unexpected size % instead of 8", it.type.runtime_size); case "CopyTensors"; assert(it.offset_in_bytes == 3088, "OrtApi.CopyTensors has unexpected offset % instead of 3088", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CopyTensors has unexpected size % instead of 8", it.type.runtime_size); case "Graph_GetModelMetadata"; assert(it.offset_in_bytes == 3096, "OrtApi.Graph_GetModelMetadata has unexpected offset % instead of 3096", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Graph_GetModelMetadata has unexpected size % instead of 8", it.type.runtime_size); case "GetModelCompatibilityForEpDevices"; assert(it.offset_in_bytes == 3104, "OrtApi.GetModelCompatibilityForEpDevices has unexpected offset % instead of 3104", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetModelCompatibilityForEpDevices has unexpected size % instead of 8", it.type.runtime_size); case "CreateExternalInitializerInfo"; assert(it.offset_in_bytes == 3112, "OrtApi.CreateExternalInitializerInfo has unexpected offset % instead of 3112", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateExternalInitializerInfo has unexpected size % instead of 8", it.type.runtime_size); case "TensorTypeAndShape_HasShape"; assert(it.offset_in_bytes == 3120, "OrtApi.TensorTypeAndShape_HasShape has unexpected offset % instead of 3120", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.TensorTypeAndShape_HasShape has unexpected size % instead of 8", it.type.runtime_size); case "KernelInfo_GetConfigEntries"; assert(it.offset_in_bytes == 3128, "OrtApi.KernelInfo_GetConfigEntries has unexpected offset % instead of 3128", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.KernelInfo_GetConfigEntries has unexpected size % instead of 8", it.type.runtime_size); case "KernelInfo_GetOperatorDomain"; assert(it.offset_in_bytes == 3136, "OrtApi.KernelInfo_GetOperatorDomain has unexpected offset % instead of 3136", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.KernelInfo_GetOperatorDomain has unexpected size % instead of 8", it.type.runtime_size); case "KernelInfo_GetOperatorType"; assert(it.offset_in_bytes == 3144, "OrtApi.KernelInfo_GetOperatorType has unexpected offset % instead of 3144", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.KernelInfo_GetOperatorType has unexpected size % instead of 8", it.type.runtime_size); case "KernelInfo_GetOperatorSinceVersion"; assert(it.offset_in_bytes == 3152, "OrtApi.KernelInfo_GetOperatorSinceVersion has unexpected offset % instead of 3152", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.KernelInfo_GetOperatorSinceVersion has unexpected size % instead of 8", it.type.runtime_size); case "GetInteropApi"; assert(it.offset_in_bytes == 3160, "OrtApi.GetInteropApi has unexpected offset % instead of 3160", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetInteropApi has unexpected size % instead of 8", it.type.runtime_size); case "SessionGetEpDeviceForOutputs"; assert(it.offset_in_bytes == 3168, "OrtApi.SessionGetEpDeviceForOutputs has unexpected offset % instead of 3168", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionGetEpDeviceForOutputs has unexpected size % instead of 8", it.type.runtime_size); case "GetNumHardwareDevices"; assert(it.offset_in_bytes == 3176, "OrtApi.GetNumHardwareDevices has unexpected offset % instead of 3176", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetNumHardwareDevices has unexpected size % instead of 8", it.type.runtime_size); case "GetHardwareDevices"; assert(it.offset_in_bytes == 3184, "OrtApi.GetHardwareDevices has unexpected offset % instead of 3184", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetHardwareDevices has unexpected size % instead of 8", it.type.runtime_size); case "GetHardwareDeviceEpIncompatibilityDetails"; assert(it.offset_in_bytes == 3192, "OrtApi.GetHardwareDeviceEpIncompatibilityDetails has unexpected offset % instead of 3192", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetHardwareDeviceEpIncompatibilityDetails has unexpected size % instead of 8", it.type.runtime_size); case "DeviceEpIncompatibilityDetails_GetReasonsBitmask"; assert(it.offset_in_bytes == 3200, "OrtApi.DeviceEpIncompatibilityDetails_GetReasonsBitmask has unexpected offset % instead of 3200", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.DeviceEpIncompatibilityDetails_GetReasonsBitmask has unexpected size % instead of 8", it.type.runtime_size); case "DeviceEpIncompatibilityDetails_GetNotes"; assert(it.offset_in_bytes == 3208, "OrtApi.DeviceEpIncompatibilityDetails_GetNotes has unexpected offset % instead of 3208", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.DeviceEpIncompatibilityDetails_GetNotes has unexpected size % instead of 8", it.type.runtime_size); case "DeviceEpIncompatibilityDetails_GetErrorCode"; assert(it.offset_in_bytes == 3216, "OrtApi.DeviceEpIncompatibilityDetails_GetErrorCode has unexpected offset % instead of 3216", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.DeviceEpIncompatibilityDetails_GetErrorCode has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseDeviceEpIncompatibilityDetails"; assert(it.offset_in_bytes == 3224, "OrtApi.ReleaseDeviceEpIncompatibilityDetails has unexpected offset % instead of 3224", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.ReleaseDeviceEpIncompatibilityDetails has unexpected size % instead of 8", it.type.runtime_size); case "GetCompatibilityInfoFromModel"; assert(it.offset_in_bytes == 3232, "OrtApi.GetCompatibilityInfoFromModel has unexpected offset % instead of 3232", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetCompatibilityInfoFromModel has unexpected size % instead of 8", it.type.runtime_size); case "GetCompatibilityInfoFromModelBytes"; assert(it.offset_in_bytes == 3240, "OrtApi.GetCompatibilityInfoFromModelBytes has unexpected offset % instead of 3240", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetCompatibilityInfoFromModelBytes has unexpected size % instead of 8", it.type.runtime_size); case "CreateEnvWithOptions"; assert(it.offset_in_bytes == 3248, "OrtApi.CreateEnvWithOptions has unexpected offset % instead of 3248", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.CreateEnvWithOptions has unexpected size % instead of 8", it.type.runtime_size); case "Session_GetEpGraphAssignmentInfo"; assert(it.offset_in_bytes == 3256, "OrtApi.Session_GetEpGraphAssignmentInfo has unexpected offset % instead of 3256", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.Session_GetEpGraphAssignmentInfo has unexpected size % instead of 8", it.type.runtime_size); case "EpAssignedSubgraph_GetEpName"; assert(it.offset_in_bytes == 3264, "OrtApi.EpAssignedSubgraph_GetEpName has unexpected offset % instead of 3264", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.EpAssignedSubgraph_GetEpName has unexpected size % instead of 8", it.type.runtime_size); case "EpAssignedSubgraph_GetNodes"; assert(it.offset_in_bytes == 3272, "OrtApi.EpAssignedSubgraph_GetNodes has unexpected offset % instead of 3272", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.EpAssignedSubgraph_GetNodes has unexpected size % instead of 8", it.type.runtime_size); case "EpAssignedNode_GetName"; assert(it.offset_in_bytes == 3280, "OrtApi.EpAssignedNode_GetName has unexpected offset % instead of 3280", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.EpAssignedNode_GetName has unexpected size % instead of 8", it.type.runtime_size); case "EpAssignedNode_GetDomain"; assert(it.offset_in_bytes == 3288, "OrtApi.EpAssignedNode_GetDomain has unexpected offset % instead of 3288", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.EpAssignedNode_GetDomain has unexpected size % instead of 8", it.type.runtime_size); case "EpAssignedNode_GetOperatorType"; assert(it.offset_in_bytes == 3296, "OrtApi.EpAssignedNode_GetOperatorType has unexpected offset % instead of 3296", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.EpAssignedNode_GetOperatorType has unexpected size % instead of 8", it.type.runtime_size); case "RunOptionsSetSyncStream"; assert(it.offset_in_bytes == 3304, "OrtApi.RunOptionsSetSyncStream has unexpected offset % instead of 3304", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.RunOptionsSetSyncStream has unexpected size % instead of 8", it.type.runtime_size); case "GetTensorElementTypeAndShapeDataReference"; assert(it.offset_in_bytes == 3312, "OrtApi.GetTensorElementTypeAndShapeDataReference has unexpected offset % instead of 3312", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetTensorElementTypeAndShapeDataReference has unexpected size % instead of 8", it.type.runtime_size); case "RunOptionsEnableProfiling"; assert(it.offset_in_bytes == 3320, "OrtApi.RunOptionsEnableProfiling has unexpected offset % instead of 3320", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.RunOptionsEnableProfiling has unexpected size % instead of 8", it.type.runtime_size); case "RunOptionsDisableProfiling"; assert(it.offset_in_bytes == 3328, "OrtApi.RunOptionsDisableProfiling has unexpected offset % instead of 3328", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.RunOptionsDisableProfiling has unexpected size % instead of 8", it.type.runtime_size); case "KernelInfoGetAttributeArray_string"; assert(it.offset_in_bytes == 3336, "OrtApi.KernelInfoGetAttributeArray_string has unexpected offset % instead of 3336", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.KernelInfoGetAttributeArray_string has unexpected size % instead of 8", it.type.runtime_size); case "SetPerSessionThreadPoolCallbacks"; assert(it.offset_in_bytes == 3344, "OrtApi.SetPerSessionThreadPoolCallbacks has unexpected offset % instead of 3344", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SetPerSessionThreadPoolCallbacks has unexpected size % instead of 8", it.type.runtime_size); case "GetMemPatternEnabled"; assert(it.offset_in_bytes == 3352, "OrtApi.GetMemPatternEnabled has unexpected offset % instead of 3352", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetMemPatternEnabled has unexpected size % instead of 8", it.type.runtime_size); case "GetSessionExecutionMode"; assert(it.offset_in_bytes == 3360, "OrtApi.GetSessionExecutionMode has unexpected offset % instead of 3360", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetSessionExecutionMode has unexpected size % instead of 8", it.type.runtime_size); case "SessionReleaseCapturedGraph"; assert(it.offset_in_bytes == 3368, "OrtApi.SessionReleaseCapturedGraph has unexpected offset % instead of 3368", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionReleaseCapturedGraph has unexpected size % instead of 8", it.type.runtime_size); case "GetExperimentalFunction"; assert(it.offset_in_bytes == 3376, "OrtApi.GetExperimentalFunction has unexpected offset % instead of 3376", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.GetExperimentalFunction has unexpected size % instead of 8", it.type.runtime_size); case "KernelContext_GetSyncStream"; assert(it.offset_in_bytes == 3384, "OrtApi.KernelContext_GetSyncStream has unexpected offset % instead of 3384", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.KernelContext_GetSyncStream has unexpected size % instead of 8", it.type.runtime_size); case "SessionOptionsSetWeightlessSourceModelBuffer"; assert(it.offset_in_bytes == 3392, "OrtApi.SessionOptionsSetWeightlessSourceModelBuffer has unexpected offset % instead of 3392", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.SessionOptionsSetWeightlessSourceModelBuffer has unexpected size % instead of 8", it.type.runtime_size); case "KernelContext_GetPreallocatedOutput"; assert(it.offset_in_bytes == 3400, "OrtApi.KernelContext_GetPreallocatedOutput has unexpected offset % instead of 3400", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtApi.KernelContext_GetPreallocatedOutput has unexpected size % instead of 8", it.type.runtime_size); } } assert(size_of(OrtApi) == 3408, "OrtApi has size % instead of 3408", size_of(OrtApi)); } { info := type_info(OrtCustomOp); for info.members { if it.name == { case "version"; assert(it.offset_in_bytes == 0, "OrtCustomOp.version has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtCustomOp.version has unexpected size % instead of 4", it.type.runtime_size); case "CreateKernel"; assert(it.offset_in_bytes == 8, "OrtCustomOp.CreateKernel has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCustomOp.CreateKernel has unexpected size % instead of 8", it.type.runtime_size); case "GetName"; assert(it.offset_in_bytes == 16, "OrtCustomOp.GetName has unexpected offset % instead of 16", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCustomOp.GetName has unexpected size % instead of 8", it.type.runtime_size); case "GetExecutionProviderType"; assert(it.offset_in_bytes == 24, "OrtCustomOp.GetExecutionProviderType has unexpected offset % instead of 24", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCustomOp.GetExecutionProviderType has unexpected size % instead of 8", it.type.runtime_size); case "GetInputType"; assert(it.offset_in_bytes == 32, "OrtCustomOp.GetInputType has unexpected offset % instead of 32", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCustomOp.GetInputType has unexpected size % instead of 8", it.type.runtime_size); case "GetInputTypeCount"; assert(it.offset_in_bytes == 40, "OrtCustomOp.GetInputTypeCount has unexpected offset % instead of 40", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCustomOp.GetInputTypeCount has unexpected size % instead of 8", it.type.runtime_size); case "GetOutputType"; assert(it.offset_in_bytes == 48, "OrtCustomOp.GetOutputType has unexpected offset % instead of 48", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCustomOp.GetOutputType has unexpected size % instead of 8", it.type.runtime_size); case "GetOutputTypeCount"; assert(it.offset_in_bytes == 56, "OrtCustomOp.GetOutputTypeCount has unexpected offset % instead of 56", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCustomOp.GetOutputTypeCount has unexpected size % instead of 8", it.type.runtime_size); case "KernelCompute"; assert(it.offset_in_bytes == 64, "OrtCustomOp.KernelCompute has unexpected offset % instead of 64", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCustomOp.KernelCompute has unexpected size % instead of 8", it.type.runtime_size); case "KernelDestroy"; assert(it.offset_in_bytes == 72, "OrtCustomOp.KernelDestroy has unexpected offset % instead of 72", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCustomOp.KernelDestroy has unexpected size % instead of 8", it.type.runtime_size); case "GetInputCharacteristic"; assert(it.offset_in_bytes == 80, "OrtCustomOp.GetInputCharacteristic has unexpected offset % instead of 80", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCustomOp.GetInputCharacteristic has unexpected size % instead of 8", it.type.runtime_size); case "GetOutputCharacteristic"; assert(it.offset_in_bytes == 88, "OrtCustomOp.GetOutputCharacteristic has unexpected offset % instead of 88", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCustomOp.GetOutputCharacteristic has unexpected size % instead of 8", it.type.runtime_size); case "GetInputMemoryType"; assert(it.offset_in_bytes == 96, "OrtCustomOp.GetInputMemoryType has unexpected offset % instead of 96", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCustomOp.GetInputMemoryType has unexpected size % instead of 8", it.type.runtime_size); case "GetVariadicInputMinArity"; assert(it.offset_in_bytes == 104, "OrtCustomOp.GetVariadicInputMinArity has unexpected offset % instead of 104", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCustomOp.GetVariadicInputMinArity has unexpected size % instead of 8", it.type.runtime_size); case "GetVariadicInputHomogeneity"; assert(it.offset_in_bytes == 112, "OrtCustomOp.GetVariadicInputHomogeneity has unexpected offset % instead of 112", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCustomOp.GetVariadicInputHomogeneity has unexpected size % instead of 8", it.type.runtime_size); case "GetVariadicOutputMinArity"; assert(it.offset_in_bytes == 120, "OrtCustomOp.GetVariadicOutputMinArity has unexpected offset % instead of 120", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCustomOp.GetVariadicOutputMinArity has unexpected size % instead of 8", it.type.runtime_size); case "GetVariadicOutputHomogeneity"; assert(it.offset_in_bytes == 128, "OrtCustomOp.GetVariadicOutputHomogeneity has unexpected offset % instead of 128", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCustomOp.GetVariadicOutputHomogeneity has unexpected size % instead of 8", it.type.runtime_size); case "CreateKernelV2"; assert(it.offset_in_bytes == 136, "OrtCustomOp.CreateKernelV2 has unexpected offset % instead of 136", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCustomOp.CreateKernelV2 has unexpected size % instead of 8", it.type.runtime_size); case "KernelComputeV2"; assert(it.offset_in_bytes == 144, "OrtCustomOp.KernelComputeV2 has unexpected offset % instead of 144", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCustomOp.KernelComputeV2 has unexpected size % instead of 8", it.type.runtime_size); case "InferOutputShapeFn"; assert(it.offset_in_bytes == 152, "OrtCustomOp.InferOutputShapeFn has unexpected offset % instead of 152", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCustomOp.InferOutputShapeFn has unexpected size % instead of 8", it.type.runtime_size); case "GetStartVersion"; assert(it.offset_in_bytes == 160, "OrtCustomOp.GetStartVersion has unexpected offset % instead of 160", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCustomOp.GetStartVersion has unexpected size % instead of 8", it.type.runtime_size); case "GetEndVersion"; assert(it.offset_in_bytes == 168, "OrtCustomOp.GetEndVersion has unexpected offset % instead of 168", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCustomOp.GetEndVersion has unexpected size % instead of 8", it.type.runtime_size); case "GetMayInplace"; assert(it.offset_in_bytes == 176, "OrtCustomOp.GetMayInplace has unexpected offset % instead of 176", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCustomOp.GetMayInplace has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseMayInplace"; assert(it.offset_in_bytes == 184, "OrtCustomOp.ReleaseMayInplace has unexpected offset % instead of 184", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCustomOp.ReleaseMayInplace has unexpected size % instead of 8", it.type.runtime_size); case "GetAliasMap"; assert(it.offset_in_bytes == 192, "OrtCustomOp.GetAliasMap has unexpected offset % instead of 192", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCustomOp.GetAliasMap has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseAliasMap"; assert(it.offset_in_bytes == 200, "OrtCustomOp.ReleaseAliasMap has unexpected offset % instead of 200", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCustomOp.ReleaseAliasMap has unexpected size % instead of 8", it.type.runtime_size); } } assert(size_of(OrtCustomOp) == 208, "OrtCustomOp has size % instead of 208", size_of(OrtCustomOp)); } { info := type_info(OrtModelEditorApi); for info.members { if it.name == { case "CreateTensorTypeInfo"; assert(it.offset_in_bytes == 0, "OrtModelEditorApi.CreateTensorTypeInfo has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtModelEditorApi.CreateTensorTypeInfo has unexpected size % instead of 8", it.type.runtime_size); case "CreateSparseTensorTypeInfo"; assert(it.offset_in_bytes == 8, "OrtModelEditorApi.CreateSparseTensorTypeInfo has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtModelEditorApi.CreateSparseTensorTypeInfo has unexpected size % instead of 8", it.type.runtime_size); case "CreateMapTypeInfo"; assert(it.offset_in_bytes == 16, "OrtModelEditorApi.CreateMapTypeInfo has unexpected offset % instead of 16", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtModelEditorApi.CreateMapTypeInfo has unexpected size % instead of 8", it.type.runtime_size); case "CreateSequenceTypeInfo"; assert(it.offset_in_bytes == 24, "OrtModelEditorApi.CreateSequenceTypeInfo has unexpected offset % instead of 24", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtModelEditorApi.CreateSequenceTypeInfo has unexpected size % instead of 8", it.type.runtime_size); case "CreateOptionalTypeInfo"; assert(it.offset_in_bytes == 32, "OrtModelEditorApi.CreateOptionalTypeInfo has unexpected offset % instead of 32", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtModelEditorApi.CreateOptionalTypeInfo has unexpected size % instead of 8", it.type.runtime_size); case "CreateValueInfo"; assert(it.offset_in_bytes == 40, "OrtModelEditorApi.CreateValueInfo has unexpected offset % instead of 40", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtModelEditorApi.CreateValueInfo has unexpected size % instead of 8", it.type.runtime_size); case "CreateNode"; assert(it.offset_in_bytes == 48, "OrtModelEditorApi.CreateNode has unexpected offset % instead of 48", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtModelEditorApi.CreateNode has unexpected size % instead of 8", it.type.runtime_size); case "CreateGraph"; assert(it.offset_in_bytes == 56, "OrtModelEditorApi.CreateGraph has unexpected offset % instead of 56", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtModelEditorApi.CreateGraph has unexpected size % instead of 8", it.type.runtime_size); case "SetGraphInputs"; assert(it.offset_in_bytes == 64, "OrtModelEditorApi.SetGraphInputs has unexpected offset % instead of 64", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtModelEditorApi.SetGraphInputs has unexpected size % instead of 8", it.type.runtime_size); case "SetGraphOutputs"; assert(it.offset_in_bytes == 72, "OrtModelEditorApi.SetGraphOutputs has unexpected offset % instead of 72", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtModelEditorApi.SetGraphOutputs has unexpected size % instead of 8", it.type.runtime_size); case "AddInitializerToGraph"; assert(it.offset_in_bytes == 80, "OrtModelEditorApi.AddInitializerToGraph has unexpected offset % instead of 80", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtModelEditorApi.AddInitializerToGraph has unexpected size % instead of 8", it.type.runtime_size); case "AddNodeToGraph"; assert(it.offset_in_bytes == 88, "OrtModelEditorApi.AddNodeToGraph has unexpected offset % instead of 88", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtModelEditorApi.AddNodeToGraph has unexpected size % instead of 8", it.type.runtime_size); case "CreateModel"; assert(it.offset_in_bytes == 96, "OrtModelEditorApi.CreateModel has unexpected offset % instead of 96", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtModelEditorApi.CreateModel has unexpected size % instead of 8", it.type.runtime_size); case "AddGraphToModel"; assert(it.offset_in_bytes == 104, "OrtModelEditorApi.AddGraphToModel has unexpected offset % instead of 104", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtModelEditorApi.AddGraphToModel has unexpected size % instead of 8", it.type.runtime_size); case "CreateSessionFromModel"; assert(it.offset_in_bytes == 112, "OrtModelEditorApi.CreateSessionFromModel has unexpected offset % instead of 112", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtModelEditorApi.CreateSessionFromModel has unexpected size % instead of 8", it.type.runtime_size); case "CreateModelEditorSession"; assert(it.offset_in_bytes == 120, "OrtModelEditorApi.CreateModelEditorSession has unexpected offset % instead of 120", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtModelEditorApi.CreateModelEditorSession has unexpected size % instead of 8", it.type.runtime_size); case "CreateModelEditorSessionFromArray"; assert(it.offset_in_bytes == 128, "OrtModelEditorApi.CreateModelEditorSessionFromArray has unexpected offset % instead of 128", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtModelEditorApi.CreateModelEditorSessionFromArray has unexpected size % instead of 8", it.type.runtime_size); case "SessionGetOpsetForDomain"; assert(it.offset_in_bytes == 136, "OrtModelEditorApi.SessionGetOpsetForDomain has unexpected offset % instead of 136", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtModelEditorApi.SessionGetOpsetForDomain has unexpected size % instead of 8", it.type.runtime_size); case "ApplyModelToModelEditorSession"; assert(it.offset_in_bytes == 144, "OrtModelEditorApi.ApplyModelToModelEditorSession has unexpected offset % instead of 144", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtModelEditorApi.ApplyModelToModelEditorSession has unexpected size % instead of 8", it.type.runtime_size); case "FinalizeModelEditorSession"; assert(it.offset_in_bytes == 152, "OrtModelEditorApi.FinalizeModelEditorSession has unexpected offset % instead of 152", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtModelEditorApi.FinalizeModelEditorSession has unexpected size % instead of 8", it.type.runtime_size); } } assert(size_of(OrtModelEditorApi) == 160, "OrtModelEditorApi has size % instead of 160", size_of(OrtModelEditorApi)); } { info := type_info(OrtCompileApi); for info.members { if it.name == { case "ReleaseModelCompilationOptions"; assert(it.offset_in_bytes == 0, "OrtCompileApi.ReleaseModelCompilationOptions has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCompileApi.ReleaseModelCompilationOptions has unexpected size % instead of 8", it.type.runtime_size); case "CreateModelCompilationOptionsFromSessionOptions"; assert(it.offset_in_bytes == 8, "OrtCompileApi.CreateModelCompilationOptionsFromSessionOptions has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCompileApi.CreateModelCompilationOptionsFromSessionOptions has unexpected size % instead of 8", it.type.runtime_size); case "ModelCompilationOptions_SetInputModelPath"; assert(it.offset_in_bytes == 16, "OrtCompileApi.ModelCompilationOptions_SetInputModelPath has unexpected offset % instead of 16", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCompileApi.ModelCompilationOptions_SetInputModelPath has unexpected size % instead of 8", it.type.runtime_size); case "ModelCompilationOptions_SetInputModelFromBuffer"; assert(it.offset_in_bytes == 24, "OrtCompileApi.ModelCompilationOptions_SetInputModelFromBuffer has unexpected offset % instead of 24", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCompileApi.ModelCompilationOptions_SetInputModelFromBuffer has unexpected size % instead of 8", it.type.runtime_size); case "ModelCompilationOptions_SetOutputModelPath"; assert(it.offset_in_bytes == 32, "OrtCompileApi.ModelCompilationOptions_SetOutputModelPath has unexpected offset % instead of 32", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCompileApi.ModelCompilationOptions_SetOutputModelPath has unexpected size % instead of 8", it.type.runtime_size); case "ModelCompilationOptions_SetOutputModelExternalInitializersFile"; assert(it.offset_in_bytes == 40, "OrtCompileApi.ModelCompilationOptions_SetOutputModelExternalInitializersFile has unexpected offset % instead of 40", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCompileApi.ModelCompilationOptions_SetOutputModelExternalInitializersFile has unexpected size % instead of 8", it.type.runtime_size); case "ModelCompilationOptions_SetOutputModelBuffer"; assert(it.offset_in_bytes == 48, "OrtCompileApi.ModelCompilationOptions_SetOutputModelBuffer has unexpected offset % instead of 48", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCompileApi.ModelCompilationOptions_SetOutputModelBuffer has unexpected size % instead of 8", it.type.runtime_size); case "ModelCompilationOptions_SetEpContextEmbedMode"; assert(it.offset_in_bytes == 56, "OrtCompileApi.ModelCompilationOptions_SetEpContextEmbedMode has unexpected offset % instead of 56", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCompileApi.ModelCompilationOptions_SetEpContextEmbedMode has unexpected size % instead of 8", it.type.runtime_size); case "CompileModel"; assert(it.offset_in_bytes == 64, "OrtCompileApi.CompileModel has unexpected offset % instead of 64", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCompileApi.CompileModel has unexpected size % instead of 8", it.type.runtime_size); case "ModelCompilationOptions_SetFlags"; assert(it.offset_in_bytes == 72, "OrtCompileApi.ModelCompilationOptions_SetFlags has unexpected offset % instead of 72", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCompileApi.ModelCompilationOptions_SetFlags has unexpected size % instead of 8", it.type.runtime_size); case "ModelCompilationOptions_SetEpContextBinaryInformation"; assert(it.offset_in_bytes == 80, "OrtCompileApi.ModelCompilationOptions_SetEpContextBinaryInformation has unexpected offset % instead of 80", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCompileApi.ModelCompilationOptions_SetEpContextBinaryInformation has unexpected size % instead of 8", it.type.runtime_size); case "ModelCompilationOptions_SetGraphOptimizationLevel"; assert(it.offset_in_bytes == 88, "OrtCompileApi.ModelCompilationOptions_SetGraphOptimizationLevel has unexpected offset % instead of 88", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCompileApi.ModelCompilationOptions_SetGraphOptimizationLevel has unexpected size % instead of 8", it.type.runtime_size); case "ModelCompilationOptions_SetOutputModelWriteFunc"; assert(it.offset_in_bytes == 96, "OrtCompileApi.ModelCompilationOptions_SetOutputModelWriteFunc has unexpected offset % instead of 96", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCompileApi.ModelCompilationOptions_SetOutputModelWriteFunc has unexpected size % instead of 8", it.type.runtime_size); case "ModelCompilationOptions_SetOutputModelGetInitializerLocationFunc"; assert(it.offset_in_bytes == 104, "OrtCompileApi.ModelCompilationOptions_SetOutputModelGetInitializerLocationFunc has unexpected offset % instead of 104", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCompileApi.ModelCompilationOptions_SetOutputModelGetInitializerLocationFunc has unexpected size % instead of 8", it.type.runtime_size); case "ModelCompilationOptions_SetInputModel"; assert(it.offset_in_bytes == 112, "OrtCompileApi.ModelCompilationOptions_SetInputModel has unexpected offset % instead of 112", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCompileApi.ModelCompilationOptions_SetInputModel has unexpected size % instead of 8", it.type.runtime_size); case "ModelCompilationOptions_SetWeightlessEnabled"; assert(it.offset_in_bytes == 120, "OrtCompileApi.ModelCompilationOptions_SetWeightlessEnabled has unexpected offset % instead of 120", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtCompileApi.ModelCompilationOptions_SetWeightlessEnabled has unexpected size % instead of 8", it.type.runtime_size); } } assert(size_of(OrtCompileApi) == 128, "OrtCompileApi has size % instead of 128", size_of(OrtCompileApi)); } { info := type_info(OrtInteropApi); for info.members { if it.name == { case "CreateExternalResourceImporterForDevice"; assert(it.offset_in_bytes == 0, "OrtInteropApi.CreateExternalResourceImporterForDevice has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtInteropApi.CreateExternalResourceImporterForDevice has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseExternalResourceImporter"; assert(it.offset_in_bytes == 8, "OrtInteropApi.ReleaseExternalResourceImporter has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtInteropApi.ReleaseExternalResourceImporter has unexpected size % instead of 8", it.type.runtime_size); case "CanImportMemory"; assert(it.offset_in_bytes == 16, "OrtInteropApi.CanImportMemory has unexpected offset % instead of 16", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtInteropApi.CanImportMemory has unexpected size % instead of 8", it.type.runtime_size); case "ImportMemory"; assert(it.offset_in_bytes == 24, "OrtInteropApi.ImportMemory has unexpected offset % instead of 24", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtInteropApi.ImportMemory has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseExternalMemoryHandle"; assert(it.offset_in_bytes == 32, "OrtInteropApi.ReleaseExternalMemoryHandle has unexpected offset % instead of 32", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtInteropApi.ReleaseExternalMemoryHandle has unexpected size % instead of 8", it.type.runtime_size); case "CreateTensorFromMemory"; assert(it.offset_in_bytes == 40, "OrtInteropApi.CreateTensorFromMemory has unexpected offset % instead of 40", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtInteropApi.CreateTensorFromMemory has unexpected size % instead of 8", it.type.runtime_size); case "CanImportSemaphore"; assert(it.offset_in_bytes == 48, "OrtInteropApi.CanImportSemaphore has unexpected offset % instead of 48", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtInteropApi.CanImportSemaphore has unexpected size % instead of 8", it.type.runtime_size); case "ImportSemaphore"; assert(it.offset_in_bytes == 56, "OrtInteropApi.ImportSemaphore has unexpected offset % instead of 56", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtInteropApi.ImportSemaphore has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseExternalSemaphoreHandle"; assert(it.offset_in_bytes == 64, "OrtInteropApi.ReleaseExternalSemaphoreHandle has unexpected offset % instead of 64", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtInteropApi.ReleaseExternalSemaphoreHandle has unexpected size % instead of 8", it.type.runtime_size); case "WaitSemaphore"; assert(it.offset_in_bytes == 72, "OrtInteropApi.WaitSemaphore has unexpected offset % instead of 72", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtInteropApi.WaitSemaphore has unexpected size % instead of 8", it.type.runtime_size); case "SignalSemaphore"; assert(it.offset_in_bytes == 80, "OrtInteropApi.SignalSemaphore has unexpected offset % instead of 80", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtInteropApi.SignalSemaphore has unexpected size % instead of 8", it.type.runtime_size); case "InitGraphicsInteropForEpDevice"; assert(it.offset_in_bytes == 88, "OrtInteropApi.InitGraphicsInteropForEpDevice has unexpected offset % instead of 88", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtInteropApi.InitGraphicsInteropForEpDevice has unexpected size % instead of 8", it.type.runtime_size); case "DeinitGraphicsInteropForEpDevice"; assert(it.offset_in_bytes == 96, "OrtInteropApi.DeinitGraphicsInteropForEpDevice has unexpected offset % instead of 96", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtInteropApi.DeinitGraphicsInteropForEpDevice has unexpected size % instead of 8", it.type.runtime_size); } } assert(size_of(OrtInteropApi) == 104, "OrtInteropApi has size % instead of 104", size_of(OrtInteropApi)); } { info := type_info(OrtExternalMemoryHandle); for info.members { if it.name == { case "version"; assert(it.offset_in_bytes == 0, "OrtExternalMemoryHandle.version has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtExternalMemoryHandle.version has unexpected size % instead of 4", it.type.runtime_size); case "ep_device"; assert(it.offset_in_bytes == 8, "OrtExternalMemoryHandle.ep_device has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtExternalMemoryHandle.ep_device has unexpected size % instead of 8", it.type.runtime_size); case "descriptor"; assert(it.offset_in_bytes == 16, "OrtExternalMemoryHandle.descriptor has unexpected offset % instead of 16", it.offset_in_bytes); assert(it.type.runtime_size == 32, "OrtExternalMemoryHandle.descriptor has unexpected size % instead of 32", it.type.runtime_size); case "Release"; assert(it.offset_in_bytes == 48, "OrtExternalMemoryHandle.Release has unexpected offset % instead of 48", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtExternalMemoryHandle.Release has unexpected size % instead of 8", it.type.runtime_size); } } assert(size_of(OrtExternalMemoryHandle) == 56, "OrtExternalMemoryHandle has size % instead of 56", size_of(OrtExternalMemoryHandle)); } { info := type_info(OrtExternalSemaphoreHandle); for info.members { if it.name == { case "version"; assert(it.offset_in_bytes == 0, "OrtExternalSemaphoreHandle.version has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtExternalSemaphoreHandle.version has unexpected size % instead of 4", it.type.runtime_size); case "ep_device"; assert(it.offset_in_bytes == 8, "OrtExternalSemaphoreHandle.ep_device has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtExternalSemaphoreHandle.ep_device has unexpected size % instead of 8", it.type.runtime_size); case "descriptor"; assert(it.offset_in_bytes == 16, "OrtExternalSemaphoreHandle.descriptor has unexpected offset % instead of 16", it.offset_in_bytes); assert(it.type.runtime_size == 16, "OrtExternalSemaphoreHandle.descriptor has unexpected size % instead of 16", it.type.runtime_size); case "Release"; assert(it.offset_in_bytes == 32, "OrtExternalSemaphoreHandle.Release has unexpected offset % instead of 32", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtExternalSemaphoreHandle.Release has unexpected size % instead of 8", it.type.runtime_size); } } assert(size_of(OrtExternalSemaphoreHandle) == 40, "OrtExternalSemaphoreHandle has size % instead of 40", size_of(OrtExternalSemaphoreHandle)); } { info := type_info(OrtDataTransferImpl); for info.members { if it.name == { case "ort_version_supported"; assert(it.offset_in_bytes == 0, "OrtDataTransferImpl.ort_version_supported has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtDataTransferImpl.ort_version_supported has unexpected size % instead of 4", it.type.runtime_size); case "Release"; assert(it.offset_in_bytes == 8, "OrtDataTransferImpl.Release has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtDataTransferImpl.Release has unexpected size % instead of 8", it.type.runtime_size); case "CanCopy"; assert(it.offset_in_bytes == 16, "OrtDataTransferImpl.CanCopy has unexpected offset % instead of 16", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtDataTransferImpl.CanCopy has unexpected size % instead of 8", it.type.runtime_size); case "CopyTensors"; assert(it.offset_in_bytes == 24, "OrtDataTransferImpl.CopyTensors has unexpected offset % instead of 24", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtDataTransferImpl.CopyTensors has unexpected size % instead of 8", it.type.runtime_size); } } assert(size_of(OrtDataTransferImpl) == 32, "OrtDataTransferImpl has size % instead of 32", size_of(OrtDataTransferImpl)); } { info := type_info(OrtSyncNotificationImpl); for info.members { if it.name == { case "ort_version_supported"; assert(it.offset_in_bytes == 0, "OrtSyncNotificationImpl.ort_version_supported has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtSyncNotificationImpl.ort_version_supported has unexpected size % instead of 4", it.type.runtime_size); case "Release"; assert(it.offset_in_bytes == 8, "OrtSyncNotificationImpl.Release has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtSyncNotificationImpl.Release has unexpected size % instead of 8", it.type.runtime_size); case "Activate"; assert(it.offset_in_bytes == 16, "OrtSyncNotificationImpl.Activate has unexpected offset % instead of 16", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtSyncNotificationImpl.Activate has unexpected size % instead of 8", it.type.runtime_size); case "WaitOnDevice"; assert(it.offset_in_bytes == 24, "OrtSyncNotificationImpl.WaitOnDevice has unexpected offset % instead of 24", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtSyncNotificationImpl.WaitOnDevice has unexpected size % instead of 8", it.type.runtime_size); case "WaitOnHost"; assert(it.offset_in_bytes == 32, "OrtSyncNotificationImpl.WaitOnHost has unexpected offset % instead of 32", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtSyncNotificationImpl.WaitOnHost has unexpected size % instead of 8", it.type.runtime_size); } } assert(size_of(OrtSyncNotificationImpl) == 40, "OrtSyncNotificationImpl has size % instead of 40", size_of(OrtSyncNotificationImpl)); } { info := type_info(OrtSyncStreamImpl); for info.members { if it.name == { case "ort_version_supported"; assert(it.offset_in_bytes == 0, "OrtSyncStreamImpl.ort_version_supported has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtSyncStreamImpl.ort_version_supported has unexpected size % instead of 4", it.type.runtime_size); case "Release"; assert(it.offset_in_bytes == 8, "OrtSyncStreamImpl.Release has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtSyncStreamImpl.Release has unexpected size % instead of 8", it.type.runtime_size); case "GetHandle"; assert(it.offset_in_bytes == 16, "OrtSyncStreamImpl.GetHandle has unexpected offset % instead of 16", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtSyncStreamImpl.GetHandle has unexpected size % instead of 8", it.type.runtime_size); case "CreateNotification"; assert(it.offset_in_bytes == 24, "OrtSyncStreamImpl.CreateNotification has unexpected offset % instead of 24", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtSyncStreamImpl.CreateNotification has unexpected size % instead of 8", it.type.runtime_size); case "Flush"; assert(it.offset_in_bytes == 32, "OrtSyncStreamImpl.Flush has unexpected offset % instead of 32", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtSyncStreamImpl.Flush has unexpected size % instead of 8", it.type.runtime_size); case "OnSessionRunEnd"; assert(it.offset_in_bytes == 40, "OrtSyncStreamImpl.OnSessionRunEnd has unexpected offset % instead of 40", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtSyncStreamImpl.OnSessionRunEnd has unexpected size % instead of 8", it.type.runtime_size); } } assert(size_of(OrtSyncStreamImpl) == 48, "OrtSyncStreamImpl has size % instead of 48", size_of(OrtSyncStreamImpl)); } { info := type_info(OrtExternalResourceImporterImpl); for info.members { if it.name == { case "ort_version_supported"; assert(it.offset_in_bytes == 0, "OrtExternalResourceImporterImpl.ort_version_supported has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtExternalResourceImporterImpl.ort_version_supported has unexpected size % instead of 4", it.type.runtime_size); case "CanImportMemory"; assert(it.offset_in_bytes == 8, "OrtExternalResourceImporterImpl.CanImportMemory has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtExternalResourceImporterImpl.CanImportMemory has unexpected size % instead of 8", it.type.runtime_size); case "ImportMemory"; assert(it.offset_in_bytes == 16, "OrtExternalResourceImporterImpl.ImportMemory has unexpected offset % instead of 16", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtExternalResourceImporterImpl.ImportMemory has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseMemory"; assert(it.offset_in_bytes == 24, "OrtExternalResourceImporterImpl.ReleaseMemory has unexpected offset % instead of 24", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtExternalResourceImporterImpl.ReleaseMemory has unexpected size % instead of 8", it.type.runtime_size); case "CreateTensorFromMemory"; assert(it.offset_in_bytes == 32, "OrtExternalResourceImporterImpl.CreateTensorFromMemory has unexpected offset % instead of 32", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtExternalResourceImporterImpl.CreateTensorFromMemory has unexpected size % instead of 8", it.type.runtime_size); case "CanImportSemaphore"; assert(it.offset_in_bytes == 40, "OrtExternalResourceImporterImpl.CanImportSemaphore has unexpected offset % instead of 40", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtExternalResourceImporterImpl.CanImportSemaphore has unexpected size % instead of 8", it.type.runtime_size); case "ImportSemaphore"; assert(it.offset_in_bytes == 48, "OrtExternalResourceImporterImpl.ImportSemaphore has unexpected offset % instead of 48", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtExternalResourceImporterImpl.ImportSemaphore has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseSemaphore"; assert(it.offset_in_bytes == 56, "OrtExternalResourceImporterImpl.ReleaseSemaphore has unexpected offset % instead of 56", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtExternalResourceImporterImpl.ReleaseSemaphore has unexpected size % instead of 8", it.type.runtime_size); case "WaitSemaphore"; assert(it.offset_in_bytes == 64, "OrtExternalResourceImporterImpl.WaitSemaphore has unexpected offset % instead of 64", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtExternalResourceImporterImpl.WaitSemaphore has unexpected size % instead of 8", it.type.runtime_size); case "SignalSemaphore"; assert(it.offset_in_bytes == 72, "OrtExternalResourceImporterImpl.SignalSemaphore has unexpected offset % instead of 72", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtExternalResourceImporterImpl.SignalSemaphore has unexpected size % instead of 8", it.type.runtime_size); case "Release"; assert(it.offset_in_bytes == 80, "OrtExternalResourceImporterImpl.Release has unexpected offset % instead of 80", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtExternalResourceImporterImpl.Release has unexpected size % instead of 8", it.type.runtime_size); } } assert(size_of(OrtExternalResourceImporterImpl) == 88, "OrtExternalResourceImporterImpl has size % instead of 88", size_of(OrtExternalResourceImporterImpl)); } { info := type_info(OrtEpProfilerImpl); for info.members { if it.name == { case "ort_version_supported"; assert(it.offset_in_bytes == 0, "OrtEpProfilerImpl.ort_version_supported has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtEpProfilerImpl.ort_version_supported has unexpected size % instead of 4", it.type.runtime_size); case "Release"; assert(it.offset_in_bytes == 8, "OrtEpProfilerImpl.Release has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpProfilerImpl.Release has unexpected size % instead of 8", it.type.runtime_size); case "StartProfiling"; assert(it.offset_in_bytes == 16, "OrtEpProfilerImpl.StartProfiling has unexpected offset % instead of 16", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpProfilerImpl.StartProfiling has unexpected size % instead of 8", it.type.runtime_size); case "StartEvent"; assert(it.offset_in_bytes == 24, "OrtEpProfilerImpl.StartEvent has unexpected offset % instead of 24", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpProfilerImpl.StartEvent has unexpected size % instead of 8", it.type.runtime_size); case "StopEvent"; assert(it.offset_in_bytes == 32, "OrtEpProfilerImpl.StopEvent has unexpected offset % instead of 32", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpProfilerImpl.StopEvent has unexpected size % instead of 8", it.type.runtime_size); case "EndProfiling"; assert(it.offset_in_bytes == 40, "OrtEpProfilerImpl.EndProfiling has unexpected offset % instead of 40", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpProfilerImpl.EndProfiling has unexpected size % instead of 8", it.type.runtime_size); } } assert(size_of(OrtEpProfilerImpl) == 48, "OrtEpProfilerImpl has size % instead of 48", size_of(OrtEpProfilerImpl)); } { info := type_info(OrtNodeFusionOptions); for info.members { if it.name == { case "ort_version_supported"; assert(it.offset_in_bytes == 0, "OrtNodeFusionOptions.ort_version_supported has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtNodeFusionOptions.ort_version_supported has unexpected size % instead of 4", it.type.runtime_size); case "drop_constant_initializers"; assert(it.offset_in_bytes == 4, "OrtNodeFusionOptions.drop_constant_initializers has unexpected offset % instead of 4", it.offset_in_bytes); assert(it.type.runtime_size == 1, "OrtNodeFusionOptions.drop_constant_initializers has unexpected size % instead of 1", it.type.runtime_size); } } assert(size_of(OrtNodeFusionOptions) == 8, "OrtNodeFusionOptions has size % instead of 8", size_of(OrtNodeFusionOptions)); } { info := type_info(OrtNodeComputeInfo); for info.members { if it.name == { case "ort_version_supported"; assert(it.offset_in_bytes == 0, "OrtNodeComputeInfo.ort_version_supported has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtNodeComputeInfo.ort_version_supported has unexpected size % instead of 4", it.type.runtime_size); case "CreateState"; assert(it.offset_in_bytes == 8, "OrtNodeComputeInfo.CreateState has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtNodeComputeInfo.CreateState has unexpected size % instead of 8", it.type.runtime_size); case "Compute"; assert(it.offset_in_bytes == 16, "OrtNodeComputeInfo.Compute has unexpected offset % instead of 16", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtNodeComputeInfo.Compute has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseState"; assert(it.offset_in_bytes == 24, "OrtNodeComputeInfo.ReleaseState has unexpected offset % instead of 24", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtNodeComputeInfo.ReleaseState has unexpected size % instead of 8", it.type.runtime_size); } } assert(size_of(OrtNodeComputeInfo) == 32, "OrtNodeComputeInfo has size % instead of 32", size_of(OrtNodeComputeInfo)); } { info := type_info(OrtKernelImpl); for info.members { if it.name == { case "ort_version_supported"; assert(it.offset_in_bytes == 0, "OrtKernelImpl.ort_version_supported has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtKernelImpl.ort_version_supported has unexpected size % instead of 4", it.type.runtime_size); case "flags"; assert(it.offset_in_bytes == 4, "OrtKernelImpl.flags has unexpected offset % instead of 4", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtKernelImpl.flags has unexpected size % instead of 4", it.type.runtime_size); case "Compute"; assert(it.offset_in_bytes == 8, "OrtKernelImpl.Compute has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtKernelImpl.Compute has unexpected size % instead of 8", it.type.runtime_size); case "Release"; assert(it.offset_in_bytes == 16, "OrtKernelImpl.Release has unexpected offset % instead of 16", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtKernelImpl.Release has unexpected size % instead of 8", it.type.runtime_size); case "PrePackWeight"; assert(it.offset_in_bytes == 24, "OrtKernelImpl.PrePackWeight has unexpected offset % instead of 24", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtKernelImpl.PrePackWeight has unexpected size % instead of 8", it.type.runtime_size); case "SetSharedPrePackedWeight"; assert(it.offset_in_bytes == 32, "OrtKernelImpl.SetSharedPrePackedWeight has unexpected offset % instead of 32", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtKernelImpl.SetSharedPrePackedWeight has unexpected size % instead of 8", it.type.runtime_size); } } assert(size_of(OrtKernelImpl) == 40, "OrtKernelImpl has size % instead of 40", size_of(OrtKernelImpl)); } { info := type_info(OrtLoopKernelHelper); for info.members { if it.name == { case "ort_version_supported"; assert(it.offset_in_bytes == 0, "OrtLoopKernelHelper.ort_version_supported has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtLoopKernelHelper.ort_version_supported has unexpected size % instead of 4", it.type.runtime_size); case "Release"; assert(it.offset_in_bytes == 8, "OrtLoopKernelHelper.Release has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtLoopKernelHelper.Release has unexpected size % instead of 8", it.type.runtime_size); case "ConcatOutput"; assert(it.offset_in_bytes == 16, "OrtLoopKernelHelper.ConcatOutput has unexpected offset % instead of 16", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtLoopKernelHelper.ConcatOutput has unexpected size % instead of 8", it.type.runtime_size); } } assert(size_of(OrtLoopKernelHelper) == 24, "OrtLoopKernelHelper has size % instead of 24", size_of(OrtLoopKernelHelper)); } { info := type_info(OrtScanKernelHelper); for info.members { if it.name == { case "ort_version_supported"; assert(it.offset_in_bytes == 0, "OrtScanKernelHelper.ort_version_supported has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtScanKernelHelper.ort_version_supported has unexpected size % instead of 4", it.type.runtime_size); case "Release"; assert(it.offset_in_bytes == 8, "OrtScanKernelHelper.Release has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtScanKernelHelper.Release has unexpected size % instead of 8", it.type.runtime_size); case "Transpose"; assert(it.offset_in_bytes == 16, "OrtScanKernelHelper.Transpose has unexpected offset % instead of 16", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtScanKernelHelper.Transpose has unexpected size % instead of 8", it.type.runtime_size); } } assert(size_of(OrtScanKernelHelper) == 24, "OrtScanKernelHelper has size % instead of 24", size_of(OrtScanKernelHelper)); } { info := type_info(OrtResourceCount); for info.members { if it.name == { case "kind"; assert(it.offset_in_bytes == 0, "OrtResourceCount.kind has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtResourceCount.kind has unexpected size % instead of 4", it.type.runtime_size); case "reserved"; assert(it.offset_in_bytes == 4, "OrtResourceCount.reserved has unexpected offset % instead of 4", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtResourceCount.reserved has unexpected size % instead of 4", it.type.runtime_size); case "value"; assert(it.offset_in_bytes == 8, "OrtResourceCount.value has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 48, "OrtResourceCount.value has unexpected size % instead of 48", it.type.runtime_size); } } assert(size_of(OrtResourceCount) == 56, "OrtResourceCount has size % instead of 56", size_of(OrtResourceCount)); } { info := type_info(OrtEpApi); for info.members { if it.name == { case "CreateEpDevice"; assert(it.offset_in_bytes == 0, "OrtEpApi.CreateEpDevice has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.CreateEpDevice has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseEpDevice"; assert(it.offset_in_bytes == 8, "OrtEpApi.ReleaseEpDevice has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.ReleaseEpDevice has unexpected size % instead of 8", it.type.runtime_size); case "EpGraphSupportInfo_AddNodesToFuse"; assert(it.offset_in_bytes == 16, "OrtEpApi.EpGraphSupportInfo_AddNodesToFuse has unexpected offset % instead of 16", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.EpGraphSupportInfo_AddNodesToFuse has unexpected size % instead of 8", it.type.runtime_size); case "EpGraphSupportInfo_AddSingleNode"; assert(it.offset_in_bytes == 24, "OrtEpApi.EpGraphSupportInfo_AddSingleNode has unexpected offset % instead of 24", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.EpGraphSupportInfo_AddSingleNode has unexpected size % instead of 8", it.type.runtime_size); case "NodeComputeContext_NodeName"; assert(it.offset_in_bytes == 32, "OrtEpApi.NodeComputeContext_NodeName has unexpected offset % instead of 32", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.NodeComputeContext_NodeName has unexpected size % instead of 8", it.type.runtime_size); case "EpDevice_AddAllocatorInfo"; assert(it.offset_in_bytes == 40, "OrtEpApi.EpDevice_AddAllocatorInfo has unexpected offset % instead of 40", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.EpDevice_AddAllocatorInfo has unexpected size % instead of 8", it.type.runtime_size); case "MemoryInfo_GetMemoryDevice"; assert(it.offset_in_bytes == 48, "OrtEpApi.MemoryInfo_GetMemoryDevice has unexpected offset % instead of 48", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.MemoryInfo_GetMemoryDevice has unexpected size % instead of 8", it.type.runtime_size); case "Value_GetMemoryDevice"; assert(it.offset_in_bytes == 56, "OrtEpApi.Value_GetMemoryDevice has unexpected offset % instead of 56", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.Value_GetMemoryDevice has unexpected size % instead of 8", it.type.runtime_size); case "MemoryDevice_AreEqual"; assert(it.offset_in_bytes == 64, "OrtEpApi.MemoryDevice_AreEqual has unexpected offset % instead of 64", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.MemoryDevice_AreEqual has unexpected size % instead of 8", it.type.runtime_size); case "MemoryDevice_GetDeviceType"; assert(it.offset_in_bytes == 72, "OrtEpApi.MemoryDevice_GetDeviceType has unexpected offset % instead of 72", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.MemoryDevice_GetDeviceType has unexpected size % instead of 8", it.type.runtime_size); case "MemoryDevice_GetMemoryType"; assert(it.offset_in_bytes == 80, "OrtEpApi.MemoryDevice_GetMemoryType has unexpected offset % instead of 80", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.MemoryDevice_GetMemoryType has unexpected size % instead of 8", it.type.runtime_size); case "MemoryDevice_GetVendorId"; assert(it.offset_in_bytes == 88, "OrtEpApi.MemoryDevice_GetVendorId has unexpected offset % instead of 88", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.MemoryDevice_GetVendorId has unexpected size % instead of 8", it.type.runtime_size); case "MemoryDevice_GetDeviceId"; assert(it.offset_in_bytes == 96, "OrtEpApi.MemoryDevice_GetDeviceId has unexpected offset % instead of 96", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.MemoryDevice_GetDeviceId has unexpected size % instead of 8", it.type.runtime_size); case "SyncStream_GetImpl"; assert(it.offset_in_bytes == 104, "OrtEpApi.SyncStream_GetImpl has unexpected offset % instead of 104", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.SyncStream_GetImpl has unexpected size % instead of 8", it.type.runtime_size); case "SyncStream_GetSyncId"; assert(it.offset_in_bytes == 112, "OrtEpApi.SyncStream_GetSyncId has unexpected offset % instead of 112", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.SyncStream_GetSyncId has unexpected size % instead of 8", it.type.runtime_size); case "GetSyncIdForLastWaitOnSyncStream"; assert(it.offset_in_bytes == 120, "OrtEpApi.GetSyncIdForLastWaitOnSyncStream has unexpected offset % instead of 120", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.GetSyncIdForLastWaitOnSyncStream has unexpected size % instead of 8", it.type.runtime_size); case "CreateHardwareDevice"; assert(it.offset_in_bytes == 128, "OrtEpApi.CreateHardwareDevice has unexpected offset % instead of 128", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.CreateHardwareDevice has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseHardwareDevice"; assert(it.offset_in_bytes == 136, "OrtEpApi.ReleaseHardwareDevice has unexpected offset % instead of 136", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.ReleaseHardwareDevice has unexpected size % instead of 8", it.type.runtime_size); case "CreateKernelRegistry"; assert(it.offset_in_bytes == 144, "OrtEpApi.CreateKernelRegistry has unexpected offset % instead of 144", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.CreateKernelRegistry has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseKernelRegistry"; assert(it.offset_in_bytes == 152, "OrtEpApi.ReleaseKernelRegistry has unexpected offset % instead of 152", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.ReleaseKernelRegistry has unexpected size % instead of 8", it.type.runtime_size); case "KernelRegistry_AddKernel"; assert(it.offset_in_bytes == 160, "OrtEpApi.KernelRegistry_AddKernel has unexpected offset % instead of 160", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.KernelRegistry_AddKernel has unexpected size % instead of 8", it.type.runtime_size); case "CreateKernelDefBuilder"; assert(it.offset_in_bytes == 168, "OrtEpApi.CreateKernelDefBuilder has unexpected offset % instead of 168", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.CreateKernelDefBuilder has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseKernelDefBuilder"; assert(it.offset_in_bytes == 176, "OrtEpApi.ReleaseKernelDefBuilder has unexpected offset % instead of 176", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.ReleaseKernelDefBuilder has unexpected size % instead of 8", it.type.runtime_size); case "KernelDefBuilder_SetOperatorType"; assert(it.offset_in_bytes == 184, "OrtEpApi.KernelDefBuilder_SetOperatorType has unexpected offset % instead of 184", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.KernelDefBuilder_SetOperatorType has unexpected size % instead of 8", it.type.runtime_size); case "KernelDefBuilder_SetDomain"; assert(it.offset_in_bytes == 192, "OrtEpApi.KernelDefBuilder_SetDomain has unexpected offset % instead of 192", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.KernelDefBuilder_SetDomain has unexpected size % instead of 8", it.type.runtime_size); case "KernelDefBuilder_SetSinceVersion"; assert(it.offset_in_bytes == 200, "OrtEpApi.KernelDefBuilder_SetSinceVersion has unexpected offset % instead of 200", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.KernelDefBuilder_SetSinceVersion has unexpected size % instead of 8", it.type.runtime_size); case "KernelDefBuilder_SetExecutionProvider"; assert(it.offset_in_bytes == 208, "OrtEpApi.KernelDefBuilder_SetExecutionProvider has unexpected offset % instead of 208", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.KernelDefBuilder_SetExecutionProvider has unexpected size % instead of 8", it.type.runtime_size); case "KernelDefBuilder_SetInputMemType"; assert(it.offset_in_bytes == 216, "OrtEpApi.KernelDefBuilder_SetInputMemType has unexpected offset % instead of 216", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.KernelDefBuilder_SetInputMemType has unexpected size % instead of 8", it.type.runtime_size); case "KernelDefBuilder_SetOutputMemType"; assert(it.offset_in_bytes == 224, "OrtEpApi.KernelDefBuilder_SetOutputMemType has unexpected offset % instead of 224", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.KernelDefBuilder_SetOutputMemType has unexpected size % instead of 8", it.type.runtime_size); case "KernelDefBuilder_AddTypeConstraint"; assert(it.offset_in_bytes == 232, "OrtEpApi.KernelDefBuilder_AddTypeConstraint has unexpected offset % instead of 232", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.KernelDefBuilder_AddTypeConstraint has unexpected size % instead of 8", it.type.runtime_size); case "KernelDefBuilder_AddInputOutputAliases"; assert(it.offset_in_bytes == 240, "OrtEpApi.KernelDefBuilder_AddInputOutputAliases has unexpected offset % instead of 240", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.KernelDefBuilder_AddInputOutputAliases has unexpected size % instead of 8", it.type.runtime_size); case "KernelDefBuilder_AddInputOutputMutableAliases"; assert(it.offset_in_bytes == 248, "OrtEpApi.KernelDefBuilder_AddInputOutputMutableAliases has unexpected offset % instead of 248", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.KernelDefBuilder_AddInputOutputMutableAliases has unexpected size % instead of 8", it.type.runtime_size); case "KernelDefBuilder_Build"; assert(it.offset_in_bytes == 256, "OrtEpApi.KernelDefBuilder_Build has unexpected offset % instead of 256", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.KernelDefBuilder_Build has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseKernelDef"; assert(it.offset_in_bytes == 264, "OrtEpApi.ReleaseKernelDef has unexpected offset % instead of 264", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.ReleaseKernelDef has unexpected size % instead of 8", it.type.runtime_size); case "KernelDef_GetOperatorType"; assert(it.offset_in_bytes == 272, "OrtEpApi.KernelDef_GetOperatorType has unexpected offset % instead of 272", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.KernelDef_GetOperatorType has unexpected size % instead of 8", it.type.runtime_size); case "KernelDef_GetDomain"; assert(it.offset_in_bytes == 280, "OrtEpApi.KernelDef_GetDomain has unexpected offset % instead of 280", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.KernelDef_GetDomain has unexpected size % instead of 8", it.type.runtime_size); case "KernelDef_GetSinceVersion"; assert(it.offset_in_bytes == 288, "OrtEpApi.KernelDef_GetSinceVersion has unexpected offset % instead of 288", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.KernelDef_GetSinceVersion has unexpected size % instead of 8", it.type.runtime_size); case "KernelDef_GetExecutionProvider"; assert(it.offset_in_bytes == 296, "OrtEpApi.KernelDef_GetExecutionProvider has unexpected offset % instead of 296", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.KernelDef_GetExecutionProvider has unexpected size % instead of 8", it.type.runtime_size); case "KernelDef_GetInputMemType"; assert(it.offset_in_bytes == 304, "OrtEpApi.KernelDef_GetInputMemType has unexpected offset % instead of 304", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.KernelDef_GetInputMemType has unexpected size % instead of 8", it.type.runtime_size); case "KernelDef_GetOutputMemType"; assert(it.offset_in_bytes == 312, "OrtEpApi.KernelDef_GetOutputMemType has unexpected offset % instead of 312", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.KernelDef_GetOutputMemType has unexpected size % instead of 8", it.type.runtime_size); case "GetTensorDataType"; assert(it.offset_in_bytes == 320, "OrtEpApi.GetTensorDataType has unexpected offset % instead of 320", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.GetTensorDataType has unexpected size % instead of 8", it.type.runtime_size); case "EpGraphSupportInfo_LookUpKernel"; assert(it.offset_in_bytes == 328, "OrtEpApi.EpGraphSupportInfo_LookUpKernel has unexpected offset % instead of 328", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.EpGraphSupportInfo_LookUpKernel has unexpected size % instead of 8", it.type.runtime_size); case "SharedPrePackedWeightCache_StoreWeightData"; assert(it.offset_in_bytes == 336, "OrtEpApi.SharedPrePackedWeightCache_StoreWeightData has unexpected offset % instead of 336", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.SharedPrePackedWeightCache_StoreWeightData has unexpected size % instead of 8", it.type.runtime_size); case "KernelInfo_GetEp"; assert(it.offset_in_bytes == 344, "OrtEpApi.KernelInfo_GetEp has unexpected offset % instead of 344", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.KernelInfo_GetEp has unexpected size % instead of 8", it.type.runtime_size); case "DeviceEpIncompatibilityDetails_SetDetails"; assert(it.offset_in_bytes == 352, "OrtEpApi.DeviceEpIncompatibilityDetails_SetDetails has unexpected offset % instead of 352", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.DeviceEpIncompatibilityDetails_SetDetails has unexpected size % instead of 8", it.type.runtime_size); case "CreateIfKernel"; assert(it.offset_in_bytes == 360, "OrtEpApi.CreateIfKernel has unexpected offset % instead of 360", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.CreateIfKernel has unexpected size % instead of 8", it.type.runtime_size); case "CreateLoopKernel"; assert(it.offset_in_bytes == 368, "OrtEpApi.CreateLoopKernel has unexpected offset % instead of 368", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.CreateLoopKernel has unexpected size % instead of 8", it.type.runtime_size); case "CreateScanKernel"; assert(it.offset_in_bytes == 376, "OrtEpApi.CreateScanKernel has unexpected offset % instead of 376", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.CreateScanKernel has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseKernelImpl"; assert(it.offset_in_bytes == 384, "OrtEpApi.ReleaseKernelImpl has unexpected offset % instead of 384", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.ReleaseKernelImpl has unexpected size % instead of 8", it.type.runtime_size); case "GetEnvConfigEntries"; assert(it.offset_in_bytes == 392, "OrtEpApi.GetEnvConfigEntries has unexpected offset % instead of 392", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.GetEnvConfigEntries has unexpected size % instead of 8", it.type.runtime_size); case "GetOpSchema"; assert(it.offset_in_bytes == 400, "OrtEpApi.GetOpSchema has unexpected offset % instead of 400", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.GetOpSchema has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseOpSchema"; assert(it.offset_in_bytes == 408, "OrtEpApi.ReleaseOpSchema has unexpected offset % instead of 408", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.ReleaseOpSchema has unexpected size % instead of 8", it.type.runtime_size); case "OpSchema_GetSinceVersion"; assert(it.offset_in_bytes == 416, "OrtEpApi.OpSchema_GetSinceVersion has unexpected offset % instead of 416", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.OpSchema_GetSinceVersion has unexpected size % instead of 8", it.type.runtime_size); case "OpSchema_GetNumInputs"; assert(it.offset_in_bytes == 424, "OrtEpApi.OpSchema_GetNumInputs has unexpected offset % instead of 424", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.OpSchema_GetNumInputs has unexpected size % instead of 8", it.type.runtime_size); case "OpSchema_GetInputName"; assert(it.offset_in_bytes == 432, "OrtEpApi.OpSchema_GetInputName has unexpected offset % instead of 432", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.OpSchema_GetInputName has unexpected size % instead of 8", it.type.runtime_size); case "OpSchema_GetInputTypeConstraint"; assert(it.offset_in_bytes == 440, "OrtEpApi.OpSchema_GetInputTypeConstraint has unexpected offset % instead of 440", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.OpSchema_GetInputTypeConstraint has unexpected size % instead of 8", it.type.runtime_size); case "OpSchema_GetNumOutputs"; assert(it.offset_in_bytes == 448, "OrtEpApi.OpSchema_GetNumOutputs has unexpected offset % instead of 448", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.OpSchema_GetNumOutputs has unexpected size % instead of 8", it.type.runtime_size); case "OpSchema_GetOutputName"; assert(it.offset_in_bytes == 456, "OrtEpApi.OpSchema_GetOutputName has unexpected offset % instead of 456", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.OpSchema_GetOutputName has unexpected size % instead of 8", it.type.runtime_size); case "OpSchema_GetOutputTypeConstraint"; assert(it.offset_in_bytes == 464, "OrtEpApi.OpSchema_GetOutputTypeConstraint has unexpected offset % instead of 464", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.OpSchema_GetOutputTypeConstraint has unexpected size % instead of 8", it.type.runtime_size); case "OpSchema_GetTypeConstraintCount"; assert(it.offset_in_bytes == 472, "OrtEpApi.OpSchema_GetTypeConstraintCount has unexpected offset % instead of 472", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.OpSchema_GetTypeConstraintCount has unexpected size % instead of 8", it.type.runtime_size); case "OpSchema_GetTypeConstraint"; assert(it.offset_in_bytes == 480, "OrtEpApi.OpSchema_GetTypeConstraint has unexpected offset % instead of 480", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.OpSchema_GetTypeConstraint has unexpected size % instead of 8", it.type.runtime_size); case "OpSchemaTypeConstraint_GetTypeParamName"; assert(it.offset_in_bytes == 488, "OrtEpApi.OpSchemaTypeConstraint_GetTypeParamName has unexpected offset % instead of 488", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.OpSchemaTypeConstraint_GetTypeParamName has unexpected size % instead of 8", it.type.runtime_size); case "OpSchemaTypeConstraint_GetAllowedTypes"; assert(it.offset_in_bytes == 496, "OrtEpApi.OpSchemaTypeConstraint_GetAllowedTypes has unexpected offset % instead of 496", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.OpSchemaTypeConstraint_GetAllowedTypes has unexpected size % instead of 8", it.type.runtime_size); case "OpSchemaTypeConstraint_GetInputIndices"; assert(it.offset_in_bytes == 504, "OrtEpApi.OpSchemaTypeConstraint_GetInputIndices has unexpected offset % instead of 504", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.OpSchemaTypeConstraint_GetInputIndices has unexpected size % instead of 8", it.type.runtime_size); case "OpSchemaTypeConstraint_GetOutputIndices"; assert(it.offset_in_bytes == 512, "OrtEpApi.OpSchemaTypeConstraint_GetOutputIndices has unexpected offset % instead of 512", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.OpSchemaTypeConstraint_GetOutputIndices has unexpected size % instead of 8", it.type.runtime_size); case "CreateProfilingEvent"; assert(it.offset_in_bytes == 520, "OrtEpApi.CreateProfilingEvent has unexpected offset % instead of 520", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.CreateProfilingEvent has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseProfilingEvent"; assert(it.offset_in_bytes == 528, "OrtEpApi.ReleaseProfilingEvent has unexpected offset % instead of 528", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.ReleaseProfilingEvent has unexpected size % instead of 8", it.type.runtime_size); case "ProfilingEvent_GetCategory"; assert(it.offset_in_bytes == 536, "OrtEpApi.ProfilingEvent_GetCategory has unexpected offset % instead of 536", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.ProfilingEvent_GetCategory has unexpected size % instead of 8", it.type.runtime_size); case "ProfilingEvent_GetName"; assert(it.offset_in_bytes == 544, "OrtEpApi.ProfilingEvent_GetName has unexpected offset % instead of 544", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.ProfilingEvent_GetName has unexpected size % instead of 8", it.type.runtime_size); case "ProfilingEvent_GetTimestampUs"; assert(it.offset_in_bytes == 552, "OrtEpApi.ProfilingEvent_GetTimestampUs has unexpected offset % instead of 552", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.ProfilingEvent_GetTimestampUs has unexpected size % instead of 8", it.type.runtime_size); case "ProfilingEvent_GetDurationUs"; assert(it.offset_in_bytes == 560, "OrtEpApi.ProfilingEvent_GetDurationUs has unexpected offset % instead of 560", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.ProfilingEvent_GetDurationUs has unexpected size % instead of 8", it.type.runtime_size); case "ProfilingEvent_GetArgValue"; assert(it.offset_in_bytes == 568, "OrtEpApi.ProfilingEvent_GetArgValue has unexpected offset % instead of 568", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.ProfilingEvent_GetArgValue has unexpected size % instead of 8", it.type.runtime_size); case "ProfilingEventsContainer_AddEvents"; assert(it.offset_in_bytes == 576, "OrtEpApi.ProfilingEventsContainer_AddEvents has unexpected offset % instead of 576", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.ProfilingEventsContainer_AddEvents has unexpected size % instead of 8", it.type.runtime_size); case "SessionOptionsGetWeightlessSourceModelBuffer"; assert(it.offset_in_bytes == 584, "OrtEpApi.SessionOptionsGetWeightlessSourceModelBuffer has unexpected offset % instead of 584", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpApi.SessionOptionsGetWeightlessSourceModelBuffer has unexpected size % instead of 8", it.type.runtime_size); } } assert(size_of(OrtEpApi) == 592, "OrtEpApi has size % instead of 592", size_of(OrtEpApi)); } { info := type_info(OrtEp); for info.members { if it.name == { case "ort_version_supported"; assert(it.offset_in_bytes == 0, "OrtEp.ort_version_supported has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtEp.ort_version_supported has unexpected size % instead of 4", it.type.runtime_size); case "GetName"; assert(it.offset_in_bytes == 8, "OrtEp.GetName has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEp.GetName has unexpected size % instead of 8", it.type.runtime_size); case "GetCapability"; assert(it.offset_in_bytes == 16, "OrtEp.GetCapability has unexpected offset % instead of 16", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEp.GetCapability has unexpected size % instead of 8", it.type.runtime_size); case "Compile"; assert(it.offset_in_bytes == 24, "OrtEp.Compile has unexpected offset % instead of 24", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEp.Compile has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseNodeComputeInfos"; assert(it.offset_in_bytes == 32, "OrtEp.ReleaseNodeComputeInfos has unexpected offset % instead of 32", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEp.ReleaseNodeComputeInfos has unexpected size % instead of 8", it.type.runtime_size); case "GetPreferredDataLayout"; assert(it.offset_in_bytes == 40, "OrtEp.GetPreferredDataLayout has unexpected offset % instead of 40", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEp.GetPreferredDataLayout has unexpected size % instead of 8", it.type.runtime_size); case "ShouldConvertDataLayoutForOp"; assert(it.offset_in_bytes == 48, "OrtEp.ShouldConvertDataLayoutForOp has unexpected offset % instead of 48", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEp.ShouldConvertDataLayoutForOp has unexpected size % instead of 8", it.type.runtime_size); case "SetDynamicOptions"; assert(it.offset_in_bytes == 56, "OrtEp.SetDynamicOptions has unexpected offset % instead of 56", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEp.SetDynamicOptions has unexpected size % instead of 8", it.type.runtime_size); case "OnRunStart"; assert(it.offset_in_bytes == 64, "OrtEp.OnRunStart has unexpected offset % instead of 64", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEp.OnRunStart has unexpected size % instead of 8", it.type.runtime_size); case "OnRunEnd"; assert(it.offset_in_bytes == 72, "OrtEp.OnRunEnd has unexpected offset % instead of 72", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEp.OnRunEnd has unexpected size % instead of 8", it.type.runtime_size); case "CreateAllocator"; assert(it.offset_in_bytes == 80, "OrtEp.CreateAllocator has unexpected offset % instead of 80", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEp.CreateAllocator has unexpected size % instead of 8", it.type.runtime_size); case "CreateSyncStreamForDevice"; assert(it.offset_in_bytes == 88, "OrtEp.CreateSyncStreamForDevice has unexpected offset % instead of 88", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEp.CreateSyncStreamForDevice has unexpected size % instead of 8", it.type.runtime_size); case "GetCompiledModelCompatibilityInfo"; assert(it.offset_in_bytes == 96, "OrtEp.GetCompiledModelCompatibilityInfo has unexpected offset % instead of 96", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEp.GetCompiledModelCompatibilityInfo has unexpected size % instead of 8", it.type.runtime_size); case "GetKernelRegistry"; assert(it.offset_in_bytes == 104, "OrtEp.GetKernelRegistry has unexpected offset % instead of 104", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEp.GetKernelRegistry has unexpected size % instead of 8", it.type.runtime_size); case "IsConcurrentRunSupported"; assert(it.offset_in_bytes == 112, "OrtEp.IsConcurrentRunSupported has unexpected offset % instead of 112", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEp.IsConcurrentRunSupported has unexpected size % instead of 8", it.type.runtime_size); case "Sync"; assert(it.offset_in_bytes == 120, "OrtEp.Sync has unexpected offset % instead of 120", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEp.Sync has unexpected size % instead of 8", it.type.runtime_size); case "CreateProfiler"; assert(it.offset_in_bytes == 128, "OrtEp.CreateProfiler has unexpected offset % instead of 128", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEp.CreateProfiler has unexpected size % instead of 8", it.type.runtime_size); case "IsGraphCaptureEnabled"; assert(it.offset_in_bytes == 136, "OrtEp.IsGraphCaptureEnabled has unexpected offset % instead of 136", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEp.IsGraphCaptureEnabled has unexpected size % instead of 8", it.type.runtime_size); case "IsGraphCaptured"; assert(it.offset_in_bytes == 144, "OrtEp.IsGraphCaptured has unexpected offset % instead of 144", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEp.IsGraphCaptured has unexpected size % instead of 8", it.type.runtime_size); case "ReplayGraph"; assert(it.offset_in_bytes == 152, "OrtEp.ReplayGraph has unexpected offset % instead of 152", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEp.ReplayGraph has unexpected size % instead of 8", it.type.runtime_size); case "GetGraphCaptureNodeAssignmentPolicy"; assert(it.offset_in_bytes == 160, "OrtEp.GetGraphCaptureNodeAssignmentPolicy has unexpected offset % instead of 160", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEp.GetGraphCaptureNodeAssignmentPolicy has unexpected size % instead of 8", it.type.runtime_size); case "GetAvailableResource"; assert(it.offset_in_bytes == 168, "OrtEp.GetAvailableResource has unexpected offset % instead of 168", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEp.GetAvailableResource has unexpected size % instead of 8", it.type.runtime_size); case "OnSessionInitializationEnd"; assert(it.offset_in_bytes == 176, "OrtEp.OnSessionInitializationEnd has unexpected offset % instead of 176", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEp.OnSessionInitializationEnd has unexpected size % instead of 8", it.type.runtime_size); case "GetDefaultMemoryDevice"; assert(it.offset_in_bytes == 184, "OrtEp.GetDefaultMemoryDevice has unexpected offset % instead of 184", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEp.GetDefaultMemoryDevice has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseCapturedGraph"; assert(it.offset_in_bytes == 192, "OrtEp.ReleaseCapturedGraph has unexpected offset % instead of 192", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEp.ReleaseCapturedGraph has unexpected size % instead of 8", it.type.runtime_size); case "GetWeightlessSupport"; assert(it.offset_in_bytes == 200, "OrtEp.GetWeightlessSupport has unexpected offset % instead of 200", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEp.GetWeightlessSupport has unexpected size % instead of 8", it.type.runtime_size); } } assert(size_of(OrtEp) == 208, "OrtEp has size % instead of 208", size_of(OrtEp)); } { info := type_info(OrtEpFactory); for info.members { if it.name == { case "ort_version_supported"; assert(it.offset_in_bytes == 0, "OrtEpFactory.ort_version_supported has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 4, "OrtEpFactory.ort_version_supported has unexpected size % instead of 4", it.type.runtime_size); case "GetName"; assert(it.offset_in_bytes == 8, "OrtEpFactory.GetName has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpFactory.GetName has unexpected size % instead of 8", it.type.runtime_size); case "GetVendor"; assert(it.offset_in_bytes == 16, "OrtEpFactory.GetVendor has unexpected offset % instead of 16", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpFactory.GetVendor has unexpected size % instead of 8", it.type.runtime_size); case "GetSupportedDevices"; assert(it.offset_in_bytes == 24, "OrtEpFactory.GetSupportedDevices has unexpected offset % instead of 24", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpFactory.GetSupportedDevices has unexpected size % instead of 8", it.type.runtime_size); case "CreateEp"; assert(it.offset_in_bytes == 32, "OrtEpFactory.CreateEp has unexpected offset % instead of 32", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpFactory.CreateEp has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseEp"; assert(it.offset_in_bytes == 40, "OrtEpFactory.ReleaseEp has unexpected offset % instead of 40", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpFactory.ReleaseEp has unexpected size % instead of 8", it.type.runtime_size); case "GetVendorId"; assert(it.offset_in_bytes == 48, "OrtEpFactory.GetVendorId has unexpected offset % instead of 48", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpFactory.GetVendorId has unexpected size % instead of 8", it.type.runtime_size); case "GetVersion"; assert(it.offset_in_bytes == 56, "OrtEpFactory.GetVersion has unexpected offset % instead of 56", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpFactory.GetVersion has unexpected size % instead of 8", it.type.runtime_size); case "ValidateCompiledModelCompatibilityInfo"; assert(it.offset_in_bytes == 64, "OrtEpFactory.ValidateCompiledModelCompatibilityInfo has unexpected offset % instead of 64", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpFactory.ValidateCompiledModelCompatibilityInfo has unexpected size % instead of 8", it.type.runtime_size); case "CreateAllocator"; assert(it.offset_in_bytes == 72, "OrtEpFactory.CreateAllocator has unexpected offset % instead of 72", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpFactory.CreateAllocator has unexpected size % instead of 8", it.type.runtime_size); case "ReleaseAllocator"; assert(it.offset_in_bytes == 80, "OrtEpFactory.ReleaseAllocator has unexpected offset % instead of 80", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpFactory.ReleaseAllocator has unexpected size % instead of 8", it.type.runtime_size); case "CreateDataTransfer"; assert(it.offset_in_bytes == 88, "OrtEpFactory.CreateDataTransfer has unexpected offset % instead of 88", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpFactory.CreateDataTransfer has unexpected size % instead of 8", it.type.runtime_size); case "IsStreamAware"; assert(it.offset_in_bytes == 96, "OrtEpFactory.IsStreamAware has unexpected offset % instead of 96", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpFactory.IsStreamAware has unexpected size % instead of 8", it.type.runtime_size); case "CreateSyncStreamForDevice"; assert(it.offset_in_bytes == 104, "OrtEpFactory.CreateSyncStreamForDevice has unexpected offset % instead of 104", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpFactory.CreateSyncStreamForDevice has unexpected size % instead of 8", it.type.runtime_size); case "GetHardwareDeviceIncompatibilityDetails"; assert(it.offset_in_bytes == 112, "OrtEpFactory.GetHardwareDeviceIncompatibilityDetails has unexpected offset % instead of 112", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpFactory.GetHardwareDeviceIncompatibilityDetails has unexpected size % instead of 8", it.type.runtime_size); case "CreateExternalResourceImporterForDevice"; assert(it.offset_in_bytes == 120, "OrtEpFactory.CreateExternalResourceImporterForDevice has unexpected offset % instead of 120", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpFactory.CreateExternalResourceImporterForDevice has unexpected size % instead of 8", it.type.runtime_size); case "GetNumCustomOpDomains"; assert(it.offset_in_bytes == 128, "OrtEpFactory.GetNumCustomOpDomains has unexpected offset % instead of 128", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpFactory.GetNumCustomOpDomains has unexpected size % instead of 8", it.type.runtime_size); case "GetCustomOpDomains"; assert(it.offset_in_bytes == 136, "OrtEpFactory.GetCustomOpDomains has unexpected offset % instead of 136", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpFactory.GetCustomOpDomains has unexpected size % instead of 8", it.type.runtime_size); case "InitGraphicsInterop"; assert(it.offset_in_bytes == 144, "OrtEpFactory.InitGraphicsInterop has unexpected offset % instead of 144", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpFactory.InitGraphicsInterop has unexpected size % instead of 8", it.type.runtime_size); case "DeinitGraphicsInterop"; assert(it.offset_in_bytes == 152, "OrtEpFactory.DeinitGraphicsInterop has unexpected offset % instead of 152", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpFactory.DeinitGraphicsInterop has unexpected size % instead of 8", it.type.runtime_size); case "SelectBestModelCandidate"; assert(it.offset_in_bytes == 160, "OrtEpFactory.SelectBestModelCandidate has unexpected offset % instead of 160", it.offset_in_bytes); assert(it.type.runtime_size == 8, "OrtEpFactory.SelectBestModelCandidate has unexpected size % instead of 8", it.type.runtime_size); } } assert(size_of(OrtEpFactory) == 168, "OrtEpFactory has size % instead of 168", size_of(OrtEpFactory)); } }