Skip to content

Commit cc86dc1

Browse files
committed
try fix call site
1 parent 7d8430e commit cc86dc1

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

backends/qualcomm/runtime/QnnBackendOptions.cpp

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

runtime/backend/options.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@ struct BackendOption {
3232
char key[kMaxOptionKeyLength]{};
3333
// value is the value of the backend option, like 4, true, etc
3434
OptionValue value;
35-
36-
BackendOption(const char* k, OptionValue v) {
37-
strncpy(key, k, kMaxOptionKeyLength);
38-
key[kMaxOptionKeyLength - 1] = '\0'; // ensure null-termination
39-
value = v;
40-
}
4135
};
4236

4337
/**

0 commit comments

Comments
 (0)