Fix minor TRT EP provider option issue (#16107)

Several TRT EP provider options are not included when calling
OrtApis::GetTensorRTProviderOptionsAsString().
This issue doesn't affect TRT EP, but when user calling above api to get
all the provider options will find some provider options not included in
the string.
This commit is contained in:
Chi Lo 2023-06-16 10:07:40 -07:00 committed by GitHub
parent 4915191e63
commit fbf08c4b4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -139,6 +139,10 @@ ProviderOptions TensorrtExecutionProviderInfo::ToProviderOptions(const OrtTensor
const std::string kCachePath_ = empty_if_null(info.trt_engine_cache_path);
const std::string kTacticSources_ = empty_if_null(info.trt_tactic_sources);
const std::string kDecryptionLibPath_ = empty_if_null(info.trt_engine_decryption_lib_path);
const std::string kExtraPluginLibPaths_ = empty_if_null(info.trt_extra_plugin_lib_paths);
const std::string kProfilesMinShapes_ = empty_if_null(info.trt_profile_min_shapes);
const std::string kProfilesMaxShapes_ = empty_if_null(info.trt_profile_max_shapes);
const std::string kProfilesOptShapes_ = empty_if_null(info.trt_profile_opt_shapes);
const ProviderOptions options{
{tensorrt::provider_option_names::kDeviceId, MakeStringWithClassicLocale(info.device_id)},
@ -167,6 +171,10 @@ ProviderOptions TensorrtExecutionProviderInfo::ToProviderOptions(const OrtTensor
{tensorrt::provider_option_names::kBuilderOptimizationLevel, MakeStringWithClassicLocale(info.trt_builder_optimization_level)},
{tensorrt::provider_option_names::kAuxiliaryStreams, MakeStringWithClassicLocale(info.trt_auxiliary_streams)},
{tensorrt::provider_option_names::kTacticSources, kTacticSources_},
{tensorrt::provider_option_names::kExtraPluginLibPaths, kExtraPluginLibPaths_},
{tensorrt::provider_option_names::kProfilesMinShapes, kProfilesMinShapes_},
{tensorrt::provider_option_names::kProfilesMaxShapes, kProfilesMaxShapes_},
{tensorrt::provider_option_names::kProfilesOptShapes, kProfilesOptShapes_},
};
return options;
}