Skip to content

Commit f8d1e9b

Browse files
committed
Adding preprocessor define for checking CAN_USE_COREML8_OR_LATER
1 parent 2eb900a commit f8d1e9b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

onnxruntime/core/providers/coreml/model/host_utils.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@
4343
#define API_AVAILABLE_COREML7 API_AVAILABLE(macos(14), ios(17))
4444
#define API_AVAILABLE_COREML8 API_AVAILABLE(macos(15), ios(18))
4545

46+
// The previous macros are used in header files to declare the availability of the APIs.
47+
// The following macros are used in implementation files to check the availability of the APIs.
48+
#define CAN_USE_COREML8_OR_LATER (__MAC_OS_X_VERSION_MAX_ALLOWED >= 150000 && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180000)
49+
50+
4651
// @available is used in implementation code
4752
// Base required OS to run CoreML Specification Version 4 (Core ML 3)
4853
#define HAS_COREML3_OR_LATER @available(macOS 10.15, iOS 13, *)
@@ -52,6 +57,7 @@
5257
#define HAS_COREML7_OR_LATER @available(macOS 14, iOS 17, *)
5358
#define HAS_COREML8_OR_LATER @available(macOS 15, iOS 18, *)
5459

60+
5561
#endif
5662

5763
#define MINIMUM_COREML_VERSION 3 // first version we support

0 commit comments

Comments
 (0)