mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-06 00:03:22 +00:00
Add support for BrainSlice execution provider in Python, if onnxruntime is built with it.
This commit is contained in:
parent
10b113f144
commit
24d80b4bda
1 changed files with 11 additions and 1 deletions
|
|
@ -58,6 +58,9 @@
|
|||
#ifdef USE_NUPHAR
|
||||
#include "core/providers/nuphar/nuphar_provider_factory.h"
|
||||
#endif
|
||||
#ifdef USE_BRAINSLICE
|
||||
#include "core/providers/brainslice/brainslice_provider_factory.h"
|
||||
#endif
|
||||
|
||||
namespace onnxruntime {
|
||||
std::shared_ptr<IExecutionProviderFactory> CreateExecutionProviderFactory_CPU(int use_arena);
|
||||
|
|
@ -65,7 +68,7 @@ std::shared_ptr<IExecutionProviderFactory> CreateExecutionProviderFactory_CUDA(i
|
|||
std::shared_ptr<IExecutionProviderFactory> CreateExecutionProviderFactory_Tensorrt();
|
||||
std::shared_ptr<IExecutionProviderFactory> CreateExecutionProviderFactory_Mkldnn(int use_arena);
|
||||
std::shared_ptr<IExecutionProviderFactory> CreateExecutionProviderFactory_Nuphar(int device_id, const char*);
|
||||
std::shared_ptr<IExecutionProviderFactory> CreateExecutionProviderFactory_BrainSlice(int ip, int, int, bool, const char*, const char*, const char*);
|
||||
std::shared_ptr<IExecutionProviderFactory> CreateExecutionProviderFactory_BrainSlice(uint32_t ip, int, int, bool, const char*, const char*, const char*);
|
||||
} // namespace onnxruntime
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
|
|
@ -215,12 +218,19 @@ void InitializeSession(InferenceSession* sess) {
|
|||
RegisterExecutionProvider(sess, *onnxruntime::CreateExecutionProviderFactory_Mkldnn(enable_cpu_mem_arena ? 1 : 0));
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0 //USE_NUPHAR
|
||||
{
|
||||
RegisterExecutionProvider(sess, *onnxruntime::CreateExecutionProviderFactory_Nuphar(0, ""));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_BRAINSLICE
|
||||
{
|
||||
RegisterExecutionProvider(sess, *onnxruntime::CreateExecutionProviderFactory_BrainSlice(0, -1, -1, false, "", "", ""));
|
||||
}
|
||||
#endif
|
||||
|
||||
status = sess->Initialize();
|
||||
if (!status.IsOK()) {
|
||||
throw std::runtime_error(status.ToString().c_str());
|
||||
|
|
|
|||
Loading…
Reference in a new issue