#pragma once #include "Env.h" #include "EpContextDataReadCallback.h" #include #include #include "onnxruntime_cxx_api.h" #include namespace onnxruntimejsi { extern const std::vector supportedBackends; /** * @brief Parse the JavaScript session options into `sessionOptions`. * * Must be called on the JS thread. When the options register an `epContextDataRead` callback, * `epContextDataRead` receives the state that backs it; the caller must keep that state alive for * at least as long as the session created from `sessionOptions`. */ void parseSessionOptions(facebook::jsi::Runtime& runtime, const facebook::jsi::Value& optionsValue, Ort::SessionOptions& sessionOptions, const std::shared_ptr& env, std::shared_ptr& epContextDataRead); void parseRunOptions(facebook::jsi::Runtime& runtime, const facebook::jsi::Value& optionsValue, Ort::RunOptions& runOptions); } // namespace onnxruntimejsi