Skip to content

Commit e6d3e08

Browse files
authored
Introduce new C++ API for C interfaces (microsoft#25762)
### Description <!-- Describe your changes. --> This PR provides C++ interfaces for the following: Env ==== CopyTensors() CreateSharedAllocator GetSharedAllocator ReleaseSharedAllocator CreateAndRegisterAllocatorV2 RegisterAllocator UnregisterAllocator EpDevice ====== EpDevice_MemoryInfo CreateSyncStreamForEpDevice MemoryInfo ======== CreateMemoryInfo_V2 MemoryInfoGetName MemoryInfoGetId MemoryInfoGetMemType MemoryInfoGetType MemoryInfoGetDeviceMemType MemoryInfoGetVendorId Session ========== SessionGetInputName SessionGetOutputName SessionGetMemoryInfoForInputs SessionGetMemoryInfoForOutputs SessionGetEpDeviceForInputs SyncStream =========== SyncStream_GetHandle ReleaseSyncStream OrtArenaCfg =========== CreateArenaCfgV2 TRT === CreateTensorRTProviderOptions and V2 UpdateTensorRTProviderOptions SessionOptions ============== OrtSessionOptionsAppendExecutionProvider_CPU Prepacked container ============= CUDA Options V2 =========== OrtCUDAProviderOptionsV2 CreateCUDAProviderOptions GetCUDAProviderOptionsByName UpdateCUDAProviderOptionsWithValue UpdateCUDAProviderOptions GetCUDAProviderOptionsAsString ### 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. --> Provide a way to write exception safe code.
1 parent 30f865a commit e6d3e08

File tree

22 files changed

+704
-616
lines changed

22 files changed

+704
-616
lines changed

include/onnxruntime/core/graph/indexed_sub_graph.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ struct IndexedSubGraph {
3131
std::string domain; ///< Domain of customized SubGraph/FunctionProto
3232
int since_version; ///< Since version of customized SubGraph/FunctionProto.
3333

34-
ONNX_NAMESPACE::OperatorStatus status; ///< Status of customized SubGraph/FunctionProto.
34+
ONNX_NAMESPACE::OperatorStatus status{ONNX_NAMESPACE::OperatorStatus::STABLE}; ///< Status of customized SubGraph/FunctionProto.
3535

3636
std::vector<std::string> inputs; ///< Inputs of customized SubGraph/FunctionProto.
3737
std::vector<std::string> outputs; ///< Outputs of customized SubGraph/FunctionProto.

include/onnxruntime/core/session/onnxruntime_c_api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5829,7 +5829,7 @@ struct OrtApi {
58295829
*
58305830
* \since Version 1.23.
58315831
*/
5832-
ORT_API2_STATUS(Graph_GetNodes, const OrtGraph* graph,
5832+
ORT_API2_STATUS(Graph_GetNodes, _In_ const OrtGraph* graph,
58335833
_Out_writes_(num_nodes) const OrtNode** nodes, _In_ size_t num_nodes);
58345834

58355835
/** \brief Get the parent node for the given graph, if any exists.

include/onnxruntime/core/session/onnxruntime_cxx_api.h

Lines changed: 210 additions & 102 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)