Skip to content

Commit 612499b

Browse files
author
Hao-Wei Hsu
committed
[Apply latest review comment]
- change target logging to qnn_logging inside backends/qualcomm/CMakeList.txt - apply lintrunner to the left files
1 parent 7445cba commit 612499b

File tree

9 files changed

+41
-35
lines changed

9 files changed

+41
-35
lines changed

backends/qualcomm/CMakeLists.txt

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ get_filename_component(_common_include_directories
2323
ABSOLUTE)
2424

2525
if(NOT DEFINED QNN_SDK_ROOT)
26-
message(FATAL_ERROR "Please define QNN_SDK_ROOT, e.g., cmake <..> -DQNN_SDK_ROOT=<...>")
26+
message(FATAL_ERROR
27+
"Please define QNN_SDK_ROOT, e.g. cmake <..> -DQNN_SDK_ROOT=<...>")
2728
endif()
2829

2930
message(STATUS "Using qnn sdk root ${QNN_SDK_ROOT}")
@@ -82,7 +83,7 @@ add_library(qnn_graph STATIC)
8283
add_library(qnn_backend STATIC)
8384
add_library(qnn_factory STATIC)
8485
add_library(qnn_header INTERFACE)
85-
add_library(logging STATIC)
86+
add_library(qnn_logging STATIC)
8687
add_library(wrappers STATIC)
8788
add_library(utils STATIC)
8889

@@ -101,7 +102,7 @@ target_link_libraries(qnn_implementation
101102
PRIVATE
102103
qnn_function_interface
103104
qnn_header
104-
logging
105+
qnn_logging
105106
${CMAKE_DL_LIBS}
106107
)
107108
target_link_libraries(qnn_sys_function_interface
@@ -112,7 +113,7 @@ target_link_libraries(qnn_sys_implementation
112113
PRIVATE
113114
qnn_sys_function_interface
114115
qnn_header
115-
logging
116+
qnn_logging
116117
${CMAKE_DL_LIBS}
117118
)
118119
target_link_libraries(qnn_logger
@@ -210,7 +211,7 @@ if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
210211
pybind11::module
211212
pybind11::lto
212213
wrappers
213-
logging
214+
qnn_logging
214215
qnn_executorch_header
215216
)
216217

@@ -244,7 +245,11 @@ if(NOT CMAKE_TOOLCHAIN_FILE MATCHES ".*ios\.toolchain\.cmake$")
244245
${CMAKE_CURRENT_LIST_DIR}/executor_runner/qnn_executor_runner.cpp
245246
)
246247
add_executable(qnn_executor_runner ${_qnn_executor_runner__srcs})
247-
target_link_libraries(qnn_executor_runner ${_executor_runner_libs} qnn_executorch_backend gflags)
248+
target_link_libraries(qnn_executor_runner
249+
${_executor_runner_libs}
250+
qnn_executorch_backend
251+
gflags
252+
)
248253
target_compile_options(qnn_executor_runner PUBLIC ${_common_compile_options})
249254
endif()
250255

backends/qualcomm/runtime/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ target_sources(qnn_manager
3333
)
3434

3535
# logging
36-
target_sources(logging
36+
target_sources(qnn_logging
3737
PUBLIC
3838
${CMAKE_CURRENT_LIST_DIR}/Logging.h
3939
PRIVATE

backends/qualcomm/runtime/backends/CMakeLists.txt

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ target_sources(qnn_logger
4242
)
4343

4444
# qnn_device
45+
set(HOST_ARCHITECTURE
46+
${CMAKE_CURRENT_LIST_DIR}/htpbackend/${CMAKE_SYSTEM_PROCESSOR}
47+
)
48+
4549
target_sources(qnn_device
4650
PUBLIC
4751
${CMAKE_CURRENT_LIST_DIR}/QnnDeviceCommon.h
@@ -50,8 +54,9 @@ target_sources(qnn_device
5054
${CMAKE_CURRENT_LIST_DIR}/QnnDeviceCommon.cpp
5155
${CMAKE_CURRENT_LIST_DIR}/htpbackend/HtpDevice.cpp
5256
${CMAKE_CURRENT_LIST_DIR}/htpbackend/HtpDevicePlatformInfoConfig.h
53-
# When offline prepare context cache in x86 host, we have to provide platform infomation to Qnn
54-
${CMAKE_CURRENT_LIST_DIR}/htpbackend/${CMAKE_SYSTEM_PROCESSOR}/HtpDevicePlatformInfoConfig.cpp
57+
# When offline prepare context cache in x86 host
58+
# we have to provide platform infomation to Qnn
59+
${HOST_ARCHITECTURE}/HtpDevicePlatformInfoConfig.cpp
5560
)
5661

5762
# qnn_context
@@ -81,7 +86,7 @@ target_sources(qnn_graph
8186
${CMAKE_CURRENT_LIST_DIR}/htpbackend/HtpGraph.cpp
8287
${CMAKE_CURRENT_LIST_DIR}/htpbackend/HtpGraphCustomConfig.h
8388
# When preparation on x86 host, need to set graph config from Qnn Graph.
84-
${CMAKE_CURRENT_LIST_DIR}/htpbackend/${CMAKE_SYSTEM_PROCESSOR}/HtpGraphCustomConfig.cpp
89+
${HOST_ARCHITECTURE}/HtpGraphCustomConfig.cpp
8590
)
8691

8792
# qnn_backend
@@ -138,12 +143,14 @@ set(qnn_header_basenames
138143

139144
set(QNN_HEADER_DIR_DST
140145
${CMAKE_CURRENT_BINARY_DIR}/QNN/include)
141-
142146

143147
# add the custom commands to copy each headers
144148
foreach(_qnn_header ${qnn_header_basenames})
145149
# copy at generation time to make below target_sources(qnn_header) happy.
146-
configure_file( ${QNN_SDK_ROOT}/include/QNN/${_qnn_header} ${QNN_HEADER_DIR_DST}/${_qnn_header} COPYONLY)
150+
configure_file(${QNN_SDK_ROOT}/include/QNN/${_qnn_header}
151+
${QNN_HEADER_DIR_DST}/${_qnn_header}
152+
COPYONLY
153+
)
147154
list(APPEND qnn_header_files ${QNN_HEADER_DIR_DST}/${_qnn_header})
148155
endforeach()
149156

backends/qualcomm/runtime/backends/htpbackend/aarch64/HtpDevicePlatformInfoConfig.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ HtpDevicePlatformInfoConfig::CreateDevicePlatformInfo(
1414
const HtpInfo& qcom_target_soc_info) {
1515
return {};
1616
}
17-
} // namespace qnn
18-
} // namespace executor
19-
} // namespace torch
17+
} // namespace qnn
18+
} // namespace executor
19+
} // namespace torch

backends/qualcomm/runtime/backends/htpbackend/aarch64/HtpGraphCustomConfig.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ std::vector<QnnGraph_CustomConfig_t>
1313
HtpGraphCustomConfig::CreateGraphCustomConfig() {
1414
return {};
1515
}
16-
} // namespace qnn
17-
} // namespace executor
18-
} // namespace torch
16+
} // namespace qnn
17+
} // namespace executor
18+
} // namespace torch

backends/qualcomm/runtime/backends/htpbackend/x86_64/HtpDevicePlatformInfoConfig.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ HtpDevicePlatformInfoConfig::CreateDevicePlatformInfo(
5454

5555
return ret;
5656
}
57-
} // namespace qnn
58-
} // namespace executor
59-
} // namespace torch
57+
} // namespace qnn
58+
} // namespace executor
59+
} // namespace torch

backends/qualcomm/runtime/backends/htpbackend/x86_64/HtpGraphCustomConfig.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ HtpGraphCustomConfig::CreateGraphCustomConfig() {
4343
break;
4444
}
4545

46-
QNN_EXECUTORCH_LOG(kLogLevelInfo,
47-
"[Qnn ExecuTorch] Running level=3 optimization.");
46+
QNN_EXECUTORCH_LOG(
47+
kLogLevelInfo, "[Qnn ExecuTorch] Running level=3 optimization.");
4848

4949
p_custom_config = AllocGraphCustomConfig();
5050
p_custom_config->option = QNN_HTP_GRAPH_CONFIG_OPTION_OPTIMIZATION;
@@ -55,6 +55,6 @@ HtpGraphCustomConfig::CreateGraphCustomConfig() {
5555

5656
return ret;
5757
}
58-
} // namespace qnn
59-
} // namespace executor
60-
} // namespace torch
58+
} // namespace qnn
59+
} // namespace executor
60+
} // namespace torch

examples/models/deeplab_v3/__init__.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44
# This source code is licensed under the BSD-style license found in the
55
# LICENSE file in the root directory of this source tree.
66

7-
from .model import (
8-
DeepLabV3ResNet50Model,
9-
DeepLabV3ResNet101Model,
10-
)
7+
from .model import DeepLabV3ResNet101Model, DeepLabV3ResNet50Model
118

12-
__all__ = [
13-
DeepLabV3ResNet50Model,
14-
DeepLabV3ResNet101Model
15-
]
9+
__all__ = [DeepLabV3ResNet50Model, DeepLabV3ResNet101Model]

examples/models/deeplab_v3/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
import torch
1010
from torchvision.models.segmentation import (
1111
deeplabv3,
12-
deeplabv3_resnet50,
1312
deeplabv3_resnet101,
13+
deeplabv3_resnet50,
1414
)
1515

1616
from ..model_base import EagerModelBase

0 commit comments

Comments
 (0)