From 79efe33fdc8475ae9f5da2eee1b15b306871b769 Mon Sep 17 00:00:00 2001 From: nihui Date: Fri, 25 Dec 2020 11:24:56 +0800 Subject: [PATCH] cmake option for platform api uses (#2502) * cmake option for platform api uses * adroid gpu ci does not rely on glslangvalidator, add android termux ci --- .github/workflows/android-armv7-gpu.yml | 15 +-------- .github/workflows/android-armv8-gpu.yml | 41 ++++++++----------------- .github/workflows/android-x64-gpu.yml | 15 +-------- .github/workflows/android-x86-gpu.yml | 15 +-------- CMakeLists.txt | 1 + src/CMakeLists.txt | 2 +- src/allocator.h | 4 +++ src/command.cpp | 2 ++ src/command.h | 2 ++ src/datareader.cpp | 2 ++ src/datareader.h | 4 +++ src/mat.cpp | 4 +++ src/mat.h | 6 ++++ src/mat_pixel_android.cpp | 4 +++ src/net.cpp | 2 ++ src/net.h | 4 +++ src/pipeline.cpp | 3 ++ src/pipeline.h | 3 ++ src/platform.h.in | 7 +++-- 19 files changed, 62 insertions(+), 74 deletions(-) diff --git a/.github/workflows/android-armv7-gpu.yml b/.github/workflows/android-armv7-gpu.yml index 1a0703812..f82594b2e 100644 --- a/.github/workflows/android-armv7-gpu.yml +++ b/.github/workflows/android-armv7-gpu.yml @@ -7,20 +7,7 @@ jobs: - uses: actions/checkout@v2 with: submodules: true - - name: cache-vulkansdk - id: cache-vulkansdk - uses: actions/cache@v1 - with: - path: "1.2.148.1" - key: vulkansdk-linux-x86_64-1.2.148.1 - - name: vulkansdk - if: steps.cache-vulkansdk.outputs.cache-hit != 'true' - run: | - wget https://sdk.lunarg.com/sdk/download/1.2.148.1/linux/vulkansdk-linux-x86_64-1.2.148.1.tar.gz?Human=true -O vulkansdk-linux-x86_64-1.2.148.1.tar.gz - tar -xf vulkansdk-linux-x86_64-1.2.148.1.tar.gz - rm -rf 1.2.148.1/source 1.2.148.1/samples - find 1.2.148.1 -type f | grep -v -E 'vulkan|glslang' | xargs rm - name: configure - run: export PATH=`pwd`/1.2.148.1/x86_64/bin:$PATH && mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_ABI="armeabi-v7a" -DANDROID_ARM_NEON=ON -DANDROID_PLATFORM=android-24 -DNCNN_VULKAN=ON .. + run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_ABI="armeabi-v7a" -DANDROID_ARM_NEON=ON -DANDROID_PLATFORM=android-24 -DNCNN_VULKAN=ON .. - name: build run: cmake --build build -j 2 diff --git a/.github/workflows/android-armv8-gpu.yml b/.github/workflows/android-armv8-gpu.yml index 32d49e2fc..834c6a90e 100644 --- a/.github/workflows/android-armv8-gpu.yml +++ b/.github/workflows/android-armv8-gpu.yml @@ -7,21 +7,8 @@ jobs: - uses: actions/checkout@v2 with: submodules: true - - name: cache-vulkansdk - id: cache-vulkansdk - uses: actions/cache@v1 - with: - path: "1.2.148.1" - key: vulkansdk-linux-x86_64-1.2.148.1 - - name: vulkansdk - if: steps.cache-vulkansdk.outputs.cache-hit != 'true' - run: | - wget https://sdk.lunarg.com/sdk/download/1.2.148.1/linux/vulkansdk-linux-x86_64-1.2.148.1.tar.gz?Human=true -O vulkansdk-linux-x86_64-1.2.148.1.tar.gz - tar -xf vulkansdk-linux-x86_64-1.2.148.1.tar.gz - rm -rf 1.2.148.1/source 1.2.148.1/samples - find 1.2.148.1 -type f | grep -v -E 'vulkan|glslang' | xargs rm - name: configure - run: export PATH=`pwd`/1.2.148.1/x86_64/bin:$PATH && mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_ABI="arm64-v8a" -DANDROID_PLATFORM=android-24 -DNCNN_VULKAN=ON .. + run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_ABI="arm64-v8a" -DANDROID_PLATFORM=android-24 -DNCNN_VULKAN=ON .. - name: build run: cmake --build build -j 2 @@ -31,24 +18,22 @@ jobs: - uses: actions/checkout@v2 with: submodules: true - - name: cache-vulkansdk - id: cache-vulkansdk - uses: actions/cache@v1 - with: - path: "1.2.148.1" - key: vulkansdk-linux-x86_64-1.2.148.1 - - name: vulkansdk - if: steps.cache-vulkansdk.outputs.cache-hit != 'true' - run: | - wget https://sdk.lunarg.com/sdk/download/1.2.148.1/linux/vulkansdk-linux-x86_64-1.2.148.1.tar.gz?Human=true -O vulkansdk-linux-x86_64-1.2.148.1.tar.gz - tar -xf vulkansdk-linux-x86_64-1.2.148.1.tar.gz - rm -rf 1.2.148.1/source 1.2.148.1/samples - find 1.2.148.1 -type f | grep -v -E 'vulkan|glslang' | xargs rm - name: ndk-r16b run: | wget https://dl.google.com/android/repository/android-ndk-r16b-linux-x86_64.zip -O $GITHUB_WORKSPACE/android-ndk-r16b-linux-x86_64.zip cd $GITHUB_WORKSPACE && unzip -q android-ndk-r16b-linux-x86_64.zip - name: configure - run: export PATH=`pwd`/1.2.148.1/x86_64/bin:$PATH && mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/android-ndk-r16b/build/cmake/android.toolchain.cmake -DANDROID_ABI="arm64-v8a" -DANDROID_PLATFORM=android-24 -DNCNN_VULKAN=ON .. + run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/android-ndk-r16b/build/cmake/android.toolchain.cmake -DANDROID_ABI="arm64-v8a" -DANDROID_PLATFORM=android-24 -DNCNN_VULKAN=ON .. + - name: build + run: cmake --build build -j 2 + + android-aarch64-gpu-termux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - name: configure + run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_ABI="arm64-v8a" -DANDROID_PLATFORM=android-24 -DNCNN_VULKAN=ON -DNCNN_PLATFORM_API=OFF .. - name: build run: cmake --build build -j 2 diff --git a/.github/workflows/android-x64-gpu.yml b/.github/workflows/android-x64-gpu.yml index 9e614d83e..c0e3e2041 100644 --- a/.github/workflows/android-x64-gpu.yml +++ b/.github/workflows/android-x64-gpu.yml @@ -7,20 +7,7 @@ jobs: - uses: actions/checkout@v2 with: submodules: true - - name: cache-vulkansdk - id: cache-vulkansdk - uses: actions/cache@v1 - with: - path: "1.2.148.1" - key: vulkansdk-linux-x86_64-1.2.148.1 - - name: vulkansdk - if: steps.cache-vulkansdk.outputs.cache-hit != 'true' - run: | - wget https://sdk.lunarg.com/sdk/download/1.2.148.1/linux/vulkansdk-linux-x86_64-1.2.148.1.tar.gz?Human=true -O vulkansdk-linux-x86_64-1.2.148.1.tar.gz - tar -xf vulkansdk-linux-x86_64-1.2.148.1.tar.gz - rm -rf 1.2.148.1/source 1.2.148.1/samples - find 1.2.148.1 -type f | grep -v -E 'vulkan|glslang' | xargs rm - name: configure - run: export PATH=`pwd`/1.2.148.1/x86_64/bin:$PATH && mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_ABI="x86_64" -DANDROID_PLATFORM=android-24 -DNCNN_VULKAN=ON .. + run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_ABI="x86_64" -DANDROID_PLATFORM=android-24 -DNCNN_VULKAN=ON .. - name: build run: cmake --build build -j 2 diff --git a/.github/workflows/android-x86-gpu.yml b/.github/workflows/android-x86-gpu.yml index 50236e64f..54ff3620c 100644 --- a/.github/workflows/android-x86-gpu.yml +++ b/.github/workflows/android-x86-gpu.yml @@ -7,20 +7,7 @@ jobs: - uses: actions/checkout@v2 with: submodules: true - - name: cache-vulkansdk - id: cache-vulkansdk - uses: actions/cache@v1 - with: - path: "1.2.148.1" - key: vulkansdk-linux-x86_64-1.2.148.1 - - name: vulkansdk - if: steps.cache-vulkansdk.outputs.cache-hit != 'true' - run: | - wget https://sdk.lunarg.com/sdk/download/1.2.148.1/linux/vulkansdk-linux-x86_64-1.2.148.1.tar.gz?Human=true -O vulkansdk-linux-x86_64-1.2.148.1.tar.gz - tar -xf vulkansdk-linux-x86_64-1.2.148.1.tar.gz - rm -rf 1.2.148.1/source 1.2.148.1/samples - find 1.2.148.1 -type f | grep -v -E 'vulkan|glslang' | xargs rm - name: configure - run: export PATH=`pwd`/1.2.148.1/x86_64/bin:$PATH && mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_ABI="x86" -DANDROID_PLATFORM=android-24 -DNCNN_VULKAN=ON .. + run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_ABI="x86" -DANDROID_PLATFORM=android-24 -DNCNN_VULKAN=ON .. - name: build run: cmake --build build -j 2 diff --git a/CMakeLists.txt b/CMakeLists.txt index 0f98520da..e7d856541 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,6 +46,7 @@ option(NCNN_SIMPLEOMP "minimal openmp runtime emulation" OFF) option(NCNN_SIMPLESTL "minimal cpp stl structure emulation" OFF) option(NCNN_THREADS "build with threads" ON) option(NCNN_BENCHMARK "print benchmark information for every layer" OFF) +option(NCNN_PLATFORM_API "build with platform api candy" ON) option(NCNN_PIXEL "convert and resize from/to image pixel" ON) option(NCNN_PIXEL_ROTATE "rotate image pixel orientation" ON) option(NCNN_PIXEL_AFFINE "warp affine image pixel" ON) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e460f2aa1..f94a2a03b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -238,7 +238,7 @@ if(NCNN_VULKAN) target_link_libraries(ncnn PRIVATE glslang SPIRV) endif() -if(ANDROID_NDK) +if(NCNN_PLATFORM_API AND ANDROID_NDK) target_link_libraries(ncnn PUBLIC android jnigraphics log) endif() diff --git a/src/allocator.h b/src/allocator.h index a12476fb6..497564e67 100644 --- a/src/allocator.h +++ b/src/allocator.h @@ -28,9 +28,11 @@ #include #endif // NCNN_VULKAN +#if NCNN_PLATFORM_API #if __ANDROID_API__ >= 26 #include #endif // __ANDROID_API__ >= 26 +#endif // NCNN_PLATFORM_API namespace ncnn { @@ -388,6 +390,7 @@ public: protected: }; +#if NCNN_PLATFORM_API #if __ANDROID_API__ >= 26 class ImportAndroidHardwareBufferPipeline; class VkAndroidHardwareBufferImageAllocator : public VkAllocator @@ -422,6 +425,7 @@ public: VkSamplerYcbcrConversionKHR samplerYcbcrConversion; }; #endif // __ANDROID_API__ >= 26 +#endif // NCNN_PLATFORM_API #endif // NCNN_VULKAN diff --git a/src/command.cpp b/src/command.cpp index 6673dea93..982565732 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -1646,6 +1646,7 @@ void VkCompute::record_write_timestamp(uint32_t query) } #endif // NCNN_BENCHMARK +#if NCNN_PLATFORM_API #if __ANDROID_API__ >= 26 void VkCompute::record_import_android_hardware_buffer(const ImportAndroidHardwareBufferPipeline* pipeline, const VkImageMat& src, const VkMat& dst) { @@ -2076,6 +2077,7 @@ void VkCompute::record_import_android_hardware_buffer(const ImportAndroidHardwar } } #endif // __ANDROID_API__ >= 26 +#endif // NCNN_PLATFORM_API int VkCompute::submit_and_wait() { diff --git a/src/command.h b/src/command.h index 089659243..e363faa75 100644 --- a/src/command.h +++ b/src/command.h @@ -73,11 +73,13 @@ public: void record_write_timestamp(uint32_t query); #endif // NCNN_BENCHMARK +#if NCNN_PLATFORM_API #if __ANDROID_API__ >= 26 void record_import_android_hardware_buffer(const ImportAndroidHardwareBufferPipeline* pipeline, const VkImageMat& src, const VkMat& dst); void record_import_android_hardware_buffer(const ImportAndroidHardwareBufferPipeline* pipeline, const VkImageMat& src, const VkImageMat& dst); #endif // __ANDROID_API__ >= 26 +#endif // NCNN_PLATFORM_API int submit_and_wait(); diff --git a/src/datareader.cpp b/src/datareader.cpp index 6260eea11..7f168c140 100644 --- a/src/datareader.cpp +++ b/src/datareader.cpp @@ -83,6 +83,7 @@ size_t DataReaderFromMemory::read(void* buf, size_t size) const return size; } +#if NCNN_PLATFORM_API #if __ANDROID_API__ >= 9 DataReaderFromAndroidAsset::DataReaderFromAndroidAsset(AAsset* _asset) : asset(_asset), mem(0) @@ -133,5 +134,6 @@ size_t DataReaderFromAndroidAsset::read(void* buf, size_t size) const return nread; } #endif // __ANDROID_API__ >= 9 +#endif // NCNN_PLATFORM_API } // namespace ncnn diff --git a/src/datareader.h b/src/datareader.h index 5cdf3d7f1..478d2cc3a 100644 --- a/src/datareader.h +++ b/src/datareader.h @@ -20,9 +20,11 @@ #include #endif +#if NCNN_PLATFORM_API #if __ANDROID_API__ >= 9 #include #endif +#endif // NCNN_PLATFORM_API namespace ncnn { @@ -73,6 +75,7 @@ protected: const unsigned char*& mem; }; +#if NCNN_PLATFORM_API #if __ANDROID_API__ >= 9 class DataReaderFromAndroidAsset : public DataReader { @@ -89,6 +92,7 @@ protected: mutable const unsigned char* mem; }; #endif // __ANDROID_API__ >= 9 +#endif // NCNN_PLATFORM_API } // namespace ncnn diff --git a/src/mat.cpp b/src/mat.cpp index d0ff9b6f8..2b7d8961d 100644 --- a/src/mat.cpp +++ b/src/mat.cpp @@ -24,9 +24,11 @@ #include #if NCNN_VULKAN +#if NCNN_PLATFORM_API #if __ANDROID_API__ >= 26 #include #endif // __ANDROID_API__ >= 26 +#endif // NCNN_PLATFORM_API #endif // NCNN_VULKAN namespace ncnn { @@ -179,6 +181,7 @@ Mat Mat::from_float16(const unsigned short* data, int size) } #if NCNN_VULKAN +#if NCNN_PLATFORM_API #if __ANDROID_API__ >= 26 VkImageMat VkImageMat::from_android_hardware_buffer(VkAndroidHardwareBufferImageAllocator* allocator) { @@ -188,6 +191,7 @@ VkImageMat VkImageMat::from_android_hardware_buffer(VkAndroidHardwareBufferImage return VkImageMat(width, height, allocator); } #endif // __ANDROID_API__ >= 26 +#endif // NCNN_PLATFORM_API #endif // NCNN_VULKAN unsigned short float32_to_float16(float value) diff --git a/src/mat.h b/src/mat.h index fc5a14646..af28c4844 100644 --- a/src/mat.h +++ b/src/mat.h @@ -33,10 +33,12 @@ #endif // NCNN_VULKAN #if NCNN_PIXEL +#if NCNN_PLATFORM_API #if __ANDROID_API__ >= 9 #include #include #endif // __ANDROID_API__ >= 9 +#endif // NCNN_PLATFORM_API #endif // NCNN_PIXEL namespace ncnn { @@ -233,6 +235,7 @@ public: // convenient export to pixel data and resize to specific size with stride(bytes-per-row) parameter void to_pixels_resize(unsigned char* pixels, int type, int target_width, int target_height, int target_stride) const; +#if NCNN_PLATFORM_API #if __ANDROID_API__ >= 9 // convenient construct from android Bitmap static Mat from_android_bitmap(JNIEnv* env, jobject bitmap, int type_to, Allocator* allocator = 0); @@ -245,6 +248,7 @@ public: // convenient export to android Bitmap and resize to the android Bitmap size void to_android_bitmap(JNIEnv* env, jobject bitmap, int type_from) const; #endif // __ANDROID_API__ >= 9 +#endif // NCNN_PLATFORM_API #endif // NCNN_PIXEL // substract channel-wise mean values, then multiply by normalize values, pass 0 to skip @@ -475,10 +479,12 @@ public: VkImage image() const; VkImageView imageview() const; +#if NCNN_PLATFORM_API #if __ANDROID_API__ >= 26 // convenient construct from android hardware buffer static VkImageMat from_android_hardware_buffer(VkAndroidHardwareBufferImageAllocator* allocator); #endif // __ANDROID_API__ >= 26 +#endif // NCNN_PLATFORM_API // device image VkImageMemory* data; diff --git a/src/mat_pixel_android.cpp b/src/mat_pixel_android.cpp index d3b37e18d..6e70b7fe0 100644 --- a/src/mat_pixel_android.cpp +++ b/src/mat_pixel_android.cpp @@ -16,13 +16,16 @@ #if NCNN_PIXEL +#if NCNN_PLATFORM_API #if __ANDROID_API__ >= 9 #include #include #endif // __ANDROID_API__ >= 9 +#endif // NCNN_PLATFORM_API namespace ncnn { +#if NCNN_PLATFORM_API #if __ANDROID_API__ >= 9 Mat Mat::from_android_bitmap(JNIEnv* env, jobject bitmap, int type_to, Allocator* allocator) { @@ -214,6 +217,7 @@ void Mat::to_android_bitmap(JNIEnv* env, jobject bitmap, int type_from) const AndroidBitmap_unlockPixels(env, bitmap); } #endif // __ANDROID_API__ >= 9 +#endif // NCNN_PLATFORM_API } // namespace ncnn diff --git a/src/net.cpp b/src/net.cpp index 761f8d3ee..7b7ea659a 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -708,6 +708,7 @@ int Net::load_model(const unsigned char* _mem) return static_cast(mem - _mem); } +#if NCNN_PLATFORM_API #if __ANDROID_API__ >= 9 #if NCNN_STRING int Net::load_param(AAsset* asset) @@ -771,6 +772,7 @@ int Net::load_model(AAssetManager* mgr, const char* assetpath) return ret; } #endif // __ANDROID_API__ >= 9 +#endif // NCNN_PLATFORM_API int Net::fuse_network() { diff --git a/src/net.h b/src/net.h index b78bd05d7..3c1923461 100644 --- a/src/net.h +++ b/src/net.h @@ -21,9 +21,11 @@ #include "option.h" #include "platform.h" +#if NCNN_PLATFORM_API #if __ANDROID_API__ >= 9 #include #endif // __ANDROID_API__ >= 9 +#endif // NCNN_PLATFORM_API namespace ncnn { @@ -103,6 +105,7 @@ public: // return bytes consumed int load_model(const unsigned char* mem); +#if NCNN_PLATFORM_API #if __ANDROID_API__ >= 9 #if NCNN_STRING // convenient load network structure from android asset plain param file @@ -117,6 +120,7 @@ public: int load_model(AAsset* asset); int load_model(AAssetManager* mgr, const char* assetpath); #endif // __ANDROID_API__ >= 9 +#endif // NCNN_PLATFORM_API // unload network structure and weight data void clear(); diff --git a/src/pipeline.cpp b/src/pipeline.cpp index 36e647221..a41c0125b 100644 --- a/src/pipeline.cpp +++ b/src/pipeline.cpp @@ -115,6 +115,7 @@ void Pipeline::set_local_size_xyz(int w, int h, int c) // NCNN_LOGE("local size = %d %d %d", local_size_x, local_size_y, local_size_z); } +#if NCNN_PLATFORM_API #if __ANDROID_API__ >= 26 ImportAndroidHardwareBufferPipeline::ImportAndroidHardwareBufferPipeline(const VulkanDevice* _vkdev) : Pipeline(_vkdev) @@ -340,6 +341,8 @@ int ImportAndroidHardwareBufferPipeline::create_descriptorset_layout() return 0; } #endif // __ANDROID_API__ >= 26 +#endif // NCNN_PLATFORM_API + #endif // NCNN_VULKAN } // namespace ncnn diff --git a/src/pipeline.h b/src/pipeline.h index bab6a8cea..19d3585a2 100644 --- a/src/pipeline.h +++ b/src/pipeline.h @@ -58,6 +58,7 @@ public: uint32_t local_size_z; }; +#if NCNN_PLATFORM_API #if __ANDROID_API__ >= 26 class VkCompute; class ImportAndroidHardwareBufferPipeline : private Pipeline @@ -85,6 +86,8 @@ public: VkSampler sampler; }; #endif // __ANDROID_API__ >= 26 +#endif // NCNN_PLATFORM_API + #endif // NCNN_VULKAN } // namespace ncnn diff --git a/src/platform.h.in b/src/platform.h.in index 8987ca414..2c41fc8d4 100644 --- a/src/platform.h.in +++ b/src/platform.h.in @@ -22,6 +22,7 @@ #cmakedefine01 NCNN_SIMPLESTL #cmakedefine01 NCNN_THREADS #cmakedefine01 NCNN_BENCHMARK +#cmakedefine01 NCNN_PLATFORM_API #cmakedefine01 NCNN_PIXEL #cmakedefine01 NCNN_PIXEL_ROTATE #cmakedefine01 NCNN_PIXEL_AFFINE @@ -214,16 +215,16 @@ private: #endif // __cplusplus #if NCNN_STDIO -#if __ANDROID_API__ >= 8 +#if NCNN_PLATFORM_API && __ANDROID_API__ >= 8 #include #define NCNN_LOGE(...) do { \ fprintf(stderr, ##__VA_ARGS__); fprintf(stderr, "\n"); \ __android_log_print(ANDROID_LOG_WARN, "ncnn", ##__VA_ARGS__); } while(0) -#else // __ANDROID_API__ >= 8 +#else // NCNN_PLATFORM_API && __ANDROID_API__ >= 8 #include #define NCNN_LOGE(...) do { \ fprintf(stderr, ##__VA_ARGS__); fprintf(stderr, "\n"); } while(0) -#endif // __ANDROID_API__ >= 8 +#endif // NCNN_PLATFORM_API && __ANDROID_API__ >= 8 #else #define NCNN_LOGE(...) #endif