Skip to content

Commit 80f9953

Browse files
committed
fix build issue
1 parent 3fabc2f commit 80f9953

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

include/onnxruntime/core/session/onnxruntime_c_api.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6678,6 +6678,7 @@ struct OrtApi {
66786678
*/
66796679
ORT_API2_STATUS(KernelInfo_GetOperatorSinceVersion, _In_ const OrtKernelInfo* info,
66806680
_Out_ int* since_version);
6681+
66816682
/** \brief Get the list of available hardware devices.
66826683
*
66836684
* Enumerates hardware devices available on the system. Device discovery results

onnxruntime/core/session/onnxruntime_c_api.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4327,6 +4327,7 @@ DEFINE_RELEASE_ORT_OBJECT_FUNCTION(ModelMetadata, ::onnxruntime::ModelMetadata)
43274327

43284328
ORT_API_STATUS_IMPL(OrtApis::GetOrtHardwareDevices, _In_ const OrtEnv* env, _Outptr_ const OrtHardwareDevice* const** devices, _Out_ size_t* num_devices) {
43294329
API_IMPL_BEGIN
4330+
#if !defined(ORT_MINIMAL_BUILD)
43304331
if (env == nullptr) {
43314332
return OrtApis::CreateStatus(ORT_INVALID_ARGUMENT, "env must not be null");
43324333
}
@@ -4338,6 +4339,12 @@ ORT_API_STATUS_IMPL(OrtApis::GetOrtHardwareDevices, _In_ const OrtEnv* env, _Out
43384339
*devices = device_vector.data();
43394340
*num_devices = device_vector.size();
43404341
return nullptr;
4342+
#else
4343+
ORT_UNUSED_PARAMETER(env);
4344+
ORT_UNUSED_PARAMETER(devices);
4345+
ORT_UNUSED_PARAMETER(num_devices);
4346+
return OrtApis::CreateStatus(ORT_NOT_IMPLEMENTED, "GetOrtHardwareDevices is not available in minimal build");
4347+
#endif
43414348
API_IMPL_END
43424349
}
43434350

0 commit comments

Comments
 (0)