-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Labels
apiissues related to all other APIs: C, C++, Python, etc.issues related to all other APIs: C, C++, Python, etc.feature requestrequest for unsupported feature or enhancementrequest for unsupported feature or enhancement
Description
In ORT v1.12.0 the Ort::InitApi() is not defined noexcept.
I request it be noexcept so that it can be used easily in all code blocks including default constructors (which should be themselves noexcept and therefore cascades down).
Both ORT_API_MANUAL_INIT codepaths are already exception safe today in their code
Setup
<package id="Microsoft.ML.OnnxRuntime.DirectML" version="1.12.0" />- VS2019 community v16.11.18
Recommended code
in packages\Microsoft.ML.OnnxRuntime.DirectML.1.12.0\build\native\include\onnxruntime_cxx_api.h
inline void InitApi() { Global<void>::api_ = OrtGetApiBase()->GetApi(ORT_API_VERSION); }
// to
inline void InitApi() NO_EXCEPTION { Global<void>::api_ = OrtGetApiBase()->GetApi(ORT_API_VERSION); }Workaround
- private build
- try/catch wrapping
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
apiissues related to all other APIs: C, C++, Python, etc.issues related to all other APIs: C, C++, Python, etc.feature requestrequest for unsupported feature or enhancementrequest for unsupported feature or enhancement