microsoft/onnxruntime-extensions
Publicmirrored fromhttps://github.com/microsoft/onnxruntime-extensionsAvailable
include/onnxruntime_extensions.h
32lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 | // Licensed under the MIT License. |
| 3 | |
| 4 | // Note: The following include path is used for building Swift Package Manager support for ORT Extensions. |
| 5 | // The macro is defined in cxxSettings config in Package.swift. |
| 6 | // The reason why we need a prefix is that when Xcode includes the package it copies it to an internally generated path with |
| 7 | // the package name as a prefix. |
| 8 | // And we don't have control over the include paths when that happens in the user's iOS app. |
| 9 | // The only way we found to make the include path work automatically for now. |
| 10 | #ifdef ORT_SWIFT_PACKAGE_MANAGER_BUILD |
| 11 | #include "onnxruntime/onnxruntime_c_api.h" |
| 12 | #else |
| 13 | #include "onnxruntime_c_api.h" |
| 14 | #endif |
| 15 | |
| 16 | #ifdef __cplusplus |
| 17 | extern "C" { |
| 18 | #endif |
| 19 | |
| 20 | OrtStatus* |
| 21 | ORT_API_CALL RegisterCustomOps(OrtSessionOptions* options, const OrtApiBase* api); |
| 22 | |
| 23 | int |
| 24 | ORT_API_CALL GetActiveOrtAPIVersion(); |
| 25 | |
| 26 | #ifdef __cplusplus |
| 27 | } |
| 28 | #endif |
| 29 | |
| 30 | #if defined(ENABLE_C_API) |
| 31 | #include "ortx_tokenizer.h" |
| 32 | #endif // ENABLE_C_API |
| 33 | |