Skip to content

Commit 2e07de9

Browse files
committed
Add ONNX. Don't use it yet since Mac and Linux builds aren't ready.
1 parent 1fc2de3 commit 2e07de9

15 files changed

+6467
-2
lines changed

3rdParty/ONNX/OnnxToolsPA.h

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/* Simple Integer Option
2+
*
3+
* From: https://github.com/PokemonAutomation/
4+
*
5+
* This option is thread-safe.
6+
*
7+
*/
8+
9+
#ifndef PokemonAutomation_3rdParty_OnnxToolsPA_H
10+
#define PokemonAutomation_3rdParty_OnnxToolsPA_H
11+
12+
#include <string>
13+
#include <onnxruntime_c_api.h>
14+
#include "Common/Cpp/Unicode.h"
15+
16+
namespace PokemonAutomation{
17+
18+
#ifdef _WIN32
19+
20+
inline std::wstring str_to_onnx_str(const std::string& str){
21+
return utf8_to_wstr(str);
22+
}
23+
24+
25+
#else
26+
27+
28+
inline std::string str_to_onnx_str(std::string str){
29+
return std::move(str);
30+
}
31+
32+
33+
#endif
34+
35+
36+
37+
}
38+
#endif

3rdParty/ONNX/cpu_provider_factory.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
#include "onnxruntime_c_api.h"
5+
6+
#ifdef __cplusplus
7+
extern "C" {
8+
#endif
9+
10+
/**
11+
* \param use_arena zero: false. non-zero: true.
12+
*/
13+
ORT_EXPORT
14+
ORT_API_STATUS(OrtSessionOptionsAppendExecutionProvider_CPU, _In_ OrtSessionOptions* options, int use_arena)
15+
ORT_ALL_ARGS_NONNULL;
16+
17+
#ifdef __cplusplus
18+
}
19+
#endif

0 commit comments

Comments
 (0)