mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-02 03:55:34 +00:00
Miscellaneous cleanups (#23048)
### Description <!-- Describe your changes. --> - fix some missing end of version markers and since_version info - fix include to use onnx_protobuf.h which handles minimal builds - we should always prefer that header over directly using the onnx ones ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. -->
This commit is contained in:
parent
22ae97c7dc
commit
2f2c73bdde
3 changed files with 32 additions and 7 deletions
|
|
@ -4615,6 +4615,8 @@ struct OrtApi {
|
|||
* \param[in] num_keys
|
||||
*
|
||||
* \snippet{doc} snippets.dox OrtStatus Return Value
|
||||
*
|
||||
* \since Version 1.17.
|
||||
*/
|
||||
ORT_API2_STATUS(SessionOptionsAppendExecutionProvider_OpenVINO_V2,
|
||||
_In_ OrtSessionOptions* options,
|
||||
|
|
@ -4632,6 +4634,8 @@ struct OrtApi {
|
|||
* \param[in] num_keys
|
||||
*
|
||||
* \snippet{doc} snippets.dox OrtStatus Return Value
|
||||
*
|
||||
* \since Version 1.18.
|
||||
*/
|
||||
ORT_API2_STATUS(SessionOptionsAppendExecutionProvider_VitisAI,
|
||||
_In_ OrtSessionOptions* options,
|
||||
|
|
@ -4645,7 +4649,10 @@ struct OrtApi {
|
|||
* \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 scrach buffer
|
||||
*
|
||||
* \snippet{doc} snippets.dox OrtStatus Return Value
|
||||
*
|
||||
* \since Version 1.18.
|
||||
*/
|
||||
ORT_API2_STATUS(KernelContext_GetScratchBuffer, _In_ const OrtKernelContext* context, _In_ const OrtMemoryInfo* mem_info, _In_ size_t count_or_bytes, _Outptr_ void** out);
|
||||
|
||||
|
|
@ -4656,6 +4663,8 @@ struct OrtApi {
|
|||
* \param[out] out A pointer to OrtAllocator
|
||||
*
|
||||
* \snippet{doc} snippets.dox OrtStatus Return Value
|
||||
*
|
||||
* \since Version 1.18.
|
||||
*/
|
||||
ORT_API2_STATUS(KernelInfoGetAllocator, _In_ const OrtKernelInfo* info, _In_ OrtMemType mem_type, _Outptr_ OrtAllocator** out);
|
||||
|
||||
|
|
@ -4677,6 +4686,8 @@ struct OrtApi {
|
|||
* \param[in] num_external_initializer_files Number of external files
|
||||
*
|
||||
* \snippet{doc} snippets.dox OrtStatus Return Value
|
||||
*
|
||||
* \since Version 1.18.
|
||||
*/
|
||||
ORT_API2_STATUS(AddExternalInitializersFromFilesInMemory, _In_ OrtSessionOptions* options,
|
||||
_In_reads_(num_external_initializer_files) const ORTCHAR_T* const* external_initializer_file_names,
|
||||
|
|
@ -4699,6 +4710,8 @@ struct OrtApi {
|
|||
* OrtApi::ReleaseLoraAdapter.
|
||||
*
|
||||
* \snippet{doc} snippets.dox OrtStatus Return Value
|
||||
*
|
||||
* \since Version 1.20.
|
||||
*/
|
||||
ORT_API2_STATUS(CreateLoraAdapter, const ORTCHAR_T* adapter_file_path, _In_ OrtAllocator* allocator,
|
||||
_Outptr_ OrtLoraAdapter** out);
|
||||
|
|
@ -4717,6 +4730,8 @@ struct OrtApi {
|
|||
* OrtApi::ReleaseLoraAdapter.
|
||||
*
|
||||
* \snippet{doc} snippets.dox OrtStatus Return Value
|
||||
*
|
||||
* \since Version 1.20.
|
||||
*/
|
||||
ORT_API2_STATUS(CreateLoraAdapterFromArray, _In_ const void* bytes, size_t num_bytes, _In_ OrtAllocator* allocator,
|
||||
_Outptr_ OrtLoraAdapter** out);
|
||||
|
|
@ -4738,6 +4753,8 @@ struct OrtApi {
|
|||
* \param[in] adapter OrtLoraAdapter instance
|
||||
*
|
||||
* \snippet{doc} snippets.dox OrtStatus Return Value
|
||||
*
|
||||
* \since Version 1.20.
|
||||
*/
|
||||
ORT_API2_STATUS(RunOptionsAddActiveLoraAdapter, _Inout_ OrtRunOptions* options, _In_ const OrtLoraAdapter* adapter);
|
||||
|
||||
|
|
@ -4756,6 +4773,8 @@ struct OrtApi {
|
|||
* \param[in] kv_len Number of elements in the keys and values arrays
|
||||
*
|
||||
* \snippet{doc} snippets.dox OrtStatus Return Value
|
||||
*
|
||||
* \since Version 1.20.
|
||||
*/
|
||||
ORT_API2_STATUS(SetEpDynamicOptions, _Inout_ OrtSession* sess, _In_reads_(kv_len) const char* const* keys,
|
||||
_In_reads_(kv_len) const char* const* values, _In_ size_t kv_len);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#include "core/graph/constants.h"
|
||||
#include "core/graph/contrib_ops/contrib_defs.h"
|
||||
#include "core/graph/contrib_ops/shape_inference_functions.h"
|
||||
#include "onnx/onnx-ml.pb.h" // ?
|
||||
#include "core/graph/onnx_protobuf.h"
|
||||
|
||||
// Suppress a warning: global initializer calls a non-constexpr function 'symbol' which is from
|
||||
// ONNX_OPERATOR_SET_SCHEMA_EX macro and only happens in debug build
|
||||
|
|
@ -23,7 +23,7 @@ void convTransposeShapeInference(InferenceContext& ctx);
|
|||
void convPoolShapeInference(ONNX_NAMESPACE::InferenceContext& ctx, bool use_dilation, bool require_kernel_shape,
|
||||
int input1Idx, int input2Idx);
|
||||
namespace defs::math::utils {
|
||||
void MatMulShapeInference(ONNX_NAMESPACE::InferenceContext& ctx, int input1Idx, int input2Idx);
|
||||
void MatMulShapeInference(ONNX_NAMESPACE::InferenceContext& ctx, int input1Idx, int input2Idx);
|
||||
}
|
||||
|
||||
} // namespace ONNX_NAMESPACE
|
||||
|
|
@ -822,10 +822,10 @@ ONNX_MS_OPERATOR_SET_SCHEMA(
|
|||
}
|
||||
}
|
||||
|
||||
if (all_lengths_known) {
|
||||
output_shape->mutable_dim(axis)->set_dim_value(total_length);
|
||||
}
|
||||
}));
|
||||
if (all_lengths_known) {
|
||||
output_shape->mutable_dim(axis)->set_dim_value(total_length);
|
||||
}
|
||||
}));
|
||||
|
||||
ONNX_MS_OPERATOR_SET_SCHEMA(QLinearWhere, 1, OpSchema()
|
||||
.SetDoc("Return elements, either from X or Y, depending on condition.")
|
||||
|
|
@ -955,7 +955,8 @@ ONNX_MS_OPERATOR_SET_SCHEMA(
|
|||
AttributeProto::INT, static_cast<int64_t>(0))
|
||||
.Attr("do_rotary", "Whether to use rotary position embedding. Default value is 0.",
|
||||
AttributeProto::INT, OPTIONAL_VALUE)
|
||||
.Attr("past_present_share_buffer", "Corresponding past and present are same tensor, its shape is "
|
||||
.Attr("past_present_share_buffer",
|
||||
"Corresponding past and present are same tensor, its shape is "
|
||||
"(2, batch_size, num_heads, max_sequence_length, head_size)",
|
||||
AttributeProto::INT, OPTIONAL_VALUE)
|
||||
.Attr("mask_filter_value",
|
||||
|
|
|
|||
|
|
@ -2803,12 +2803,15 @@ static constexpr OrtApi ort_api_1_to_21 = {
|
|||
&OrtApis::KernelInfoGetAllocator,
|
||||
&OrtApis::AddExternalInitializersFromFilesInMemory,
|
||||
// End of Version 18 - DO NOT MODIFY ABOVE (see above text for more information)
|
||||
// End of Version 19 - DO NOT MODIFY ABOVE (see above text for more information)
|
||||
|
||||
&OrtApis::CreateLoraAdapter,
|
||||
&OrtApis::CreateLoraAdapterFromArray,
|
||||
&OrtApis::ReleaseLoraAdapter,
|
||||
&OrtApis::RunOptionsAddActiveLoraAdapter,
|
||||
|
||||
&OrtApis::SetEpDynamicOptions,
|
||||
// End of Version 20 - DO NOT MODIFY ABOVE (see above text for more information)
|
||||
};
|
||||
|
||||
// OrtApiBase can never change as there is no way to know what version of OrtApiBase is returned by OrtGetApiBase.
|
||||
|
|
@ -2840,6 +2843,8 @@ static_assert(offsetof(OrtApi, GetBuildInfoString) / sizeof(void*) == 254, "Size
|
|||
static_assert(offsetof(OrtApi, KernelContext_GetResource) / sizeof(void*) == 265, "Size of version 16 API cannot change");
|
||||
static_assert(offsetof(OrtApi, SessionOptionsAppendExecutionProvider_OpenVINO_V2) / sizeof(void*) == 275, "Size of version 17 API cannot change");
|
||||
static_assert(offsetof(OrtApi, AddExternalInitializersFromFilesInMemory) / sizeof(void*) == 279, "Size of version 18 API cannot change");
|
||||
// no additions in version 19
|
||||
static_assert(offsetof(OrtApi, SetEpDynamicOptions) / sizeof(void*) == 284, "Size of version 20 API cannot change");
|
||||
|
||||
// So that nobody forgets to finish an API version, this check will serve as a reminder:
|
||||
static_assert(std::string_view(ORT_VERSION) == "1.21.0",
|
||||
|
|
|
|||
Loading…
Reference in a new issue