Remove onnxruntime_session_options_config_keys.h from c_api (#5772)

* Remove seesion config keys header from c_api

* remove copy session config header in release package

* Keep the session option config header in the package
This commit is contained in:
Guoyu Wang 2020-11-12 09:12:13 -08:00 committed by GitHub
parent 54de618c2e
commit dc0f7b8f82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 15 additions and 11 deletions

View file

@ -5,7 +5,6 @@
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include "onnxruntime_session_options_config_keys.h"
// This value is used in structures passed to ORT so that a newer version of ORT will still work with them
#define ORT_API_VERSION 5
@ -1084,7 +1083,7 @@ struct OrtApi {
* Creates a custom environment with global threadpools and logger that will be shared across sessions.
* Use this in conjunction with DisablePerSessionThreads API or else the session will use
* its own thread pools.
*
*
* \param out should be freed by `OrtReleaseEnv` after use
*/
ORT_API2_STATUS(CreateEnvWithCustomLoggerAndGlobalThreadPools, OrtLoggingFunction logging_function, _In_opt_ void* logger_param, OrtLoggingLevel logging_level,

View file

@ -15,6 +15,7 @@
#include "core/framework/session_state_utils.h"
#include "core/framework/utils.h"
#include "core/providers/cpu/controlflow/utils.h"
#include "core/session/onnxruntime_session_options_config_keys.h"
using namespace ::onnxruntime::common;
using namespace ::onnxruntime::experimental;

View file

@ -46,6 +46,7 @@
#include "core/session/environment.h"
#include "core/session/IOBinding.h"
#include "core/session/inference_session_utils.h"
#include "core/session/onnxruntime_session_options_config_keys.h"
#include "core/util/protobuf_parsing_utils.h"
#include "core/util/thread_utils.h"

View file

@ -36,6 +36,7 @@
#include "core/session/IOBinding.h"
#include "core/session/device_allocator.h"
#include "core/session/allocator_impl.h"
#include "core/session/onnxruntime_session_options_config_keys.h"
#include "dummy_provider.h"
#include "test_utils.h"
#include "test/capturing_sink.h"

View file

@ -8,6 +8,7 @@
#include "core/framework/tensorprotoutils.h"
#include "core/graph/onnx_protobuf.h"
#include "core/session/inference_session.h"
#include "core/session/onnxruntime_session_options_config_keys.h"
#include "core/graph/model.h"
#include "test/test_environment.h"
#include "test_utils.h"
@ -237,7 +238,6 @@ static void DumpOrtModelAsJson(const std::string& model_uri) {
}
*/
TEST(OrtModelOnlyTests, SerializeToOrtFormat) {
const std::basic_string<ORTCHAR_T> ort_file = ORT_TSTR("ort_github_issue_4031.onnx.ort");
SaveAndCompareModels("testdata/ort_github_issue_4031.onnx", ort_file);

View file

@ -3,6 +3,7 @@
#include <iostream>
#include "asserts.h"
#include "core/framework/execution_providers.h"
#include "core/framework/graph_partitioner.h"
#include "core/framework/kernel_registry.h"
@ -12,9 +13,9 @@
#include "core/graph/graph_viewer.h"
#include "core/graph/model.h"
#include "core/graph/op.h"
#include "core/util/thread_utils.h"
#include "core/providers/cpu/cpu_execution_provider.h"
#include "asserts.h"
#include "core/session/onnxruntime_session_options_config_keys.h"
#include "core/util/thread_utils.h"
#include "gtest/gtest.h"
#include "test/test_environment.h"

View file

@ -19,6 +19,7 @@
#include "core/session/onnxruntime_cxx_api.h"
#include "core/optimizer/graph_transformer_level.h"
#include "core/framework/session_options.h"
#include "core/session/onnxruntime_session_options_config_keys.h"
using namespace onnxruntime;
@ -287,8 +288,7 @@ int real_main(int argc, char* argv[], Ort::Env& env) {
double per_sample_tolerance = 1e-3;
// when cuda is enabled, set it to a larger value for resolving random MNIST test failure
// when openvino is enabled, set it to a larger value for resolving MNIST accuracy mismatch
double relative_per_sample_tolerance = enable_cuda ? 0.017 : enable_openvino ? 0.009
: 1e-3;
double relative_per_sample_tolerance = enable_cuda ? 0.017 : enable_openvino ? 0.009 : 1e-3;
Ort::SessionOptions sf;

View file

@ -1,5 +1,6 @@
#include "ort_test_session.h"
#include <core/session/onnxruntime_cxx_api.h>
#include "core/session/onnxruntime_session_options_config_keys.h"
#include <assert.h>
#include "providers.h"
#include "TestCase.h"
@ -51,9 +52,8 @@ OnnxRuntimeTestSession::OnnxRuntimeTestSession(Ort::Env& env, std::random_device
static_cast<OrtCudnnConvAlgoSearch>(performance_test_config.run_config.cudnn_conv_algo),
std::numeric_limits<size_t>::max(),
0,
!performance_test_config.run_config.do_cuda_copy_in_separate_stream
};
Ort::ThrowOnError(session_options.OrtSessionOptionsAppendExecutionProvider_CUDA(session_options, &cuda_options));
!performance_test_config.run_config.do_cuda_copy_in_separate_stream};
Ort::ThrowOnError(session_options.OrtSessionOptionsAppendExecutionProvider_CUDA(session_options, &cuda_options));
#else
ORT_THROW("CUDA is not supported in this build\n");
#endif

View file

@ -4,6 +4,7 @@
#include <core/common/make_unique.h>
#include "core/session/onnxruntime_c_api.h"
#include "core/session/onnxruntime_cxx_api.h"
#include "core/session/onnxruntime_session_options_config_keys.h"
#include "core/graph/constants.h"
#include "providers.h"
#include <memory>
@ -839,7 +840,7 @@ TEST(CApiTest, create_tensor_with_data_bfloat16) {
TEST(CApiTest, access_tensor_data_elements) {
/**
* Create a 2x3 data blob that looks like:
*
*
* 0 1 2
* 3 4 5
*/