Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* The maximum length of the Config Key is 1024
*
* The string format of a SessionOptions Config Value is defined individually for each Config.
* The maximum length of the Config Value is 2048
* The maximum length of the Config Value is 8192
*/

// Key for disable PrePacking,
Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/core/framework/config_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct ConfigOptions {
// Maximum key/value string lengths specified in
// core/session/onnxruntime_session_options_config_keys.h
static constexpr size_t kMaxKeyLength = 1024;
static constexpr size_t kMaxValueLength = 4096;
static constexpr size_t kMaxValueLength = 8192;

std::unordered_map<std::string, std::string> configurations;

Expand Down
3 changes: 2 additions & 1 deletion onnxruntime/test/shared_lib/test_session_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT License.

#include "core/common/common.h"
#include "core/framework/config_options.h"
#include "core/graph/constants.h"
#include "core/session/onnxruntime_cxx_api.h"
#include "core/session/onnxruntime_session_options_config_keys.h"
Expand All @@ -25,7 +26,7 @@ TEST(CApiTest, session_options_deterministic_compute) {

TEST(CApiTest, session_options_oversized_affinity_string) {
Ort::SessionOptions options;
std::string long_affinity_str(onnxruntime::kMaxStrLen + 1, '0');
std::string long_affinity_str(ConfigOptions::kMaxValueLength + 1, '0');
try {
options.AddConfigEntry(kOrtSessionOptionsConfigIntraOpThreadAffinities, long_affinity_str.c_str());
ASSERT_TRUE(false) << "Creation of config should have thrown exception";
Expand Down
Loading