@@ -21,12 +21,24 @@ T get_option(T aot_option) {
2121 executorch::runtime::BackendOption backend_option;
2222
2323 if constexpr (std::is_same_v<T, QnnExecuTorchLogLevel>) {
24- backend_option = {QNN_RUNTIME_LOG_LEVEL, -1 };
24+ std::strncpy (
25+ backend_option.key , QNN_RUNTIME_LOG_LEVEL, kMaxOptionKeyLength );
26+ backend_option.key [kMaxOptionKeyLength - 1 ] = ' \0 ' ;
27+ backend_option.value = -1 ;
2528 } else if constexpr (std::is_same_v<T, QnnExecuTorchHtpPerformanceMode>) {
26- backend_option = {QNN_RUNTIME_HTP_PERFORMANCE_MODE, -1 };
29+ std::strncpy (
30+ backend_option.key ,
31+ QNN_RUNTIME_HTP_PERFORMANCE_MODE,
32+ kMaxOptionKeyLength );
33+ backend_option.key [kMaxOptionKeyLength - 1 ] = ' \0 ' ;
34+ backend_option.value = -1 ;
2735 } else if constexpr (std::is_same_v<T, QnnExecuTorchProfileLevel>) {
28- backend_option = {QNN_RUNTIME_PROFILE_LEVEL, -1 };
36+ std::strncpy (
37+ backend_option.key , QNN_RUNTIME_PROFILE_LEVEL, kMaxOptionKeyLength );
38+ backend_option.key [kMaxOptionKeyLength - 1 ] = ' \0 ' ;
39+ backend_option.value = -1 ;
2940 }
41+
3042 // This will call get_option under runtime backend interface
3143 status = get_option (QNN_BACKEND, backend_option);
3244
0 commit comments