Use system includes for libneuralnetworks_common headers
Command used to generate the bulk this change:
for file in $(ls -1 common/include/*.h); do
header="${file#"common/include/"}"
perl -pi -e "s@^#include \"$header\"@#include <$header>@g" **/*.{h,cpp}
done
git checkout common/
clang-format -i **/*.{h,cpp}
Also added these missing headers:
driver/cache/nnCache/nnCache_test.cpp:122: Add #include <algorithm> for min [build/include_what_you_use] [4]
runtime/BurstBuilder.cpp:45: Add #include <memory> for shared_ptr<> [build/include_what_you_use] [4]
runtime/BurstBuilder.cpp:30: Add #include <utility> for move [build/include_what_you_use] [4]
runtime/BurstBuilder.cpp:29: Add #include <vector> for vector<> [build/include_what_you_use] [4]
runtime/include/NeuralNetworksWrapperExtensions.h:88: Add #include <utility> for move [build/include_what_you_use] [4]
runtime/include/NeuralNetworksWrapperExtensions.h:87: Add #include <vector> for vector<> [build/include_what_you_use] [4]
Also reordered conditionally included headers to go at the end.
Bug: N/A
Test: m
Change-Id: Ice4cb0682de1bf2fcf07c377ef9e0deec6a2de7e
Merged-In: Ice4cb0682de1bf2fcf07c377ef9e0deec6a2de7e
(cherry picked from commit 19582f204a2669716dd0f1bdf44e94b667923925)
diff --git a/common/CpuExecutor.cpp b/common/CpuExecutor.cpp
index 700efdd..2d74272 100644
--- a/common/CpuExecutor.cpp
+++ b/common/CpuExecutor.cpp
@@ -19,22 +19,14 @@
#include "CpuExecutor.h"
#include <android-base/scopeguard.h>
+#include <nnapi/SharedMemory.h>
+#include <nnapi/TypeUtils.h>
#include <limits>
#include <memory>
#include <utility>
#include <vector>
-// b/109953668, disable OpenMP
-#ifdef NNAPI_OPENMP
-#include <omp.h>
-
-#include <Eigen/Core>
-#endif // NNAPI_OPENMP
-
-#include <nnapi/SharedMemory.h>
-#include <nnapi/TypeUtils.h>
-
#include "ControlFlow.h"
#include "NeuralNetworks.h"
#include "OperationResolver.h"
@@ -42,6 +34,13 @@
#include "OperationsUtils.h"
#include "Tracing.h"
+// b/109953668, disable OpenMP
+#ifdef NNAPI_OPENMP
+#include <omp.h>
+
+#include <Eigen/Core>
+#endif // NNAPI_OPENMP
+
namespace android {
namespace nn {
namespace {
diff --git a/common/LogTagTest.cpp b/common/LogTagTest.cpp
index 7c6a4d5..ad837a9 100644
--- a/common/LogTagTest.cpp
+++ b/common/LogTagTest.cpp
@@ -19,6 +19,7 @@
#include <android-base/logging.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
+
#include "LegacyUtils.h"
namespace log_tag_test {
diff --git a/common/SharedMemory.cpp b/common/SharedMemory.cpp
index 3c848c3..6e8869a 100644
--- a/common/SharedMemory.cpp
+++ b/common/SharedMemory.cpp
@@ -14,6 +14,8 @@
* limitations under the License.
*/
+#include "SharedMemory.h"
+
#include <android-base/logging.h>
#include <limits>
@@ -23,7 +25,6 @@
#include <vector>
#include "Result.h"
-#include "SharedMemory.h"
#include "Types.h"
namespace android::nn {
diff --git a/common/SharedMemoryAndroid.cpp b/common/SharedMemoryAndroid.cpp
index 04c3414..774dab1 100644
--- a/common/SharedMemoryAndroid.cpp
+++ b/common/SharedMemoryAndroid.cpp
@@ -19,16 +19,6 @@
#include <android-base/logging.h>
#include <android-base/mapped_file.h>
#include <android-base/scopeguard.h>
-#ifndef NN_COMPATIBILITY_LIBRARY_BUILD
-#include <android/hidl/allocator/1.0/IAllocator.h>
-#include <hidl/HidlSupport.h>
-#include <hidlmemory/mapping.h>
-#include <sys/mman.h>
-#endif // NN_COMPATIBILITY_LIBRARY_BUILD
-#ifndef NN_NO_AHWB
-#include <android/hardware_buffer.h>
-#include <vndk/hardware_buffer.h>
-#endif // NN_NO_AHWB
#include <algorithm>
#include <any>
@@ -44,6 +34,18 @@
#include "TypeUtils.h"
#include "Types.h"
+#ifndef NN_COMPATIBILITY_LIBRARY_BUILD
+#include <android/hidl/allocator/1.0/IAllocator.h>
+#include <hidl/HidlSupport.h>
+#include <hidlmemory/mapping.h>
+#include <sys/mman.h>
+#endif // NN_COMPATIBILITY_LIBRARY_BUILD
+
+#ifndef NN_NO_AHWB
+#include <android/hardware_buffer.h>
+#include <vndk/hardware_buffer.h>
+#endif // NN_NO_AHWB
+
namespace android::nn {
namespace {
diff --git a/common/TokenHasher.cpp b/common/TokenHasher.cpp
index 76df02a..2dd870b 100644
--- a/common/TokenHasher.cpp
+++ b/common/TokenHasher.cpp
@@ -18,11 +18,11 @@
#include "TokenHasher.h"
-#include "NeuralNetworks.h"
-
#include <android-base/logging.h>
#include <openssl/sha.h>
+#include "NeuralNetworks.h"
+
namespace android {
namespace nn {
diff --git a/common/include/LegacyUtils.h b/common/include/LegacyUtils.h
index 21e08c1..f20641f 100644
--- a/common/include/LegacyUtils.h
+++ b/common/include/LegacyUtils.h
@@ -21,6 +21,8 @@
#define ANDROID_FRAMEWORKS_ML_NN_COMMON_LEGACY_UTILS_H
#include <android-base/logging.h>
+#include <nnapi/TypeUtils.h>
+#include <nnapi/Types.h>
#include <string>
#include <tuple>
diff --git a/common/include/Operations.h b/common/include/Operations.h
index 9c02a69..89b55ad 100644
--- a/common/include/Operations.h
+++ b/common/include/Operations.h
@@ -17,6 +17,13 @@
#ifndef ANDROID_FRAMEWORKS_ML_NN_COMMON_OPERATIONS_H
#define ANDROID_FRAMEWORKS_ML_NN_COMMON_OPERATIONS_H
+#include <stddef.h>
+
+#include <cstdint>
+#include <vector>
+
+#include "ActivationFunctor.h"
+
#ifndef NN_COMPATIBILITY_LIBRARY_BUILD
#include "operations/BidirectionalSequenceLSTM.h"
#include "operations/Cast.h"
@@ -34,13 +41,6 @@
#include "operations/Tile.h"
#endif // NN_COMPATIBILITY_LIBRARY_BUILD
-#include <stddef.h>
-
-#include <cstdint>
-#include <vector>
-
-#include "ActivationFunctor.h"
-
namespace android {
namespace nn {
diff --git a/common/include/TokenHasher.h b/common/include/TokenHasher.h
index 3245138..a849619 100644
--- a/common/include/TokenHasher.h
+++ b/common/include/TokenHasher.h
@@ -17,12 +17,12 @@
#ifndef ANDROID_FRAMEWORKS_ML_NN_COMMON_TOKEN_HASHER_H
#define ANDROID_FRAMEWORKS_ML_NN_COMMON_TOKEN_HASHER_H
-#include <cstring>
-#include <vector>
-
#include <android-base/macros.h>
#include <openssl/sha.h>
+#include <cstring>
+#include <vector>
+
namespace android {
namespace nn {
diff --git a/common/include/ValidateHal.h b/common/include/ValidateHal.h
index 3d811e0..7d9a50f 100644
--- a/common/include/ValidateHal.h
+++ b/common/include/ValidateHal.h
@@ -17,6 +17,9 @@
#ifndef ANDROID_FRAMEWORKS_ML_NN_COMMON_VALIDATE_HAL_H
#define ANDROID_FRAMEWORKS_ML_NN_COMMON_VALIDATE_HAL_H
+#include <nnapi/TypeUtils.h>
+#include <nnapi/Validation.h>
+
#include <set>
#include <tuple>
diff --git a/common/operations/PRelu.cpp b/common/operations/PRelu.cpp
index 60d7210..718093a 100644
--- a/common/operations/PRelu.cpp
+++ b/common/operations/PRelu.cpp
@@ -16,10 +16,6 @@
#define LOG_TAG "Operations"
-#ifndef NN_COMPATIBILITY_LIBRARY_BUILD
-#include <tensorflow/lite/kernels/internal/optimized/legacy_optimized_ops.h>
-#endif // NN_COMPATIBILITY_LIBRARY_BUILD
-
#include <algorithm>
#include <vector>
@@ -28,6 +24,10 @@
#include "OperationsUtils.h"
#include "Tracing.h"
+#ifndef NN_COMPATIBILITY_LIBRARY_BUILD
+#include <tensorflow/lite/kernels/internal/optimized/legacy_optimized_ops.h>
+#endif // NN_COMPATIBILITY_LIBRARY_BUILD
+
namespace android {
namespace nn {
namespace prelu {
diff --git a/common/operations/QLSTM.cpp b/common/operations/QLSTM.cpp
index 4dad7f7..d9b22e2 100644
--- a/common/operations/QLSTM.cpp
+++ b/common/operations/QLSTM.cpp
@@ -20,6 +20,7 @@
#include "CpuExecutor.h"
#include "OperationsUtils.h"
+
#ifndef NN_COMPATIBILITY_LIBRARY_BUILD
#include "QuantUtils.h"
#endif // NN_COMPATIBILITY_LIBRARY_BUILD
diff --git a/common/operations/Reduce.cpp b/common/operations/Reduce.cpp
index a73b652..794992c 100644
--- a/common/operations/Reduce.cpp
+++ b/common/operations/Reduce.cpp
@@ -16,10 +16,6 @@
#define LOG_TAG "Operations"
-#ifndef NN_COMPATIBILITY_LIBRARY_BUILD
-#include <tensorflow/lite/kernels/internal/reference/reference_ops.h>
-#endif // NN_COMPATIBILITY_LIBRARY_BUILD
-
#include <algorithm>
#include <limits>
#include <vector>
@@ -28,6 +24,10 @@
#include "OperationsUtils.h"
#include "Tracing.h"
+#ifndef NN_COMPATIBILITY_LIBRARY_BUILD
+#include <tensorflow/lite/kernels/internal/reference/reference_ops.h>
+#endif // NN_COMPATIBILITY_LIBRARY_BUILD
+
namespace android {
namespace nn {
namespace reduce {
diff --git a/common/operations/UnidirectionalSequenceLSTM.cpp b/common/operations/UnidirectionalSequenceLSTM.cpp
index 7d34023..0e639a3 100644
--- a/common/operations/UnidirectionalSequenceLSTM.cpp
+++ b/common/operations/UnidirectionalSequenceLSTM.cpp
@@ -19,11 +19,12 @@
#include <vector>
#include "IndexedShapeWrapper.h"
+#include "OperationResolver.h"
+#include "OperationsUtils.h"
+
#ifndef NN_COMPATIBILITY_LIBRARY_BUILD
#include "LSTM.h"
#endif // NN_COMPATIBILITY_LIBRARY_BUILD
-#include "OperationResolver.h"
-#include "OperationsUtils.h"
namespace android {
namespace nn {
diff --git a/common/random/random_distributions.h b/common/random/random_distributions.h
index feb5c64..69271ce 100644
--- a/common/random/random_distributions.h
+++ b/common/random/random_distributions.h
@@ -18,14 +18,15 @@
#define _USE_MATH_DEFINES
#include <math.h>
+
#include <cmath>
#undef _USE_MATH_DEFINES
#include <string.h>
+#include <tensorflow/core/lib/bfloat16/bfloat16.h>
+
#include <algorithm>
#include <type_traits>
-
-#include <tensorflow/core/lib/bfloat16/bfloat16.h>
#include <unsupported/Eigen/CXX11/Tensor>
#include "philox_random.h"
diff --git a/common/random/simple_philox.h b/common/random/simple_philox.h
index 38bc744..c2ca53a 100644
--- a/common/random/simple_philox.h
+++ b/common/random/simple_philox.h
@@ -18,6 +18,7 @@
#include <math.h>
#include <string.h>
+
#include <algorithm>
#include "philox_random.h"
diff --git a/driver/cache/BlobCache/BlobCache.cpp b/driver/cache/BlobCache/BlobCache.cpp
index 8308e46..a783bc8 100644
--- a/driver/cache/BlobCache/BlobCache.cpp
+++ b/driver/cache/BlobCache/BlobCache.cpp
@@ -25,6 +25,7 @@
#include <cutils/properties.h>
#else
#include <string.h>
+
#include <algorithm>
static const char property_value[] = "[HOST]";
#define PROPERTY_VALUE_MAX (sizeof(property_value) - 1)
diff --git a/driver/cache/BlobCache/BlobCache_test.cpp b/driver/cache/BlobCache/BlobCache_test.cpp
index 73184ba..ad1b0bf 100644
--- a/driver/cache/BlobCache/BlobCache_test.cpp
+++ b/driver/cache/BlobCache/BlobCache_test.cpp
@@ -14,7 +14,10 @@
** limitations under the License.
*/
+#include "BlobCache.h"
+
#include <fcntl.h>
+#include <gtest/gtest.h>
#include <stdio.h>
#include <stdlib.h>
@@ -23,10 +26,6 @@
#include <numeric>
#include <random>
-#include <gtest/gtest.h>
-
-#include "BlobCache.h"
-
namespace android {
template <typename T>
diff --git a/driver/cache/nnCache/nnCache.cpp b/driver/cache/nnCache/nnCache.cpp
index 8ae8204..c1b0a9f 100644
--- a/driver/cache/nnCache/nnCache.cpp
+++ b/driver/cache/nnCache/nnCache.cpp
@@ -18,14 +18,13 @@
#include <fcntl.h>
#include <inttypes.h>
+#include <log/log.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <unistd.h>
#include <thread>
-#include <log/log.h>
-
// Cache file header
static const char* cacheFileMagic = "nn$$";
static const size_t cacheFileHeaderSize = 8;
diff --git a/driver/cache/nnCache/nnCache.h b/driver/cache/nnCache/nnCache.h
index a0ec6ee..6c5531a 100644
--- a/driver/cache/nnCache/nnCache.h
+++ b/driver/cache/nnCache/nnCache.h
@@ -17,13 +17,13 @@
#ifndef ANDROID_FRAMEWORKS_ML_NN_DRIVER_CACHE_NN_CACHE_NN_CACHE_H
#define ANDROID_FRAMEWORKS_ML_NN_DRIVER_CACHE_NN_CACHE_NN_CACHE_H
-#include "BlobCache.h"
-
#include <functional>
#include <memory>
#include <mutex>
#include <string>
+#include "BlobCache.h"
+
// ----------------------------------------------------------------------------
namespace android {
// ----------------------------------------------------------------------------
diff --git a/driver/cache/nnCache/nnCache_test.cpp b/driver/cache/nnCache/nnCache_test.cpp
index 0ee8956..9d57f53 100644
--- a/driver/cache/nnCache/nnCache_test.cpp
+++ b/driver/cache/nnCache/nnCache_test.cpp
@@ -17,16 +17,16 @@
#define LOG_TAG "nnCache_test"
//#define LOG_NDEBUG 0
-#include <stdlib.h>
-#include <string.h>
-
-#include <memory>
+#include "nnCache.h"
#include <android-base/file.h>
#include <gtest/gtest.h>
#include <log/log.h>
+#include <stdlib.h>
+#include <string.h>
-#include "nnCache.h"
+#include <algorithm>
+#include <memory>
// Cache size limits.
static const size_t maxKeySize = 12 * 1024;
diff --git a/driver/sample/CanonicalBuffer.h b/driver/sample/CanonicalBuffer.h
index 3a0dd3f..15c534d 100644
--- a/driver/sample/CanonicalBuffer.h
+++ b/driver/sample/CanonicalBuffer.h
@@ -17,15 +17,14 @@
#ifndef ANDROID_PACKAGES_MODULES_NEURALNETWORKS_DRIVER_SAMPLE_CANONICAL_BUFFER_H
#define ANDROID_PACKAGES_MODULES_NEURALNETWORKS_DRIVER_SAMPLE_CANONICAL_BUFFER_H
+#include <BufferTracker.h>
+#include <CpuExecutor.h>
#include <nnapi/IBuffer.h>
#include <nnapi/Result.h>
#include <nnapi/Types.h>
#include <memory>
-#include "BufferTracker.h"
-#include "CpuExecutor.h"
-
namespace android::nn::sample {
class Buffer final : public IBuffer {
diff --git a/driver/sample/CanonicalDevice.cpp b/driver/sample/CanonicalDevice.cpp
index f78ac28..beb8041 100644
--- a/driver/sample/CanonicalDevice.cpp
+++ b/driver/sample/CanonicalDevice.cpp
@@ -16,6 +16,7 @@
#include "CanonicalDevice.h"
+#include <Tracing.h>
#include <android-base/logging.h>
#include <nnapi/IBuffer.h>
#include <nnapi/IDevice.h>
@@ -38,7 +39,6 @@
#include "CanonicalBuffer.h"
#include "CanonicalPreparedModel.h"
-#include "Tracing.h"
namespace android::nn::sample {
namespace {
diff --git a/driver/sample/CanonicalDevice.h b/driver/sample/CanonicalDevice.h
index 0d49de4..341356d 100644
--- a/driver/sample/CanonicalDevice.h
+++ b/driver/sample/CanonicalDevice.h
@@ -17,6 +17,8 @@
#ifndef ANDROID_PACKAGES_MODULES_NEURALNETWORKS_DRIVER_SAMPLE_CANONICAL_DEVICE_H
#define ANDROID_PACKAGES_MODULES_NEURALNETWORKS_DRIVER_SAMPLE_CANONICAL_DEVICE_H
+#include <BufferTracker.h>
+#include <CpuExecutor.h>
#include <nnapi/IBuffer.h>
#include <nnapi/IDevice.h>
#include <nnapi/OperandTypes.h>
@@ -30,9 +32,6 @@
#include <utility>
#include <vector>
-#include "BufferTracker.h"
-#include "CpuExecutor.h"
-
namespace android::nn::sample {
class Device final : public IDevice {
diff --git a/driver/sample/CanonicalPreparedModel.cpp b/driver/sample/CanonicalPreparedModel.cpp
index d297c84..ce031b6 100644
--- a/driver/sample/CanonicalPreparedModel.cpp
+++ b/driver/sample/CanonicalPreparedModel.cpp
@@ -16,6 +16,7 @@
#include "CanonicalPreparedModel.h"
+#include <Tracing.h>
#include <nnapi/IPreparedModel.h>
#include <nnapi/Result.h>
#include <nnapi/TypeUtils.h>
@@ -29,7 +30,6 @@
#include "CanonicalBurst.h"
#include "CanonicalDevice.h"
-#include "Tracing.h"
namespace android::nn::sample {
namespace {
diff --git a/driver/sample/CanonicalPreparedModel.h b/driver/sample/CanonicalPreparedModel.h
index 74ccd87..15957b6 100644
--- a/driver/sample/CanonicalPreparedModel.h
+++ b/driver/sample/CanonicalPreparedModel.h
@@ -17,6 +17,8 @@
#ifndef ANDROID_PACKAGES_MODULES_NEURALNETWORKS_DRIVER_SAMPLE_CANONICAL_PREPARED_MODEL_H
#define ANDROID_PACKAGES_MODULES_NEURALNETWORKS_DRIVER_SAMPLE_CANONICAL_PREPARED_MODEL_H
+#include <BufferTracker.h>
+#include <CpuExecutor.h>
#include <nnapi/IPreparedModel.h>
#include <nnapi/Result.h>
#include <nnapi/Types.h>
@@ -26,9 +28,6 @@
#include <utility>
#include <vector>
-#include "BufferTracker.h"
-#include "CpuExecutor.h"
-
namespace android::nn::sample {
class PreparedModel final : public IPreparedModel,
diff --git a/driver/sample/SampleDriver.cpp b/driver/sample/SampleDriver.cpp
index 303fdef..cbeccc3 100644
--- a/driver/sample/SampleDriver.cpp
+++ b/driver/sample/SampleDriver.cpp
@@ -18,6 +18,12 @@
#include "SampleDriver.h"
+#include <CpuExecutor.h>
+#include <ExecutionBurstServer.h>
+#include <HalBufferTracker.h>
+#include <HalInterfaces.h>
+#include <Tracing.h>
+#include <ValidateHal.h>
#include <android-base/logging.h>
#include <android-base/properties.h>
#include <hidl/LegacySupport.h>
@@ -34,13 +40,7 @@
#include <utility>
#include <vector>
-#include "CpuExecutor.h"
-#include "ExecutionBurstServer.h"
-#include "HalBufferTracker.h"
-#include "HalInterfaces.h"
#include "SampleDriverUtils.h"
-#include "Tracing.h"
-#include "ValidateHal.h"
namespace android {
namespace nn {
diff --git a/driver/sample/SampleDriver.h b/driver/sample/SampleDriver.h
index 5048f94..ca7bc9e 100644
--- a/driver/sample/SampleDriver.h
+++ b/driver/sample/SampleDriver.h
@@ -17,6 +17,9 @@
#ifndef ANDROID_FRAMEWORKS_ML_NN_DRIVER_SAMPLE_SAMPLE_DRIVER_H
#define ANDROID_FRAMEWORKS_ML_NN_DRIVER_SAMPLE_SAMPLE_DRIVER_H
+#include <CpuExecutor.h>
+#include <HalBufferTracker.h>
+#include <HalInterfaces.h>
#include <hwbinder/IPCThreadState.h>
#include <memory>
@@ -24,9 +27,6 @@
#include <utility>
#include <vector>
-#include "CpuExecutor.h"
-#include "HalBufferTracker.h"
-#include "HalInterfaces.h"
#include "NeuralNetworks.h"
namespace android {
diff --git a/driver/sample/SampleDriverAll.cpp b/driver/sample/SampleDriverAll.cpp
index 23a36f8..a693b0d 100644
--- a/driver/sample/SampleDriverAll.cpp
+++ b/driver/sample/SampleDriverAll.cpp
@@ -16,10 +16,10 @@
#define LOG_TAG "SampleDriverAll"
-#include "SampleDriverFull.h"
-
#include <hidl/LegacySupport.h>
+#include "SampleDriverFull.h"
+
using android::sp;
using android::nn::sample_driver::SampleDriverFull;
diff --git a/driver/sample/SampleDriverFloatFast.cpp b/driver/sample/SampleDriverFloatFast.cpp
index eae529c..2123df4 100644
--- a/driver/sample/SampleDriverFloatFast.cpp
+++ b/driver/sample/SampleDriverFloatFast.cpp
@@ -16,15 +16,15 @@
#define LOG_TAG "SampleDriverFloatFast"
+#include <HalInterfaces.h>
+#include <Utils.h>
#include <android-base/logging.h>
#include <hidl/LegacySupport.h>
#include <thread>
#include <vector>
-#include "HalInterfaces.h"
#include "SampleDriverPartial.h"
-#include "Utils.h"
namespace android {
namespace nn {
diff --git a/driver/sample/SampleDriverFloatSlow.cpp b/driver/sample/SampleDriverFloatSlow.cpp
index 8e70dae..ad9dda9 100644
--- a/driver/sample/SampleDriverFloatSlow.cpp
+++ b/driver/sample/SampleDriverFloatSlow.cpp
@@ -16,15 +16,15 @@
#define LOG_TAG "SampleDriverFloatSlow"
+#include <HalInterfaces.h>
+#include <Utils.h>
#include <android-base/logging.h>
#include <hidl/LegacySupport.h>
#include <thread>
#include <vector>
-#include "HalInterfaces.h"
#include "SampleDriverPartial.h"
-#include "Utils.h"
namespace android {
namespace nn {
diff --git a/driver/sample/SampleDriverFloatXNNPACK.cpp b/driver/sample/SampleDriverFloatXNNPACK.cpp
index e1c27bf..ebab372 100644
--- a/driver/sample/SampleDriverFloatXNNPACK.cpp
+++ b/driver/sample/SampleDriverFloatXNNPACK.cpp
@@ -16,6 +16,10 @@
#define LOG_TAG "SampleDriverFloatXNNPACK"
+#include <CpuExecutor.h>
+#include <HalInterfaces.h>
+#include <Utils.h>
+#include <ValidateHal.h>
#include <android-base/logging.h>
#include <hidl/LegacySupport.h>
#include <hwbinder/IPCThreadState.h>
@@ -32,12 +36,8 @@
#include <utility>
#include <vector>
-#include "CpuExecutor.h"
-#include "HalInterfaces.h"
#include "SampleDriverPartial.h"
#include "SampleDriverUtils.h"
-#include "Utils.h"
-#include "ValidateHal.h"
namespace android {
namespace nn {
diff --git a/driver/sample/SampleDriverFull.cpp b/driver/sample/SampleDriverFull.cpp
index efd5e60..c8fcde6 100644
--- a/driver/sample/SampleDriverFull.cpp
+++ b/driver/sample/SampleDriverFull.cpp
@@ -18,10 +18,10 @@
#include "SampleDriverFull.h"
-#include <vector>
+#include <Utils.h>
+#include <ValidateHal.h>
-#include "Utils.h"
-#include "ValidateHal.h"
+#include <vector>
namespace android {
namespace nn {
diff --git a/driver/sample/SampleDriverFull.h b/driver/sample/SampleDriverFull.h
index ecf5c76..ed4910d 100644
--- a/driver/sample/SampleDriverFull.h
+++ b/driver/sample/SampleDriverFull.h
@@ -17,7 +17,8 @@
#ifndef ANDROID_FRAMEWORKS_ML_NN_DRIVER_SAMPLE_SAMPLE_DRIVER_FULL_H
#define ANDROID_FRAMEWORKS_ML_NN_DRIVER_SAMPLE_SAMPLE_DRIVER_FULL_H
-#include "HalInterfaces.h"
+#include <HalInterfaces.h>
+
#include "SampleDriver.h"
namespace android {
diff --git a/driver/sample/SampleDriverMinimal.cpp b/driver/sample/SampleDriverMinimal.cpp
index b0863fa..6456b57 100644
--- a/driver/sample/SampleDriverMinimal.cpp
+++ b/driver/sample/SampleDriverMinimal.cpp
@@ -16,15 +16,15 @@
#define LOG_TAG "SampleDriverMinimal"
+#include <HalInterfaces.h>
+#include <Utils.h>
#include <android-base/logging.h>
#include <thread>
#include <vector>
-#include "HalInterfaces.h"
#include "NeuralNetworksOEM.h"
#include "SampleDriverPartial.h"
-#include "Utils.h"
namespace android {
namespace nn {
diff --git a/driver/sample/SampleDriverPartial.cpp b/driver/sample/SampleDriverPartial.cpp
index 0c3b4d4..71d5a3a 100644
--- a/driver/sample/SampleDriverPartial.cpp
+++ b/driver/sample/SampleDriverPartial.cpp
@@ -18,15 +18,15 @@
#include "SampleDriverPartial.h"
+#include <HalInterfaces.h>
+#include <Utils.h>
+#include <ValidateHal.h>
#include <android-base/logging.h>
#include <thread>
#include <vector>
-#include "HalInterfaces.h"
#include "SampleDriverUtils.h"
-#include "Utils.h"
-#include "ValidateHal.h"
namespace android {
namespace nn {
diff --git a/driver/sample/SampleDriverPartial.h b/driver/sample/SampleDriverPartial.h
index 19ac4fd..6ef1b08 100644
--- a/driver/sample/SampleDriverPartial.h
+++ b/driver/sample/SampleDriverPartial.h
@@ -17,14 +17,14 @@
#ifndef ANDROID_FRAMEWORKS_ML_NN_DRIVER_SAMPLE_SAMPLE_DRIVER_PARTIAL_H
#define ANDROID_FRAMEWORKS_ML_NN_DRIVER_SAMPLE_SAMPLE_DRIVER_PARTIAL_H
+#include <HalInterfaces.h>
+#include <Utils.h>
#include <android-base/logging.h>
#include <thread>
#include <vector>
-#include "HalInterfaces.h"
#include "SampleDriver.h"
-#include "Utils.h"
namespace android {
namespace nn {
diff --git a/driver/sample/SampleDriverQuant.cpp b/driver/sample/SampleDriverQuant.cpp
index 0883eca..89ac7aa 100644
--- a/driver/sample/SampleDriverQuant.cpp
+++ b/driver/sample/SampleDriverQuant.cpp
@@ -16,15 +16,15 @@
#define LOG_TAG "SampleDriverQuant"
+#include <HalInterfaces.h>
+#include <Utils.h>
#include <android-base/logging.h>
#include <hidl/LegacySupport.h>
#include <thread>
#include <vector>
-#include "HalInterfaces.h"
#include "SampleDriverPartial.h"
-#include "Utils.h"
namespace android {
namespace nn {
diff --git a/driver/sample/SampleDriverUtils.cpp b/driver/sample/SampleDriverUtils.cpp
index e8c5718..08fd47d 100644
--- a/driver/sample/SampleDriverUtils.cpp
+++ b/driver/sample/SampleDriverUtils.cpp
@@ -15,10 +15,11 @@
*/
#include "SampleDriverUtils.h"
-#include "SampleDriver.h"
#include <android-base/logging.h>
+#include "SampleDriver.h"
+
namespace android {
namespace nn {
namespace sample_driver {
diff --git a/driver/sample/SampleDriverUtils.h b/driver/sample/SampleDriverUtils.h
index 1130f5d..6e30ac8 100644
--- a/driver/sample/SampleDriverUtils.h
+++ b/driver/sample/SampleDriverUtils.h
@@ -17,11 +17,11 @@
#ifndef ANDROID_FRAMEWORKS_ML_NN_DRIVER_SAMPLE_SAMPLE_DRIVER_UTILS_H
#define ANDROID_FRAMEWORKS_ML_NN_DRIVER_SAMPLE_SAMPLE_DRIVER_UTILS_H
+#include <HalInterfaces.h>
#include <hwbinder/IPCThreadState.h>
#include <thread>
-#include "HalInterfaces.h"
#include "SampleDriver.h"
namespace android {
diff --git a/runtime/AppInfoFetcher.cpp b/runtime/AppInfoFetcher.cpp
index 1338ef3..7b90fc6 100644
--- a/runtime/AppInfoFetcher.cpp
+++ b/runtime/AppInfoFetcher.cpp
@@ -19,6 +19,7 @@
#include "AppInfoFetcher.h"
#include <PackageInfo.h>
+#include <Utils.h>
#include <android-base/file.h>
#include <android-base/properties.h>
#include <binder/IServiceManager.h>
@@ -32,8 +33,6 @@
#include <string_view>
#include <vector>
-#include "Utils.h"
-
namespace android {
namespace nn {
diff --git a/runtime/BurstBuilder.cpp b/runtime/BurstBuilder.cpp
index f8aa6be..b4f6289 100644
--- a/runtime/BurstBuilder.cpp
+++ b/runtime/BurstBuilder.cpp
@@ -18,8 +18,13 @@
#include "BurstBuilder.h"
+#include <ExecutionBurstController.h>
+
+#include <memory>
+#include <utility>
+#include <vector>
+
#include "CompilationBuilder.h"
-#include "ExecutionBurstController.h"
namespace android {
namespace nn {
diff --git a/runtime/BurstBuilder.h b/runtime/BurstBuilder.h
index 6a3ba78..de10f2c 100644
--- a/runtime/BurstBuilder.h
+++ b/runtime/BurstBuilder.h
@@ -17,10 +17,11 @@
#ifndef ANDROID_FRAMEWORKS_ML_NN_RUNTIME_BURST_BUILDER_H
#define ANDROID_FRAMEWORKS_ML_NN_RUNTIME_BURST_BUILDER_H
+#include <ExecutionBurstController.h>
+
#include <atomic>
#include <memory>
#include <vector>
-#include "ExecutionBurstController.h"
namespace android {
namespace nn {
diff --git a/runtime/CompilationBuilder.cpp b/runtime/CompilationBuilder.cpp
index 13d61e3..7d13d71 100644
--- a/runtime/CompilationBuilder.cpp
+++ b/runtime/CompilationBuilder.cpp
@@ -18,6 +18,9 @@
#include "CompilationBuilder.h"
+#include <ExecutionBurstController.h>
+#include <LegacyUtils.h>
+
#include <algorithm>
#include <limits>
#include <memory>
@@ -27,9 +30,7 @@
#include "BurstBuilder.h"
#include "ExecutionBuilder.h"
-#include "ExecutionBurstController.h"
#include "ExecutionPlan.h"
-#include "LegacyUtils.h"
#include "Manager.h"
#include "ModelBuilder.h"
diff --git a/runtime/ExecutionBuilder.cpp b/runtime/ExecutionBuilder.cpp
index bc3e54e..9fc77fb 100644
--- a/runtime/ExecutionBuilder.cpp
+++ b/runtime/ExecutionBuilder.cpp
@@ -18,6 +18,11 @@
#include "ExecutionBuilder.h"
+#include <ControlFlow.h>
+#include <CpuExecutor.h>
+#include <ExecutionBurstController.h>
+#include <LegacyUtils.h>
+#include <Tracing.h>
#include <android-base/logging.h>
#include <nnapi/IPreparedModel.h>
@@ -34,14 +39,9 @@
#include <vector>
#include "CompilationBuilder.h"
-#include "ControlFlow.h"
-#include "CpuExecutor.h"
-#include "ExecutionBurstController.h"
-#include "LegacyUtils.h"
#include "Manager.h"
#include "ModelArgumentInfo.h"
#include "ModelBuilder.h"
-#include "Tracing.h"
#include "TypeManager.h"
namespace android {
diff --git a/runtime/ExecutionBuilder.h b/runtime/ExecutionBuilder.h
index 65af1d8..99a7e25 100644
--- a/runtime/ExecutionBuilder.h
+++ b/runtime/ExecutionBuilder.h
@@ -17,6 +17,8 @@
#ifndef ANDROID_FRAMEWORKS_ML_NN_RUNTIME_EXECUTION_BUILDER_H
#define ANDROID_FRAMEWORKS_ML_NN_RUNTIME_EXECUTION_BUILDER_H
+#include <ControlFlow.h>
+#include <CpuExecutor.h>
#include <nnapi/IPreparedModel.h>
#include <nnapi/Validation.h>
@@ -27,8 +29,6 @@
#include <utility>
#include <vector>
-#include "ControlFlow.h"
-#include "CpuExecutor.h"
#include "ExecutionCallback.h"
#include "Memory.h"
#include "ModelArgumentInfo.h"
diff --git a/runtime/ExecutionPlan.cpp b/runtime/ExecutionPlan.cpp
index 47fbcec..ca3f071 100644
--- a/runtime/ExecutionPlan.cpp
+++ b/runtime/ExecutionPlan.cpp
@@ -18,6 +18,15 @@
#include "ExecutionPlan.h"
+#include <ControlFlow.h>
+#include <CpuExecutor.h>
+#include <ExecutionBurstController.h>
+#include <GraphDump.h>
+#include <LegacyUtils.h>
+#include <MetaModel.h>
+#include <OperationsUtils.h>
+#include <TokenHasher.h>
+#include <Tracing.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
@@ -37,19 +46,10 @@
#include "BurstBuilder.h"
#include "CompilationBuilder.h"
-#include "ControlFlow.h"
-#include "CpuExecutor.h"
#include "ExecutionBuilder.h"
-#include "ExecutionBurstController.h"
#include "ExecutionCallback.h"
-#include "GraphDump.h"
-#include "LegacyUtils.h"
#include "Manager.h"
-#include "MetaModel.h"
#include "ModelBuilder.h"
-#include "OperationsUtils.h"
-#include "TokenHasher.h"
-#include "Tracing.h"
#include "TypeManager.h"
namespace android {
diff --git a/runtime/ExecutionPlan.h b/runtime/ExecutionPlan.h
index e9b06a9..aa3c675 100644
--- a/runtime/ExecutionPlan.h
+++ b/runtime/ExecutionPlan.h
@@ -19,6 +19,8 @@
#ifndef ANDROID_FRAMEWORKS_ML_NN_RUNTIME_EXECUTION_PLAN_H
#define ANDROID_FRAMEWORKS_ML_NN_RUNTIME_EXECUTION_PLAN_H
+#include <LegacyUtils.h>
+#include <TokenHasher.h>
#include <android-base/logging.h>
#include <nnapi/Types.h>
@@ -35,12 +37,10 @@
#include <variant>
#include <vector>
-#include "LegacyUtils.h"
#include "Memory.h"
#include "ModelArgumentInfo.h"
#include "ModelBuilder.h"
#include "NeuralNetworks.h"
-#include "TokenHasher.h"
namespace android {
namespace nn {
diff --git a/runtime/Manager.cpp b/runtime/Manager.cpp
index b551b2e..943205b 100644
--- a/runtime/Manager.cpp
+++ b/runtime/Manager.cpp
@@ -21,6 +21,8 @@
#include <CpuExecutor.h>
#include <ExecutionBurstController.h>
#include <LegacyUtils.h>
+#include <MetaModel.h>
+#include <Tracing.h>
#include <nnapi/IDevice.h>
#include <nnapi/IPreparedModel.h>
#include <nnapi/SharedMemory.h>
@@ -36,9 +38,7 @@
#include "ExecutionCallback.h"
#include "Memory.h"
-#include "MetaModel.h"
#include "ModelArgumentInfo.h"
-#include "Tracing.h"
#include "TypeManager.h"
#ifndef NN_COMPATIBILITY_LIBRARY_BUILD
diff --git a/runtime/Manager.h b/runtime/Manager.h
index 2c51fc9..e9db782 100644
--- a/runtime/Manager.h
+++ b/runtime/Manager.h
@@ -17,6 +17,7 @@
#ifndef ANDROID_FRAMEWORKS_ML_NN_RUNTIME_MANAGER_H
#define ANDROID_FRAMEWORKS_ML_NN_RUNTIME_MANAGER_H
+#include <LegacyUtils.h>
#include <android-base/macros.h>
#include <nnapi/IDevice.h>
#include <nnapi/IPreparedModel.h>
@@ -30,7 +31,6 @@
#include <vector>
#include "ExecutionCallback.h"
-#include "LegacyUtils.h"
#include "Memory.h"
namespace android {
diff --git a/runtime/Memory.h b/runtime/Memory.h
index 573ac0b..77da722 100644
--- a/runtime/Memory.h
+++ b/runtime/Memory.h
@@ -17,6 +17,8 @@
#ifndef ANDROID_FRAMEWORKS_ML_NN_RUNTIME_MEMORY_H
#define ANDROID_FRAMEWORKS_ML_NN_RUNTIME_MEMORY_H
+#include <CpuExecutor.h>
+#include <LegacyUtils.h>
#include <android-base/macros.h>
#include <android-base/scopeguard.h>
#include <nnapi/IBuffer.h>
@@ -34,8 +36,6 @@
#include <utility>
#include <vector>
-#include "CpuExecutor.h"
-#include "LegacyUtils.h"
#include "NeuralNetworks.h"
namespace android {
diff --git a/runtime/ModelArgumentInfo.cpp b/runtime/ModelArgumentInfo.cpp
index 65e132a..ee2f3ce 100644
--- a/runtime/ModelArgumentInfo.cpp
+++ b/runtime/ModelArgumentInfo.cpp
@@ -18,11 +18,12 @@
#include "ModelArgumentInfo.h"
+#include <LegacyUtils.h>
+
#include <algorithm>
#include <utility>
#include <vector>
-#include "LegacyUtils.h"
#include "NeuralNetworks.h"
#include "TypeManager.h"
diff --git a/runtime/ModelArgumentInfo.h b/runtime/ModelArgumentInfo.h
index a8cc858..956c260 100644
--- a/runtime/ModelArgumentInfo.h
+++ b/runtime/ModelArgumentInfo.h
@@ -17,10 +17,11 @@
#ifndef ANDROID_FRAMEWORKS_ML_NN_RUNTIME_MODEL_ARGUMENT_INFO_H
#define ANDROID_FRAMEWORKS_ML_NN_RUNTIME_MODEL_ARGUMENT_INFO_H
+#include <LegacyUtils.h>
+
#include <utility>
#include <vector>
-#include "LegacyUtils.h"
#include "NeuralNetworks.h"
namespace android {
diff --git a/runtime/ModelBuilder.cpp b/runtime/ModelBuilder.cpp
index 94ba3d7..32bef39 100644
--- a/runtime/ModelBuilder.cpp
+++ b/runtime/ModelBuilder.cpp
@@ -18,6 +18,9 @@
#include "ModelBuilder.h"
+#include <GraphDump.h>
+#include <LegacyUtils.h>
+
#include <algorithm>
#include <map>
#include <memory>
@@ -26,8 +29,6 @@
#include <vector>
#include "CompilationBuilder.h"
-#include "GraphDump.h"
-#include "LegacyUtils.h"
#include "Manager.h"
#include "TypeManager.h"
diff --git a/runtime/ModelBuilder.h b/runtime/ModelBuilder.h
index 4e8bd4a..ae9df8b 100644
--- a/runtime/ModelBuilder.h
+++ b/runtime/ModelBuilder.h
@@ -20,10 +20,11 @@
#ifndef ANDROID_FRAMEWORKS_ML_NN_RUNTIME_MODEL_BUILDER_H
#define ANDROID_FRAMEWORKS_ML_NN_RUNTIME_MODEL_BUILDER_H
+#include <LegacyUtils.h>
+
#include <memory>
#include <vector>
-#include "LegacyUtils.h"
#include "Memory.h"
#include "NeuralNetworks.h"
diff --git a/runtime/TypeManager.cpp b/runtime/TypeManager.cpp
index dec2c6a..858de27 100644
--- a/runtime/TypeManager.cpp
+++ b/runtime/TypeManager.cpp
@@ -18,11 +18,7 @@
#include "TypeManager.h"
-#ifndef NN_COMPATIBILITY_LIBRARY_BUILD
-#include <PackageInfo.h>
-#include <binder/IServiceManager.h>
-#include <procpartition/procpartition.h>
-#endif // NN_COMPATIBILITY_LIBRARY_BUILD
+#include <LegacyUtils.h>
#include <android-base/file.h>
#include <android-base/properties.h>
@@ -34,6 +30,12 @@
#include <string_view>
#include <vector>
+#ifndef NN_COMPATIBILITY_LIBRARY_BUILD
+#include <PackageInfo.h>
+#include <binder/IServiceManager.h>
+#include <procpartition/procpartition.h>
+#endif // NN_COMPATIBILITY_LIBRARY_BUILD
+
namespace android {
namespace nn {
@@ -124,7 +126,7 @@
getVendorExtensionAllowlistedApps());
#else
mExtensionsAllowed = true;
-#endif
+#endif // NN_COMPATIBILITY_LIBRARY_BUILD
VLOG(MANAGER) << "NNAPI Vendor extensions enabled: " << mExtensionsAllowed;
findAvailableExtensions();
}
diff --git a/runtime/include/NeuralNetworksWrapper.h b/runtime/include/NeuralNetworksWrapper.h
index cb3271a..d796a1c 100644
--- a/runtime/include/NeuralNetworksWrapper.h
+++ b/runtime/include/NeuralNetworksWrapper.h
@@ -19,12 +19,6 @@
#ifndef ANDROID_FRAMEWORKS_ML_NN_RUNTIME_NEURAL_NETWORKS_WRAPPER_H
#define ANDROID_FRAMEWORKS_ML_NN_RUNTIME_NEURAL_NETWORKS_WRAPPER_H
-#ifdef NNTEST_SLTS
-#include "SupportLibrary.h"
-#else
-#include "NeuralNetworks.h"
-#endif
-
#include <assert.h>
#include <math.h>
@@ -34,6 +28,12 @@
#include <utility>
#include <vector>
+#ifdef NNTEST_SLTS
+#include "SupportLibrary.h"
+#else
+#include "NeuralNetworks.h"
+#endif
+
namespace android {
namespace nn {
namespace wrapper {
diff --git a/runtime/include/NeuralNetworksWrapperExtensions.h b/runtime/include/NeuralNetworksWrapperExtensions.h
index 524e8da..967efef 100644
--- a/runtime/include/NeuralNetworksWrapperExtensions.h
+++ b/runtime/include/NeuralNetworksWrapperExtensions.h
@@ -17,11 +17,13 @@
#ifndef ANDROID_FRAMEWORKS_ML_NN_RUNTIME_NEURAL_NETWORKS_WRAPPER_EXTENSIONS_H
#define ANDROID_FRAMEWORKS_ML_NN_RUNTIME_NEURAL_NETWORKS_WRAPPER_EXTENSIONS_H
+#include <utility>
+#include <variant>
+#include <vector>
+
#include "NeuralNetworksExtensions.h"
#include "NeuralNetworksWrapper.h"
-#include <variant>
-
namespace android {
namespace nn {
namespace extension_wrapper {
diff --git a/runtime/packageinfo/PackageInfo.cpp b/runtime/packageinfo/PackageInfo.cpp
index b986acb..85e29a6 100644
--- a/runtime/packageinfo/PackageInfo.cpp
+++ b/runtime/packageinfo/PackageInfo.cpp
@@ -17,9 +17,11 @@
#define LOG_TAG "PackageInfo"
#include "PackageInfo.h"
+
#include <android-base/logging.h>
#include <android/content/pm/IPackageManagerNative.h>
#include <binder/IServiceManager.h>
+
#include <string>
#include <vector>
diff --git a/runtime/test/GeneratedTestUtils.cpp b/runtime/test/GeneratedTestUtils.cpp
index 9742200..60c2a8d 100644
--- a/runtime/test/GeneratedTestUtils.cpp
+++ b/runtime/test/GeneratedTestUtils.cpp
@@ -25,13 +25,14 @@
#include <utility>
#include <vector>
+#include "TestHarness.h"
+
#ifdef NNTEST_SLTS
#include <android/hardware_buffer.h>
#include "SupportLibraryWrapper.h"
#else
#include "TestNeuralNetworksWrapper.h"
#endif
-#include "TestHarness.h"
namespace android::nn::generated_tests {
using namespace test_wrapper;
diff --git a/runtime/test/GeneratedTestUtils.h b/runtime/test/GeneratedTestUtils.h
index 0fcf65c..5a3866d 100644
--- a/runtime/test/GeneratedTestUtils.h
+++ b/runtime/test/GeneratedTestUtils.h
@@ -24,12 +24,13 @@
#include <utility>
#include <vector>
+#include "TestHarness.h"
+
#ifdef NNTEST_SLTS
#include "SupportLibraryWrapper.h"
#else
#include "TestNeuralNetworksWrapper.h"
#endif
-#include "TestHarness.h"
namespace android::nn::generated_tests {
diff --git a/runtime/test/HalUtils.h b/runtime/test/HalUtils.h
index c0962db..98503c3 100644
--- a/runtime/test/HalUtils.h
+++ b/runtime/test/HalUtils.h
@@ -17,6 +17,8 @@
#ifndef ANDROID_FRAMEWORKS_ML_NN_RUNTIME_TEST_HAL_UTILS_H
#define ANDROID_FRAMEWORKS_ML_NN_RUNTIME_TEST_HAL_UTILS_H
+#include <HalInterfaces.h>
+#include <Utils.h>
#include <nnapi/hal/1.0/Device.h>
#include <nnapi/hal/1.1/Device.h>
#include <nnapi/hal/1.2/Device.h>
@@ -26,9 +28,6 @@
#include <string>
#include <utility>
-#include "HalInterfaces.h"
-#include "Utils.h"
-
namespace android::nn {
// Creates valid V1_3::Capabilities.
diff --git a/runtime/test/SupportLibraryTestGenerated.cpp b/runtime/test/SupportLibraryTestGenerated.cpp
index c42361b..9375476 100644
--- a/runtime/test/SupportLibraryTestGenerated.cpp
+++ b/runtime/test/SupportLibraryTestGenerated.cpp
@@ -41,7 +41,7 @@
// constraints. We reuse the NNTEST_ONLY_PUBLIC_API flag, as that should also be
// the case for CTS (public APIs only).
#ifndef NNTEST_ONLY_PUBLIC_API
-#include "Tracing.h"
+#include <Tracing.h>
#else
#define NNTRACE_FULL_RAW(...)
#define NNTRACE_APP(...)
diff --git a/runtime/test/SupportLibraryTestMain.cpp b/runtime/test/SupportLibraryTestMain.cpp
index 741f253..54b60af 100644
--- a/runtime/test/SupportLibraryTestMain.cpp
+++ b/runtime/test/SupportLibraryTestMain.cpp
@@ -14,11 +14,11 @@
* limitations under the License.
*/
+#include <gtest/gtest.h>
+
#include <iostream>
#include <string>
-#include <gtest/gtest.h>
-
std::string SUPPORT_LIBRARY_NAME;
int main(int argc, char** argv) {
diff --git a/runtime/test/TestCompilationCaching.cpp b/runtime/test/TestCompilationCaching.cpp
index 4604a3f..d69637a 100644
--- a/runtime/test/TestCompilationCaching.cpp
+++ b/runtime/test/TestCompilationCaching.cpp
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+#include <HalInterfaces.h>
#include <android-base/scopeguard.h>
#include <gtest/gtest.h>
@@ -25,7 +26,6 @@
#include <tuple>
#include <vector>
-#include "HalInterfaces.h"
#include "HalUtils.h"
#include "Manager.h"
#include "SampleDriver.h"
diff --git a/runtime/test/TestCompliance.cpp b/runtime/test/TestCompliance.cpp
index 2d2dcd6..815ea5c 100644
--- a/runtime/test/TestCompliance.cpp
+++ b/runtime/test/TestCompliance.cpp
@@ -14,16 +14,16 @@
* limitations under the License.
*/
+#include <HalInterfaces.h>
+#include <MemoryUtils.h>
+#include <Utils.h>
#include <android-base/scopeguard.h>
#include <gtest/gtest.h>
#include "GeneratedTestUtils.h"
-#include "HalInterfaces.h"
#include "Memory.h"
-#include "MemoryUtils.h"
#include "ModelBuilder.h"
#include "TestNeuralNetworksWrapper.h"
-#include "Utils.h"
namespace android::nn::compliance_test {
diff --git a/runtime/test/TestControlFlow.cpp b/runtime/test/TestControlFlow.cpp
index dc7a099..dc6af38 100644
--- a/runtime/test/TestControlFlow.cpp
+++ b/runtime/test/TestControlFlow.cpp
@@ -16,10 +16,10 @@
#define LOG_TAG "TestControlFlow"
+#include <ControlFlow.h>
#include <android-base/logging.h>
#include <gtest/gtest.h>
-#include "ControlFlow.h"
#include "TestNeuralNetworksWrapper.h"
namespace android {
diff --git a/runtime/test/TestExecution.cpp b/runtime/test/TestExecution.cpp
index b286234..203e970 100644
--- a/runtime/test/TestExecution.cpp
+++ b/runtime/test/TestExecution.cpp
@@ -14,6 +14,8 @@
* limitations under the License.
*/
+#include <HalInterfaces.h>
+#include <ValidateHal.h>
#include <gtest/gtest.h>
#include <algorithm>
@@ -28,7 +30,6 @@
#include "CompilationBuilder.h"
#include "ExecutionBurstServer.h"
#include "ExecutionCallback.h"
-#include "HalInterfaces.h"
#include "HalUtils.h"
#include "Manager.h"
#include "ModelBuilder.h"
@@ -36,7 +37,6 @@
#include "PreparedModelCallback.h"
#include "SampleDriver.h"
#include "TestNeuralNetworksWrapper.h"
-#include "ValidateHal.h"
namespace android {
diff --git a/runtime/test/TestExtensions.cpp b/runtime/test/TestExtensions.cpp
index e7d923b..918c843 100644
--- a/runtime/test/TestExtensions.cpp
+++ b/runtime/test/TestExtensions.cpp
@@ -14,13 +14,13 @@
* limitations under the License.
*/
+#include <HalInterfaces.h>
#include <gtest/gtest.h>
#include <string>
#include <vector>
#include "AppInfoFetcher.h"
-#include "HalInterfaces.h"
#include "HalUtils.h"
#include "Manager.h"
#include "NeuralNetworks.h"
diff --git a/runtime/test/TestFree.cpp b/runtime/test/TestFree.cpp
index dedf55e..519e9a7 100644
--- a/runtime/test/TestFree.cpp
+++ b/runtime/test/TestFree.cpp
@@ -19,12 +19,12 @@
// Limitation: It doesn't set various combinations of properties on objects before
// freeing those objects.
-#include "NeuralNetworks.h"
-
#include <gtest/gtest.h>
#include <vector>
+#include "NeuralNetworks.h"
+
namespace {
ANeuralNetworksModel* createUnfinishedModel() {
diff --git a/runtime/test/TestGenerated.cpp b/runtime/test/TestGenerated.cpp
index 75536ec..2eb904d 100644
--- a/runtime/test/TestGenerated.cpp
+++ b/runtime/test/TestGenerated.cpp
@@ -42,7 +42,7 @@
// constraints. We reuse the NNTEST_ONLY_PUBLIC_API flag, as that should also be
// the case for CTS (public APIs only).
#ifndef NNTEST_ONLY_PUBLIC_API
-#include "Tracing.h"
+#include <Tracing.h>
#else
#define NNTRACE_FULL_RAW(...)
#define NNTRACE_APP(...)
diff --git a/runtime/test/TestIntrospectionControl.cpp b/runtime/test/TestIntrospectionControl.cpp
index 078b8f4..3da4530 100644
--- a/runtime/test/TestIntrospectionControl.cpp
+++ b/runtime/test/TestIntrospectionControl.cpp
@@ -14,6 +14,9 @@
* limitations under the License.
*/
+#include <ExecutionBurstServer.h>
+#include <HalInterfaces.h>
+#include <ValidateHal.h>
#include <gtest/gtest.h>
#include <algorithm>
@@ -29,15 +32,12 @@
#include <vector>
#include "CompilationBuilder.h"
-#include "ExecutionBurstServer.h"
-#include "HalInterfaces.h"
#include "HalUtils.h"
#include "Manager.h"
#include "NeuralNetworks.h"
#include "NeuralNetworksOEM.h"
#include "SampleDriver.h"
#include "TestNeuralNetworksWrapper.h"
-#include "ValidateHal.h"
namespace {
diff --git a/runtime/test/TestMain.cpp b/runtime/test/TestMain.cpp
index 0d490c8..016c6e3 100644
--- a/runtime/test/TestMain.cpp
+++ b/runtime/test/TestMain.cpp
@@ -16,14 +16,6 @@
#define LOG_TAG "NeuralNetworksTest"
-#include "LogTestCaseToLogcat.h"
-#include "TestNeuralNetworksWrapper.h"
-
-#ifndef NNTEST_ONLY_PUBLIC_API
-#include "Manager.h"
-#include "Utils.h"
-#endif
-
#include <android-base/logging.h>
#include <gtest/gtest.h>
@@ -32,6 +24,15 @@
#include <sstream>
#include <string>
+#include "LogTestCaseToLogcat.h"
+#include "TestNeuralNetworksWrapper.h"
+
+#ifndef NNTEST_ONLY_PUBLIC_API
+#include <Utils.h>
+
+#include "Manager.h"
+#endif
+
namespace {
using namespace android::nn::test_wrapper;
diff --git a/runtime/test/TestMemoryDomain.cpp b/runtime/test/TestMemoryDomain.cpp
index 50dd0bf..cd57126 100644
--- a/runtime/test/TestMemoryDomain.cpp
+++ b/runtime/test/TestMemoryDomain.cpp
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+#include <HalInterfaces.h>
#include <android/hardware/neuralnetworks/1.2/ADevice.h>
#include <gtest/gtest.h>
@@ -25,7 +26,6 @@
#include <utility>
#include <vector>
-#include "HalInterfaces.h"
#include "HalUtils.h"
#include "Manager.h"
#include "Memory.h"
diff --git a/runtime/test/TestMemoryInternal.cpp b/runtime/test/TestMemoryInternal.cpp
index 5657912..67e282b 100644
--- a/runtime/test/TestMemoryInternal.cpp
+++ b/runtime/test/TestMemoryInternal.cpp
@@ -18,18 +18,17 @@
// files, including NN API HIDL definitions.
// It is not part of CTS.
-#include "TestMemory.h"
-
-#include "Manager.h"
-#include "Memory.h"
-#include "TestNeuralNetworksWrapper.h"
-
#include <android/sharedmem.h>
#include <gtest/gtest.h>
#include <fstream>
#include <string>
+#include "Manager.h"
+#include "Memory.h"
+#include "TestMemory.h"
+#include "TestNeuralNetworksWrapper.h"
+
using WrapperCompilation = ::android::nn::test_wrapper::Compilation;
using WrapperExecution = ::android::nn::test_wrapper::Execution;
using WrapperMemory = ::android::nn::test_wrapper::Memory;
diff --git a/runtime/test/TestOpenmpSettings.cpp b/runtime/test/TestOpenmpSettings.cpp
index af50c63..0720745 100644
--- a/runtime/test/TestOpenmpSettings.cpp
+++ b/runtime/test/TestOpenmpSettings.cpp
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-#include "CpuExecutor.h"
-
+#include <CpuExecutor.h>
#include <gtest/gtest.h>
#include <omp.h>
#include <unistd.h>
+
#include <algorithm>
#include <memory>
#include <random>
diff --git a/runtime/test/TestOperandExtraParams.cpp b/runtime/test/TestOperandExtraParams.cpp
index ce7f589..3f7f969 100644
--- a/runtime/test/TestOperandExtraParams.cpp
+++ b/runtime/test/TestOperandExtraParams.cpp
@@ -14,14 +14,15 @@
* limitations under the License.
*/
+#include <gtest/gtest.h>
+
#include "NeuralNetworks.h"
#include "NeuralNetworksOEM.h"
#include "NeuralNetworksWrapper.h"
-#ifndef NNTEST_ONLY_PUBLIC_API
-#include "Utils.h"
-#endif
-#include <gtest/gtest.h>
+#ifndef NNTEST_ONLY_PUBLIC_API
+#include <Utils.h>
+#endif
namespace {
diff --git a/runtime/test/TestPartitioning.cpp b/runtime/test/TestPartitioning.cpp
index 5618382..f428aea 100644
--- a/runtime/test/TestPartitioning.cpp
+++ b/runtime/test/TestPartitioning.cpp
@@ -14,6 +14,10 @@
* limitations under the License.
*/
+#include <ControlFlow.h>
+#include <HalInterfaces.h>
+#include <Utils.h>
+#include <ValidateHal.h>
#include <gtest/gtest.h>
#include <algorithm>
@@ -30,9 +34,7 @@
#include <vector>
#include "CompilationBuilder.h"
-#include "ControlFlow.h"
#include "ExecutionPlan.h"
-#include "HalInterfaces.h"
#include "HalUtils.h"
#include "Manager.h"
#include "ModelBuilder.h"
@@ -40,8 +42,6 @@
#include "NeuralNetworksOEM.h"
#include "SampleDriver.h"
#include "TestNeuralNetworksWrapper.h"
-#include "Utils.h"
-#include "ValidateHal.h"
// Uncomment the following line to generate some debugging output that
// may be useful when analyzing failures:
diff --git a/runtime/test/TestPartitioningRandom.cpp b/runtime/test/TestPartitioningRandom.cpp
index 37c1357..9937028 100644
--- a/runtime/test/TestPartitioningRandom.cpp
+++ b/runtime/test/TestPartitioningRandom.cpp
@@ -14,13 +14,14 @@
* limitations under the License.
*/
+#include <HalInterfaces.h>
+#include <ValidateHal.h>
#include <android-base/logging.h>
-#include <gtest/gtest.h>
-#include <unistd.h>
-
#include <android/hardware/neuralnetworks/1.0/ADevice.h>
#include <android/hardware/neuralnetworks/1.1/ADevice.h>
#include <android/hardware/neuralnetworks/1.2/ADevice.h>
+#include <gtest/gtest.h>
+#include <unistd.h>
#include <algorithm>
#include <cassert>
@@ -36,14 +37,12 @@
#include <vector>
#include "CompilationBuilder.h"
-#include "HalInterfaces.h"
#include "HalUtils.h"
#include "Manager.h"
#include "ModelBuilder.h"
#include "NeuralNetworks.h"
#include "SampleDriver.h"
#include "TestNeuralNetworksWrapper.h"
-#include "ValidateHal.h"
// Uncomment the following line to generate some debugging output that
// may be useful when analyzing failures:
diff --git a/runtime/test/TestRemoveDefaultArguments.cpp b/runtime/test/TestRemoveDefaultArguments.cpp
index dee4ed2..eb99bbb 100644
--- a/runtime/test/TestRemoveDefaultArguments.cpp
+++ b/runtime/test/TestRemoveDefaultArguments.cpp
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+#include <Utils.h>
#include <gtest/gtest.h>
#include <algorithm>
@@ -27,7 +28,6 @@
#include "Manager.h"
#include "SampleDriverPartial.h"
#include "TestNeuralNetworksWrapper.h"
-#include "Utils.h"
namespace generated_tests::avg_pool_v1_2 {
const test_helper::TestModel& get_test_model_nhwc();
diff --git a/runtime/test/TestUnspecifiedDimensions.cpp b/runtime/test/TestUnspecifiedDimensions.cpp
index 5a2287c..a17e47a 100644
--- a/runtime/test/TestUnspecifiedDimensions.cpp
+++ b/runtime/test/TestUnspecifiedDimensions.cpp
@@ -14,18 +14,18 @@
* limitations under the License.
*/
-#include "TestNeuralNetworksWrapper.h"
-
+#include <android-base/macros.h>
+#include <android/sharedmem.h>
+#include <gtest/gtest.h>
#include <sys/mman.h>
+
#include <memory>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
-#include <android-base/macros.h>
-#include <android/sharedmem.h>
-#include <gtest/gtest.h>
+#include "TestNeuralNetworksWrapper.h"
using namespace android::nn::test_wrapper;
diff --git a/runtime/test/TestWrapper.cpp b/runtime/test/TestWrapper.cpp
index 1ab8f95..d75f677 100644
--- a/runtime/test/TestWrapper.cpp
+++ b/runtime/test/TestWrapper.cpp
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-#include "NeuralNetworksWrapper.h"
-
#include <gtest/gtest.h>
+#include "NeuralNetworksWrapper.h"
+
using namespace ::android::nn::wrapper;
// This file tests certain aspects of the interfaces from NeuralNetworksWrapper.h.
diff --git a/runtime/test/android_fuzzing/DriverFuzzTest.cpp b/runtime/test/android_fuzzing/DriverFuzzTest.cpp
index a103728..5f0cc2a 100644
--- a/runtime/test/android_fuzzing/DriverFuzzTest.cpp
+++ b/runtime/test/android_fuzzing/DriverFuzzTest.cpp
@@ -14,6 +14,8 @@
* limitations under the License.
*/
+#include <MemoryUtils.h>
+#include <Utils.h>
#include <android-base/logging.h>
#include <android/hardware/neuralnetworks/1.3/IDevice.h>
#include <android/hardware/neuralnetworks/1.3/IPreparedModel.h>
@@ -26,10 +28,8 @@
#include <utility>
#include <vector>
-#include "MemoryUtils.h"
#include "SampleDriverFull.h"
#include "TestHarness.h"
-#include "Utils.h"
namespace {
diff --git a/runtime/test/android_fuzzing/FuzzHarness.cpp b/runtime/test/android_fuzzing/FuzzHarness.cpp
index 55ff1e6..e6aef56 100644
--- a/runtime/test/android_fuzzing/FuzzHarness.cpp
+++ b/runtime/test/android_fuzzing/FuzzHarness.cpp
@@ -14,13 +14,13 @@
* limitations under the License.
*/
+#include <LegacyUtils.h>
#include <nnapi/TypeUtils.h>
#include <src/libfuzzer/libfuzzer_macro.h>
#include <algorithm>
#include "Converter.h"
-#include "LegacyUtils.h"
#include "Model.pb.h"
#include "TestHarness.h"
diff --git a/runtime/test/fibonacci_extension/FibonacciDriver.cpp b/runtime/test/fibonacci_extension/FibonacciDriver.cpp
index 66023c1..95dfc99 100644
--- a/runtime/test/fibonacci_extension/FibonacciDriver.cpp
+++ b/runtime/test/fibonacci_extension/FibonacciDriver.cpp
@@ -18,16 +18,17 @@
#include "FibonacciDriver.h"
+#include <HalInterfaces.h>
+#include <OperationResolver.h>
+#include <OperationsUtils.h>
+#include <Utils.h>
+#include <ValidateHal.h>
+#include <nnapi/Types.h>
+
#include <vector>
-#include <nnapi/Types.h>
#include "FibonacciExtension.h"
-#include "HalInterfaces.h"
#include "NeuralNetworksExtensions.h"
-#include "OperationResolver.h"
-#include "OperationsUtils.h"
-#include "Utils.h"
-#include "ValidateHal.h"
namespace android {
namespace nn {
diff --git a/runtime/test/fibonacci_extension/FibonacciDriver.h b/runtime/test/fibonacci_extension/FibonacciDriver.h
index 7daf4d2..8ca09e6 100644
--- a/runtime/test/fibonacci_extension/FibonacciDriver.h
+++ b/runtime/test/fibonacci_extension/FibonacciDriver.h
@@ -17,8 +17,9 @@
#ifndef ANDROID_FRAMEWORKS_ML_NN_RUNTIME_TEST_FIBONACCI_EXTENSION_FIBONACCI_DRIVER_H
#define ANDROID_FRAMEWORKS_ML_NN_RUNTIME_TEST_FIBONACCI_EXTENSION_FIBONACCI_DRIVER_H
-#include "HalInterfaces.h"
-#include "OperationResolver.h"
+#include <HalInterfaces.h>
+#include <OperationResolver.h>
+
#include "SampleDriver.h"
namespace android {
diff --git a/runtime/test/fibonacci_extension/FibonacciExtensionTest.cpp b/runtime/test/fibonacci_extension/FibonacciExtensionTest.cpp
index b740f89..07cdb58 100644
--- a/runtime/test/fibonacci_extension/FibonacciExtensionTest.cpp
+++ b/runtime/test/fibonacci_extension/FibonacciExtensionTest.cpp
@@ -14,13 +14,14 @@
* limitations under the License.
*/
+#include <HalInterfaces.h>
+#include <ValidateHal.h>
#include <gtest/gtest.h>
#include <vector>
#include "FibonacciDriver.h"
#include "FibonacciExtension.h"
-#include "HalInterfaces.h"
#include "HalUtils.h"
#include "Manager.h"
#include "NeuralNetworks.h"
@@ -28,7 +29,6 @@
#include "NeuralNetworksWrapperExtensions.h"
#include "TestNeuralNetworksWrapper.h"
#include "TypeManager.h"
-#include "ValidateHal.h"
namespace android {
namespace nn {
diff --git a/runtime/test/fuzzing/TestRandomGraph.cpp b/runtime/test/fuzzing/TestRandomGraph.cpp
index f3efcba..667cb23 100644
--- a/runtime/test/fuzzing/TestRandomGraph.cpp
+++ b/runtime/test/fuzzing/TestRandomGraph.cpp
@@ -32,11 +32,11 @@
#include "fuzzing/RandomGraphGeneratorUtils.h"
#ifndef NNTEST_CTS
+#include <HalInterfaces.h>
#include <memunreachable/memunreachable.h>
#include <vector>
-#include "HalInterfaces.h"
#include "HalUtils.h"
#include "Manager.h"
#include "SampleDriverFull.h"
diff --git a/sl/SupportLibrary.cpp b/sl/SupportLibrary.cpp
index 2d92aef..72a5d68 100644
--- a/sl/SupportLibrary.cpp
+++ b/sl/SupportLibrary.cpp
@@ -17,6 +17,7 @@
#include "SupportLibrary.h"
#include <dlfcn.h>
+
#include <cstring>
#include <memory>
#include <string>
diff --git a/tools/ion_watcher/ion_watcher.cpp b/tools/ion_watcher/ion_watcher.cpp
index 1a79b38..cf1ecbf 100644
--- a/tools/ion_watcher/ion_watcher.cpp
+++ b/tools/ion_watcher/ion_watcher.cpp
@@ -16,14 +16,14 @@
#define LOG_TAG "IonWatcher"
+#include <android/log.h>
#include <stdio.h>
#include <unistd.h>
+
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
-
-#include <android/log.h>
#define ATRACE_TAG ATRACE_TAG_NNAPI
#include <utils/Trace.h>