Skip to content
Merged

try fix #14246

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
22 changes: 19 additions & 3 deletions backends/qualcomm/runtime/QnnBackendOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,28 @@ T get_option(T aot_option) {
executorch::runtime::BackendOption backend_option;

if constexpr (std::is_same_v<T, QnnExecuTorchLogLevel>) {
backend_option = {QNN_RUNTIME_LOG_LEVEL, -1};
std::strncpy(
backend_option.key,
QNN_RUNTIME_LOG_LEVEL,
runtime::kMaxOptionKeyLength);
backend_option.key[runtime::kMaxOptionKeyLength - 1] = '\0';
backend_option.value = -1;
} else if constexpr (std::is_same_v<T, QnnExecuTorchHtpPerformanceMode>) {
backend_option = {QNN_RUNTIME_HTP_PERFORMANCE_MODE, -1};
std::strncpy(
backend_option.key,
QNN_RUNTIME_HTP_PERFORMANCE_MODE,
runtime::kMaxOptionKeyLength);
backend_option.key[runtime::kMaxOptionKeyLength - 1] = '\0';
backend_option.value = -1;
} else if constexpr (std::is_same_v<T, QnnExecuTorchProfileLevel>) {
backend_option = {QNN_RUNTIME_PROFILE_LEVEL, -1};
std::strncpy(
backend_option.key,
QNN_RUNTIME_PROFILE_LEVEL,
runtime::kMaxOptionKeyLength);
backend_option.key[runtime::kMaxOptionKeyLength - 1] = '\0';
backend_option.value = -1;
}

// This will call get_option under runtime backend interface
status = get_option(QNN_BACKEND, backend_option);

Expand Down
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,15 +478,13 @@ def run(self):
tmp_path = Path(tmpdir)
sdk_path = _download_qnn_sdk(dst_folder=tmp_path)

logging.info("sdk_path: ", sdk_path)
if not sdk_path:
raise RuntimeError(
"Qualcomm SDK not found, cannot build backend"
)

# Determine paths
prj_root = Path(__file__).parent.resolve()
logging.info("prj_root: ", prj_root)
build_sh = prj_root / "backends/qualcomm/scripts/build.sh"
build_root = prj_root / "build-x86"

Expand Down
Loading