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
11 changes: 7 additions & 4 deletions backends/qualcomm/runtime/backends/QnnProfiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ QnnProfile::QnnProfile(
QnnProfile_Level_t qnnProfileLevel = 0;
if (profile_level == QnnExecuTorchProfileLevel::kProfileBasic) {
qnnProfileLevel = QNN_PROFILE_LEVEL_BASIC;
} else if (profile_level == QnnExecuTorchProfileLevel::kProfileDetailed
|| profile_level == QnnExecuTorchProfileLevel::kProfileOptrace) {
} else if (
profile_level == QnnExecuTorchProfileLevel::kProfileDetailed ||
profile_level == QnnExecuTorchProfileLevel::kProfileOptrace) {
qnnProfileLevel = QNN_PROFILE_LEVEL_DETAILED;
} else {
QNN_EXECUTORCH_LOG_WARN("Invalid profile level");
Expand All @@ -46,15 +47,17 @@ QnnProfile::QnnProfile(

if (profile_level == QnnExecuTorchProfileLevel::kProfileOptrace) {
if (handle_ == nullptr) {
QNN_EXECUTORCH_LOG_WARN("Prfoile handle is null, cannot enable optrace");
QNN_EXECUTORCH_LOG_WARN(
"Prfoile handle is null, cannot enable optrace");
return;
}

QnnProfile_Config_t qnnProfileConfig = QNN_PROFILE_CONFIG_INIT;
qnnProfileConfig.option = QNN_PROFILE_CONFIG_OPTION_ENABLE_OPTRACE;
std::array<const QnnProfile_Config_t*, 2> profileConfigs = {
&qnnProfileConfig, nullptr};
error = qnn_interface.qnn_profile_set_config(handle_, profileConfigs.data());
error =
qnn_interface.qnn_profile_set_config(handle_, profileConfigs.data());

if (error != QNN_SUCCESS) {
QNN_EXECUTORCH_LOG_WARN(
Expand Down
4 changes: 1 addition & 3 deletions backends/qualcomm/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -833,9 +833,7 @@ def generate_qnn_executorch_compiler_spec(
qnn_executorch_options.library_path = "libQnnSaver.so"

if optrace:
qnn_executorch_options.profile_level = (
QnnExecuTorchProfileLevel.kProfileOptrace
)
qnn_executorch_options.profile_level = QnnExecuTorchProfileLevel.kProfileOptrace
elif profile:
qnn_executorch_options.profile_level = (
QnnExecuTorchProfileLevel.kProfileDetailed
Expand Down
Loading