11 |
12 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 yge58
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 |
2 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
3 |
4 | buildscript {
5 | repositories {
6 | jcenter()
7 | }
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:2.3.3'
10 |
11 | // NOTE: Do not place your application dependencies here; they belong
12 | // in the individual module build.gradle files
13 | }
14 | }
15 |
16 | allprojects {
17 | repositories {
18 | jcenter()
19 | }
20 | }
--------------------------------------------------------------------------------
/camera.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/device-2017-10-23-185701.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/device-2017-10-23-185701.png
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Feb 02 13:44:22 PST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
7 |
--------------------------------------------------------------------------------
/local.properties:
--------------------------------------------------------------------------------
1 | ## This file is automatically generated by Android Studio.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must *NOT* be checked into Version Control Systems,
5 | # as it contains information specific to your local configuration.
6 | #
7 | # Location of the SDK. This is only used by Gradle.
8 | # For customization when using a Version Control System, please read the
9 | # header note.
10 | #Wed Sep 27 15:11:58 EDT 2017
11 | ndk.dir=/root/Android/Sdk/ndk-bundle
12 | sdk.dir=/root/Android/Sdk
13 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':texture-view'
2 |
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/debug/arm64-v8a/.ninja_deps:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/.externalNativeBuild/cmake/debug/arm64-v8a/.ninja_deps
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/debug/arm64-v8a/CMakeFiles/3.6.0-rc2/CMakeDetermineCompilerABI_C.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/.externalNativeBuild/cmake/debug/arm64-v8a/CMakeFiles/3.6.0-rc2/CMakeDetermineCompilerABI_C.bin
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/debug/arm64-v8a/CMakeFiles/3.6.0-rc2/CMakeDetermineCompilerABI_CXX.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/.externalNativeBuild/cmake/debug/arm64-v8a/CMakeFiles/3.6.0-rc2/CMakeDetermineCompilerABI_CXX.bin
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/debug/arm64-v8a/CMakeFiles/3.6.0-rc2/CMakeSystem.cmake:
--------------------------------------------------------------------------------
1 | set(CMAKE_HOST_SYSTEM "Linux-4.4.0-83-generic")
2 | set(CMAKE_HOST_SYSTEM_NAME "Linux")
3 | set(CMAKE_HOST_SYSTEM_VERSION "4.4.0-83-generic")
4 | set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64")
5 |
6 | include("/root/Android/Sdk/ndk-bundle/build/cmake/android.toolchain.cmake")
7 |
8 | set(CMAKE_SYSTEM "Android-24")
9 | set(CMAKE_SYSTEM_NAME "Android")
10 | set(CMAKE_SYSTEM_VERSION "24")
11 | set(CMAKE_SYSTEM_PROCESSOR "aarch64")
12 |
13 | set(CMAKE_CROSSCOMPILING "TRUE")
14 |
15 | set(CMAKE_SYSTEM_LOADED 1)
16 |
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/debug/arm64-v8a/CMakeFiles/TargetDirectories.txt:
--------------------------------------------------------------------------------
1 | /home/yan/camera/texture-view/.externalNativeBuild/cmake/debug/arm64-v8a/CMakeFiles/edit_cache.dir
2 | /home/yan/camera/texture-view/.externalNativeBuild/cmake/debug/arm64-v8a/CMakeFiles/rebuild_cache.dir
3 | /home/yan/camera/texture-view/.externalNativeBuild/cmake/debug/arm64-v8a/CMakeFiles/camera_textureview.dir
4 |
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/debug/arm64-v8a/CMakeFiles/cmake.check_cache:
--------------------------------------------------------------------------------
1 | # This file is generated by cmake for dependency checking of the CMakeCache.txt file
2 |
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/debug/arm64-v8a/CMakeFiles/feature_tests.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/.externalNativeBuild/cmake/debug/arm64-v8a/CMakeFiles/feature_tests.bin
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/debug/arm64-v8a/CMakeFiles/feature_tests.c:
--------------------------------------------------------------------------------
1 |
2 | const char features[] = {"\n"
3 | "C_FEATURE:"
4 | #if ((__clang_major__ * 100) + __clang_minor__) >= 304
5 | "1"
6 | #else
7 | "0"
8 | #endif
9 | "c_function_prototypes\n"
10 | "C_FEATURE:"
11 | #if ((__clang_major__ * 100) + __clang_minor__) >= 304 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
12 | "1"
13 | #else
14 | "0"
15 | #endif
16 | "c_restrict\n"
17 | "C_FEATURE:"
18 | #if ((__clang_major__ * 100) + __clang_minor__) >= 304 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
19 | "1"
20 | #else
21 | "0"
22 | #endif
23 | "c_static_assert\n"
24 | "C_FEATURE:"
25 | #if ((__clang_major__ * 100) + __clang_minor__) >= 304 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
26 | "1"
27 | #else
28 | "0"
29 | #endif
30 | "c_variadic_macros\n"
31 |
32 | };
33 |
34 | int main(int argc, char** argv) { (void)argv; return features[argc]; }
35 |
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/debug/arm64-v8a/cmake_build_command.txt:
--------------------------------------------------------------------------------
1 | Executable : /root/Android/Sdk/cmake/3.6.4111459/bin/cmake
2 | arguments :
3 | -H/home/yan/camera/texture-view/src/main/cpp
4 | -B/home/yan/camera/texture-view/.externalNativeBuild/cmake/debug/arm64-v8a
5 | -GAndroid Gradle - Ninja
6 | -DANDROID_ABI=arm64-v8a
7 | -DANDROID_NDK=/root/Android/Sdk/ndk-bundle
8 | -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/yan/camera/texture-view/build/intermediates/cmake/debug/obj/arm64-v8a
9 | -DCMAKE_BUILD_TYPE=Debug
10 | -DCMAKE_MAKE_PROGRAM=/root/Android/Sdk/cmake/3.6.4111459/bin/ninja
11 | -DCMAKE_TOOLCHAIN_FILE=/root/Android/Sdk/ndk-bundle/build/cmake/android.toolchain.cmake
12 | -DANDROID_PLATFORM=android-24
13 | -DANDROID_STL=gnustl_static
14 | -DANDROID_TOOLCHAIN=clang
15 | -DANDROID_PLATFORM=android-24
16 | jvmArgs :
17 |
18 |
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/debug/arm64-v8a/cmake_build_output.txt:
--------------------------------------------------------------------------------
1 | -- Check for working C compiler: /root/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang
2 | -- Check for working C compiler: /root/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -- works
3 | -- Detecting C compiler ABI info
4 | -- Detecting C compiler ABI info - done
5 | -- Detecting C compile features
6 | -- Detecting C compile features - done
7 | -- Check for working CXX compiler: /root/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++
8 | -- Check for working CXX compiler: /root/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -- works
9 | -- Detecting CXX compiler ABI info
10 | -- Detecting CXX compiler ABI info - done
11 | -- Detecting CXX compile features
12 | -- Detecting CXX compile features - done
13 | -- Configuring done
14 | -- Generating done
15 | -- Build files have been written to: /home/yan/camera/texture-view/.externalNativeBuild/cmake/debug/arm64-v8a
16 |
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/debug/arm64-v8a/cmake_install.cmake:
--------------------------------------------------------------------------------
1 | # Install script for directory: /home/yan/camera/texture-view/src/main/cpp
2 |
3 | # Set the install prefix
4 | if(NOT DEFINED CMAKE_INSTALL_PREFIX)
5 | set(CMAKE_INSTALL_PREFIX "/usr/local")
6 | endif()
7 | string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
8 |
9 | # Set the install configuration name.
10 | if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
11 | if(BUILD_TYPE)
12 | string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
13 | CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
14 | else()
15 | set(CMAKE_INSTALL_CONFIG_NAME "Debug")
16 | endif()
17 | message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
18 | endif()
19 |
20 | # Set the component getting installed.
21 | if(NOT CMAKE_INSTALL_COMPONENT)
22 | if(COMPONENT)
23 | message(STATUS "Install component: \"${COMPONENT}\"")
24 | set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
25 | else()
26 | set(CMAKE_INSTALL_COMPONENT)
27 | endif()
28 | endif()
29 |
30 | # Install shared libraries without execute permission?
31 | if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
32 | set(CMAKE_INSTALL_SO_NO_EXE "1")
33 | endif()
34 |
35 | if(CMAKE_INSTALL_COMPONENT)
36 | set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
37 | else()
38 | set(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
39 | endif()
40 |
41 | string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
42 | "${CMAKE_INSTALL_MANIFEST_FILES}")
43 | file(WRITE "/home/yan/camera/texture-view/.externalNativeBuild/cmake/debug/arm64-v8a/${CMAKE_INSTALL_MANIFEST}"
44 | "${CMAKE_INSTALL_MANIFEST_CONTENT}")
45 |
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/3.6.0-rc2/CMakeDetermineCompilerABI_C.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/3.6.0-rc2/CMakeDetermineCompilerABI_C.bin
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/3.6.0-rc2/CMakeDetermineCompilerABI_CXX.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/3.6.0-rc2/CMakeDetermineCompilerABI_CXX.bin
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/3.6.0-rc2/CMakeSystem.cmake:
--------------------------------------------------------------------------------
1 | set(CMAKE_HOST_SYSTEM "Linux-4.4.0-83-generic")
2 | set(CMAKE_HOST_SYSTEM_NAME "Linux")
3 | set(CMAKE_HOST_SYSTEM_VERSION "4.4.0-83-generic")
4 | set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64")
5 |
6 | include("/root/Android/Sdk/ndk-bundle/build/cmake/android.toolchain.cmake")
7 |
8 | set(CMAKE_SYSTEM "Android-24")
9 | set(CMAKE_SYSTEM_NAME "Android")
10 | set(CMAKE_SYSTEM_VERSION "24")
11 | set(CMAKE_SYSTEM_PROCESSOR "armv7-a")
12 |
13 | set(CMAKE_CROSSCOMPILING "TRUE")
14 |
15 | set(CMAKE_SYSTEM_LOADED 1)
16 |
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/TargetDirectories.txt:
--------------------------------------------------------------------------------
1 | /home/yan/camera/texture-view/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/edit_cache.dir
2 | /home/yan/camera/texture-view/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/rebuild_cache.dir
3 | /home/yan/camera/texture-view/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/ndk-module.dir
4 | /home/yan/camera/texture-view/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/cpufeatures.dir
5 |
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/cmake.check_cache:
--------------------------------------------------------------------------------
1 | # This file is generated by cmake for dependency checking of the CMakeCache.txt file
2 |
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/feature_tests.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/feature_tests.bin
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/feature_tests.c:
--------------------------------------------------------------------------------
1 |
2 | const char features[] = {"\n"
3 | "C_FEATURE:"
4 | #if ((__clang_major__ * 100) + __clang_minor__) >= 304
5 | "1"
6 | #else
7 | "0"
8 | #endif
9 | "c_function_prototypes\n"
10 | "C_FEATURE:"
11 | #if ((__clang_major__ * 100) + __clang_minor__) >= 304 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
12 | "1"
13 | #else
14 | "0"
15 | #endif
16 | "c_restrict\n"
17 | "C_FEATURE:"
18 | #if ((__clang_major__ * 100) + __clang_minor__) >= 304 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
19 | "1"
20 | #else
21 | "0"
22 | #endif
23 | "c_static_assert\n"
24 | "C_FEATURE:"
25 | #if ((__clang_major__ * 100) + __clang_minor__) >= 304 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
26 | "1"
27 | #else
28 | "0"
29 | #endif
30 | "c_variadic_macros\n"
31 |
32 | };
33 |
34 | int main(int argc, char** argv) { (void)argv; return features[argc]; }
35 |
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/debug/armeabi-v7a/cmake_build_command.txt:
--------------------------------------------------------------------------------
1 | Executable : /root/Android/Sdk/cmake/3.6.4111459/bin/cmake
2 | arguments :
3 | -H/home/yan/camera/texture-view/src/main/cpp
4 | -B/home/yan/camera/texture-view/.externalNativeBuild/cmake/debug/armeabi-v7a
5 | -GAndroid Gradle - Ninja
6 | -DANDROID_ABI=armeabi-v7a
7 | -DANDROID_NDK=/root/Android/Sdk/ndk-bundle
8 | -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/yan/camera/texture-view/build/intermediates/cmake/debug/obj/armeabi-v7a
9 | -DCMAKE_BUILD_TYPE=Debug
10 | -DCMAKE_MAKE_PROGRAM=/root/Android/Sdk/cmake/3.6.4111459/bin/ninja
11 | -DCMAKE_TOOLCHAIN_FILE=/root/Android/Sdk/ndk-bundle/build/cmake/android.toolchain.cmake
12 | -DANDROID_PLATFORM=android-24
13 | -DANDROID_STL=gnustl_static
14 | -DANDROID_TOOLCHAIN=clang
15 | -DANDROID_PLATFORM=android-24
16 | jvmArgs :
17 |
18 |
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/debug/armeabi-v7a/cmake_build_output.txt:
--------------------------------------------------------------------------------
1 | -- Check for working C compiler: /root/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang
2 | -- Check for working C compiler: /root/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -- works
3 | -- Detecting C compiler ABI info
4 | -- Detecting C compiler ABI info - done
5 | -- Detecting C compile features
6 | -- Detecting C compile features - done
7 | -- Check for working CXX compiler: /root/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++
8 | -- Check for working CXX compiler: /root/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -- works
9 | -- Detecting CXX compiler ABI info
10 | -- Detecting CXX compiler ABI info - done
11 | -- Detecting CXX compile features
12 | -- Detecting CXX compile features - done
13 | -- Configuring done
14 | -- Generating done
15 | -- Build files have been written to: /home/yan/camera/texture-view/.externalNativeBuild/cmake/debug/armeabi-v7a
16 |
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/debug/armeabi-v7a/cmake_install.cmake:
--------------------------------------------------------------------------------
1 | # Install script for directory: /home/yan/camera/texture-view/src/main/cpp
2 |
3 | # Set the install prefix
4 | if(NOT DEFINED CMAKE_INSTALL_PREFIX)
5 | set(CMAKE_INSTALL_PREFIX "/usr/local")
6 | endif()
7 | string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
8 |
9 | # Set the install configuration name.
10 | if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
11 | if(BUILD_TYPE)
12 | string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
13 | CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
14 | else()
15 | set(CMAKE_INSTALL_CONFIG_NAME "Debug")
16 | endif()
17 | message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
18 | endif()
19 |
20 | # Set the component getting installed.
21 | if(NOT CMAKE_INSTALL_COMPONENT)
22 | if(COMPONENT)
23 | message(STATUS "Install component: \"${COMPONENT}\"")
24 | set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
25 | else()
26 | set(CMAKE_INSTALL_COMPONENT)
27 | endif()
28 | endif()
29 |
30 | # Install shared libraries without execute permission?
31 | if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
32 | set(CMAKE_INSTALL_SO_NO_EXE "1")
33 | endif()
34 |
35 | if(CMAKE_INSTALL_COMPONENT)
36 | set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
37 | else()
38 | set(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
39 | endif()
40 |
41 | string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
42 | "${CMAKE_INSTALL_MANIFEST_FILES}")
43 | file(WRITE "/home/yan/camera/texture-view/.externalNativeBuild/cmake/debug/armeabi-v7a/${CMAKE_INSTALL_MANIFEST}"
44 | "${CMAKE_INSTALL_MANIFEST_CONTENT}")
45 |
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/release/arm64-v8a/CMakeFiles/3.6.0-rc2/CMakeDetermineCompilerABI_C.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/.externalNativeBuild/cmake/release/arm64-v8a/CMakeFiles/3.6.0-rc2/CMakeDetermineCompilerABI_C.bin
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/release/arm64-v8a/CMakeFiles/3.6.0-rc2/CMakeDetermineCompilerABI_CXX.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/.externalNativeBuild/cmake/release/arm64-v8a/CMakeFiles/3.6.0-rc2/CMakeDetermineCompilerABI_CXX.bin
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/release/arm64-v8a/CMakeFiles/3.6.0-rc2/CMakeSystem.cmake:
--------------------------------------------------------------------------------
1 | set(CMAKE_HOST_SYSTEM "Linux-4.4.0-83-generic")
2 | set(CMAKE_HOST_SYSTEM_NAME "Linux")
3 | set(CMAKE_HOST_SYSTEM_VERSION "4.4.0-83-generic")
4 | set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64")
5 |
6 | include("/root/Android/Sdk/ndk-bundle/build/cmake/android.toolchain.cmake")
7 |
8 | set(CMAKE_SYSTEM "Android-24")
9 | set(CMAKE_SYSTEM_NAME "Android")
10 | set(CMAKE_SYSTEM_VERSION "24")
11 | set(CMAKE_SYSTEM_PROCESSOR "aarch64")
12 |
13 | set(CMAKE_CROSSCOMPILING "TRUE")
14 |
15 | set(CMAKE_SYSTEM_LOADED 1)
16 |
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/release/arm64-v8a/CMakeFiles/TargetDirectories.txt:
--------------------------------------------------------------------------------
1 | /home/yan/camera/texture-view/.externalNativeBuild/cmake/release/arm64-v8a/CMakeFiles/edit_cache.dir
2 | /home/yan/camera/texture-view/.externalNativeBuild/cmake/release/arm64-v8a/CMakeFiles/rebuild_cache.dir
3 | /home/yan/camera/texture-view/.externalNativeBuild/cmake/release/arm64-v8a/CMakeFiles/camera_textureview.dir
4 |
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/release/arm64-v8a/CMakeFiles/cmake.check_cache:
--------------------------------------------------------------------------------
1 | # This file is generated by cmake for dependency checking of the CMakeCache.txt file
2 |
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/release/arm64-v8a/CMakeFiles/feature_tests.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/.externalNativeBuild/cmake/release/arm64-v8a/CMakeFiles/feature_tests.bin
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/release/arm64-v8a/CMakeFiles/feature_tests.c:
--------------------------------------------------------------------------------
1 |
2 | const char features[] = {"\n"
3 | "C_FEATURE:"
4 | #if ((__clang_major__ * 100) + __clang_minor__) >= 304
5 | "1"
6 | #else
7 | "0"
8 | #endif
9 | "c_function_prototypes\n"
10 | "C_FEATURE:"
11 | #if ((__clang_major__ * 100) + __clang_minor__) >= 304 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
12 | "1"
13 | #else
14 | "0"
15 | #endif
16 | "c_restrict\n"
17 | "C_FEATURE:"
18 | #if ((__clang_major__ * 100) + __clang_minor__) >= 304 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
19 | "1"
20 | #else
21 | "0"
22 | #endif
23 | "c_static_assert\n"
24 | "C_FEATURE:"
25 | #if ((__clang_major__ * 100) + __clang_minor__) >= 304 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
26 | "1"
27 | #else
28 | "0"
29 | #endif
30 | "c_variadic_macros\n"
31 |
32 | };
33 |
34 | int main(int argc, char** argv) { (void)argv; return features[argc]; }
35 |
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/release/arm64-v8a/cmake_build_command.txt:
--------------------------------------------------------------------------------
1 | Executable : /root/Android/Sdk/cmake/3.6.4111459/bin/cmake
2 | arguments :
3 | -H/home/yan/camera/texture-view/src/main/cpp
4 | -B/home/yan/camera/texture-view/.externalNativeBuild/cmake/release/arm64-v8a
5 | -GAndroid Gradle - Ninja
6 | -DANDROID_ABI=arm64-v8a
7 | -DANDROID_NDK=/root/Android/Sdk/ndk-bundle
8 | -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/yan/camera/texture-view/build/intermediates/cmake/release/obj/arm64-v8a
9 | -DCMAKE_BUILD_TYPE=Release
10 | -DCMAKE_MAKE_PROGRAM=/root/Android/Sdk/cmake/3.6.4111459/bin/ninja
11 | -DCMAKE_TOOLCHAIN_FILE=/root/Android/Sdk/ndk-bundle/build/cmake/android.toolchain.cmake
12 | -DANDROID_PLATFORM=android-24
13 | -DANDROID_STL=gnustl_static
14 | -DANDROID_TOOLCHAIN=clang
15 | -DANDROID_PLATFORM=android-24
16 | jvmArgs :
17 |
18 |
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/release/arm64-v8a/cmake_build_output.txt:
--------------------------------------------------------------------------------
1 | -- Check for working C compiler: /root/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang
2 | -- Check for working C compiler: /root/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -- works
3 | -- Detecting C compiler ABI info
4 | -- Detecting C compiler ABI info - done
5 | -- Detecting C compile features
6 | -- Detecting C compile features - done
7 | -- Check for working CXX compiler: /root/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++
8 | -- Check for working CXX compiler: /root/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -- works
9 | -- Detecting CXX compiler ABI info
10 | -- Detecting CXX compiler ABI info - done
11 | -- Detecting CXX compile features
12 | -- Detecting CXX compile features - done
13 | -- Configuring done
14 | -- Generating done
15 | -- Build files have been written to: /home/yan/camera/texture-view/.externalNativeBuild/cmake/release/arm64-v8a
16 |
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/release/arm64-v8a/cmake_install.cmake:
--------------------------------------------------------------------------------
1 | # Install script for directory: /home/yan/camera/texture-view/src/main/cpp
2 |
3 | # Set the install prefix
4 | if(NOT DEFINED CMAKE_INSTALL_PREFIX)
5 | set(CMAKE_INSTALL_PREFIX "/usr/local")
6 | endif()
7 | string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
8 |
9 | # Set the install configuration name.
10 | if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
11 | if(BUILD_TYPE)
12 | string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
13 | CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
14 | else()
15 | set(CMAKE_INSTALL_CONFIG_NAME "Release")
16 | endif()
17 | message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
18 | endif()
19 |
20 | # Set the component getting installed.
21 | if(NOT CMAKE_INSTALL_COMPONENT)
22 | if(COMPONENT)
23 | message(STATUS "Install component: \"${COMPONENT}\"")
24 | set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
25 | else()
26 | set(CMAKE_INSTALL_COMPONENT)
27 | endif()
28 | endif()
29 |
30 | # Install shared libraries without execute permission?
31 | if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
32 | set(CMAKE_INSTALL_SO_NO_EXE "1")
33 | endif()
34 |
35 | if(CMAKE_INSTALL_COMPONENT)
36 | set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
37 | else()
38 | set(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
39 | endif()
40 |
41 | string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
42 | "${CMAKE_INSTALL_MANIFEST_FILES}")
43 | file(WRITE "/home/yan/camera/texture-view/.externalNativeBuild/cmake/release/arm64-v8a/${CMAKE_INSTALL_MANIFEST}"
44 | "${CMAKE_INSTALL_MANIFEST_CONTENT}")
45 |
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/release/armeabi-v7a/CMakeFiles/3.6.0-rc2/CMakeDetermineCompilerABI_C.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/.externalNativeBuild/cmake/release/armeabi-v7a/CMakeFiles/3.6.0-rc2/CMakeDetermineCompilerABI_C.bin
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/release/armeabi-v7a/CMakeFiles/3.6.0-rc2/CMakeDetermineCompilerABI_CXX.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/.externalNativeBuild/cmake/release/armeabi-v7a/CMakeFiles/3.6.0-rc2/CMakeDetermineCompilerABI_CXX.bin
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/release/armeabi-v7a/CMakeFiles/3.6.0-rc2/CMakeSystem.cmake:
--------------------------------------------------------------------------------
1 | set(CMAKE_HOST_SYSTEM "Linux-4.4.0-83-generic")
2 | set(CMAKE_HOST_SYSTEM_NAME "Linux")
3 | set(CMAKE_HOST_SYSTEM_VERSION "4.4.0-83-generic")
4 | set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64")
5 |
6 | include("/root/Android/Sdk/ndk-bundle/build/cmake/android.toolchain.cmake")
7 |
8 | set(CMAKE_SYSTEM "Android-24")
9 | set(CMAKE_SYSTEM_NAME "Android")
10 | set(CMAKE_SYSTEM_VERSION "24")
11 | set(CMAKE_SYSTEM_PROCESSOR "armv7-a")
12 |
13 | set(CMAKE_CROSSCOMPILING "TRUE")
14 |
15 | set(CMAKE_SYSTEM_LOADED 1)
16 |
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/release/armeabi-v7a/CMakeFiles/TargetDirectories.txt:
--------------------------------------------------------------------------------
1 | /home/yan/camera/texture-view/.externalNativeBuild/cmake/release/armeabi-v7a/CMakeFiles/edit_cache.dir
2 | /home/yan/camera/texture-view/.externalNativeBuild/cmake/release/armeabi-v7a/CMakeFiles/rebuild_cache.dir
3 | /home/yan/camera/texture-view/.externalNativeBuild/cmake/release/armeabi-v7a/CMakeFiles/ndk-module.dir
4 | /home/yan/camera/texture-view/.externalNativeBuild/cmake/release/armeabi-v7a/CMakeFiles/cpufeatures.dir
5 |
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/release/armeabi-v7a/CMakeFiles/cmake.check_cache:
--------------------------------------------------------------------------------
1 | # This file is generated by cmake for dependency checking of the CMakeCache.txt file
2 |
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/release/armeabi-v7a/CMakeFiles/feature_tests.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/.externalNativeBuild/cmake/release/armeabi-v7a/CMakeFiles/feature_tests.bin
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/release/armeabi-v7a/CMakeFiles/feature_tests.c:
--------------------------------------------------------------------------------
1 |
2 | const char features[] = {"\n"
3 | "C_FEATURE:"
4 | #if ((__clang_major__ * 100) + __clang_minor__) >= 304
5 | "1"
6 | #else
7 | "0"
8 | #endif
9 | "c_function_prototypes\n"
10 | "C_FEATURE:"
11 | #if ((__clang_major__ * 100) + __clang_minor__) >= 304 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
12 | "1"
13 | #else
14 | "0"
15 | #endif
16 | "c_restrict\n"
17 | "C_FEATURE:"
18 | #if ((__clang_major__ * 100) + __clang_minor__) >= 304 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
19 | "1"
20 | #else
21 | "0"
22 | #endif
23 | "c_static_assert\n"
24 | "C_FEATURE:"
25 | #if ((__clang_major__ * 100) + __clang_minor__) >= 304 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
26 | "1"
27 | #else
28 | "0"
29 | #endif
30 | "c_variadic_macros\n"
31 |
32 | };
33 |
34 | int main(int argc, char** argv) { (void)argv; return features[argc]; }
35 |
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/release/armeabi-v7a/cmake_build_command.txt:
--------------------------------------------------------------------------------
1 | Executable : /root/Android/Sdk/cmake/3.6.4111459/bin/cmake
2 | arguments :
3 | -H/home/yan/camera/texture-view/src/main/cpp
4 | -B/home/yan/camera/texture-view/.externalNativeBuild/cmake/release/armeabi-v7a
5 | -GAndroid Gradle - Ninja
6 | -DANDROID_ABI=armeabi-v7a
7 | -DANDROID_NDK=/root/Android/Sdk/ndk-bundle
8 | -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/yan/camera/texture-view/build/intermediates/cmake/release/obj/armeabi-v7a
9 | -DCMAKE_BUILD_TYPE=Release
10 | -DCMAKE_MAKE_PROGRAM=/root/Android/Sdk/cmake/3.6.4111459/bin/ninja
11 | -DCMAKE_TOOLCHAIN_FILE=/root/Android/Sdk/ndk-bundle/build/cmake/android.toolchain.cmake
12 | -DANDROID_PLATFORM=android-24
13 | -DANDROID_STL=gnustl_static
14 | -DANDROID_TOOLCHAIN=clang
15 | -DANDROID_PLATFORM=android-24
16 | jvmArgs :
17 |
18 |
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/release/armeabi-v7a/cmake_build_output.txt:
--------------------------------------------------------------------------------
1 | -- Check for working C compiler: /root/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang
2 | -- Check for working C compiler: /root/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -- works
3 | -- Detecting C compiler ABI info
4 | -- Detecting C compiler ABI info - done
5 | -- Detecting C compile features
6 | -- Detecting C compile features - done
7 | -- Check for working CXX compiler: /root/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++
8 | -- Check for working CXX compiler: /root/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -- works
9 | -- Detecting CXX compiler ABI info
10 | -- Detecting CXX compiler ABI info - done
11 | -- Detecting CXX compile features
12 | -- Detecting CXX compile features - done
13 | -- Configuring done
14 | -- Generating done
15 | -- Build files have been written to: /home/yan/camera/texture-view/.externalNativeBuild/cmake/release/armeabi-v7a
16 |
--------------------------------------------------------------------------------
/texture-view/.externalNativeBuild/cmake/release/armeabi-v7a/cmake_install.cmake:
--------------------------------------------------------------------------------
1 | # Install script for directory: /home/yan/camera/texture-view/src/main/cpp
2 |
3 | # Set the install prefix
4 | if(NOT DEFINED CMAKE_INSTALL_PREFIX)
5 | set(CMAKE_INSTALL_PREFIX "/usr/local")
6 | endif()
7 | string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
8 |
9 | # Set the install configuration name.
10 | if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
11 | if(BUILD_TYPE)
12 | string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
13 | CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
14 | else()
15 | set(CMAKE_INSTALL_CONFIG_NAME "Release")
16 | endif()
17 | message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
18 | endif()
19 |
20 | # Set the component getting installed.
21 | if(NOT CMAKE_INSTALL_COMPONENT)
22 | if(COMPONENT)
23 | message(STATUS "Install component: \"${COMPONENT}\"")
24 | set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
25 | else()
26 | set(CMAKE_INSTALL_COMPONENT)
27 | endif()
28 | endif()
29 |
30 | # Install shared libraries without execute permission?
31 | if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
32 | set(CMAKE_INSTALL_SO_NO_EXE "1")
33 | endif()
34 |
35 | if(CMAKE_INSTALL_COMPONENT)
36 | set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
37 | else()
38 | set(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
39 | endif()
40 |
41 | string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
42 | "${CMAKE_INSTALL_MANIFEST_FILES}")
43 | file(WRITE "/home/yan/camera/texture-view/.externalNativeBuild/cmake/release/armeabi-v7a/${CMAKE_INSTALL_MANIFEST}"
44 | "${CMAKE_INSTALL_MANIFEST_CONTENT}")
45 |
--------------------------------------------------------------------------------
/texture-view/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 25
5 | buildToolsVersion "25.0.3"
6 |
7 | defaultConfig {
8 | applicationId "com.sample.textureview"
9 | minSdkVersion 24
10 | targetSdkVersion 24
11 | ndk {
12 | abiFilters 'armeabi-v7a'
13 | }
14 | externalNativeBuild {
15 | cmake {
16 | arguments '-DANDROID_STL=gnustl_static', '-DANDROID_TOOLCHAIN=clang'
17 | arguments '-DANDROID_PLATFORM=android-24'
18 | }
19 | }
20 | }
21 |
22 | externalNativeBuild {
23 | cmake {
24 | path 'src/main/cpp/CMakeLists.txt'
25 | }
26 | }
27 |
28 | buildTypes {
29 | release {
30 | minifyEnabled false
31 | proguardFiles getDefaultProguardFile('proguard-android.txt'),
32 | 'proguard-rules.txt'
33 | }
34 | }
35 |
36 | }
37 |
38 | dependencies {
39 | compile 'com.android.support:support-compat:25.3.1'
40 | }
41 |
--------------------------------------------------------------------------------
/texture-view/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
19 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/texture-view/src/main/assets/squeeze_init_net.pb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/src/main/assets/squeeze_init_net.pb
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/Eigen/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | include(RegexUtils)
2 | test_escape_string_as_regex()
3 |
4 | file(GLOB Eigen_directory_files "*")
5 |
6 | escape_string_as_regex(ESCAPED_CMAKE_CURRENT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
7 |
8 | foreach(f ${Eigen_directory_files})
9 | if(NOT f MATCHES "\\.txt" AND NOT f MATCHES "${ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/[.].+" AND NOT f MATCHES "${ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/src")
10 | list(APPEND Eigen_directory_files_to_install ${f})
11 | endif()
12 | endforeach(f ${Eigen_directory_files})
13 |
14 | install(FILES
15 | ${Eigen_directory_files_to_install}
16 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen COMPONENT Devel
17 | )
18 |
19 | install(DIRECTORY src DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen COMPONENT Devel FILES_MATCHING PATTERN "*.h")
20 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/Eigen/Cholesky:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla
5 | // Public License v. 2.0. If a copy of the MPL was not distributed
6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 | #ifndef EIGEN_CHOLESKY_MODULE_H
9 | #define EIGEN_CHOLESKY_MODULE_H
10 |
11 | #include "Core"
12 |
13 | #include "src/Core/util/DisableStupidWarnings.h"
14 |
15 | /** \defgroup Cholesky_Module Cholesky module
16 | *
17 | *
18 | *
19 | * This module provides two variants of the Cholesky decomposition for selfadjoint (hermitian) matrices.
20 | * Those decompositions are also accessible via the following methods:
21 | * - MatrixBase::llt()
22 | * - MatrixBase::ldlt()
23 | * - SelfAdjointView::llt()
24 | * - SelfAdjointView::ldlt()
25 | *
26 | * \code
27 | * #include
28 | * \endcode
29 | */
30 |
31 | #include "src/Cholesky/LLT.h"
32 | #include "src/Cholesky/LDLT.h"
33 | #ifdef EIGEN_USE_LAPACKE
34 | #include "src/misc/lapacke.h"
35 | #include "src/Cholesky/LLT_LAPACKE.h"
36 | #endif
37 |
38 | #include "src/Core/util/ReenableStupidWarnings.h"
39 |
40 | #endif // EIGEN_CHOLESKY_MODULE_H
41 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */
42 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/Eigen/Dense:
--------------------------------------------------------------------------------
1 | #include "Core"
2 | #include "LU"
3 | #include "Cholesky"
4 | #include "QR"
5 | #include "SVD"
6 | #include "Geometry"
7 | #include "Eigenvalues"
8 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/Eigen/Eigen:
--------------------------------------------------------------------------------
1 | #include "Dense"
2 | #include "Sparse"
3 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/Eigen/Householder:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla
5 | // Public License v. 2.0. If a copy of the MPL was not distributed
6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 | #ifndef EIGEN_HOUSEHOLDER_MODULE_H
9 | #define EIGEN_HOUSEHOLDER_MODULE_H
10 |
11 | #include "Core"
12 |
13 | #include "src/Core/util/DisableStupidWarnings.h"
14 |
15 | /** \defgroup Householder_Module Householder module
16 | * This module provides Householder transformations.
17 | *
18 | * \code
19 | * #include
20 | * \endcode
21 | */
22 |
23 | #include "src/Householder/Householder.h"
24 | #include "src/Householder/HouseholderSequence.h"
25 | #include "src/Householder/BlockHouseholder.h"
26 |
27 | #include "src/Core/util/ReenableStupidWarnings.h"
28 |
29 | #endif // EIGEN_HOUSEHOLDER_MODULE_H
30 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */
31 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/Eigen/Jacobi:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla
5 | // Public License v. 2.0. If a copy of the MPL was not distributed
6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 | #ifndef EIGEN_JACOBI_MODULE_H
9 | #define EIGEN_JACOBI_MODULE_H
10 |
11 | #include "Core"
12 |
13 | #include "src/Core/util/DisableStupidWarnings.h"
14 |
15 | /** \defgroup Jacobi_Module Jacobi module
16 | * This module provides Jacobi and Givens rotations.
17 | *
18 | * \code
19 | * #include
20 | * \endcode
21 | *
22 | * In addition to listed classes, it defines the two following MatrixBase methods to apply a Jacobi or Givens rotation:
23 | * - MatrixBase::applyOnTheLeft()
24 | * - MatrixBase::applyOnTheRight().
25 | */
26 |
27 | #include "src/Jacobi/Jacobi.h"
28 |
29 | #include "src/Core/util/ReenableStupidWarnings.h"
30 |
31 | #endif // EIGEN_JACOBI_MODULE_H
32 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */
33 |
34 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/Eigen/LU:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla
5 | // Public License v. 2.0. If a copy of the MPL was not distributed
6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 | #ifndef EIGEN_LU_MODULE_H
9 | #define EIGEN_LU_MODULE_H
10 |
11 | #include "Core"
12 |
13 | #include "src/Core/util/DisableStupidWarnings.h"
14 |
15 | /** \defgroup LU_Module LU module
16 | * This module includes %LU decomposition and related notions such as matrix inversion and determinant.
17 | * This module defines the following MatrixBase methods:
18 | * - MatrixBase::inverse()
19 | * - MatrixBase::determinant()
20 | *
21 | * \code
22 | * #include
23 | * \endcode
24 | */
25 |
26 | #include "src/misc/Kernel.h"
27 | #include "src/misc/Image.h"
28 | #include "src/LU/FullPivLU.h"
29 | #include "src/LU/PartialPivLU.h"
30 | #ifdef EIGEN_USE_LAPACKE
31 | #include "src/misc/lapacke.h"
32 | #include "src/LU/PartialPivLU_LAPACKE.h"
33 | #endif
34 | #include "src/LU/Determinant.h"
35 | #include "src/LU/InverseImpl.h"
36 |
37 | // Use the SSE optimized version whenever possible. At the moment the
38 | // SSE version doesn't compile when AVX is enabled
39 | #if defined EIGEN_VECTORIZE_SSE && !defined EIGEN_VECTORIZE_AVX
40 | #include "src/LU/arch/Inverse_SSE.h"
41 | #endif
42 |
43 | #include "src/Core/util/ReenableStupidWarnings.h"
44 |
45 | #endif // EIGEN_LU_MODULE_H
46 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */
47 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/Eigen/MetisSupport:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla
5 | // Public License v. 2.0. If a copy of the MPL was not distributed
6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 | #ifndef EIGEN_METISSUPPORT_MODULE_H
9 | #define EIGEN_METISSUPPORT_MODULE_H
10 |
11 | #include "SparseCore"
12 |
13 | #include "src/Core/util/DisableStupidWarnings.h"
14 |
15 | extern "C" {
16 | #include
17 | }
18 |
19 |
20 | /** \ingroup Support_modules
21 | * \defgroup MetisSupport_Module MetisSupport module
22 | *
23 | * \code
24 | * #include
25 | * \endcode
26 | * This module defines an interface to the METIS reordering package (http://glaros.dtc.umn.edu/gkhome/views/metis).
27 | * It can be used just as any other built-in method as explained in \link OrderingMethods_Module here. \endlink
28 | */
29 |
30 |
31 | #include "src/MetisSupport/MetisSupport.h"
32 |
33 | #include "src/Core/util/ReenableStupidWarnings.h"
34 |
35 | #endif // EIGEN_METISSUPPORT_MODULE_H
36 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/Eigen/PardisoSupport:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla
5 | // Public License v. 2.0. If a copy of the MPL was not distributed
6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 | #ifndef EIGEN_PARDISOSUPPORT_MODULE_H
9 | #define EIGEN_PARDISOSUPPORT_MODULE_H
10 |
11 | #include "SparseCore"
12 |
13 | #include "src/Core/util/DisableStupidWarnings.h"
14 |
15 | #include
16 |
17 | /** \ingroup Support_modules
18 | * \defgroup PardisoSupport_Module PardisoSupport module
19 | *
20 | * This module brings support for the Intel(R) MKL PARDISO direct sparse solvers.
21 | *
22 | * \code
23 | * #include
24 | * \endcode
25 | *
26 | * In order to use this module, the MKL headers must be accessible from the include paths, and your binary must be linked to the MKL library and its dependencies.
27 | * See this \ref TopicUsingIntelMKL "page" for more information on MKL-Eigen integration.
28 | *
29 | */
30 |
31 | #include "src/PardisoSupport/PardisoSupport.h"
32 |
33 | #include "src/Core/util/ReenableStupidWarnings.h"
34 |
35 | #endif // EIGEN_PARDISOSUPPORT_MODULE_H
36 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/Eigen/QR:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla
5 | // Public License v. 2.0. If a copy of the MPL was not distributed
6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 | #ifndef EIGEN_QR_MODULE_H
9 | #define EIGEN_QR_MODULE_H
10 |
11 | #include "Core"
12 |
13 | #include "src/Core/util/DisableStupidWarnings.h"
14 |
15 | #include "Cholesky"
16 | #include "Jacobi"
17 | #include "Householder"
18 |
19 | /** \defgroup QR_Module QR module
20 | *
21 | *
22 | *
23 | * This module provides various QR decompositions
24 | * This module also provides some MatrixBase methods, including:
25 | * - MatrixBase::householderQr()
26 | * - MatrixBase::colPivHouseholderQr()
27 | * - MatrixBase::fullPivHouseholderQr()
28 | *
29 | * \code
30 | * #include
31 | * \endcode
32 | */
33 |
34 | #include "src/QR/HouseholderQR.h"
35 | #include "src/QR/FullPivHouseholderQR.h"
36 | #include "src/QR/ColPivHouseholderQR.h"
37 | #include "src/QR/CompleteOrthogonalDecomposition.h"
38 | #ifdef EIGEN_USE_LAPACKE
39 | #include "src/misc/lapacke.h"
40 | #include "src/QR/HouseholderQR_LAPACKE.h"
41 | #include "src/QR/ColPivHouseholderQR_LAPACKE.h"
42 | #endif
43 |
44 | #include "src/Core/util/ReenableStupidWarnings.h"
45 |
46 | #endif // EIGEN_QR_MODULE_H
47 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */
48 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/Eigen/QtAlignedMalloc:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla
5 | // Public License v. 2.0. If a copy of the MPL was not distributed
6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 | #ifndef EIGEN_QTMALLOC_MODULE_H
9 | #define EIGEN_QTMALLOC_MODULE_H
10 |
11 | #include "Core"
12 |
13 | #if (!EIGEN_MALLOC_ALREADY_ALIGNED)
14 |
15 | #include "src/Core/util/DisableStupidWarnings.h"
16 |
17 | void *qMalloc(std::size_t size)
18 | {
19 | return Eigen::internal::aligned_malloc(size);
20 | }
21 |
22 | void qFree(void *ptr)
23 | {
24 | Eigen::internal::aligned_free(ptr);
25 | }
26 |
27 | void *qRealloc(void *ptr, std::size_t size)
28 | {
29 | void* newPtr = Eigen::internal::aligned_malloc(size);
30 | memcpy(newPtr, ptr, size);
31 | Eigen::internal::aligned_free(ptr);
32 | return newPtr;
33 | }
34 |
35 | #include "src/Core/util/ReenableStupidWarnings.h"
36 |
37 | #endif
38 |
39 | #endif // EIGEN_QTMALLOC_MODULE_H
40 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */
41 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/Eigen/SPQRSupport:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla
5 | // Public License v. 2.0. If a copy of the MPL was not distributed
6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 | #ifndef EIGEN_SPQRSUPPORT_MODULE_H
9 | #define EIGEN_SPQRSUPPORT_MODULE_H
10 |
11 | #include "SparseCore"
12 |
13 | #include "src/Core/util/DisableStupidWarnings.h"
14 |
15 | #include "SuiteSparseQR.hpp"
16 |
17 | /** \ingroup Support_modules
18 | * \defgroup SPQRSupport_Module SuiteSparseQR module
19 | *
20 | * This module provides an interface to the SPQR library, which is part of the suitesparse package.
21 | *
22 | * \code
23 | * #include
24 | * \endcode
25 | *
26 | * In order to use this module, the SPQR headers must be accessible from the include paths, and your binary must be linked to the SPQR library and its dependencies (Cholmod, AMD, COLAMD,...).
27 | * For a cmake based project, you can use our FindSPQR.cmake and FindCholmod.Cmake modules
28 | *
29 | */
30 |
31 | #include "src/CholmodSupport/CholmodSupport.h"
32 | #include "src/SPQRSupport/SuiteSparseQRSupport.h"
33 |
34 | #endif
35 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/Eigen/Sparse:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla
5 | // Public License v. 2.0. If a copy of the MPL was not distributed
6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 | #ifndef EIGEN_SPARSE_MODULE_H
9 | #define EIGEN_SPARSE_MODULE_H
10 |
11 | /** \defgroup Sparse_Module Sparse meta-module
12 | *
13 | * Meta-module including all related modules:
14 | * - \ref SparseCore_Module
15 | * - \ref OrderingMethods_Module
16 | * - \ref SparseCholesky_Module
17 | * - \ref SparseLU_Module
18 | * - \ref SparseQR_Module
19 | * - \ref IterativeLinearSolvers_Module
20 | *
21 | \code
22 | #include
23 | \endcode
24 | */
25 |
26 | #include "SparseCore"
27 | #include "OrderingMethods"
28 | #ifndef EIGEN_MPL2_ONLY
29 | #include "SparseCholesky"
30 | #endif
31 | #include "SparseLU"
32 | #include "SparseQR"
33 | #include "IterativeLinearSolvers"
34 |
35 | #endif // EIGEN_SPARSE_MODULE_H
36 |
37 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/Eigen/SparseCholesky:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // Copyright (C) 2008-2013 Gael Guennebaud
5 | //
6 | // This Source Code Form is subject to the terms of the Mozilla
7 | // Public License v. 2.0. If a copy of the MPL was not distributed
8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 |
10 | #ifndef EIGEN_SPARSECHOLESKY_MODULE_H
11 | #define EIGEN_SPARSECHOLESKY_MODULE_H
12 |
13 | #include "SparseCore"
14 | #include "OrderingMethods"
15 |
16 | #include "src/Core/util/DisableStupidWarnings.h"
17 |
18 | /**
19 | * \defgroup SparseCholesky_Module SparseCholesky module
20 | *
21 | * This module currently provides two variants of the direct sparse Cholesky decomposition for selfadjoint (hermitian) matrices.
22 | * Those decompositions are accessible via the following classes:
23 | * - SimplicialLLt,
24 | * - SimplicialLDLt
25 | *
26 | * Such problems can also be solved using the ConjugateGradient solver from the IterativeLinearSolvers module.
27 | *
28 | * \code
29 | * #include
30 | * \endcode
31 | */
32 |
33 | #ifdef EIGEN_MPL2_ONLY
34 | #error The SparseCholesky module has nothing to offer in MPL2 only mode
35 | #endif
36 |
37 | #include "src/SparseCholesky/SimplicialCholesky.h"
38 |
39 | #ifndef EIGEN_MPL2_ONLY
40 | #include "src/SparseCholesky/SimplicialCholesky_impl.h"
41 | #endif
42 |
43 | #include "src/Core/util/ReenableStupidWarnings.h"
44 |
45 | #endif // EIGEN_SPARSECHOLESKY_MODULE_H
46 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/Eigen/SparseQR:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla
5 | // Public License v. 2.0. If a copy of the MPL was not distributed
6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 | #ifndef EIGEN_SPARSEQR_MODULE_H
9 | #define EIGEN_SPARSEQR_MODULE_H
10 |
11 | #include "SparseCore"
12 | #include "OrderingMethods"
13 | #include "src/Core/util/DisableStupidWarnings.h"
14 |
15 | /** \defgroup SparseQR_Module SparseQR module
16 | * \brief Provides QR decomposition for sparse matrices
17 | *
18 | * This module provides a simplicial version of the left-looking Sparse QR decomposition.
19 | * The columns of the input matrix should be reordered to limit the fill-in during the
20 | * decomposition. Built-in methods (COLAMD, AMD) or external methods (METIS) can be used to this end.
21 | * See the \link OrderingMethods_Module OrderingMethods\endlink module for the list
22 | * of built-in and external ordering methods.
23 | *
24 | * \code
25 | * #include
26 | * \endcode
27 | *
28 | *
29 | */
30 |
31 | #include "OrderingMethods"
32 | #include "src/SparseCore/SparseColEtree.h"
33 | #include "src/SparseQR/SparseQR.h"
34 |
35 | #include "src/Core/util/ReenableStupidWarnings.h"
36 |
37 | #endif
38 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/Eigen/StdDeque:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // Copyright (C) 2009 Gael Guennebaud
5 | // Copyright (C) 2009 Hauke Heibel
6 | //
7 | // This Source Code Form is subject to the terms of the Mozilla
8 | // Public License v. 2.0. If a copy of the MPL was not distributed
9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 |
11 | #ifndef EIGEN_STDDEQUE_MODULE_H
12 | #define EIGEN_STDDEQUE_MODULE_H
13 |
14 | #include "Core"
15 | #include
16 |
17 | #if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */
18 |
19 | #define EIGEN_DEFINE_STL_DEQUE_SPECIALIZATION(...)
20 |
21 | #else
22 |
23 | #include "src/StlSupport/StdDeque.h"
24 |
25 | #endif
26 |
27 | #endif // EIGEN_STDDEQUE_MODULE_H
28 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/Eigen/StdList:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // Copyright (C) 2009 Hauke Heibel
5 | //
6 | // This Source Code Form is subject to the terms of the Mozilla
7 | // Public License v. 2.0. If a copy of the MPL was not distributed
8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 |
10 | #ifndef EIGEN_STDLIST_MODULE_H
11 | #define EIGEN_STDLIST_MODULE_H
12 |
13 | #include "Core"
14 | #include
15 |
16 | #if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */
17 |
18 | #define EIGEN_DEFINE_STL_LIST_SPECIALIZATION(...)
19 |
20 | #else
21 |
22 | #include "src/StlSupport/StdList.h"
23 |
24 | #endif
25 |
26 | #endif // EIGEN_STDLIST_MODULE_H
27 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/Eigen/StdVector:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // Copyright (C) 2009 Gael Guennebaud
5 | // Copyright (C) 2009 Hauke Heibel
6 | //
7 | // This Source Code Form is subject to the terms of the Mozilla
8 | // Public License v. 2.0. If a copy of the MPL was not distributed
9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 |
11 | #ifndef EIGEN_STDVECTOR_MODULE_H
12 | #define EIGEN_STDVECTOR_MODULE_H
13 |
14 | #include "Core"
15 | #include
16 |
17 | #if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */
18 |
19 | #define EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(...)
20 |
21 | #else
22 |
23 | #include "src/StlSupport/StdVector.h"
24 |
25 | #endif
26 |
27 | #endif // EIGEN_STDVECTOR_MODULE_H
28 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/Eigen/UmfPackSupport:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla
5 | // Public License v. 2.0. If a copy of the MPL was not distributed
6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 | #ifndef EIGEN_UMFPACKSUPPORT_MODULE_H
9 | #define EIGEN_UMFPACKSUPPORT_MODULE_H
10 |
11 | #include "SparseCore"
12 |
13 | #include "src/Core/util/DisableStupidWarnings.h"
14 |
15 | extern "C" {
16 | #include
17 | }
18 |
19 | /** \ingroup Support_modules
20 | * \defgroup UmfPackSupport_Module UmfPackSupport module
21 | *
22 | * This module provides an interface to the UmfPack library which is part of the suitesparse package.
23 | * It provides the following factorization class:
24 | * - class UmfPackLU: a multifrontal sequential LU factorization.
25 | *
26 | * \code
27 | * #include
28 | * \endcode
29 | *
30 | * In order to use this module, the umfpack headers must be accessible from the include paths, and your binary must be linked to the umfpack library and its dependencies.
31 | * The dependencies depend on how umfpack has been compiled.
32 | * For a cmake based project, you can use our FindUmfPack.cmake module to help you in this task.
33 | *
34 | */
35 |
36 | #include "src/UmfPackSupport/UmfPackSupport.h"
37 |
38 | #include "src/Core/util/ReenableStupidWarnings.h"
39 |
40 | #endif // EIGEN_UMFPACKSUPPORT_MODULE_H
41 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/Eigen/src/Core/DiagonalProduct.h:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // Copyright (C) 2008 Gael Guennebaud
5 | // Copyright (C) 2007-2009 Benoit Jacob
6 | //
7 | // This Source Code Form is subject to the terms of the Mozilla
8 | // Public License v. 2.0. If a copy of the MPL was not distributed
9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 |
11 | #ifndef EIGEN_DIAGONALPRODUCT_H
12 | #define EIGEN_DIAGONALPRODUCT_H
13 |
14 | namespace Eigen {
15 |
16 | /** \returns the diagonal matrix product of \c *this by the diagonal matrix \a diagonal.
17 | */
18 | template
19 | template
20 | EIGEN_DEVICE_FUNC inline const Product
21 | MatrixBase::operator*(const DiagonalBase &a_diagonal) const
22 | {
23 | return Product(derived(),a_diagonal.derived());
24 | }
25 |
26 | } // end namespace Eigen
27 |
28 | #endif // EIGEN_DIAGONALPRODUCT_H
29 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/Eigen/src/Core/arch/AVX/TypeCasting.h:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // Copyright (C) 2015 Benoit Steiner
5 | //
6 | // This Source Code Form is subject to the terms of the Mozilla
7 | // Public License v. 2.0. If a copy of the MPL was not distributed
8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 |
10 | #ifndef EIGEN_TYPE_CASTING_AVX_H
11 | #define EIGEN_TYPE_CASTING_AVX_H
12 |
13 | namespace Eigen {
14 |
15 | namespace internal {
16 |
17 | // For now we use SSE to handle integers, so we can't use AVX instructions to cast
18 | // from int to float
19 | template <>
20 | struct type_casting_traits {
21 | enum {
22 | VectorizedCast = 0,
23 | SrcCoeffRatio = 1,
24 | TgtCoeffRatio = 1
25 | };
26 | };
27 |
28 | template <>
29 | struct type_casting_traits {
30 | enum {
31 | VectorizedCast = 0,
32 | SrcCoeffRatio = 1,
33 | TgtCoeffRatio = 1
34 | };
35 | };
36 |
37 |
38 |
39 | template<> EIGEN_STRONG_INLINE Packet8i pcast(const Packet8f& a) {
40 | return _mm256_cvtps_epi32(a);
41 | }
42 |
43 | template<> EIGEN_STRONG_INLINE Packet8f pcast(const Packet8i& a) {
44 | return _mm256_cvtepi32_ps(a);
45 | }
46 |
47 | } // end namespace internal
48 |
49 | } // end namespace Eigen
50 |
51 | #endif // EIGEN_TYPE_CASTING_AVX_H
52 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/Eigen/src/Core/functors/TernaryFunctors.h:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // Copyright (C) 2016 Eugene Brevdo
5 | //
6 | // This Source Code Form is subject to the terms of the Mozilla
7 | // Public License v. 2.0. If a copy of the MPL was not distributed
8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 |
10 | #ifndef EIGEN_TERNARY_FUNCTORS_H
11 | #define EIGEN_TERNARY_FUNCTORS_H
12 |
13 | namespace Eigen {
14 |
15 | namespace internal {
16 |
17 | //---------- associative ternary functors ----------
18 |
19 |
20 |
21 | } // end namespace internal
22 |
23 | } // end namespace Eigen
24 |
25 | #endif // EIGEN_TERNARY_FUNCTORS_H
26 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/Eigen/src/Core/util/NonMPL2.h:
--------------------------------------------------------------------------------
1 | #ifdef EIGEN_MPL2_ONLY
2 | #error Including non-MPL2 code in EIGEN_MPL2_ONLY mode
3 | #endif
4 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/Eigen/src/Core/util/ReenableStupidWarnings.h:
--------------------------------------------------------------------------------
1 | #ifdef EIGEN_WARNINGS_DISABLED
2 | #undef EIGEN_WARNINGS_DISABLED
3 |
4 | #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
5 | #ifdef _MSC_VER
6 | #pragma warning( pop )
7 | #elif defined __INTEL_COMPILER
8 | #pragma warning pop
9 | #elif defined __clang__
10 | #pragma clang diagnostic pop
11 | #elif defined __GNUC__ && __GNUC__>=6
12 | #pragma GCC diagnostic pop
13 | #endif
14 |
15 | #if defined __NVCC__
16 | // Don't reenable the diagnostic messages, as it turns out these messages need
17 | // to be disabled at the point of the template instantiation (i.e the user code)
18 | // otherwise they'll be triggered by nvcc.
19 | // #pragma diag_default code_is_unreachable
20 | // #pragma diag_default initialization_not_reachable
21 | // #pragma diag_default 2651
22 | // #pragma diag_default 2653
23 | #endif
24 |
25 | #endif
26 |
27 | #endif // EIGEN_WARNINGS_DISABLED
28 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/Eigen/src/SparseCore/SparseFuzzy.h:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // Copyright (C) 2008-2014 Gael Guennebaud
5 | //
6 | // This Source Code Form is subject to the terms of the Mozilla
7 | // Public License v. 2.0. If a copy of the MPL was not distributed
8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 |
10 | #ifndef EIGEN_SPARSE_FUZZY_H
11 | #define EIGEN_SPARSE_FUZZY_H
12 |
13 | namespace Eigen {
14 |
15 | template
16 | template
17 | bool SparseMatrixBase::isApprox(const SparseMatrixBase& other, const RealScalar &prec) const
18 | {
19 | const typename internal::nested_eval::type actualA(derived());
20 | typename internal::conditional::type,
22 | const PlainObject>::type actualB(other.derived());
23 |
24 | return (actualA - actualB).squaredNorm() <= prec * prec * numext::mini(actualA.squaredNorm(), actualB.squaredNorm());
25 | }
26 |
27 | } // end namespace Eigen
28 |
29 | #endif // EIGEN_SPARSE_FUZZY_H
30 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/Eigen/src/misc/lapacke_mangling.h:
--------------------------------------------------------------------------------
1 | #ifndef LAPACK_HEADER_INCLUDED
2 | #define LAPACK_HEADER_INCLUDED
3 |
4 | #ifndef LAPACK_GLOBAL
5 | #if defined(LAPACK_GLOBAL_PATTERN_LC) || defined(ADD_)
6 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname##_
7 | #elif defined(LAPACK_GLOBAL_PATTERN_UC) || defined(UPPER)
8 | #define LAPACK_GLOBAL(lcname,UCNAME) UCNAME
9 | #elif defined(LAPACK_GLOBAL_PATTERN_MC) || defined(NOCHANGE)
10 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname
11 | #else
12 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname##_
13 | #endif
14 | #endif
15 |
16 | #endif
17 |
18 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/contrib/gloo/common.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | #include "caffe2/core/blob.h"
6 |
7 | #include
8 | #include
9 |
10 | namespace caffe2 {
11 | namespace gloo {
12 |
13 | void signalFailure(Blob* status_blob, std::exception& exception);
14 |
15 | struct createDeviceAttr {
16 | // "tcp" or "ibverbs"
17 | std::string transport;
18 |
19 | // E.g. "eth0" (tcp), or "mlx5_0" (ibverbs).
20 | // This may be empty to make Gloo figure it out.
21 | std::string interface;
22 | };
23 |
24 | std::shared_ptr<::gloo::transport::Device> createDevice(
25 | const createDeviceAttr attr);
26 |
27 | #if defined(GLOO_USE_MPI) && GLOO_USE_MPI
28 | void mpiInitialize();
29 | void mpiFinalize();
30 | #endif
31 |
32 | } // namespace gloo
33 | } // namespace caffe2
34 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/contrib/gloo/context.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/contrib/gloo/store_handler.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "caffe2/distributed/store_handler.h"
4 |
5 | #include
6 |
7 | namespace caffe2 {
8 | namespace gloo {
9 |
10 | class StoreHandlerWrapper : public ::gloo::rendezvous::Store {
11 | public:
12 | explicit StoreHandlerWrapper(StoreHandler& handler) : handler_(handler) {}
13 |
14 | virtual ~StoreHandlerWrapper() {}
15 |
16 | virtual void set(const std::string& key, const std::vector& data)
17 | override;
18 |
19 | virtual std::vector get(const std::string& key) override;
20 |
21 | virtual void wait(const std::vector& keys) override {
22 | wait(keys, ::gloo::rendezvous::Store::kDefaultTimeout);
23 | }
24 |
25 | virtual void wait(
26 | const std::vector& keys,
27 | const std::chrono::milliseconds& timeout) override;
28 |
29 | protected:
30 | StoreHandler& handler_;
31 | };
32 |
33 | } // namespace gloo
34 | } // namespace caffe2
35 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/contrib/nccl/cuda_nccl_gpu.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | #include "caffe2/core/common_gpu.h"
6 | #include "caffe2/core/context_gpu.h"
7 | #include "caffe2/core/logging.h"
8 |
9 | #include
10 | #include
11 |
12 | #define NCCL_VERSION_MIN(major, minor, patch) \
13 | ((NCCL_MAJOR > major) || \
14 | ((NCCL_MAJOR == major) && ((NCCL_MINOR > minor) || \
15 | ((NCCL_MINOR == minor) && (NCCL_PATCH >= patch)) )))
16 |
17 | namespace caffe2 {
18 |
19 | namespace nccl {
20 |
21 | #define CAFFE_NCCL_CHECK(condition) \
22 | do { \
23 | ncclResult_t status = (condition); \
24 | CAFFE_ENFORCE_EQ( \
25 | status, \
26 | ncclSuccess, \
27 | " ", \
28 | "Error at: ", \
29 | __FILE__, \
30 | __LINE__, \
31 | ": ", \
32 | ncclGetErrorString(status)); \
33 | } while (0)
34 |
35 | struct NCCLElement {
36 | const TensorCUDA* src{nullptr};
37 | TensorCUDA* dst{nullptr};
38 | int device{0};
39 | };
40 |
41 | struct NCCLExecution {
42 | int stream_gpu_id{0};
43 | cudaStream_t stream{nullptr};
44 | std::vector elements;
45 | size_t root{0};
46 | };
47 |
48 | template
49 | class NCCL {
50 | public:
51 | static void AllReduce(const NCCLExecution& ex);
52 | static void Broadcast(const NCCLExecution& ex);
53 | static void Reduce(const NCCLExecution& ex);
54 | static void AllGather(const NCCLExecution& ex);
55 | static void ReduceScatter(const NCCLExecution& ex);
56 | };
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/contrib/nervana/nervana.h:
--------------------------------------------------------------------------------
1 | #ifndef CAFFE2_FB_NERVANA_INIT_H_
2 | #define CAFFE2_FB_NERVANA_INIT_H_
3 |
4 | #include "caffe2/core/init.h"
5 | #include "caffe2/core/flags.h"
6 |
7 | #include "nervana_c_api.h"
8 |
9 | /**
10 | * A flag that specifies the nervana cubin path.
11 | */
12 | CAFFE2_DECLARE_string(nervana_cubin_path);
13 |
14 | namespace caffe2 {
15 |
16 | /**
17 | * An empty class to be used in identifying the engine in the math functions.
18 | */
19 | class NervanaEngine {};
20 |
21 | /**
22 | * Returns whether the nervana kernels are loaded or not.
23 | */
24 | bool NervanaKernelLoaded();
25 |
26 | /**
27 | * An initialization function that is run once by caffe2::GlobalInit()
28 | * that initializes the nervana kernels.
29 | */
30 | bool Caffe2InitializeNervanaKernels();
31 |
32 | } // namespace caffe2
33 |
34 | #endif // CAFFE2_FB_NERVANA_INIT_H_
35 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/contrib/observers/time_observer.h:
--------------------------------------------------------------------------------
1 | #ifndef CAFFE2_CONTRIB_OBSERVERS_TIME_OBSERVER_H_
2 | #define CAFFE2_CONTRIB_OBSERVERS_TIME_OBSERVER_H_
3 |
4 | #include
5 |
6 | #include "caffe2/core/common.h"
7 | #include "caffe2/core/observer.h"
8 | #include "caffe2/core/operator.h"
9 | #include "caffe2/core/timer.h"
10 |
11 | namespace caffe2 {
12 |
13 | template
14 | class TimeObserver final : public ObserverBase {
15 | public:
16 | explicit TimeObserver(T* subject) : ObserverBase(subject) {}
17 | inline float average_time() const {
18 | return total_time_ / iterations_;
19 | }
20 | float average_time_children() const {
21 | float sum = 0.0f;
22 | for (auto* op : this->subject_->GetOperators()) {
23 | auto* observer =
24 | dynamic_cast_if_rtti*>(op->GetObserver());
25 | sum += observer->average_time();
26 | }
27 | return sum / this->subject_->GetOperators().size();
28 | }
29 | ~TimeObserver() {}
30 |
31 | private:
32 | Timer timer_;
33 | float start_time_ = 0.0f;
34 | float total_time_ = 0.0f;
35 | int iterations_ = 0;
36 |
37 | bool Start() override;
38 | bool Stop() override;
39 | };
40 |
41 | } // namespace caffe2
42 |
43 | #endif // CAFFE2_CONTRIB_OBSERVERS_TIME_OBSERVER_H_
44 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/contrib/prof/htrace_conf.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "caffe2/core/flags.h"
4 |
5 | CAFFE2_DECLARE_string(caffe2_htrace_span_log_path);
6 |
7 | namespace caffe2 {
8 |
9 | const string defaultHTraceConf(const string& net_name);
10 |
11 | } // namespace caffe2
12 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/contrib/prof/prof_dag_net.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "caffe2/core/net_dag.h"
4 | #include "caffe2/proto/prof_dag.pb.h"
5 |
6 | namespace caffe2 {
7 |
8 | struct Stats {
9 | float sum;
10 | float sqrsum;
11 | size_t cnt;
12 | };
13 |
14 | /**
15 | * This net type is identical to DAGNet, except that it
16 | * measures the time taken for each and every operator.
17 | *
18 | * To collect statistics from stable runs, this net ignores the first run.
19 | * Thus, at least two runs are required for this net to print operator metrics.
20 | */
21 | class ProfDAGNet : public DAGNetBase {
22 | public:
23 | ProfDAGNet(const std::shared_ptr& net_def, Workspace* ws);
24 | ~ProfDAGNet();
25 | bool SupportsAsync() override {
26 | return false;
27 | }
28 | bool RunAsync() override;
29 | ProfDAGProtos GetOperatorStats();
30 |
31 | protected:
32 | bool RunAt(const std::vector& chain) override;
33 | void PrintStats();
34 | void ValidateOpTensorDevices();
35 | ProfDAGProto ProtoMsg(std::pair op_stat) const;
36 | std::vector time_per_op_;
37 | CaffeMap time_per_op_type_;
38 | int runs_ = 0;
39 | };
40 |
41 | } // namespace caffe2
42 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/contrib/prof/prof_dag_stats_op.h:
--------------------------------------------------------------------------------
1 | #ifndef CAFFE2_OPERATORS_FULLY_CONNECTED_OP_H_
2 | #define CAFFE2_OPERATORS_FULLY_CONNECTED_OP_H_
3 |
4 | #include "caffe2/contrib/prof/prof_dag_net.h"
5 | #include "caffe2/core/context.h"
6 | #include "caffe2/core/operator.h"
7 |
8 | namespace caffe2 {
9 |
10 | // This operator outputs the ProfDAGNet stats
11 | template
12 | class GetProfDagStatsOp final : public Operator {
13 | public:
14 | USE_OPERATOR_CONTEXT_FUNCTIONS;
15 | GetProfDagStatsOp(const OperatorDef& operator_def, Workspace* ws)
16 | : Operator(operator_def, ws),
17 | net_name_(
18 | OperatorBase::GetSingleArgument("net_name", "")) {
19 | ws_ = ws;
20 | }
21 | ~GetProfDagStatsOp() {}
22 |
23 | bool RunOnDevice() override {
24 | // Read operator statistics for net_name_
25 | CAFFE_ENFORCE(!net_name_.empty(), "You need to provide net_name");
26 | auto* net = ws_->GetNet(net_name_);
27 |
28 | auto prof_dag_net = dynamic_cast_if_rtti(net);
29 | CAFFE_ENFORCE(prof_dag_net);
30 | auto stats = prof_dag_net->GetOperatorStats();
31 |
32 | // Write protobuf message to the output blob
33 | std::string serialized_data;
34 | CAFFE_ENFORCE(stats.SerializeToString(&serialized_data));
35 | Output(0)->Resize(1);
36 | Output(0)->template mutable_data()[0] = serialized_data;
37 |
38 | return true;
39 | }
40 |
41 | protected:
42 | std::string net_name_;
43 | Workspace* ws_;
44 | };
45 |
46 | } // namespace caffe2
47 |
48 | #endif // CAFFE2_OPERATORS_FULLY_CONNECTED_OP_H_
49 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/core/asan.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | // Detect address sanitizer as some stuff doesn't work with it
4 |
5 | #undef CAFFE2_ASAN_ENABLED
6 |
7 | // for clang
8 | #if defined(__has_feature)
9 | #if ((__has_feature(address_sanitizer)))
10 | #define CAFFE2_ASAN_ENABLED 1
11 | #endif
12 | #endif
13 |
14 | // for gcc
15 | #if defined(__SANITIZE_ADDRESS__)
16 | #if __SANITIZE_ADDRESS__
17 | #if !defined(CAFFE2_ASAN_ENABLED)
18 | #define CAFFE2_ASAN_ENABLED 1
19 | #endif
20 | #endif
21 | #endif
22 |
23 | #if !defined(CAFFE2_ASAN_ENABLED)
24 | #define CAFFE2_ASAN_ENABLED 0
25 | #endif
26 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/core/blob_stats.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "caffe2/core/blob.h"
4 | #include "caffe2/core/registry.h"
5 | #include "caffe2/core/typeid.h"
6 |
7 | #include
8 |
9 | namespace caffe2 {
10 |
11 | struct BlobStatGetter {
12 | virtual size_t sizeBytes(const Blob& blob) const = 0;
13 | virtual ~BlobStatGetter() {}
14 | };
15 |
16 | struct BlobStatRegistry {
17 | private:
18 | std::unordered_map> map_;
19 | void doRegister(CaffeTypeId id, std::unique_ptr&& v);
20 |
21 | public:
22 | template
23 | struct Registrar {
24 | Registrar() {
25 | BlobStatRegistry::instance().doRegister(
26 | TypeMeta::Id(), std::unique_ptr(new Getter));
27 | }
28 | };
29 |
30 | const BlobStatGetter* get(CaffeTypeId id);
31 | static BlobStatRegistry& instance();
32 | };
33 |
34 | #define REGISTER_BLOB_STAT_GETTER(Type, BlobStatGetterClass) \
35 | static BlobStatRegistry::Registrar \
36 | CAFFE_ANONYMOUS_VARIABLE(BlobStatRegistry)
37 |
38 | namespace BlobStat {
39 |
40 | /**
41 | * Return size in bytes of the blob, if available for a blob of given type.
42 | * If not available, return 0.
43 | */
44 | size_t sizeBytes(const Blob& blob);
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/core/common_omp.h:
--------------------------------------------------------------------------------
1 | #ifndef CAFFE2_CORE_COMMON_OMP_H_
2 | #define CAFFE2_CORE_COMMON_OMP_H_
3 |
4 | #ifdef _OPENMP
5 | #include
6 | #endif // _OPENMP
7 |
8 | #endif // CAFFE2_CORE_COMMON_OMP_H_
9 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/core/logging_is_google_glog.h:
--------------------------------------------------------------------------------
1 | #ifndef CAFFE2_CORE_LOGGING_IS_GOOGLE_GLOG_H_
2 | #define CAFFE2_CORE_LOGGING_IS_GOOGLE_GLOG_H_
3 |
4 | #include // because some of the caffe2 code uses e.g. std::setw
5 | // Using google glog. For glog 0.3.2 versions, stl_logging.h needs to be before
6 | // logging.h to actually use stl_logging. Because template magic.
7 | // In addition, we do not do stl logging in .cu files because nvcc does not like
8 | // it. Some mobile platforms do not like stl_logging, so we add an
9 | // overload in that case as well.
10 |
11 | #if !defined(__CUDACC__) && !defined(CAFFE2_USE_MINIMAL_GOOGLE_GLOG)
12 | #include
13 | #else // !defined(__CUDACC__) && !!defined(CAFFE2_USE_MINIMAL_GOOGLE_GLOG)
14 |
15 | // here, we need to register a fake overload for vector/string - here,
16 | // we just ignore the entries in the logs.
17 |
18 | #define INSTANTIATE_FOR_CONTAINER(container) \
19 | template \
20 | std::ostream& operator<<(std::ostream& out, const container&) { \
21 | return out; \
22 | }
23 |
24 | INSTANTIATE_FOR_CONTAINER(std::vector)
25 | INSTANTIATE_FOR_CONTAINER(std::map)
26 | INSTANTIATE_FOR_CONTAINER(std::set)
27 | #undef INSTANTIATE_FOR_CONTAINER
28 |
29 | #endif
30 |
31 | #include
32 |
33 |
34 | #endif // CAFFE2_CORE_LOGGING_IS_GOOGLE_GLOG_H_
35 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/core/macros.h:
--------------------------------------------------------------------------------
1 | // Automatically generated header file for caffe2 macros. These
2 | // macros are used to build the Caffe2 binary, and if you are
3 | // building a dependent library, they will need to be set as well
4 | // for your program to link correctly.
5 |
6 | #pragma once
7 |
8 | // Caffe2 version. The plan is to increment the minor version every other week
9 | // as a track point for bugs, until we find a proper versioning cycle.
10 |
11 | #define CAFFE2_VERSION_MAJOR 0
12 | #define CAFFE2_VERSION_MINOR 8
13 | #define CAFFE2_VERSION_PATCH 1
14 | #define CAFFE2_GIT_VERSION ""
15 |
16 | static_assert(
17 | CAFFE2_VERSION_MINOR < 100,
18 | "Programming error: you set a minor version that is too big.");
19 | static_assert(
20 | CAFFE2_VERSION_PATCH < 100,
21 | "Programming error: you set a patch version that is too big.");
22 |
23 | #define CAFFE2_VERSION \
24 | (CAFFE2_VERSION_MAJOR * 10000 + CAFFE2_VERSION_MINOR * 100 + \
25 | CAFFE2_VERSION_PATCH)
26 |
27 | /* #undef CAFFE2_ANDROID */
28 | /* #undef CAFFE2_FORCE_FALLBACK_CUDA_MPI */
29 | /* #undef CAFFE2_HAS_MKL_DNN */
30 | /* #undef CAFFE2_HAS_MKL_SGEMM_PACK */
31 | /* #undef CAFFE2_PERF_WITH_AVX */
32 | /* #undef CAFFE2_PERF_WITH_AVX2 */
33 | /* #undef CAFFE2_THREADPOOL_MAIN_IMBALANCE */
34 | /* #undef CAFFE2_THREADPOOL_STATS */
35 | #define CAFFE2_UNIQUE_LONG_TYPEMETA
36 | /* #undef CAFFE2_USE_ACCELERATE */
37 | #define CAFFE2_USE_EIGEN_FOR_BLAS
38 | /* #undef CAFFE2_USE_FBCODE */
39 | /* #undef CAFFE2_USE_GFLAGS */
40 | /* #undef CAFFE2_USE_GOOGLE_GLOG */
41 | /* #undef CAFFE2_USE_LITE_PROTO */
42 | /* #undef CAFFE2_USE_MKL */
43 | /* #undef CAFFE2_USE_NVTX */
44 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/core/memonger.h:
--------------------------------------------------------------------------------
1 | #ifndef CAFFE2_CORE_MEMONGER_H_
2 | #define CAFFE2_CORE_MEMONGER_H_
3 |
4 | #include
5 |
6 | #include "caffe2/core/common.h"
7 | #include "caffe2/core/workspace.h"
8 | #include "caffe2/proto/caffe2.pb.h"
9 |
10 | namespace caffe2 {
11 | namespace memonger {
12 |
13 | NetDef optimize_inference_net(
14 | const NetDef& net,
15 | const std::set& static_blobs);
16 |
17 | NetDef compute_blob_recycling_for_dag(
18 | const NetDef& net,
19 | const std::vector& heads,
20 | const std::vector& op_indices,
21 | const std::unordered_set& shareable_blob_names,
22 | const string& namescope,
23 | const std::unordered_set& dont_share_blob_names,
24 | const std::unordered_map>& blob_shapes);
25 |
26 | } // memonger
27 | } // caffe2
28 |
29 | #endif
30 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/core/net_async_dag_gpu.h:
--------------------------------------------------------------------------------
1 | #ifndef CAFFE2_CORE_NET_ASYNC_DAG_GPU_H_
2 | #define CAFFE2_CORE_NET_ASYNC_DAG_GPU_H_
3 |
4 | #include "caffe2/core/common.h"
5 | #include "caffe2/core/net_dag.h"
6 | #include "caffe2/core/workspace.h"
7 | #include "caffe2/proto/caffe2.pb.h"
8 |
9 | namespace caffe2 {
10 |
11 | // Run an event-driven graph - before each operator chain, wait on each parent
12 | // operator for the chain source, then execute each operator. Due to the chain
13 | // construction mechanism, operators in the same chain implicitly runs on the
14 | // same stream.
15 | // AsyncDAGNet is only registered in gpu mode, because CPU code is always sync
16 | // and a CPU only AsyncDAG net is essentially a DAG net.
17 | class AsyncDAGNet : public DAGNetBase {
18 | public:
19 | AsyncDAGNet(const std::shared_ptr& net_def, Workspace* ws);
20 | bool SupportsAsync() override {
21 | return true;
22 | }
23 | bool RunAt(const std::vector& chain) override;
24 | bool RunAsync() override;
25 |
26 | protected:
27 | // Tracks whether a given op has had an event recorded in each
28 | // RunAt() iteration.
29 | std::vector eventRecorded_;
30 | DISABLE_COPY_AND_ASSIGN(AsyncDAGNet);
31 | };
32 |
33 | } // namespace caffe2
34 |
35 | #endif // CAFFE2_CORE_NET_ASYNC_DAG_GPU_H_
36 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/core/net_simple.h:
--------------------------------------------------------------------------------
1 | #ifndef CAFFE2_CORE_NET_SIMPLE_H_
2 | #define CAFFE2_CORE_NET_SIMPLE_H_
3 |
4 | #include
5 |
6 | #include "caffe2/core/common.h"
7 | #include "caffe2/core/logging.h"
8 | #include "caffe2/core/net.h"
9 | #include "caffe2/core/registry.h"
10 | #include "caffe2/core/tensor.h"
11 | #include "caffe2/core/workspace.h"
12 | #include "caffe2/proto/caffe2.pb.h"
13 |
14 | namespace caffe2 {
15 |
16 | // This is the very basic structure you need to run a network - all it
17 | // does is simply to run everything in sequence. If you want more fancy control
18 | // such as a DAG-like execution, check out other better net implementations.
19 | class SimpleNet : public NetBase {
20 | public:
21 | SimpleNet(const std::shared_ptr& net_def, Workspace* ws);
22 | bool SupportsAsync() override {
23 | return false;
24 | }
25 | bool RunAsync() override;
26 | vector TEST_Benchmark(
27 | const int warmup_runs,
28 | const int main_runs,
29 | const bool run_individual) override;
30 |
31 | /*
32 | * This returns a list of pointers to objects stored in unique_ptrs.
33 | * Used by Observers.
34 | *
35 | * Think carefully before using.
36 | */
37 | vector GetOperators() const override {
38 | vector op_list;
39 | for (auto& op : operators_) {
40 | op_list.push_back(op.get());
41 | }
42 | return op_list;
43 | }
44 |
45 | protected:
46 | vector> operators_;
47 |
48 | DISABLE_COPY_AND_ASSIGN(SimpleNet);
49 | };
50 |
51 | } // namespace caffe2
52 |
53 | #endif // CAFFE2_CORE_NET_SIMPLE_H_
54 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/core/net_simple_async.h:
--------------------------------------------------------------------------------
1 | #ifndef CAFFE2_CORE_NET_SIMPLE_ASYNC_H_
2 | #define CAFFE2_CORE_NET_SIMPLE_ASYNC_H_
3 |
4 | #include
5 |
6 | #include "caffe2/core/common.h"
7 | #include "caffe2/core/logging.h"
8 | #include "caffe2/core/net.h"
9 | #include "caffe2/core/registry.h"
10 | #include "caffe2/core/tensor.h"
11 | #include "caffe2/core/workspace.h"
12 | #include "caffe2/proto/caffe2.pb.h"
13 |
14 | namespace caffe2 {
15 |
16 | // This is the very basic structure you need to run a network - all it
17 | // does is simply to run everything in sequence. If you want more fancy control
18 | // such as a DAG-like execution, check out other better net implementations.
19 | class AsyncSimpleNet : public NetBase {
20 | public:
21 | AsyncSimpleNet(const std::shared_ptr& net_def, Workspace* ws);
22 |
23 | bool SupportsAsync() override {
24 | return true;
25 | }
26 | bool RunAsync() override;
27 |
28 | vector TEST_Benchmark(
29 | const int warmup_runs,
30 | const int main_runs,
31 | const bool run_individual) override;
32 |
33 | /*
34 | * This returns a list of pointers to objects stored in unique_ptrs.
35 | * Used by Observers.
36 | *
37 | * Think carefully before using.
38 | */
39 | vector GetOperators() const override {
40 | vector op_list;
41 | for (auto& op : operators_) {
42 | op_list.push_back(op.get());
43 | }
44 | return op_list;
45 | }
46 |
47 | protected:
48 | vector> operators_;
49 |
50 | DISABLE_COPY_AND_ASSIGN(AsyncSimpleNet);
51 | };
52 |
53 | } // namespace caffe2
54 |
55 | #endif // CAFFE2_CORE_NET_SIMPLE_ASYNC_H_
56 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/core/observer.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | namespace caffe2 {
4 |
5 | /**
6 | * Use this to implement a Observer using the Observer Pattern template.
7 | */
8 |
9 | template
10 | class ObserverBase {
11 | public:
12 | explicit ObserverBase(T* subject) : subject_(subject) {}
13 |
14 | virtual bool Start() {
15 | return false;
16 | }
17 | virtual bool Stop() {
18 | return false;
19 | }
20 |
21 | virtual ~ObserverBase() noexcept {};
22 |
23 | T* subject() const {
24 | return subject_;
25 | }
26 |
27 | protected:
28 | T* subject_;
29 | };
30 |
31 | } // namespace caffe2
32 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/core/plan_executor.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #ifndef CAFFE2_MOBILE
5 | #include "caffe2/core/stats.h"
6 | #endif // CAFFE2_MOBILE
7 |
8 | namespace caffe2 {
9 |
10 | class Workspace;
11 | class PlanDef;
12 |
13 | typedef std::function ShouldContinue;
14 |
15 | bool RunPlanOnWorkspace(Workspace* ws, const PlanDef& plan, ShouldContinue);
16 |
17 | #ifndef CAFFE2_MOBILE
18 | struct PlanExecutionTime {
19 | CAFFE_STAT_CTOR(PlanExecutionTime);
20 | CAFFE_EXPORTED_STAT(plan_execution_time_ns);
21 | };
22 | #endif // CAFFE2_MOBILE
23 | }
24 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/core/predictor.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "caffe2/core/net.h"
4 | #include "caffe2/core/tensor.h"
5 |
6 | namespace caffe2 {
7 |
8 | class Predictor {
9 | public:
10 | using TensorVector = std::vector;
11 | // Runs the `init_net` once, then saves the `run_net` to be executed
12 | // in `::run`
13 | Predictor(
14 | const NetDef& init_net,
15 | const NetDef& run_net,
16 | Workspace* parent = nullptr);
17 | ~Predictor();
18 |
19 | // Executes `run_net` on the inputs.
20 | // The first `inputs.size()` inputs from run_net::external_inputs
21 | // are shared with the data in `inputs`.
22 |
23 | // Precondition:
24 | // inputs.size() <= run_net_.external_inputs.size()
25 |
26 | // Postcondition:
27 | // outputs->size() == run_net.external_inputs.size()
28 |
29 | // Returns true on success
30 | bool run(const TensorVector& inputs, TensorVector* outputs);
31 |
32 | const NetDef& def() const {
33 | return run_net_;
34 | };
35 |
36 | Workspace* ws() {
37 | return &ws_;
38 | };
39 |
40 | private:
41 | NetDef run_net_;
42 | Workspace ws_;
43 | };
44 | }
45 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/core/static_tracepoint.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 Facebook, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #pragma once
18 |
19 | #if defined(__ELF__) && (defined(__x86_64__) || defined(__i386__))
20 | #include
21 |
22 | #define CAFFE_SDT(name, ...) \
23 | CAFFE_SDT_PROBE_N( \
24 | caffe2, name, CAFFE_SDT_NARG(0, ##__VA_ARGS__), ##__VA_ARGS__)
25 | #else
26 | #define CAFFE_SDT(name, ...) do {} while(0)
27 | #endif
28 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/core/timer.h:
--------------------------------------------------------------------------------
1 | #ifndef CAFFE2_CORE_TIMER_H_
2 | #define CAFFE2_CORE_TIMER_H_
3 |
4 | #include
5 |
6 | #include "caffe2/core/common.h"
7 |
8 | namespace caffe2 {
9 |
10 | /**
11 | * @brief A simple timer object for measuring time.
12 | *
13 | * This is a minimal class around a std::chrono::high_resolution_clock that
14 | * serves as a utility class for testing code.
15 | */
16 | class Timer {
17 | public:
18 | typedef std::chrono::high_resolution_clock clock;
19 | typedef std::chrono::nanoseconds ns;
20 | Timer() { Start(); }
21 | /**
22 | * @brief Starts a timer.
23 | */
24 | inline void Start() { start_time_ = clock::now(); }
25 | inline float NanoSeconds() {
26 | return std::chrono::duration_cast(clock::now() - start_time_).count();
27 | }
28 | /**
29 | * @brief Returns the elapsed time in milliseconds.
30 | */
31 | inline float MilliSeconds() { return NanoSeconds() / 1000000.f; }
32 | /**
33 | * @brief Returns the elapsed time in microseconds.
34 | */
35 | inline float MicroSeconds() { return NanoSeconds() / 1000.f; }
36 | /**
37 | * @brief Returns the elapsed time in seconds.
38 | */
39 | inline float Seconds() { return NanoSeconds() / 1000000000.f; }
40 |
41 | protected:
42 | std::chrono::time_point start_time_;
43 | DISABLE_COPY_AND_ASSIGN(Timer);
44 | };
45 | }
46 |
47 | #endif // CAFFE2_CORE_TIMER_H_
48 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/db/create_db_op.h:
--------------------------------------------------------------------------------
1 | #ifndef CAFFE2_DB_CREATE_DB_OP_H_
2 | #define CAFFE2_DB_CREATE_DB_OP_H_
3 |
4 | #include "caffe2/core/context.h"
5 | #include "caffe2/core/db.h"
6 | #include "caffe2/core/operator.h"
7 |
8 | namespace caffe2 {
9 |
10 | template
11 | class CreateDBOp final : public Operator {
12 | public:
13 | CreateDBOp(const OperatorDef& operator_def, Workspace* ws)
14 | : Operator(operator_def, ws),
15 | db_type_(OperatorBase::template GetSingleArgument(
16 | "db_type",
17 | "leveldb")),
18 | db_name_(OperatorBase::template GetSingleArgument("db", "")),
19 | num_shards_(
20 | OperatorBase::template GetSingleArgument("num_shards", 1)),
21 | shard_id_(
22 | OperatorBase::template GetSingleArgument("shard_id", 0)) {
23 | CAFFE_ENFORCE_GT(db_name_.size(), 0, "Must specify a db name.");
24 | }
25 |
26 | bool RunOnDevice() final {
27 | OperatorBase::Output(0)->Open(
28 | db_type_, db_name_, num_shards_, shard_id_);
29 | return true;
30 | }
31 |
32 | private:
33 | string db_type_;
34 | string db_name_;
35 | uint32_t num_shards_;
36 | uint32_t shard_id_;
37 | DISABLE_COPY_AND_ASSIGN(CreateDBOp);
38 | };
39 |
40 | } // namespace caffe2
41 |
42 | #endif // CAFFE2_DB_CREATE_DB_OP_H_
43 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/distributed/file_store_handler.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | namespace caffe2 {
6 |
7 | class FileStoreHandler : public StoreHandler {
8 | public:
9 | explicit FileStoreHandler(const std::string& path, const std::string& prefix);
10 | virtual ~FileStoreHandler();
11 |
12 | virtual void set(const std::string& name, const std::string& data) override;
13 |
14 | virtual std::string get(const std::string& name) override;
15 |
16 | virtual int64_t add(const std::string& name, int64_t value) override;
17 |
18 | virtual bool check(const std::vector& names) override;
19 |
20 | virtual void wait(
21 | const std::vector& names,
22 | const std::chrono::milliseconds& timeout = kDefaultTimeout) override;
23 |
24 | protected:
25 | std::string basePath_;
26 |
27 | std::string realPath(const std::string& path);
28 |
29 | std::string tmpPath(const std::string& name);
30 |
31 | std::string objectPath(const std::string& name);
32 | };
33 |
34 | } // namespace caffe2
35 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/distributed/file_store_handler_op.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "file_store_handler.h"
4 |
5 | #include
6 |
7 | namespace caffe2 {
8 |
9 | template
10 | class FileStoreHandlerCreateOp final : public Operator {
11 | public:
12 | explicit FileStoreHandlerCreateOp(
13 | const OperatorDef& operator_def,
14 | Workspace* ws)
15 | : Operator(operator_def, ws),
16 | basePath_(
17 | OperatorBase::template GetSingleArgument("path", "")),
18 | prefix_(OperatorBase::template GetSingleArgument(
19 | "prefix",
20 | "")) {
21 | CAFFE_ENFORCE_NE(basePath_, "", "path is a required argument");
22 | }
23 |
24 | bool RunOnDevice() override {
25 | auto ptr =
26 | std::unique_ptr(new FileStoreHandler(basePath_, prefix_));
27 | *OperatorBase::Output>(HANDLER) =
28 | std::move(ptr);
29 | return true;
30 | }
31 |
32 | private:
33 | std::string basePath_;
34 | std::string prefix_;
35 |
36 | OUTPUT_TAGS(HANDLER);
37 | };
38 |
39 | } // namespace caffe2
40 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/distributed/redis_store_handler.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | extern "C" {
6 | #include
7 | }
8 |
9 | #include
10 |
11 | namespace caffe2 {
12 |
13 | class RedisStoreHandler : public StoreHandler {
14 | public:
15 | explicit RedisStoreHandler(std::string& host, int port, std::string& prefix);
16 | virtual ~RedisStoreHandler();
17 |
18 | virtual void set(const std::string& name, const std::string& data) override;
19 |
20 | virtual std::string get(const std::string& name) override;
21 |
22 | virtual int64_t add(const std::string& name, int64_t value) override;
23 |
24 | virtual bool check(const std::vector& names) override;
25 |
26 | virtual void wait(
27 | const std::vector& names,
28 | const std::chrono::milliseconds& timeout = kDefaultTimeout) override;
29 |
30 | private:
31 | std::string host_;
32 | int port_;
33 | std::string prefix_;
34 |
35 | redisContext* redis_;
36 |
37 | std::string compoundKey(const std::string& name);
38 | };
39 |
40 | } // namespace caffe2
41 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/distributed/redis_store_handler_op.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "redis_store_handler.h"
4 |
5 | #include
6 |
7 | #include
8 |
9 | namespace caffe2 {
10 |
11 | template
12 | class RedisStoreHandlerCreateOp final : public Operator {
13 | public:
14 | explicit RedisStoreHandlerCreateOp(
15 | const OperatorDef& operator_def,
16 | Workspace* ws)
17 | : Operator(operator_def, ws),
18 | host_(
19 | OperatorBase::template GetSingleArgument("host", "")),
20 | port_(OperatorBase::template GetSingleArgument("port", 0)),
21 | prefix_(OperatorBase::template GetSingleArgument(
22 | "prefix",
23 | "")) {
24 | CAFFE_ENFORCE_NE(host_, "", "host is a required argument");
25 | CAFFE_ENFORCE_NE(port_, 0, "port is a required argument");
26 | }
27 |
28 | bool RunOnDevice() override {
29 | auto ptr = std::unique_ptr(
30 | new RedisStoreHandler(host_, port_, prefix_));
31 | *OperatorBase::Output>(HANDLER) =
32 | std::move(ptr);
33 | return true;
34 | }
35 |
36 | private:
37 | std::string host_;
38 | int port_;
39 | std::string prefix_;
40 |
41 | OUTPUT_TAGS(HANDLER);
42 | };
43 |
44 | } // namespace caffe2
45 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/distributed/store_ops.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "store_handler.h"
4 |
5 | #include
6 |
7 | namespace caffe2 {
8 |
9 | class StoreSetOp final : public Operator {
10 | public:
11 | StoreSetOp(const OperatorDef& operator_def, Workspace* ws);
12 | bool RunOnDevice() override;
13 |
14 | private:
15 | std::string blobName_;
16 |
17 | INPUT_TAGS(HANDLER, DATA);
18 | };
19 |
20 | class StoreGetOp final : public Operator {
21 | public:
22 | StoreGetOp(const OperatorDef& operator_def, Workspace* ws);
23 | bool RunOnDevice() override;
24 |
25 | private:
26 | std::string blobName_;
27 |
28 | INPUT_TAGS(HANDLER);
29 | OUTPUT_TAGS(DATA);
30 | };
31 |
32 | class StoreAddOp final : public Operator {
33 | public:
34 | StoreAddOp(const OperatorDef& operator_def, Workspace* ws);
35 | bool RunOnDevice() override;
36 |
37 | private:
38 | std::string blobName_;
39 | int addValue_;
40 |
41 | INPUT_TAGS(HANDLER);
42 | OUTPUT_TAGS(VALUE);
43 | };
44 |
45 | class StoreWaitOp final : public Operator {
46 | public:
47 | StoreWaitOp(const OperatorDef& operator_def, Workspace* ws);
48 | bool RunOnDevice() override;
49 |
50 | private:
51 | std::vector blobNames_;
52 |
53 | INPUT_TAGS(HANDLER);
54 | };
55 | }
56 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/mkl/utils/mkl_version_check.h:
--------------------------------------------------------------------------------
1 | #ifndef CAFFE2_UTILS_MKL_MKL_VERSION_CHECK_H_
2 | #define CAFFE2_UTILS_MKL_MKL_VERSION_CHECK_H_
3 | #ifdef CAFFE2_USE_MKL
4 |
5 | #include
6 |
7 | #if INTEL_MKL_VERSION >= 20170000
8 | #define CAFFE2_HAS_MKL_SGEMM_PACK
9 | #define CAFFE2_HAS_MKL_DNN
10 | #endif // INTEL_MKL_VERSION >= 20170000
11 |
12 | #endif // CAFFE2_USE_MKL
13 | #endif // CAFFE2_UTILS_MKL_MKL_VERSION_CHECK_H_
14 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/mkl/utils/sgemm_pack.h:
--------------------------------------------------------------------------------
1 | #ifndef CAFFE2_UTILS_MKL_SGEMM_PACK_H_
2 | #define CAFFE2_UTILS_MKL_SGEMM_PACK_H_
3 |
4 | #include "caffe2/core/logging.h"
5 |
6 | namespace caffe2 {
7 | namespace mkl {
8 | struct MKLPackedMatrix {
9 | CBLAS_IDENTIFIER identifier_;
10 | CBLAS_TRANSPOSE trans_;
11 | int m_;
12 | int n_;
13 | int k_;
14 | float alpha_;
15 | int ld_;
16 | float* data_ = nullptr;
17 |
18 | MKLPackedMatrix(
19 | const CBLAS_IDENTIFIER identifier,
20 | const CBLAS_TRANSPOSE trans,
21 | const int m,
22 | const int n,
23 | const int k,
24 | const float alpha,
25 | const float* src,
26 | const int ld)
27 | : identifier_(identifier),
28 | trans_(trans),
29 | m_(m),
30 | n_(n),
31 | k_(k),
32 | alpha_(alpha),
33 | ld_(ld) {
34 | data_ = cblas_sgemm_alloc(identifier, m, n, k);
35 | CAFFE_ENFORCE(data_, "MKL runtime error: cannot allocate sgemm memory.");
36 | cblas_sgemm_pack(
37 | CblasRowMajor, identifier, trans, m, n, k, alpha, src, ld, data_);
38 | }
39 |
40 | ~MKLPackedMatrix() {
41 | if (data_) {
42 | cblas_sgemm_free(data_);
43 | }
44 | }
45 | };
46 |
47 | } // namespace mkl
48 | } // namespace caffe2
49 |
50 | #endif // CAFFE2_UTILS_MKL_SGEMM_PACK_H_
51 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/mobile/contrib/ios/ios_caffe.h:
--------------------------------------------------------------------------------
1 | // Copyright 2004-present Facebook. All Rights Reserved.
2 |
3 | #ifdef __cplusplus
4 |
5 | #include
6 | #include
7 | #include "caffe2/core/predictor.h"
8 | #include "caffe2/mobile/contrib/ios/ios_caffe_defines.h"
9 | #include "caffe2/mobile/contrib/ios/ios_caffe_predictor.h"
10 |
11 | extern "C" {
12 |
13 | IOS_CAFFE_EXPORT Caffe2IOSPredictor* MakeCaffe2Predictor(const std::string& init_net_str,
14 | const std::string& predict_net_str,
15 | bool disableMultithreadProcessing,
16 | bool allowMetalOperators,
17 | std::string& errorMessage);
18 | IOS_CAFFE_EXPORT void GenerateStylizedImage(std::vector& originalImage,
19 | const std::string& init_net_str,
20 | const std::string& predict_net_str,
21 | int height,
22 | int width,
23 | std::vector& dataOut);
24 | }
25 |
26 | #endif
27 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/mobile/contrib/ios/ios_caffe_defines.h:
--------------------------------------------------------------------------------
1 | // Copyright 2004-present Facebook. All Rights Reserved.
2 |
3 | #define IOS_CAFFE_EXPORT __attribute__((visibility("default")))
4 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/mobile/contrib/ios/ios_caffe_predictor.h:
--------------------------------------------------------------------------------
1 | // Copyright 2004-present Facebook. All Rights Reserved.
2 |
3 | #pragma once
4 |
5 | #include
6 | #include "caffe2/core/net.h"
7 | #include "caffe2/core/predictor.h"
8 | #include "caffe2/mobile/contrib/ios/ios_caffe_defines.h"
9 |
10 | struct Tensor {
11 | std::vector dims;
12 | uint8_t* data;
13 | };
14 |
15 | class IOS_CAFFE_EXPORT Caffe2IOSPredictor final {
16 | public:
17 | /**
18 | @allowMetalOperators Allow converting eligible operators to Metal GPU framework accelerated
19 | operators. Setting this flag to true doesn't gaurantee predictor will be using Metal operators;
20 | Client code must check usingMetalOperators flag to determine predictor is using them.
21 | */
22 | static Caffe2IOSPredictor* NewCaffe2IOSPredictor(const caffe2::NetDef& init_net,
23 | const caffe2::NetDef& predict_net,
24 | bool disableMultithreadProcessing,
25 | bool allowMetalOperators);
26 | void run(const Tensor& inData, Tensor& outData, std::string& errorMessage);
27 | ~Caffe2IOSPredictor(){};
28 |
29 | const bool usingMetalOperators;
30 |
31 | private:
32 | Caffe2IOSPredictor(const caffe2::NetDef& init_net,
33 | const caffe2::NetDef& predict_net,
34 | bool disableMultithreadProcessing,
35 | bool usingMetalOperators);
36 | caffe2::Predictor predictor_;
37 | };
38 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/mobile/contrib/ios/mpscnn/mpscnn.h:
--------------------------------------------------------------------------------
1 | // Copyright 2004-present Facebook. All Rights Reserved.
2 |
3 | #pragma once
4 | #include "caffe2/core/net.h"
5 |
6 | namespace caffe2 {
7 | static constexpr const char* kMPSCNNReadCountArg = "__mpscnn_read_count__";
8 | static constexpr const char* kMPSCNNOutputIsTempImageArg = "__mpscnn_output_is_temp_img__";
9 |
10 | // We currently only try to convert a fixed set of operators that handle a subset of a full
11 | // CNN. We also only run when MPSCNN is available, provides a speedup.
12 | // On failure, returns false. On success, returns true, and sets the MPSCNN net in the output
13 | // parameter.
14 |
15 | bool tryConvertToMPSCNN(const NetDef& initNet, const NetDef& predictNet, NetDef* mpscnnPredictNet);
16 |
17 | // Exposed for testing.
18 | NetDef annotateDefWithReadCounts(const NetDef& net);
19 | NetDef rewriteForMetal(const NetDef& net);
20 | NetDef runMPSCNNFusion(const NetDef& net);
21 | void dumpDef(const NetDef& d);
22 | void mpscnnRecordExecutionFinish();
23 | } // namespace caffe2
24 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/mobile/contrib/ios/mpscnn/mpscnn_context.h:
--------------------------------------------------------------------------------
1 | // Copyright 2004-present Facebook. All Rights Reserved.
2 |
3 | #pragma once
4 |
5 | #import
6 | #import
7 | #import
8 |
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 |
15 | namespace caffe2 {
16 |
17 | struct MPSCNNContext {
18 | public:
19 | id device;
20 | id commandQueue;
21 | id library;
22 |
23 | id getPipelineState(NSString* kernel);
24 | id getSpecializedPipelineState(NSString* kernel,
25 | const std::vector& constants);
26 |
27 | private:
28 | std::mutex pipelineCacheMutex_;
29 | std::unordered_map> pipelineCache_;
30 | };
31 |
32 | // get the singleton instance.
33 | MPSCNNContext& getMPSCNNContext();
34 | } // namespace caffe2
35 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/mobile/contrib/ios/mpscnn/mpscnn_graph_mask.h:
--------------------------------------------------------------------------------
1 | // Copyright 2004-present Facebook. All Rights Reserved.
2 |
3 | #pragma once
4 | #include "caffe2/core/net.h"
5 | #include "mpscnn.h"
6 |
7 | namespace caffe2 {
8 | // We currently only try to convert a fixed set of operators that handle a subset of a full
9 | // CNN. We also only run when MPSCNN is available, provides a speedup.
10 | // On failure, returns false. On success, returns true, and sets the MPSCNN net in the output
11 | // parameter.
12 | // The rewrite function now supports insertion of copies in intermediate ops.
13 | bool tryConvertToMPSCNNIntermediateCopies(const NetDef& initNet,
14 | const NetDef& predictNet,
15 | NetDef* mpscnnPredictNet);
16 | NetDef setSpecialArgs(const NetDef& def);
17 | } // namespace caffe2
18 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/mobile/contrib/ios/mpscnn/mpscnn_test.h:
--------------------------------------------------------------------------------
1 | // Copyright 2004-present Facebook. All Rights Reserved.
2 |
3 | #include "caffe2/core/net.h"
4 | #pragma once
5 |
6 | namespace caffe2 {
7 |
8 | void testMPSCNN();
9 | void compareModels(const NetDef& initNet, NetDef predictNet);
10 | void verifyRewrite(const NetDef& initNet, const NetDef& net, std::vector inputDims);
11 | } // namespace caffe2
12 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/mobile/contrib/opengl/android/AndroidGLContext.h:
--------------------------------------------------------------------------------
1 | // Copyright 2004-present Facebook. All Rights Reserved.
2 |
3 | #pragma once
4 |
5 | #include "../core/GLContext.h"
6 | #include "../core/GLTexture.h"
7 | #include
8 |
9 | enum GL_Renderer { Adreno, Mali /*, PowerVR */ };
10 |
11 | class AndroidGLContext : public GLContext {
12 | private:
13 | EGLContext _eglcontext;
14 |
15 | EGLContext create_opengl_thread_context();
16 | bool opengl_thread_context_exists();
17 | bool release_opengl_thread_context();
18 |
19 | public:
20 | AndroidGLContext();
21 | ~AndroidGLContext();
22 | void set_context();
23 | void reset_context();
24 | void flush_context();
25 | void init_gles3();
26 | GL_Renderer get_platform();
27 | };
28 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/mobile/contrib/opengl/android/arm_neon_support.h:
--------------------------------------------------------------------------------
1 | // Copyright 2004-present Facebook. All Rights Reserved.
2 |
3 | #pragma once
4 |
5 | #include
6 | typedef __fp16 float16_t;
7 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/mobile/contrib/opengl/core/DataTransfer.h:
--------------------------------------------------------------------------------
1 | // Copyright 2004-present Facebook. All Rights Reserved.
2 |
3 | #pragma once
4 |
5 | #include "arm_neon_support.h"
6 |
7 | void interleaveSlice(void* output,
8 | const float* input,
9 | size_t width,
10 | size_t height,
11 | size_t row_stride,
12 | uint16_t input_channels);
13 | void deInterleaveSlice(float* output,
14 | const void* input,
15 | size_t width,
16 | size_t height,
17 | size_t input_stride,
18 | uint32_t output_channels);
19 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/mobile/contrib/opengl/core/GL.h:
--------------------------------------------------------------------------------
1 | // Copyright 2004-present Facebook. All Rights Reserved.
2 |
3 | #pragma once
4 | #include "caffe2/core/common.h"
5 |
6 | #if CAFFE2_IOS
7 | #include
8 | #include
9 | #elif CAFFE2_ANDROID
10 | #include
11 | #include
12 | #include "caffe2/mobile/contrib/opengl/android/gl3stub.h"
13 | #endif
14 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/mobile/contrib/opengl/core/GLContext.h:
--------------------------------------------------------------------------------
1 | // Copyright 2004-present Facebook. All Rights Reserved.
2 |
3 | #pragma once
4 | #include "GLTexture.h"
5 | #include "caffe2/core/common.h"
6 | #include
7 |
8 | class GLContext {
9 | private:
10 | static std::unique_ptr _glcontext;
11 | std::function foreignTextureAllocator =
12 | nullptr;
13 |
14 | protected:
15 | bool half_float_supported = true;
16 |
17 | public:
18 | virtual void set_context() = 0;
19 | virtual void reset_context() = 0;
20 | virtual void flush_context() = 0;
21 | virtual ~GLContext(){};
22 |
23 | static void initGLContext();
24 | static GLContext* getGLContext();
25 | static void deleteGLContext();
26 |
27 | static bool GL_EXT_texture_border_clamp_defined();
28 |
29 | inline bool halfFloatTextureSupported() { return half_float_supported; }
30 |
31 | void setTextureAllocator(
32 | std::function textureAllocator) {
33 | foreignTextureAllocator = textureAllocator;
34 | }
35 |
36 | std::function getTextureAllocator() {
37 | return foreignTextureAllocator;
38 | }
39 | };
40 |
41 | bool supportOpenGLES3(bool* hfs = nullptr);
42 |
43 | bool isSupportedDevice();
44 |
45 | #if CAFFE2_IOS
46 | int iPhoneVersion();
47 | #endif
48 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/mobile/contrib/opengl/core/GLImageAllocator.h:
--------------------------------------------------------------------------------
1 | // Copyright 2004-present Facebook. All Rights Reserved.
2 |
3 | #pragma once
4 |
5 | #include "GLImage.h"
6 | #include "GLPlainTexture.h"
7 |
8 | template
9 | class GLImageAllocator {
10 | public:
11 | static const GLTexture::Type& type;
12 |
13 | GLImageAllocator() { gl_log(GL_VERBOSE, "%s\n", __PRETTY_FUNCTION__); }
14 |
15 | virtual ~GLImageAllocator() { gl_log(GL_VERBOSE, "%s\n", __PRETTY_FUNCTION__); }
16 |
17 | virtual GLImageVector* newImage(
18 | int num_images, int width, int height, int channels, int tile_x, int tile_y, bool is_output);
19 |
20 | virtual GLImageVector* newImage(
21 | int num_images,
22 | int width,
23 | int height,
24 | int channels,
25 | int tile_x,
26 | int tile_y,
27 | std::function textureAllocator);
28 |
29 | virtual GLImageVector* ShareTexture(const GLuint textureID,
30 | int num_images,
31 | int width,
32 | int height,
33 | int channels,
34 | int tile_x = 1,
35 | int tile_y = 1);
36 |
37 | static GLImageAllocator* newGLImageAllocator();
38 | };
39 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/mobile/contrib/opengl/core/GLLogging.h:
--------------------------------------------------------------------------------
1 | // Copyright 2004-present Facebook. All Rights Reserved.
2 |
3 | #pragma once
4 |
5 | #include
6 | #include
7 |
8 | enum { GL_ERR = -1, GL_LOG = 0, GL_VERBOSE = 1 };
9 |
10 | static constexpr int GL_LOG_LEVEL = GL_LOG;
11 |
12 | static inline int gl_log(int level, const char* format, ...) {
13 | int r = 0;
14 | if (level <= GL_LOG_LEVEL) {
15 | va_list args;
16 | va_start(args, format);
17 | r = vfprintf(stderr, format, args);
18 | va_end(args);
19 | }
20 | return r;
21 | }
22 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/mobile/contrib/opengl/core/GLPBO.h:
--------------------------------------------------------------------------------
1 | // Copyright 2004-present Facebook. All Rights Reserved.
2 |
3 | #pragma once
4 |
5 | #include "GLTexture.h"
6 | #include
7 |
8 | class GLPBO {
9 | GLuint pboId = 0;
10 | GLuint pboSize = 0;
11 | GLuint pboFrameBuffer = 0;
12 |
13 | ~GLPBO();
14 |
15 | static GLPBO* pboContext;
16 |
17 | public:
18 | void mapTextureData(GLuint _textureId,
19 | GLsizei _width,
20 | GLsizei _height,
21 | GLsizei _stride,
22 | GLsizei _channels,
23 | const GLTexture::Type& type,
24 | std::function process);
30 |
31 | static GLPBO* getContext();
32 | };
33 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/mobile/contrib/opengl/core/GLPlainTexture.h:
--------------------------------------------------------------------------------
1 | // Copyright 2004-present Facebook. All Rights Reserved.
2 |
3 | #pragma once
4 |
5 | #include "GLContext.h"
6 | #include "GLTexture.h"
7 |
8 | class GLPlainTexture : public GLTexture {
9 | private:
10 | bool isOwner = true;
11 |
12 | public:
13 | GLPlainTexture(const Type& type,
14 | const void* input,
15 | GLsizei width,
16 | GLsizei height,
17 | bool use_padding = false,
18 | GLint filter = GL_NEAREST,
19 | GLint wrap = GL_CLAMP_TO_EDGE);
20 |
21 | GLPlainTexture(const Type& type,
22 | const GLuint textureID,
23 | GLsizei width,
24 | GLsizei height,
25 | bool use_padding = false,
26 | GLint filter = GL_NEAREST,
27 | GLint wrap = GL_CLAMP_TO_EDGE);
28 |
29 | ~GLPlainTexture() {
30 | if (glIsTexture(_textureId)) {
31 | if (isOwner) {
32 | gl_log(GL_VERBOSE, "~GLPlainTexture() - deleting texture %d\n", _textureId);
33 | glDeleteTextures(1, &_textureId);
34 | }
35 | } else {
36 | gl_log(GL_ERR, "not deleting texture %d\n", _textureId);
37 | }
38 | }
39 |
40 | GLuint name() const { return _textureId; };
41 |
42 | GLenum target() const { return GL_TEXTURE_2D; };
43 |
44 | bool flipped() const { return false; };
45 | };
46 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/mobile/contrib/opengl/core/GLPredictor.h:
--------------------------------------------------------------------------------
1 | // Copyright 2004-present Facebook. All Rights Reserved.
2 |
3 | #pragma once
4 |
5 | #include "GLImage.h"
6 | #include "caffe2/core/net.h"
7 | #include "caffe2/core/predictor.h"
8 |
9 | namespace caffe2 {
10 | class GLPredictor : public Predictor {
11 | public:
12 | GLPredictor(const NetDef& init_net,
13 | const NetDef& run_net,
14 | bool use_texture_input = false,
15 | Workspace* parent = nullptr);
16 |
17 | template
18 | bool run(std::vector*>& inputs, std::vector*>* outputs);
19 |
20 | ~GLPredictor();
21 | };
22 | } // namespace caffe2
23 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/mobile/contrib/opengl/core/ImageAllocator.h:
--------------------------------------------------------------------------------
1 | // Copyright 2004-present Facebook. All Rights Reserved.
2 |
3 | #pragma once
4 |
5 | #include "GLImageAllocator.h"
6 |
7 | namespace caffe2 {
8 |
9 | template
10 | class ImageAllocator {
11 | GLImageAllocator* glImageAllocator;
12 |
13 | public:
14 | ImageAllocator() : glImageAllocator(GLImageAllocator::newGLImageAllocator()) {}
15 |
16 | virtual ~ImageAllocator() { delete glImageAllocator; }
17 |
18 | GLImageVector* newImage(
19 | int num_images, int width, int height, int channels, bool is_output = false) {
20 | const int tile_x = 1, tile_y = 1;
21 | return glImageAllocator->newImage(
22 | num_images, width, height, channels, tile_x, tile_y, is_output);
23 | }
24 |
25 | GLImageVector* newImage(int num_images,
26 | int width,
27 | int height,
28 | int channels,
29 | int tile_x,
30 | int tile_y,
31 | bool is_output = false) {
32 | return glImageAllocator->newImage(
33 | num_images, width, height, channels, tile_x, tile_y, is_output);
34 | }
35 |
36 | GLImageVector* newImage(
37 | int num_images,
38 | int width,
39 | int height,
40 | int channels,
41 | int tile_x,
42 | int tile_y,
43 | std::function textureAllocator) {
44 | return glImageAllocator->newImage(
45 | num_images, width, height, channels, tile_x, tile_y, textureAllocator);
46 | }
47 | };
48 | } // namespace caffe2
49 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/mobile/contrib/opengl/core/arm_neon_support.h:
--------------------------------------------------------------------------------
1 | // Copyright 2004-present Facebook. All Rights Reserved.
2 |
3 | #pragma once
4 |
5 | #include "caffe2/core/common.h"
6 |
7 | #ifdef __ARM_NEON__
8 | #if CAFFE2_IOS
9 | #include "arm_neon.h"
10 | #elif CAFFE2_ANDROID
11 | #include "caffe2/mobile/contrib/opengl/android/arm_neon_support.h"
12 | #endif
13 | #endif
14 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/mobile/contrib/opengl/core/rewrite_net.h:
--------------------------------------------------------------------------------
1 | // Copyright 2004-present Facebook. All Rights Reserved.
2 |
3 | #pragma once
4 | #include "GLPredictor.h"
5 | #include "caffe2/core/predictor.h"
6 |
7 | namespace caffe2 {
8 | bool tryConvertToOpenGL(const NetDef& initNet,
9 | const NetDef& predictNet,
10 | NetDef* glPredictNet,
11 | bool useTextureInput = false,
12 | bool useTiling = false,
13 | bool runFusion = true);
14 |
15 | // Exposed for testing
16 | NetDef rewritePredictNetForOpenGL(const NetDef& predictNet,
17 | bool useTextureInput = false,
18 | bool useTiling = false,
19 | bool runFusion = true);
20 | void dumpDefForOpenGL(const NetDef& net);
21 | } // namespace caffe2
22 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/mobile/contrib/opengl/ios/IOSGLContext.h:
--------------------------------------------------------------------------------
1 | // Copyright 2004-present Facebook. All Rights Reserved.
2 |
3 | #pragma once
4 |
5 | #include "../core/GLContext.h"
6 | #include "../core/GLTexture.h"
7 |
8 | #import
9 |
10 | class IOSGLContext : public GLContext {
11 | void* oglContext;
12 | void* oldContext;
13 | CVOpenGLESTextureCacheRef textureCache;
14 |
15 | public:
16 | IOSGLContext();
17 | ~IOSGLContext();
18 |
19 | const GLTexture* createNewTexture(CVPixelBufferRef pixelBuffer, const GLTexture::Type& type);
20 | void set_context();
21 | void reset_context();
22 | void flush_context();
23 | };
24 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/mobile/contrib/opengl/ios/IOSGLImageAllocator.h:
--------------------------------------------------------------------------------
1 | // Copyright 2004-present Facebook. All Rights Reserved.
2 |
3 | #pragma once
4 |
5 | #include "../core/GLImageAllocator.h"
6 |
7 | #import
8 |
9 | template
10 | class IOSGLImageAllocator : public GLImageAllocator {
11 | static const GLTexture::Type& type;
12 |
13 | std::vector pixelbuffers;
14 |
15 | public:
16 | static const FourCharCode pixelFormat;
17 |
18 | IOSGLImageAllocator() : GLImageAllocator() { gl_log(GL_VERBOSE, "%s\n", __PRETTY_FUNCTION__); }
19 |
20 | ~IOSGLImageAllocator() {
21 | gl_log(GL_VERBOSE, "%s\n", __PRETTY_FUNCTION__);
22 |
23 | for (auto&& pixelbuffer : pixelbuffers) {
24 | CFRelease(pixelbuffer);
25 | }
26 | }
27 |
28 | GLImageVector* newImage(int num_images,
29 | int width,
30 | int height,
31 | int channels,
32 | int tile_x,
33 | int tile_y,
34 | bool useCVPixelBuffer);
35 | };
36 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/mobile/contrib/opengl/operators/gl_tiling_utils.h:
--------------------------------------------------------------------------------
1 | // Copyright 2004-present Facebook. All Rights Reserved.
2 |
3 | // pragma once
4 | #include
5 |
6 | namespace {
7 | struct point {
8 | int x;
9 | int y;
10 | };
11 |
12 | struct tile_descriptor {
13 | point tile_dims;
14 | point tile_size;
15 | int tiles;
16 | };
17 | } // namespace
18 |
19 | namespace caffe2 {
20 | inline static void squareFactors(int N, int& r1, int& r2) {
21 | int f = sqrt(N);
22 |
23 | if (f * f == N) {
24 | r1 = r2 = f;
25 | } else {
26 | while (N % f != 0) {
27 | f--;
28 | }
29 | r1 = N / f;
30 | r2 = f;
31 | }
32 | }
33 |
34 | inline static void computeOutputTiles(int output_channels, int& output_tile_x, int& output_tile_y) {
35 | squareFactors((output_channels + 3) / 4, output_tile_x, output_tile_y);
36 | }
37 | } // namespace caffe2
38 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/mobile/contrib/opengl/test/TestGLConvolution.h:
--------------------------------------------------------------------------------
1 | // Copyright 2004-present Facebook. All Rights Reserved.
2 |
3 | #pragma once
4 |
5 | void TestGLConvolution();
6 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/mobile/contrib/snpe/snpe_ffi.h:
--------------------------------------------------------------------------------
1 | #ifndef CAFFE2_SNPE_FFI_H_
2 | #define CAFFE2_SNPE_FFI_H_
3 |
4 | #include
5 | #include
6 |
7 | namespace caffe2 {
8 |
9 | std::string& gSNPELocation();
10 |
11 | const char* const snpe_ffi_so = "libsnpe_ffi.so";
12 |
13 | }
14 |
15 | extern "C" {
16 |
17 | bool snpe_has_gpu();
18 |
19 | void* snpe_create(const uint8_t* container, size_t size, const char* input_name);
20 |
21 | void snpe_destroy(void* ctx);
22 |
23 | void snpe_get_input_dims(void* ctx, size_t const** dims, size_t* size);
24 |
25 | void snpe_run(void* ctx,
26 | const float* inputData,
27 | size_t inputSize,
28 | size_t const** outputDims,
29 | size_t* outputSize);
30 |
31 | void snpe_copy_output_to(void* ctx, float* outputData);
32 |
33 | }
34 |
35 | #endif // CAFFE2_SNPE_FFI_H_
36 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/mobile/contrib/ulp2/ulp_neon.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "ulp.h"
4 |
5 | namespace caffe2 {
6 |
7 | constexpr size_t kGEMMTileSize = 64;
8 | constexpr size_t kGEMMTileDepthBytes = 16;
9 |
10 | bool run2b1bConvNeon(QConvState* state, const ConvArgs& args, const TensorCPU& X, TensorCPU* Y);
11 | }
12 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/operators/accumulate_op.h:
--------------------------------------------------------------------------------
1 | #ifndef CAFFE2_OPERATORS_ACCUMULATE_OP_H_
2 | #define CAFFE2_OPERATORS_ACCUMULATE_OP_H_
3 |
4 | #include "caffe2/core/context.h"
5 | #include "caffe2/core/operator.h"
6 | #include "caffe2/utils/math.h"
7 |
8 | namespace caffe2 {
9 |
10 | template
11 | class AccumulateOp final : public Operator {
12 | public:
13 | AccumulateOp(const OperatorDef& operator_def, Workspace* ws)
14 | : Operator(operator_def, ws),
15 | gamma_(static_cast(
16 | OperatorBase::template GetSingleArgument("gamma", 1.0))) {}
17 | USE_OPERATOR_CONTEXT_FUNCTIONS;
18 |
19 | bool RunOnDevice() override {
20 | auto& input = Input(0);
21 | auto* output = Output(0);
22 | if (output->dims() != input.dims()) {
23 | LOG(INFO) << "Reshaping and initializing output.";
24 | output->ResizeLike(input);
25 | math::Set(
26 | output->size(), 0, output->template mutable_data(), &context_);
27 | }
28 | math::Axpby(
29 | input.size(),
30 | static_cast(1),
31 | input.template data(),
32 | gamma_,
33 | output->template mutable_data(),
34 | &context_);
35 | return true;
36 | }
37 |
38 | protected:
39 | T gamma_;
40 | };
41 |
42 | } // namespace caffe2
43 |
44 | #endif // CAFFE2_OPERATORS_ACCUMULATE_OP_H_
45 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/operators/accuracy_op.h:
--------------------------------------------------------------------------------
1 | #ifndef CAFFE2_OPERATORS_ACCURACY_OP_H_
2 | #define CAFFE2_OPERATORS_ACCURACY_OP_H_
3 |
4 | #include "caffe2/core/context.h"
5 | #include "caffe2/core/operator.h"
6 |
7 | namespace caffe2 {
8 |
9 | template
10 | class AccuracyOp final : public Operator {
11 | public:
12 | USE_OPERATOR_CONTEXT_FUNCTIONS;
13 | AccuracyOp(const OperatorDef& operator_def, Workspace* ws)
14 | : Operator(operator_def, ws),
15 | top_k_(OperatorBase::GetSingleArgument("top_k", 1)) {}
16 |
17 | bool RunOnDevice() override;
18 |
19 | protected:
20 | int top_k_;
21 | INPUT_TAGS(PREDICTION, LABEL);
22 | };
23 |
24 | } // namespace caffe2
25 |
26 | #endif // CAFFE2_OPERATORS_ACCURACY_OP_H_
27 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/operators/apmeter_op.h:
--------------------------------------------------------------------------------
1 | #ifndef CAFFE2_MAP_OP_H_
2 | #define CAFFE2_MAP_OP_H_
3 |
4 | #include "caffe2/core/context.h"
5 | #include "caffe2/core/operator.h"
6 |
7 | namespace caffe2 {
8 |
9 | template
10 | class APMeterOp final : public Operator {
11 | public:
12 | USE_OPERATOR_CONTEXT_FUNCTIONS;
13 |
14 | APMeterOp(const OperatorDef& operator_def, Workspace* ws)
15 | : Operator(operator_def, ws),
16 | buffer_size_(
17 | OperatorBase::GetSingleArgument("buffer_size", 1000)),
18 | buffer_used_(0) {}
19 |
20 | bool RunOnDevice() override;
21 |
22 | protected:
23 | using BufferDataType = std::pair;
24 | // Buffer the predictions for each class
25 | std::vector> buffers_;
26 | // Capacity of the buffer
27 | int buffer_size_;
28 | // Used buffer
29 | int buffer_used_;
30 |
31 | INPUT_TAGS(PREDICTION, LABEL);
32 |
33 | protected:
34 | // Buffer predictions for N sample and D classes
35 | void
36 | BufferPredictions(const float* Xdata, const int* labelData, int N, int D);
37 | };
38 |
39 | } // namespace caffe2
40 |
41 | #endif // CAFFE2_MAP_OP_H_
42 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/operators/batch_box_cox_op.h:
--------------------------------------------------------------------------------
1 | #ifndef CAFFE_OPERATORS_BATCH_BOX_COX_OPS_H_
2 | #define CAFFE_OPERATORS_BATCH_BOX_COX_OPS_H_
3 |
4 | #include "caffe2/core/context.h"
5 | #include "caffe2/core/logging.h"
6 | #include "caffe2/core/operator.h"
7 | #include "caffe2/utils/math.h"
8 |
9 | namespace caffe2 {
10 |
11 | template
12 | class BatchBoxCoxOp final : public Operator {
13 | public:
14 | USE_OPERATOR_CONTEXT_FUNCTIONS;
15 | BatchBoxCoxOp(const OperatorDef& operator_def, Workspace* ws)
16 | : Operator(operator_def, ws) {}
17 |
18 | bool RunOnDevice() override {
19 | return DispatchHelper>::call(this, Input(DATA));
20 | }
21 |
22 | template
23 | bool DoRunWithType();
24 |
25 | protected:
26 | INPUT_TAGS(DATA, LAMBDA1, LAMBDA2);
27 | };
28 |
29 | } // namespace caffe2
30 |
31 | #endif // CAFFE_OPERATORS_BATCH_BOX_COX_OPS_H_
32 |
--------------------------------------------------------------------------------
/texture-view/src/main/cpp/caffe2/operators/boolean_mask_ops.h:
--------------------------------------------------------------------------------
1 | #ifndef BOOLEAN_MASK_OPS_H
2 | #define BOOLEAN_MASK_OPS_H
3 |
4 | #include "caffe2/core/context.h"
5 | #include "caffe2/core/operator.h"
6 | #include "caffe2/core/tensor.h"
7 | #include "caffe2/utils/conversions.h"
8 |
9 | namespace caffe2 {
10 |
11 | template
12 | class BooleanMaskOp final : public Operator {
13 | public:
14 | USE_OPERATOR_CONTEXT_FUNCTIONS;
15 | BooleanMaskOp(const OperatorDef& operator_def, Workspace* ws)
16 | : Operator(operator_def, ws) {}
17 |
18 | bool RunOnDevice() override;
19 | };
20 |
21 | template
22 | class SequenceMaskOp final : public Operator {
23 | public:
24 | USE_OPERATOR_CONTEXT_FUNCTIONS;
25 | explicit SequenceMaskOp(const OperatorDef& operator_def, Workspace* ws)
26 | : Operator