├── .gitignore ├── .gradle └── 3.3 │ ├── taskArtifacts │ ├── fileHashes.bin │ ├── fileSnapshots.bin │ ├── taskArtifacts.bin │ └── taskArtifacts.lock │ └── tasks │ ├── _basic_compileDebugJavaWithJavac │ ├── localClassSetAnalysis │ │ ├── localClassSetAnalysis.bin │ │ └── localClassSetAnalysis.lock │ └── localJarClasspathSnapshot │ │ ├── localJarClasspathSnapshot.bin │ │ └── localJarClasspathSnapshot.lock │ └── _texture-view_compileDebugJavaWithJavac │ ├── localClassSetAnalysis │ ├── localClassSetAnalysis.bin │ └── localClassSetAnalysis.lock │ └── localJarClasspathSnapshot │ ├── localJarClasspathSnapshot.bin │ └── localJarClasspathSnapshot.lock ├── .idea ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── gradle.xml ├── libraries │ ├── support_annotations_25_3_1.xml │ └── support_compat_25_3_1.xml ├── markdown-navigator │ └── profiles_settings.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── workspace.xml ├── LICENSE ├── README.md ├── build.gradle ├── camera.iml ├── device-2017-10-23-185701.png ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── local.properties ├── settings.gradle └── texture-view ├── .externalNativeBuild └── cmake │ ├── debug │ ├── arm64-v8a │ │ ├── .ninja_deps │ │ ├── .ninja_log │ │ ├── CMakeCache.txt │ │ ├── CMakeFiles │ │ │ ├── 3.6.0-rc2 │ │ │ │ ├── CMakeCCompiler.cmake │ │ │ │ ├── CMakeCXXCompiler.cmake │ │ │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ │ │ └── CMakeSystem.cmake │ │ │ ├── CMakeOutput.log │ │ │ ├── TargetDirectories.txt │ │ │ ├── cmake.check_cache │ │ │ ├── feature_tests.bin │ │ │ ├── feature_tests.c │ │ │ └── feature_tests.cxx │ │ ├── android_gradle_build.json │ │ ├── build.ninja │ │ ├── cmake_build_command.txt │ │ ├── cmake_build_output.txt │ │ ├── cmake_install.cmake │ │ └── rules.ninja │ └── armeabi-v7a │ │ ├── CMakeCache.txt │ │ ├── CMakeFiles │ │ ├── 3.6.0-rc2 │ │ │ ├── CMakeCCompiler.cmake │ │ │ ├── CMakeCXXCompiler.cmake │ │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ │ └── CMakeSystem.cmake │ │ ├── CMakeOutput.log │ │ ├── TargetDirectories.txt │ │ ├── cmake.check_cache │ │ ├── feature_tests.bin │ │ ├── feature_tests.c │ │ └── feature_tests.cxx │ │ ├── android_gradle_build.json │ │ ├── build.ninja │ │ ├── cmake_build_command.txt │ │ ├── cmake_build_output.txt │ │ ├── cmake_install.cmake │ │ └── rules.ninja │ └── release │ ├── arm64-v8a │ ├── CMakeCache.txt │ ├── CMakeFiles │ │ ├── 3.6.0-rc2 │ │ │ ├── CMakeCCompiler.cmake │ │ │ ├── CMakeCXXCompiler.cmake │ │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ │ └── CMakeSystem.cmake │ │ ├── CMakeOutput.log │ │ ├── TargetDirectories.txt │ │ ├── cmake.check_cache │ │ ├── feature_tests.bin │ │ ├── feature_tests.c │ │ └── feature_tests.cxx │ ├── android_gradle_build.json │ ├── build.ninja │ ├── cmake_build_command.txt │ ├── cmake_build_output.txt │ ├── cmake_install.cmake │ └── rules.ninja │ └── armeabi-v7a │ ├── CMakeCache.txt │ ├── CMakeFiles │ ├── 3.6.0-rc2 │ │ ├── CMakeCCompiler.cmake │ │ ├── CMakeCXXCompiler.cmake │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ └── CMakeSystem.cmake │ ├── CMakeOutput.log │ ├── TargetDirectories.txt │ ├── cmake.check_cache │ ├── feature_tests.bin │ ├── feature_tests.c │ └── feature_tests.cxx │ ├── android_gradle_build.json │ ├── build.ninja │ ├── cmake_build_command.txt │ ├── cmake_build_output.txt │ ├── cmake_install.cmake │ └── rules.ninja ├── build.gradle ├── src └── main │ ├── AndroidManifest.xml │ ├── assets │ ├── squeeze_init_net.pb │ └── squeeze_predict_net.pb │ ├── cpp │ ├── CMakeLists.txt │ ├── Eigen │ │ ├── CMakeLists.txt │ │ ├── Cholesky │ │ ├── CholmodSupport │ │ ├── Core │ │ ├── Dense │ │ ├── Eigen │ │ ├── Eigenvalues │ │ ├── Geometry │ │ ├── Householder │ │ ├── IterativeLinearSolvers │ │ ├── Jacobi │ │ ├── LU │ │ ├── MetisSupport │ │ ├── OrderingMethods │ │ ├── PaStiXSupport │ │ ├── PardisoSupport │ │ ├── QR │ │ ├── QtAlignedMalloc │ │ ├── SPQRSupport │ │ ├── SVD │ │ ├── Sparse │ │ ├── SparseCholesky │ │ ├── SparseCore │ │ ├── SparseLU │ │ ├── SparseQR │ │ ├── StdDeque │ │ ├── StdList │ │ ├── StdVector │ │ ├── SuperLUSupport │ │ ├── UmfPackSupport │ │ └── src │ │ │ ├── Cholesky │ │ │ ├── LDLT.h │ │ │ ├── LLT.h │ │ │ └── LLT_LAPACKE.h │ │ │ ├── CholmodSupport │ │ │ └── CholmodSupport.h │ │ │ ├── Core │ │ │ ├── ArithmeticSequence.h │ │ │ ├── Array.h │ │ │ ├── ArrayBase.h │ │ │ ├── ArrayWrapper.h │ │ │ ├── Assign.h │ │ │ ├── AssignEvaluator.h │ │ │ ├── Assign_MKL.h │ │ │ ├── BandMatrix.h │ │ │ ├── Block.h │ │ │ ├── BooleanRedux.h │ │ │ ├── CommaInitializer.h │ │ │ ├── ConditionEstimator.h │ │ │ ├── CoreEvaluators.h │ │ │ ├── CoreIterators.h │ │ │ ├── CwiseBinaryOp.h │ │ │ ├── CwiseNullaryOp.h │ │ │ ├── CwiseTernaryOp.h │ │ │ ├── CwiseUnaryOp.h │ │ │ ├── CwiseUnaryView.h │ │ │ ├── DenseBase.h │ │ │ ├── DenseCoeffsBase.h │ │ │ ├── DenseStorage.h │ │ │ ├── Diagonal.h │ │ │ ├── DiagonalMatrix.h │ │ │ ├── DiagonalProduct.h │ │ │ ├── Dot.h │ │ │ ├── EigenBase.h │ │ │ ├── ForceAlignedAccess.h │ │ │ ├── Fuzzy.h │ │ │ ├── GeneralProduct.h │ │ │ ├── GenericPacketMath.h │ │ │ ├── GlobalFunctions.h │ │ │ ├── IO.h │ │ │ ├── IndexedView.h │ │ │ ├── Inverse.h │ │ │ ├── Map.h │ │ │ ├── MapBase.h │ │ │ ├── MathFunctions.h │ │ │ ├── MathFunctionsImpl.h │ │ │ ├── Matrix.h │ │ │ ├── MatrixBase.h │ │ │ ├── NestByValue.h │ │ │ ├── NoAlias.h │ │ │ ├── NumTraits.h │ │ │ ├── PermutationMatrix.h │ │ │ ├── PlainObjectBase.h │ │ │ ├── Product.h │ │ │ ├── ProductEvaluators.h │ │ │ ├── Random.h │ │ │ ├── Redux.h │ │ │ ├── Ref.h │ │ │ ├── Replicate.h │ │ │ ├── ReturnByValue.h │ │ │ ├── Reverse.h │ │ │ ├── Select.h │ │ │ ├── SelfAdjointView.h │ │ │ ├── SelfCwiseBinaryOp.h │ │ │ ├── Solve.h │ │ │ ├── SolveTriangular.h │ │ │ ├── SolverBase.h │ │ │ ├── StableNorm.h │ │ │ ├── Stride.h │ │ │ ├── Swap.h │ │ │ ├── Transpose.h │ │ │ ├── Transpositions.h │ │ │ ├── TriangularMatrix.h │ │ │ ├── VectorBlock.h │ │ │ ├── VectorwiseOp.h │ │ │ ├── Visitor.h │ │ │ ├── arch │ │ │ │ ├── AVX │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── PacketMath.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ ├── AVX512 │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ └── PacketMath.h │ │ │ │ ├── AltiVec │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ └── PacketMath.h │ │ │ │ ├── CUDA │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── Half.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── PacketMath.h │ │ │ │ │ ├── PacketMathHalf.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ ├── Default │ │ │ │ │ └── Settings.h │ │ │ │ ├── NEON │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ └── PacketMath.h │ │ │ │ ├── SSE │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── PacketMath.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ └── ZVector │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ └── PacketMath.h │ │ │ ├── functors │ │ │ │ ├── AssignmentFunctors.h │ │ │ │ ├── BinaryFunctors.h │ │ │ │ ├── NullaryFunctors.h │ │ │ │ ├── StlFunctors.h │ │ │ │ ├── TernaryFunctors.h │ │ │ │ └── UnaryFunctors.h │ │ │ ├── products │ │ │ │ ├── GeneralBlockPanelKernel.h │ │ │ │ ├── GeneralMatrixMatrix.h │ │ │ │ ├── GeneralMatrixMatrixTriangular.h │ │ │ │ ├── GeneralMatrixMatrixTriangular_BLAS.h │ │ │ │ ├── GeneralMatrixMatrix_BLAS.h │ │ │ │ ├── GeneralMatrixVector.h │ │ │ │ ├── GeneralMatrixVector_BLAS.h │ │ │ │ ├── Parallelizer.h │ │ │ │ ├── SelfadjointMatrixMatrix.h │ │ │ │ ├── SelfadjointMatrixMatrix_BLAS.h │ │ │ │ ├── SelfadjointMatrixVector.h │ │ │ │ ├── SelfadjointMatrixVector_BLAS.h │ │ │ │ ├── SelfadjointProduct.h │ │ │ │ ├── SelfadjointRank2Update.h │ │ │ │ ├── TriangularMatrixMatrix.h │ │ │ │ ├── TriangularMatrixMatrix_BLAS.h │ │ │ │ ├── TriangularMatrixVector.h │ │ │ │ ├── TriangularMatrixVector_BLAS.h │ │ │ │ ├── TriangularSolverMatrix.h │ │ │ │ ├── TriangularSolverMatrix_BLAS.h │ │ │ │ └── TriangularSolverVector.h │ │ │ └── util │ │ │ │ ├── BlasUtil.h │ │ │ │ ├── Constants.h │ │ │ │ ├── DisableStupidWarnings.h │ │ │ │ ├── ForwardDeclarations.h │ │ │ │ ├── IndexedViewHelper.h │ │ │ │ ├── IntegralConstant.h │ │ │ │ ├── MKL_support.h │ │ │ │ ├── Macros.h │ │ │ │ ├── Memory.h │ │ │ │ ├── Meta.h │ │ │ │ ├── NonMPL2.h │ │ │ │ ├── ReenableStupidWarnings.h │ │ │ │ ├── StaticAssert.h │ │ │ │ ├── SymbolicIndex.h │ │ │ │ └── XprHelper.h │ │ │ ├── Eigenvalues │ │ │ ├── ComplexEigenSolver.h │ │ │ ├── ComplexSchur.h │ │ │ ├── ComplexSchur_LAPACKE.h │ │ │ ├── EigenSolver.h │ │ │ ├── GeneralizedEigenSolver.h │ │ │ ├── GeneralizedSelfAdjointEigenSolver.h │ │ │ ├── HessenbergDecomposition.h │ │ │ ├── MatrixBaseEigenvalues.h │ │ │ ├── RealQZ.h │ │ │ ├── RealSchur.h │ │ │ ├── RealSchur_LAPACKE.h │ │ │ ├── SelfAdjointEigenSolver.h │ │ │ ├── SelfAdjointEigenSolver_LAPACKE.h │ │ │ └── Tridiagonalization.h │ │ │ ├── Geometry │ │ │ ├── AlignedBox.h │ │ │ ├── AngleAxis.h │ │ │ ├── EulerAngles.h │ │ │ ├── Homogeneous.h │ │ │ ├── Hyperplane.h │ │ │ ├── OrthoMethods.h │ │ │ ├── ParametrizedLine.h │ │ │ ├── Quaternion.h │ │ │ ├── Rotation2D.h │ │ │ ├── RotationBase.h │ │ │ ├── Scaling.h │ │ │ ├── Transform.h │ │ │ ├── Translation.h │ │ │ ├── Umeyama.h │ │ │ └── arch │ │ │ │ └── Geometry_SSE.h │ │ │ ├── Householder │ │ │ ├── BlockHouseholder.h │ │ │ ├── Householder.h │ │ │ └── HouseholderSequence.h │ │ │ ├── IterativeLinearSolvers │ │ │ ├── BasicPreconditioners.h │ │ │ ├── BiCGSTAB.h │ │ │ ├── ConjugateGradient.h │ │ │ ├── IncompleteCholesky.h │ │ │ ├── IncompleteLUT.h │ │ │ ├── IterativeSolverBase.h │ │ │ ├── LeastSquareConjugateGradient.h │ │ │ └── SolveWithGuess.h │ │ │ ├── Jacobi │ │ │ └── Jacobi.h │ │ │ ├── LU │ │ │ ├── Determinant.h │ │ │ ├── FullPivLU.h │ │ │ ├── InverseImpl.h │ │ │ ├── PartialPivLU.h │ │ │ ├── PartialPivLU_LAPACKE.h │ │ │ └── arch │ │ │ │ └── Inverse_SSE.h │ │ │ ├── MetisSupport │ │ │ └── MetisSupport.h │ │ │ ├── OrderingMethods │ │ │ ├── Amd.h │ │ │ ├── Eigen_Colamd.h │ │ │ └── Ordering.h │ │ │ ├── PaStiXSupport │ │ │ └── PaStiXSupport.h │ │ │ ├── PardisoSupport │ │ │ └── PardisoSupport.h │ │ │ ├── QR │ │ │ ├── ColPivHouseholderQR.h │ │ │ ├── ColPivHouseholderQR_LAPACKE.h │ │ │ ├── CompleteOrthogonalDecomposition.h │ │ │ ├── FullPivHouseholderQR.h │ │ │ ├── HouseholderQR.h │ │ │ └── HouseholderQR_LAPACKE.h │ │ │ ├── SPQRSupport │ │ │ └── SuiteSparseQRSupport.h │ │ │ ├── SVD │ │ │ ├── BDCSVD.h │ │ │ ├── JacobiSVD.h │ │ │ ├── JacobiSVD_LAPACKE.h │ │ │ ├── SVDBase.h │ │ │ └── UpperBidiagonalization.h │ │ │ ├── SparseCholesky │ │ │ ├── SimplicialCholesky.h │ │ │ └── SimplicialCholesky_impl.h │ │ │ ├── SparseCore │ │ │ ├── AmbiVector.h │ │ │ ├── CompressedStorage.h │ │ │ ├── ConservativeSparseSparseProduct.h │ │ │ ├── MappedSparseMatrix.h │ │ │ ├── SparseAssign.h │ │ │ ├── SparseBlock.h │ │ │ ├── SparseColEtree.h │ │ │ ├── SparseCompressedBase.h │ │ │ ├── SparseCwiseBinaryOp.h │ │ │ ├── SparseCwiseUnaryOp.h │ │ │ ├── SparseDenseProduct.h │ │ │ ├── SparseDiagonalProduct.h │ │ │ ├── SparseDot.h │ │ │ ├── SparseFuzzy.h │ │ │ ├── SparseMap.h │ │ │ ├── SparseMatrix.h │ │ │ ├── SparseMatrixBase.h │ │ │ ├── SparsePermutation.h │ │ │ ├── SparseProduct.h │ │ │ ├── SparseRedux.h │ │ │ ├── SparseRef.h │ │ │ ├── SparseSelfAdjointView.h │ │ │ ├── SparseSolverBase.h │ │ │ ├── SparseSparseProductWithPruning.h │ │ │ ├── SparseTranspose.h │ │ │ ├── SparseTriangularView.h │ │ │ ├── SparseUtil.h │ │ │ ├── SparseVector.h │ │ │ ├── SparseView.h │ │ │ └── TriangularSolver.h │ │ │ ├── SparseLU │ │ │ ├── SparseLU.h │ │ │ ├── SparseLUImpl.h │ │ │ ├── SparseLU_Memory.h │ │ │ ├── SparseLU_Structs.h │ │ │ ├── SparseLU_SupernodalMatrix.h │ │ │ ├── SparseLU_Utils.h │ │ │ ├── SparseLU_column_bmod.h │ │ │ ├── SparseLU_column_dfs.h │ │ │ ├── SparseLU_copy_to_ucol.h │ │ │ ├── SparseLU_gemm_kernel.h │ │ │ ├── SparseLU_heap_relax_snode.h │ │ │ ├── SparseLU_kernel_bmod.h │ │ │ ├── SparseLU_panel_bmod.h │ │ │ ├── SparseLU_panel_dfs.h │ │ │ ├── SparseLU_pivotL.h │ │ │ ├── SparseLU_pruneL.h │ │ │ └── SparseLU_relax_snode.h │ │ │ ├── SparseQR │ │ │ └── SparseQR.h │ │ │ ├── StlSupport │ │ │ ├── StdDeque.h │ │ │ ├── StdList.h │ │ │ ├── StdVector.h │ │ │ └── details.h │ │ │ ├── SuperLUSupport │ │ │ └── SuperLUSupport.h │ │ │ ├── UmfPackSupport │ │ │ └── UmfPackSupport.h │ │ │ ├── misc │ │ │ ├── Image.h │ │ │ ├── Kernel.h │ │ │ ├── RealSvd2x2.h │ │ │ ├── blas.h │ │ │ ├── lapack.h │ │ │ ├── lapacke.h │ │ │ └── lapacke_mangling.h │ │ │ └── plugins │ │ │ ├── ArrayCwiseBinaryOps.h │ │ │ ├── ArrayCwiseUnaryOps.h │ │ │ ├── BlockMethods.h │ │ │ ├── CommonCwiseBinaryOps.h │ │ │ ├── CommonCwiseUnaryOps.h │ │ │ ├── IndexedViewMethods.h │ │ │ ├── MatrixCwiseBinaryOps.h │ │ │ └── MatrixCwiseUnaryOps.h │ ├── android_main.cpp │ ├── caffe2 │ │ ├── contrib │ │ │ ├── aten │ │ │ │ └── aten_op_template.h │ │ │ ├── gloo │ │ │ │ ├── allreduce_ops.h │ │ │ │ ├── barrier_ops.h │ │ │ │ ├── broadcast_ops.h │ │ │ │ ├── common.h │ │ │ │ ├── common_world_ops.h │ │ │ │ ├── context.h │ │ │ │ └── store_handler.h │ │ │ ├── nccl │ │ │ │ └── cuda_nccl_gpu.h │ │ │ ├── nervana │ │ │ │ ├── nervana.h │ │ │ │ └── nervana_c_api.h │ │ │ ├── observers │ │ │ │ └── time_observer.h │ │ │ ├── prof │ │ │ │ ├── htrace_conf.h │ │ │ │ ├── prof_dag_net.h │ │ │ │ └── prof_dag_stats_op.h │ │ │ ├── shm_mutex │ │ │ │ └── shm_mutex.h │ │ │ ├── torch │ │ │ │ └── torch_op.h │ │ │ └── warpctc │ │ │ │ └── ctc_op.h │ │ ├── core │ │ │ ├── allocator.h │ │ │ ├── asan.h │ │ │ ├── blob.h │ │ │ ├── blob_serialization.h │ │ │ ├── blob_serializer_base.h │ │ │ ├── blob_stats.h │ │ │ ├── common.h │ │ │ ├── common_cudnn.h │ │ │ ├── common_gpu.h │ │ │ ├── common_omp.h │ │ │ ├── context.h │ │ │ ├── context_gpu.h │ │ │ ├── db.h │ │ │ ├── event.h │ │ │ ├── flags.h │ │ │ ├── graph.h │ │ │ ├── init.h │ │ │ ├── logging.h │ │ │ ├── logging_is_google_glog.h │ │ │ ├── logging_is_not_google_glog.h │ │ │ ├── macros.h │ │ │ ├── memonger.h │ │ │ ├── net.h │ │ │ ├── net_async_dag_gpu.h │ │ │ ├── net_dag.h │ │ │ ├── net_simple.h │ │ │ ├── net_simple_async.h │ │ │ ├── observer.h │ │ │ ├── operator.h │ │ │ ├── operator_gradient.h │ │ │ ├── operator_schema.h │ │ │ ├── plan_executor.h │ │ │ ├── predictor.h │ │ │ ├── qtensor.h │ │ │ ├── qtensor_serialization.h │ │ │ ├── registry.h │ │ │ ├── scope_guard.h │ │ │ ├── static_tracepoint.h │ │ │ ├── static_tracepoint_elfx86.h │ │ │ ├── stats.h │ │ │ ├── tensor.h │ │ │ ├── timer.h │ │ │ ├── transform.h │ │ │ ├── typeid.h │ │ │ ├── types.h │ │ │ └── workspace.h │ │ ├── cuda_rtc │ │ │ └── common_rtc.h │ │ ├── db │ │ │ └── create_db_op.h │ │ ├── distributed │ │ │ ├── file_store_handler.h │ │ │ ├── file_store_handler_op.h │ │ │ ├── redis_store_handler.h │ │ │ ├── redis_store_handler_op.h │ │ │ ├── store_handler.h │ │ │ └── store_ops.h │ │ ├── experiments │ │ │ └── operators │ │ │ │ ├── fully_connected_op_decomposition.h │ │ │ │ ├── fully_connected_op_prune.h │ │ │ │ ├── fully_connected_op_sparse.h │ │ │ │ ├── funhash_op.h │ │ │ │ ├── sparse_funhash_op.h │ │ │ │ ├── sparse_matrix_reshape_op.h │ │ │ │ ├── tt_contraction_op.h │ │ │ │ └── tt_pad_op.h │ │ ├── image │ │ │ ├── image_input_op.h │ │ │ └── transform_gpu.h │ │ ├── mkl │ │ │ ├── mkl_utils.h │ │ │ ├── operators │ │ │ │ └── operator_fallback_mkl.h │ │ │ └── utils │ │ │ │ ├── mkl_context.h │ │ │ │ ├── mkl_dnn_cppwrapper.h │ │ │ │ ├── mkl_memory.h │ │ │ │ ├── mkl_operator.h │ │ │ │ ├── mkl_version_check.h │ │ │ │ └── sgemm_pack.h │ │ ├── mobile │ │ │ └── contrib │ │ │ │ ├── ios │ │ │ │ ├── ios_caffe.h │ │ │ │ ├── ios_caffe_defines.h │ │ │ │ ├── ios_caffe_predictor.h │ │ │ │ └── mpscnn │ │ │ │ │ ├── mpscnn.h │ │ │ │ │ ├── mpscnn_context.h │ │ │ │ │ ├── mpscnn_graph_mask.h │ │ │ │ │ ├── mpscnn_kernels.h │ │ │ │ │ └── mpscnn_test.h │ │ │ │ ├── libopencl-stub │ │ │ │ └── include │ │ │ │ │ ├── CL │ │ │ │ │ ├── cl.h │ │ │ │ │ ├── cl_ext.h │ │ │ │ │ ├── cl_gl.h │ │ │ │ │ ├── cl_gl_ext.h │ │ │ │ │ ├── cl_platform.h │ │ │ │ │ └── opencl.h │ │ │ │ │ └── libopencl.h │ │ │ │ ├── opengl │ │ │ │ ├── android │ │ │ │ │ ├── AndroidGLContext.h │ │ │ │ │ ├── arm_neon_support.h │ │ │ │ │ └── gl3stub.h │ │ │ │ ├── core │ │ │ │ │ ├── DataTransfer.h │ │ │ │ │ ├── GL.h │ │ │ │ │ ├── GLContext.h │ │ │ │ │ ├── GLFilter.h │ │ │ │ │ ├── GLImage.h │ │ │ │ │ ├── GLImageAllocator.h │ │ │ │ │ ├── GLLogging.h │ │ │ │ │ ├── GLPBO.h │ │ │ │ │ ├── GLPlainTexture.h │ │ │ │ │ ├── GLPredictor.h │ │ │ │ │ ├── GLTexture.h │ │ │ │ │ ├── ImageAllocator.h │ │ │ │ │ ├── arm_neon_support.h │ │ │ │ │ └── rewrite_net.h │ │ │ │ ├── ios │ │ │ │ │ ├── IOSGLContext.h │ │ │ │ │ ├── IOSGLImageAllocator.h │ │ │ │ │ └── IOSGLTexture.h │ │ │ │ ├── operators │ │ │ │ │ └── gl_tiling_utils.h │ │ │ │ └── test │ │ │ │ │ ├── TestGLConvolution.h │ │ │ │ │ └── opengl_test.h │ │ │ │ ├── snpe │ │ │ │ └── snpe_ffi.h │ │ │ │ └── ulp2 │ │ │ │ ├── ulp.h │ │ │ │ └── ulp_neon.h │ │ ├── mpi │ │ │ ├── mpi_common.h │ │ │ └── mpi_ops.h │ │ ├── operators │ │ │ ├── accumulate_op.h │ │ │ ├── accuracy_op.h │ │ │ ├── apmeter_op.h │ │ │ ├── batch_box_cox_op.h │ │ │ ├── batch_gather_ops.h │ │ │ ├── batch_matmul_op.h │ │ │ ├── boolean_mask_ops.h │ │ │ ├── boolean_unmask_ops.h │ │ │ ├── cast_op.h │ │ │ ├── channel_shuffle_op.h │ │ │ ├── clip_op.h │ │ │ ├── concat_split_op.h │ │ │ ├── conditional_op.h │ │ │ ├── conv_op.h │ │ │ ├── conv_op_cache_cudnn.h │ │ │ ├── conv_op_impl.h │ │ │ ├── conv_op_shared.h │ │ │ ├── conv_pool_op_base.h │ │ │ ├── conv_transpose_op.h │ │ │ ├── conv_transpose_op_impl.h │ │ │ ├── conv_transpose_op_mobile.h │ │ │ ├── conv_transpose_op_mobile_impl.h │ │ │ ├── conv_transpose_unpool_op_base.h │ │ │ ├── cosine_embedding_criterion_op.h │ │ │ ├── counter_ops.h │ │ │ ├── create_scope_op.h │ │ │ ├── cross_entropy_op.h │ │ │ ├── dataset_ops.h │ │ │ ├── distance_op.h │ │ │ ├── do_op.h │ │ │ ├── dropout_op.h │ │ │ ├── elementwise_linear_op.h │ │ │ ├── elementwise_logical_ops.h │ │ │ ├── elementwise_op.h │ │ │ ├── elementwise_op_test.h │ │ │ ├── elu_op.h │ │ │ ├── feed_blob_op.h │ │ │ ├── filler_op.h │ │ │ ├── find_duplicate_elements_op.h │ │ │ ├── find_op.h │ │ │ ├── free_op.h │ │ │ ├── fully_connected_op.h │ │ │ ├── given_tensor_fill_op.h │ │ │ ├── gru_unit_op.h │ │ │ ├── h_softmax_op.h │ │ │ ├── half_float_ops.h │ │ │ ├── if_op.h │ │ │ ├── im2col_op.h │ │ │ ├── index_hash_ops.h │ │ │ ├── instance_norm_op.h │ │ │ ├── layer_norm_op.h │ │ │ ├── leaky_relu_op.h │ │ │ ├── lengths_reducer_ops.h │ │ │ ├── lengths_reducer_rowwise_8bit_ops.h │ │ │ ├── lengths_tile_op.h │ │ │ ├── lengths_top_k_op.h │ │ │ ├── load_save_op.h │ │ │ ├── local_response_normalization_op.h │ │ │ ├── loss_op.h │ │ │ ├── lpnorm_op.h │ │ │ ├── lstm_unit_op.h │ │ │ ├── map_ops.h │ │ │ ├── margin_ranking_criterion_op.h │ │ │ ├── math_ops.h │ │ │ ├── matmul_op.h │ │ │ ├── max_pool_with_index.h │ │ │ ├── merge_id_lists_op.h │ │ │ ├── multi_class_accuracy_op.h │ │ │ ├── no_default_engine_op.h │ │ │ ├── normalize_op.h │ │ │ ├── one_hot_ops.h │ │ │ ├── operator_fallback_gpu.h │ │ │ ├── order_switch_ops.h │ │ │ ├── pack_rnn_sequence_op.h │ │ │ ├── pack_segments.h │ │ │ ├── pad_op.h │ │ │ ├── partition_ops.h │ │ │ ├── perplexity_op.h │ │ │ ├── piecewise_linear_transform_op.h │ │ │ ├── pool_op.h │ │ │ ├── prefetch_op.h │ │ │ ├── prelu_op.h │ │ │ ├── prepend_dim_op.h │ │ │ ├── rank_loss_op.h │ │ │ ├── recurrent_network_blob_fetcher_op.h │ │ │ ├── recurrent_network_executor.h │ │ │ ├── recurrent_network_executor_gpu.h │ │ │ ├── recurrent_network_executor_incl.h │ │ │ ├── recurrent_network_op.h │ │ │ ├── recurrent_op_cudnn.h │ │ │ ├── reducer_functors.h │ │ │ ├── reduction_front_back_ops.h │ │ │ ├── reduction_ops.h │ │ │ ├── relu_op.h │ │ │ ├── remove_data_blocks_op.h │ │ │ ├── replace_nan_op.h │ │ │ ├── reshape_op.h │ │ │ ├── resize_op.h │ │ │ ├── reverse_packed_segs_op.h │ │ │ ├── rmac_regions_op.h │ │ │ ├── roi_pool_op.h │ │ │ ├── rowmul_op.h │ │ │ ├── scale_op.h │ │ │ ├── segment_reduction_op.h │ │ │ ├── sequence_ops.h │ │ │ ├── shape_op.h │ │ │ ├── sinusoid_position_encoding_op.h │ │ │ ├── slice_op.h │ │ │ ├── softmax_op.h │ │ │ ├── softmax_shared.h │ │ │ ├── softmax_with_loss_op.h │ │ │ ├── softplus_op.h │ │ │ ├── space_batch_op.h │ │ │ ├── sparse_to_dense_mask_op.h │ │ │ ├── sparse_to_dense_op.h │ │ │ ├── spatial_batch_norm_op.h │ │ │ ├── spatial_softmax_with_loss_op.h │ │ │ ├── square_root_divide_op.h │ │ │ ├── stop_gradient.h │ │ │ ├── string_ops.h │ │ │ ├── summarize_op.h │ │ │ ├── tensor_protos_db_input.h │ │ │ ├── text_file_reader_utils.h │ │ │ ├── tile_op.h │ │ │ ├── top_k.h │ │ │ ├── transpose_op.h │ │ │ ├── tt_linear_op.h │ │ │ ├── utility_ops.h │ │ │ ├── while_op.h │ │ │ └── zero_gradient_op.h │ │ ├── perfkernels │ │ │ ├── common.h │ │ │ ├── cvtsh_ss_bugfix.h │ │ │ ├── embedding_lookup.h │ │ │ └── typed_axpy.h │ │ ├── proto │ │ │ ├── caffe2.pb.h │ │ │ ├── caffe2_legacy.pb.h │ │ │ ├── hsm.pb.h │ │ │ ├── metanet.pb.h │ │ │ ├── predictor_consts.pb.h │ │ │ └── prof_dag.pb.h │ │ ├── python │ │ │ └── pybind_state.h │ │ ├── queue │ │ │ ├── blobs_queue.h │ │ │ ├── blobs_queue_db.h │ │ │ ├── queue_ops.h │ │ │ ├── rebatching_queue.h │ │ │ └── rebatching_queue_ops.h │ │ ├── sgd │ │ │ ├── adagrad_op.h │ │ │ ├── adam_op.h │ │ │ ├── ftrl_op.h │ │ │ ├── iter_op.h │ │ │ ├── learning_rate_functors.h │ │ │ ├── learning_rate_op.h │ │ │ ├── momentum_sgd_op.h │ │ │ ├── rmsprop_op.h │ │ │ └── yellowfin_op.h │ │ ├── transforms │ │ │ ├── common_subexpression_elimination.h │ │ │ ├── conv_to_nnpack_transform.h │ │ │ ├── pattern_net_transform.h │ │ │ └── single_op_transform.h │ │ ├── utils │ │ │ ├── cast.h │ │ │ ├── cblas.h │ │ │ ├── conversions.h │ │ │ ├── cpu_neon.h │ │ │ ├── cpuid.h │ │ │ ├── fixed_divisor.h │ │ │ ├── math-detail.h │ │ │ ├── math.h │ │ │ ├── murmur_hash3.h │ │ │ ├── proto_utils.h │ │ │ ├── signal_handler.h │ │ │ ├── simple_queue.h │ │ │ ├── smart_tensor_printer.h │ │ │ ├── string_utils.h │ │ │ ├── thread_pool.h │ │ │ ├── threadpool │ │ │ │ ├── ThreadPool.h │ │ │ │ ├── ThreadPoolCommon.h │ │ │ │ ├── WorkersPool.h │ │ │ │ ├── pthreadpool.h │ │ │ │ └── pthreadpool_impl.h │ │ │ └── zmq_helper.h │ │ └── video │ │ │ ├── video_decoder.h │ │ │ ├── video_input_op.h │ │ │ └── video_io.h │ ├── camera │ │ ├── camera_engine.cpp │ │ ├── camera_engine.h │ │ ├── camera_listeners.cpp │ │ ├── camera_manager.cpp │ │ ├── camera_manager.h │ │ ├── camera_utils.cpp │ │ ├── camera_utils.h │ │ ├── image_reader.cpp │ │ ├── image_reader.h │ │ └── native_debug.h │ ├── classes.h │ ├── google │ │ └── protobuf │ │ │ ├── any.h │ │ │ ├── any.pb.h │ │ │ ├── any.proto │ │ │ ├── api.pb.h │ │ │ ├── api.proto │ │ │ ├── arena.h │ │ │ ├── arenastring.h │ │ │ ├── compiler │ │ │ ├── code_generator.h │ │ │ ├── command_line_interface.h │ │ │ ├── cpp │ │ │ │ └── cpp_generator.h │ │ │ ├── csharp │ │ │ │ ├── csharp_generator.h │ │ │ │ └── csharp_names.h │ │ │ ├── importer.h │ │ │ ├── java │ │ │ │ ├── java_generator.h │ │ │ │ └── java_names.h │ │ │ ├── javanano │ │ │ │ └── javanano_generator.h │ │ │ ├── js │ │ │ │ └── js_generator.h │ │ │ ├── objectivec │ │ │ │ ├── objectivec_generator.h │ │ │ │ └── objectivec_helpers.h │ │ │ ├── parser.h │ │ │ ├── php │ │ │ │ └── php_generator.h │ │ │ ├── plugin.h │ │ │ ├── plugin.pb.h │ │ │ ├── plugin.proto │ │ │ ├── python │ │ │ │ └── python_generator.h │ │ │ └── ruby │ │ │ │ └── ruby_generator.h │ │ │ ├── descriptor.h │ │ │ ├── descriptor.pb.h │ │ │ ├── descriptor.proto │ │ │ ├── descriptor_database.h │ │ │ ├── duration.pb.h │ │ │ ├── duration.proto │ │ │ ├── dynamic_message.h │ │ │ ├── empty.pb.h │ │ │ ├── empty.proto │ │ │ ├── extension_set.h │ │ │ ├── field_mask.pb.h │ │ │ ├── field_mask.proto │ │ │ ├── generated_enum_reflection.h │ │ │ ├── generated_enum_util.h │ │ │ ├── generated_message_reflection.h │ │ │ ├── generated_message_util.h │ │ │ ├── has_bits.h │ │ │ ├── io │ │ │ ├── coded_stream.h │ │ │ ├── gzip_stream.h │ │ │ ├── printer.h │ │ │ ├── strtod.h │ │ │ ├── tokenizer.h │ │ │ ├── zero_copy_stream.h │ │ │ ├── zero_copy_stream_impl.h │ │ │ └── zero_copy_stream_impl_lite.h │ │ │ ├── map.h │ │ │ ├── map_entry.h │ │ │ ├── map_entry_lite.h │ │ │ ├── map_field.h │ │ │ ├── map_field_inl.h │ │ │ ├── map_field_lite.h │ │ │ ├── map_type_handler.h │ │ │ ├── message.h │ │ │ ├── message_lite.h │ │ │ ├── metadata.h │ │ │ ├── reflection.h │ │ │ ├── reflection_ops.h │ │ │ ├── repeated_field.h │ │ │ ├── service.h │ │ │ ├── source_context.pb.h │ │ │ ├── source_context.proto │ │ │ ├── struct.pb.h │ │ │ ├── struct.proto │ │ │ ├── stubs │ │ │ ├── atomic_sequence_num.h │ │ │ ├── atomicops.h │ │ │ ├── atomicops_internals_arm64_gcc.h │ │ │ ├── atomicops_internals_arm_gcc.h │ │ │ ├── atomicops_internals_arm_qnx.h │ │ │ ├── atomicops_internals_atomicword_compat.h │ │ │ ├── atomicops_internals_generic_gcc.h │ │ │ ├── atomicops_internals_macosx.h │ │ │ ├── atomicops_internals_mips_gcc.h │ │ │ ├── atomicops_internals_pnacl.h │ │ │ ├── atomicops_internals_power.h │ │ │ ├── atomicops_internals_ppc_gcc.h │ │ │ ├── atomicops_internals_solaris.h │ │ │ ├── atomicops_internals_tsan.h │ │ │ ├── atomicops_internals_x86_gcc.h │ │ │ ├── atomicops_internals_x86_msvc.h │ │ │ ├── bytestream.h │ │ │ ├── callback.h │ │ │ ├── casts.h │ │ │ ├── common.h │ │ │ ├── fastmem.h │ │ │ ├── hash.h │ │ │ ├── logging.h │ │ │ ├── macros.h │ │ │ ├── mutex.h │ │ │ ├── once.h │ │ │ ├── platform_macros.h │ │ │ ├── port.h │ │ │ ├── scoped_ptr.h │ │ │ ├── shared_ptr.h │ │ │ ├── singleton.h │ │ │ ├── status.h │ │ │ ├── stl_util.h │ │ │ ├── stringpiece.h │ │ │ ├── template_util.h │ │ │ └── type_traits.h │ │ │ ├── text_format.h │ │ │ ├── timestamp.pb.h │ │ │ ├── timestamp.proto │ │ │ ├── type.pb.h │ │ │ ├── type.proto │ │ │ ├── unknown_field_set.h │ │ │ ├── util │ │ │ ├── field_comparator.h │ │ │ ├── field_mask_util.h │ │ │ ├── json_util.h │ │ │ ├── message_differencer.h │ │ │ ├── time_util.h │ │ │ ├── type_resolver.h │ │ │ └── type_resolver_util.h │ │ │ ├── wire_format.h │ │ │ ├── wire_format_lite.h │ │ │ ├── wire_format_lite_inl.h │ │ │ ├── wrappers.pb.h │ │ │ └── wrappers.proto │ ├── opencv │ │ ├── cv.h │ │ ├── cv.hpp │ │ ├── cvaux.h │ │ ├── cvaux.hpp │ │ ├── cvwimage.h │ │ ├── cxcore.h │ │ ├── cxcore.hpp │ │ ├── cxeigen.hpp │ │ ├── cxmisc.h │ │ ├── highgui.h │ │ └── ml.h │ └── opencv2 │ │ ├── calib3d │ │ └── calib3d.hpp │ │ ├── contrib │ │ ├── contrib.hpp │ │ ├── detection_based_tracker.hpp │ │ ├── hybridtracker.hpp │ │ ├── openfabmap.hpp │ │ └── retina.hpp │ │ ├── core │ │ ├── affine.hpp │ │ ├── core.hpp │ │ ├── core_c.h │ │ ├── cuda_devptrs.hpp │ │ ├── devmem2d.hpp │ │ ├── eigen.hpp │ │ ├── gpumat.hpp │ │ ├── internal.hpp │ │ ├── mat.hpp │ │ ├── opengl_interop.hpp │ │ ├── opengl_interop_deprecated.hpp │ │ ├── operations.hpp │ │ ├── types_c.h │ │ ├── version.hpp │ │ └── wimage.hpp │ │ ├── features2d │ │ └── features2d.hpp │ │ ├── flann │ │ ├── all_indices.h │ │ ├── allocator.h │ │ ├── any.h │ │ ├── autotuned_index.h │ │ ├── composite_index.h │ │ ├── config.h │ │ ├── defines.h │ │ ├── dist.h │ │ ├── dummy.h │ │ ├── dynamic_bitset.h │ │ ├── flann.hpp │ │ ├── flann_base.hpp │ │ ├── general.h │ │ ├── ground_truth.h │ │ ├── hdf5.h │ │ ├── heap.h │ │ ├── hierarchical_clustering_index.h │ │ ├── index_testing.h │ │ ├── kdtree_index.h │ │ ├── kdtree_single_index.h │ │ ├── kmeans_index.h │ │ ├── linear_index.h │ │ ├── logger.h │ │ ├── lsh_index.h │ │ ├── lsh_table.h │ │ ├── matrix.h │ │ ├── miniflann.hpp │ │ ├── nn_index.h │ │ ├── object_factory.h │ │ ├── params.h │ │ ├── random.h │ │ ├── result_set.h │ │ ├── sampling.h │ │ ├── saving.h │ │ ├── simplex_downhill.h │ │ └── timer.h │ │ ├── highgui │ │ ├── cap_ios.h │ │ ├── highgui.hpp │ │ ├── highgui_c.h │ │ └── ios.h │ │ ├── imgproc │ │ ├── imgproc.hpp │ │ ├── imgproc_c.h │ │ └── types_c.h │ │ ├── legacy │ │ ├── blobtrack.hpp │ │ ├── compat.hpp │ │ ├── legacy.hpp │ │ └── streams.hpp │ │ ├── ml │ │ └── ml.hpp │ │ ├── objdetect │ │ └── objdetect.hpp │ │ ├── ocl │ │ ├── matrix_operations.hpp │ │ └── ocl.hpp │ │ ├── opencv.hpp │ │ ├── opencv_modules.hpp │ │ ├── photo │ │ ├── photo.hpp │ │ └── photo_c.h │ │ ├── stitching │ │ ├── detail │ │ │ ├── autocalib.hpp │ │ │ ├── blenders.hpp │ │ │ ├── camera.hpp │ │ │ ├── exposure_compensate.hpp │ │ │ ├── matchers.hpp │ │ │ ├── motion_estimators.hpp │ │ │ ├── seam_finders.hpp │ │ │ ├── util.hpp │ │ │ ├── util_inl.hpp │ │ │ ├── warpers.hpp │ │ │ └── warpers_inl.hpp │ │ ├── stitcher.hpp │ │ └── warpers.hpp │ │ ├── superres │ │ ├── optical_flow.hpp │ │ └── superres.hpp │ │ ├── ts │ │ ├── gpu_perf.hpp │ │ ├── gpu_test.hpp │ │ ├── ts.hpp │ │ ├── ts_gtest.h │ │ └── ts_perf.hpp │ │ ├── video │ │ ├── background_segm.hpp │ │ ├── tracking.hpp │ │ └── video.hpp │ │ └── videostab │ │ ├── deblurring.hpp │ │ ├── fast_marching.hpp │ │ ├── fast_marching_inl.hpp │ │ ├── frame_source.hpp │ │ ├── global_motion.hpp │ │ ├── inpainting.hpp │ │ ├── log.hpp │ │ ├── motion_stabilizing.hpp │ │ ├── optical_flow.hpp │ │ ├── stabilizer.hpp │ │ └── videostab.hpp │ ├── java │ └── com │ │ └── sample │ │ └── textureview │ │ └── ViewActivity.java │ ├── libs │ └── armeabi-v7a │ │ ├── libCAFFE2_NNPACK.a │ │ ├── libCAFFE2_PTHREADPOOL.a │ │ ├── libCaffe2_CPU.a │ │ ├── libcpufeatures.a │ │ ├── libglog.so │ │ ├── libgnustl_shared.so │ │ ├── libprotobuf-lite.a │ │ ├── libprotobuf.a │ │ └── opencv │ │ ├── libIlmImf.a │ │ ├── liblibjasper.a │ │ ├── liblibjpeg.a │ │ ├── liblibpng.a │ │ ├── liblibtiff.a │ │ ├── libopencv_core.a │ │ ├── libopencv_highgui.a │ │ ├── libopencv_imgproc.a │ │ └── libtbb.a │ └── res │ ├── drawable-hdpi │ └── ic_launcher.png │ ├── drawable-mdpi │ └── ic_launcher.png │ ├── drawable-xhdpi │ └── ic_launcher.png │ ├── drawable-xxhdpi │ └── ic_launcher.png │ ├── layout │ └── activity_main.xml │ └── values │ └── strings.xml └── texture-view.iml /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | -------------------------------------------------------------------------------- /.gradle/3.3/taskArtifacts/fileHashes.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/.gradle/3.3/taskArtifacts/fileHashes.bin -------------------------------------------------------------------------------- /.gradle/3.3/taskArtifacts/fileSnapshots.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/.gradle/3.3/taskArtifacts/fileSnapshots.bin -------------------------------------------------------------------------------- /.gradle/3.3/taskArtifacts/taskArtifacts.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/.gradle/3.3/taskArtifacts/taskArtifacts.bin -------------------------------------------------------------------------------- /.gradle/3.3/taskArtifacts/taskArtifacts.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/.gradle/3.3/taskArtifacts/taskArtifacts.lock -------------------------------------------------------------------------------- /.gradle/3.3/tasks/_basic_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/.gradle/3.3/tasks/_basic_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin -------------------------------------------------------------------------------- /.gradle/3.3/tasks/_basic_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/.gradle/3.3/tasks/_basic_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock -------------------------------------------------------------------------------- /.gradle/3.3/tasks/_basic_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/.gradle/3.3/tasks/_basic_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin -------------------------------------------------------------------------------- /.gradle/3.3/tasks/_basic_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/.gradle/3.3/tasks/_basic_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock -------------------------------------------------------------------------------- /.gradle/3.3/tasks/_texture-view_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/.gradle/3.3/tasks/_texture-view_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin -------------------------------------------------------------------------------- /.gradle/3.3/tasks/_texture-view_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/.gradle/3.3/tasks/_texture-view_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock -------------------------------------------------------------------------------- /.gradle/3.3/tasks/_texture-view_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/.gradle/3.3/tasks/_texture-view_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin -------------------------------------------------------------------------------- /.gradle/3.3/tasks/_texture-view_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/.gradle/3.3/tasks/_texture-view_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /.idea/libraries/support_annotations_25_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/support_compat_25_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/markdown-navigator/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 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 | 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(operator_def, ws), 27 | axis_(OperatorBase::GetSingleArgument("axis", 1)), 28 | radius_(OperatorBase::GetSingleArgument("radius", 10)), 29 | grad_(OperatorBase::GetSingleArgument("grad", false)), 30 | fill_val_(OperatorBase::GetSingleArgument( 31 | "fill_val", 32 | -1.0f * std::numeric_limits::infinity())) { 33 | // Mode argument is required 34 | mode_ = GetArgument(operator_def, "mode").s(); 35 | } 36 | 37 | bool RunOnDevice() override; 38 | 39 | template 40 | bool DoRunWithType(); 41 | 42 | private: 43 | int axis_; 44 | int radius_; 45 | std::string mode_; 46 | bool grad_; 47 | float fill_val_; 48 | }; 49 | 50 | } // caffe2 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/boolean_unmask_ops.h: -------------------------------------------------------------------------------- 1 | #ifndef BOOLEAN_UNMASK_OPS_H 2 | #define BOOLEAN_UNMASK_OPS_H 3 | 4 | #include "caffe2/core/context.h" 5 | #include "caffe2/core/operator.h" 6 | 7 | namespace caffe2 { 8 | 9 | template 10 | class BooleanUnmaskOp final : public Operator { 11 | public: 12 | USE_SIMPLE_CTOR_DTOR(BooleanUnmaskOp) 13 | USE_OPERATOR_CONTEXT_FUNCTIONS; 14 | 15 | bool RunOnDevice() override; 16 | }; 17 | 18 | } // namespace caffe2 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/cast_op.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "caffe2/core/context.h" 4 | #include "caffe2/core/operator.h" 5 | #include "caffe2/utils/cast.h" 6 | #include "caffe2/utils/conversions.h" 7 | #include "caffe2/utils/math.h" 8 | #include "caffe2/core/logging.h" 9 | #include "caffe2/core/types.h" 10 | 11 | namespace caffe2 { 12 | 13 | template 14 | class CastOp : public Operator { 15 | public: 16 | USE_OPERATOR_CONTEXT_FUNCTIONS; 17 | 18 | CastOp(const OperatorDef& operator_def, Workspace* ws) 19 | : Operator(operator_def, ws) { 20 | const ArgumentHelper helper(operator_def); 21 | TensorProto_DataType to = cast::GetCastDataType(helper, "to"); 22 | TensorProto_DataType from = cast::GetCastDataType(helper, "from_type"); 23 | 24 | SetBody(to); 25 | } 26 | 27 | bool RunOnDevice() override { 28 | return (this->*body_)(); 29 | } 30 | 31 | // Allow for Context-specific implementations 32 | void SetBody(TensorProto_DataType to); 33 | 34 | template 35 | bool DoRunWithDstType(); 36 | 37 | template 38 | bool DoRunWithType() { 39 | auto& input = Input(0); 40 | auto* output = Output(0); 41 | output->ResizeLike(input); 42 | const auto* data = input.template data(); 43 | auto* out = output->template mutable_data(); 44 | auto N = input.size(); 45 | for (TIndex i = 0; i < N; ++i) { 46 | out[i] = static_cast(data[i]); 47 | } 48 | return true; 49 | } 50 | 51 | private: 52 | bool (CastOp::*body_)(); 53 | }; 54 | 55 | } // namespace caffe2 56 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/conditional_op.h: -------------------------------------------------------------------------------- 1 | // Copyright 2004-present Facebook. All Rights Reserved. 2 | 3 | #ifndef CONDITIONAL_OP_H 4 | #define CONDITIONAL_OP_H 5 | 6 | #include "caffe2/core/context.h" 7 | #include "caffe2/core/operator.h" 8 | #include "caffe2/core/tensor.h" 9 | 10 | namespace caffe2 { 11 | 12 | template 13 | class ConditionalOp final : public Operator { 14 | public: 15 | USE_OPERATOR_CONTEXT_FUNCTIONS; 16 | ConditionalOp(const OperatorDef& operator_def, Workspace* ws) 17 | : Operator(operator_def, ws) {} 18 | 19 | bool RunOnDevice() override; 20 | }; 21 | 22 | } // caffe2 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/conv_op_cache_cudnn.h: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE2_OPERATORS_CONV_OP_CACHE_H_ 2 | #define CAFFE2_OPERATORS_CONV_OP_CACHE_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "caffe2/core/logging.h" 9 | #include "caffe2/core/tensor.h" 10 | 11 | namespace caffe2 { 12 | template 13 | class AlgorithmsCache { 14 | public: 15 | T getAlgorithm( 16 | const std::vector& bottom, 17 | const std::vector& desc, 18 | std::function generatingFunc); 19 | 20 | private: 21 | std::unordered_map hash_; 22 | }; 23 | 24 | template 25 | T AlgorithmsCache::getAlgorithm( 26 | const std::vector& vec1, 27 | const std::vector& vec2, 28 | std::function generatingFunc) { 29 | int64_t seed = 0; 30 | std::hash hashFn; 31 | for (const auto num : vec1) { 32 | // Copied from boost::hash_combine. 33 | // Adding 1 to differentiate between first and second vector. 34 | seed ^= hashFn(num) + 0x9e3779b9 + (seed << 6) + (seed >> 2) + 1; 35 | } 36 | 37 | for (const auto num : vec2) { 38 | // Copied from boost::hash_combine. 39 | seed ^= hashFn(num) + 0x9e3779b9 + (seed << 6) + (seed >> 2); 40 | } 41 | 42 | if (seed == 0) { 43 | return generatingFunc(); 44 | } 45 | 46 | if (hash_.find(seed) == hash_.end()) { 47 | T value = generatingFunc(); 48 | hash_[seed] = value; 49 | } 50 | 51 | return hash_[seed]; 52 | } 53 | } 54 | #endif 55 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/conv_op_shared.h: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE2_OPERATORS_CONV_OP_SHARED_H_ 2 | #define CAFFE2_OPERATORS_CONV_OP_SHARED_H_ 3 | 4 | #include "caffe2/core/context.h" 5 | #include "caffe2/core/tensor.h" 6 | #include "caffe2/core/workspace.h" 7 | 8 | namespace caffe2 { 9 | 10 | /** 11 | * Creates a mutex and shared buffer in the workspace. 12 | * Not thread-safe, must be called from the constructor. 13 | */ 14 | template 15 | void createSharedBuffer(Workspace* ws); 16 | 17 | /** 18 | * Thread-safe, can be invoked from RunOnDevice() to serialize 19 | * access to shared buffer. 20 | */ 21 | template 22 | void runWithSharedBuffer( 23 | Workspace* ws, 24 | std::function* buffer)> f); 25 | } // namespace caffe2 26 | 27 | #endif // CAFFE2_OPERATORS_CONV_OP_SHARED_H_ 28 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/cosine_embedding_criterion_op.h: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE2_OPERATORS_COSINE_EMBEDDING_CRITERION_OP_H_ 2 | #define CAFFE2_OPERATORS_COSINE_EMBEDDING_CRITERION_OP_H_ 3 | 4 | #include "caffe2/core/context.h" 5 | #include "caffe2/core/logging.h" 6 | #include "caffe2/core/operator.h" 7 | 8 | namespace caffe2 { 9 | 10 | template 11 | class CosineEmbeddingCriterionOp final : public Operator { 12 | public: 13 | CosineEmbeddingCriterionOp(const OperatorDef& def, Workspace* ws) 14 | : Operator(def, ws), 15 | OP_SINGLE_ARG(float, "margin", margin_, 0.0) {} 16 | USE_OPERATOR_CONTEXT_FUNCTIONS; 17 | 18 | bool RunOnDevice() override; 19 | 20 | protected: 21 | float margin_; 22 | }; 23 | 24 | template 25 | class CosineEmbeddingCriterionGradientOp final : public Operator { 26 | public: 27 | CosineEmbeddingCriterionGradientOp(const OperatorDef& def, Workspace* ws) 28 | : Operator(def, ws), 29 | OP_SINGLE_ARG(float, "margin", margin_, 0.0) {} 30 | USE_OPERATOR_CONTEXT_FUNCTIONS; 31 | 32 | bool RunOnDevice() override; 33 | 34 | protected: 35 | float margin_; 36 | }; 37 | 38 | } // namespace caffe2 39 | 40 | #endif // CAFFE2_OPERATORS_COSINE_EMBEDDING_CRITERION_OP_H_ 41 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/dropout_op.h: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE2_OPERATORS_DROPOUT_OP_H_ 2 | #define CAFFE2_OPERATORS_DROPOUT_OP_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 DropoutOp final : public Operator { 13 | public: 14 | USE_OPERATOR_CONTEXT_FUNCTIONS; 15 | DropoutOp(const OperatorDef& operator_def, Workspace* ws) 16 | : Operator(operator_def, ws), 17 | ratio_(OperatorBase::GetSingleArgument("ratio", 0.5)), 18 | is_test_( 19 | OperatorBase::GetSingleArgument(OpSchema::Arg_IsTest, 0)) { 20 | CAFFE_ENFORCE_GE(ratio_, 0); 21 | CAFFE_ENFORCE_LT(ratio_, 1); 22 | } 23 | 24 | bool RunOnDevice() override; 25 | 26 | protected: 27 | float ratio_; 28 | bool is_test_; 29 | // Input: X; Output: Y, mask. 30 | }; 31 | 32 | template 33 | class DropoutGradientOp final : public Operator { 34 | public: 35 | USE_OPERATOR_CONTEXT_FUNCTIONS; 36 | DropoutGradientOp(const OperatorDef& operator_def, Workspace* ws) 37 | : Operator(operator_def, ws), 38 | ratio_(OperatorBase::GetSingleArgument("ratio", 0.5)), 39 | is_test_( 40 | OperatorBase::GetSingleArgument(OpSchema::Arg_IsTest, 0)) { 41 | CAFFE_ENFORCE_GE(ratio_, 0); 42 | CAFFE_ENFORCE_LT(ratio_, 1); 43 | } 44 | 45 | bool RunOnDevice() override; 46 | 47 | protected: 48 | float ratio_; 49 | bool is_test_; 50 | // Input: dY, mask; Output: dX 51 | }; 52 | 53 | } // namespace caffe2 54 | 55 | #endif // CAFFE2_OPERATORS_DROPOUT_OP_H_ 56 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/elementwise_linear_op.h: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE2_OPERATORS_ELEMENTWISE_LINEAR_OP_H_ 2 | #define CAFFE2_OPERATORS_ELEMENTWISE_LINEAR_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 | template 10 | class ElementwiseLinearOp final : public Operator { 11 | public: 12 | ElementwiseLinearOp(const OperatorDef& operator_def, Workspace* ws) 13 | : Operator(operator_def, ws), 14 | axis_(OperatorBase::GetSingleArgument("axis", 1)) {} 15 | 16 | USE_OPERATOR_CONTEXT_FUNCTIONS; 17 | bool RunOnDevice() override; 18 | 19 | protected: 20 | int axis_; 21 | }; 22 | 23 | template 24 | class ElementwiseLinearGradientOp final : public Operator { 25 | public: 26 | ElementwiseLinearGradientOp(const OperatorDef& operator_def, Workspace* ws) 27 | : Operator(operator_def, ws), 28 | axis_(OperatorBase::GetSingleArgument("axis", 1)) {} 29 | 30 | USE_OPERATOR_CONTEXT_FUNCTIONS; 31 | bool RunOnDevice() override; 32 | 33 | protected: 34 | int axis_; 35 | }; 36 | 37 | } // namespace caffe2 38 | 39 | #endif // CAFFE2_OPERATORS_ELEMENTWISE_LINEAR_OP_H_ 40 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/elu_op.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "caffe2/core/context.h" 4 | #include "caffe2/core/logging.h" 5 | #include "caffe2/core/operator.h" 6 | 7 | namespace caffe2 { 8 | 9 | template 10 | class EluOp final : public Operator { 11 | public: 12 | EluOp(const OperatorDef& operator_def, Workspace* ws) 13 | : Operator(operator_def, ws), 14 | alpha_(OperatorBase::GetSingleArgument("alpha", 1.0)) {} 15 | USE_OPERATOR_CONTEXT_FUNCTIONS; 16 | 17 | bool RunOnDevice() override; 18 | 19 | protected: 20 | T alpha_; 21 | }; 22 | 23 | template 24 | class EluGradientOp final : public Operator { 25 | public: 26 | EluGradientOp(const OperatorDef& operator_def, Workspace* ws) 27 | : Operator(operator_def, ws), 28 | alpha_(OperatorBase::GetSingleArgument("alpha", 1.0)) {} 29 | USE_OPERATOR_CONTEXT_FUNCTIONS; 30 | 31 | bool RunOnDevice() override; 32 | 33 | protected: 34 | T alpha_; 35 | }; 36 | 37 | } // namespace caffe2 38 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/feed_blob_op.h: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE2_OPERATORS_FEED_BLOB_OP_H_ 2 | #define CAFFE2_OPERATORS_FEED_BLOB_OP_H_ 3 | 4 | #include "caffe2/core/context.h" 5 | #include "caffe2/core/operator.h" 6 | 7 | namespace caffe2 { 8 | 9 | template 10 | class FeedBlobOp : public Operator { 11 | public: 12 | FeedBlobOp(const OperatorDef& def, Workspace* ws) 13 | : Operator(def, ws) { 14 | CAFFE_ENFORCE( 15 | OperatorBase::HasSingleArgumentOfType("value"), 16 | "value argument must exist and be passed as a string"); 17 | value_ = OperatorBase::GetSingleArgument("value", ""); 18 | } 19 | 20 | bool RunOnDevice() override { 21 | *OperatorBase::Output(0) = value_; 22 | return true; 23 | } 24 | 25 | private: 26 | std::string value_; 27 | }; 28 | 29 | } // namespace caffe2 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/free_op.h: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE2_OPERATORS_FREE_OP_H_ 2 | #define CAFFE2_OPERATORS_FREE_OP_H_ 3 | 4 | #include "caffe2/core/context.h" 5 | #include "caffe2/core/operator.h" 6 | 7 | namespace caffe2 { 8 | 9 | // FreeOp frees the content of the output blob. We allow it to take in input 10 | // blobs purely for the reason that it can "wait" on the input blobs to be 11 | // produced by some of the earlier operators before a free is called. 12 | template 13 | class FreeOp : public Operator { 14 | public: 15 | FreeOp(const OperatorDef& def, Workspace* ws) : Operator(def, ws) {} 16 | 17 | bool RunOnDevice() override { 18 | for (Blob* output : OperatorBase::Outputs()) { 19 | output->Reset(); 20 | } 21 | return true; 22 | } 23 | }; 24 | 25 | } // namespace caffe2 26 | 27 | #endif // CAFFE2_OPERATORS_FREE_OP_H_ 28 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/given_tensor_fill_op.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "caffe2/core/context.h" 4 | #include "caffe2/core/logging.h" 5 | #include "caffe2/core/operator.h" 6 | #include "caffe2/operators/filler_op.h" 7 | #include "caffe2/utils/math.h" 8 | 9 | namespace caffe2 { 10 | 11 | template 12 | class GivenTensorFillOp final : public FillerOp { 13 | public: 14 | USE_OPERATOR_CONTEXT_FUNCTIONS; 15 | GivenTensorFillOp(const OperatorDef& operator_def, Workspace* ws) 16 | : FillerOp(operator_def, ws) { 17 | auto source_values = 18 | OperatorBase::template GetRepeatedArgument("values"); 19 | values_.Resize(source_values.size()); 20 | T* values_data = values_.template mutable_data(); 21 | for (int i = 0; i < source_values.size(); i++) { 22 | values_data[i] = static_cast(source_values[i]); 23 | } 24 | } 25 | 26 | bool Fill(Tensor* output) override { 27 | DCHECK_EQ(output->size(), values_.size()) 28 | << "output size: " << output->size() 29 | << " given size: " << values_.size(); 30 | auto* data = output->template mutable_data(); 31 | const T* values_data = values_.template data(); 32 | if (output->size()) { 33 | context_.template Copy( 34 | output->size(), values_data, data); 35 | } 36 | return true; 37 | } 38 | 39 | private: 40 | TensorCPU values_; 41 | }; 42 | } 43 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/if_op.h: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE2_OPERATORS_IF_OP_H_ 2 | #define CAFFE2_OPERATORS_IF_OP_H_ 3 | 4 | #include "caffe2/core/context.h" 5 | #include "caffe2/core/logging.h" 6 | #include "caffe2/core/operator.h" 7 | 8 | namespace caffe2 { 9 | 10 | template 11 | class IfOp final : public Operator { 12 | public: 13 | IfOp(const OperatorDef& operator_def, Workspace* ws) 14 | : Operator(operator_def, ws) { 15 | CAFFE_ENFORCE( 16 | this->template HasSingleArgumentOfType("then_net"), 17 | "then_net must be specified in If operator"); 18 | auto then_net_def = 19 | this->template GetSingleArgument("then_net", NetDef()); 20 | then_net_ = CreateNet(then_net_def, ws); 21 | CAFFE_ENFORCE(then_net_, "Failed to initialize then subnet"); 22 | 23 | if (this->template HasSingleArgumentOfType("else_net")) { 24 | auto else_net_def = 25 | this->template GetSingleArgument("else_net", NetDef()); 26 | else_net_ = CreateNet(else_net_def, ws); 27 | CAFFE_ENFORCE(else_net_, "Failed to initialize else subnet"); 28 | } 29 | } 30 | 31 | USE_OPERATOR_CONTEXT_FUNCTIONS; 32 | bool RunOnDevice() override; 33 | 34 | private: 35 | std::unique_ptr then_net_; 36 | std::unique_ptr else_net_; 37 | }; 38 | 39 | } // namespace caffe2 40 | 41 | #endif // CAFFE2_OPERATORS_IF_OP_H_ 42 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/leaky_relu_op.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "caffe2/core/context.h" 4 | #include "caffe2/core/logging.h" 5 | #include "caffe2/core/operator.h" 6 | 7 | namespace caffe2 { 8 | 9 | template 10 | class LeakyReluOp : public Operator { 11 | public: 12 | LeakyReluOp(const OperatorDef& operator_def, Workspace* ws) 13 | : Operator(operator_def, ws), alpha_(0) { 14 | if (HasArgument("alpha")) { 15 | alpha_ = 16 | static_cast(OperatorBase::GetSingleArgument("alpha", 0)); 17 | } 18 | } 19 | 20 | USE_OPERATOR_CONTEXT_FUNCTIONS; 21 | 22 | bool RunOnDevice() override; 23 | 24 | protected: 25 | T alpha_; 26 | }; 27 | 28 | template 29 | class LeakyReluGradientOp final : public Operator { 30 | public: 31 | LeakyReluGradientOp(const OperatorDef& operator_def, Workspace* ws) 32 | : Operator(operator_def, ws), alpha_(0) { 33 | if (HasArgument("alpha")) { 34 | alpha_ = 35 | static_cast(OperatorBase::GetSingleArgument("alpha", 0)); 36 | } 37 | } 38 | 39 | USE_OPERATOR_CONTEXT_FUNCTIONS; 40 | 41 | bool RunOnDevice() override; 42 | 43 | protected: 44 | T alpha_; 45 | }; 46 | 47 | } // namespace caffe2 48 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/lengths_top_k_op.h: -------------------------------------------------------------------------------- 1 | // Copyright 2004-present Facebook. All Rights Reserved. 2 | 3 | #ifndef CAFFE2_OPERATORS_LENGTHS_TOP_K_OP_H_ 4 | #define CAFFE2_OPERATORS_LENGTHS_TOP_K_OP_H_ 5 | 6 | #include "caffe2/core/context.h" 7 | #include "caffe2/core/logging.h" 8 | #include "caffe2/core/operator.h" 9 | #include "caffe2/operators/conv_pool_op_base.h" 10 | #include "caffe2/utils/math.h" 11 | 12 | namespace caffe2 { 13 | template 14 | class LengthsTopKOp : public Operator { 15 | public: 16 | USE_OPERATOR_CONTEXT_FUNCTIONS; 17 | 18 | LengthsTopKOp(const OperatorDef& operator_def, Workspace* ws) 19 | : Operator(operator_def, ws), OP_SINGLE_ARG(int, "k", k_, -1) { 20 | CAFFE_ENFORCE_GE(k_, 1, "k argument must be >= 1"); 21 | } 22 | 23 | bool RunOnDevice() override; 24 | 25 | protected: 26 | int k_; 27 | INPUT_TAGS(X_IN, Y_IN); 28 | OUTPUT_TAGS(TOPK_VALUES_OUT, TOPK_INDICES_OUT); 29 | }; 30 | 31 | template 32 | class LengthsTopKGradientOp : public Operator { 33 | public: 34 | LengthsTopKGradientOp(const OperatorDef& def, Workspace* ws) 35 | : Operator(def, ws), OP_SINGLE_ARG(int, "k", k_, -1) { 36 | CAFFE_ENFORCE_GE(k_, 1, "k argument must be >= 1"); 37 | } 38 | USE_OPERATOR_CONTEXT_FUNCTIONS; 39 | 40 | bool RunOnDevice() override; 41 | 42 | protected: 43 | int k_; 44 | INPUT_TAGS(LENGTH_IN, INDICES_IN, DER_TOPK_IN); 45 | OUTPUT_TAGS(DER_X_OUT); 46 | }; 47 | 48 | } // namespace caffe2 49 | 50 | #endif // CAFFE2_OPERATORS_LENGTHS_TOP_K_OP_H_ 51 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/loss_op.h: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE2_OPERATORS_LOSS_OP_H_ 2 | #define CAFFE2_OPERATORS_LOSS_OP_H_ 3 | 4 | #include "caffe2/core/context.h" 5 | #include "caffe2/core/logging.h" 6 | #include "caffe2/core/operator.h" 7 | #include "caffe2/operators/reduction_ops.h" 8 | #include "caffe2/operators/utility_ops.h" 9 | #include "caffe2/utils/math.h" 10 | 11 | namespace caffe2 { 12 | 13 | // AveragedLoss takes in the input and produces the output loss value as 14 | // the average of the input. 15 | template 16 | class AveragedLoss final : public SumElementsOp { 17 | public: 18 | AveragedLoss(const OperatorDef& operator_def, Workspace* ws) 19 | : SumElementsOp(operator_def, ws, true) {} 20 | ~AveragedLoss() {} 21 | }; 22 | 23 | template 24 | class AveragedLossGradient final : public SumElementsGradientOp { 25 | public: 26 | AveragedLossGradient(const OperatorDef& operator_def, Workspace* ws) 27 | : SumElementsGradientOp(operator_def, ws, true) {} 28 | ~AveragedLossGradient() {} 29 | }; 30 | 31 | } // namespace caffe2 32 | 33 | #endif // CAFFE2_OPERATORS_LOSS_OP_H_ 34 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/lpnorm_op.h: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE2_OPERATORS_LPNORM_OP_H_ 2 | #define CAFFE2_OPERATORS_LPNORM_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 LpNormOp : public Operator { 12 | public: 13 | USE_OPERATOR_CONTEXT_FUNCTIONS; 14 | LpNormOp(const OperatorDef& def, Workspace* ws) 15 | : Operator(def, ws), 16 | p_(OperatorBase::GetSingleArgument("p", 2)) { 17 | CAFFE_ENFORCE(p_ == 1 || p_ == 2, "p should be either 1 or 2."); 18 | } 19 | 20 | bool RunOnDevice() override; 21 | 22 | protected: 23 | int p_; 24 | INPUT_TAGS(X_IN); 25 | OUTPUT_TAGS(OUT); 26 | // Input: X; Output: Norm 27 | }; 28 | 29 | template 30 | class LpNormGradientOp : public Operator { 31 | public: 32 | USE_OPERATOR_CONTEXT_FUNCTIONS; 33 | LpNormGradientOp(const OperatorDef& def, Workspace* ws) 34 | : Operator(def, ws), 35 | p_(OperatorBase::GetSingleArgument("p", 2)) { 36 | CAFFE_ENFORCE(p_ == 1 || p_ == 2, "p should be either 1 or 2."); 37 | } 38 | 39 | bool RunOnDevice() override; 40 | 41 | protected: 42 | int p_; 43 | INPUT_TAGS(X_IN, DER_NORM_IN); 44 | OUTPUT_TAGS(DER_X_OUT); 45 | // Input: X, dNorm; Output: dX 46 | }; 47 | 48 | } // namespace caffe2 49 | 50 | #endif // CAFFE2_OPERATORS_LPNORM_OP_H_ 51 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/margin_ranking_criterion_op.h: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE2_OPERATORS_MARGIN_RANKING_CRITERION_OP_H_ 2 | #define CAFFE2_OPERATORS_MARGIN_RANKING_CRITERION_OP_H_ 3 | 4 | #include "caffe2/core/context.h" 5 | #include "caffe2/core/logging.h" 6 | #include "caffe2/core/operator.h" 7 | 8 | namespace caffe2 { 9 | 10 | template 11 | class MarginRankingCriterionOp final : public Operator { 12 | public: 13 | MarginRankingCriterionOp(const OperatorDef& def, Workspace* ws) 14 | : Operator(def, ws), 15 | OP_SINGLE_ARG(float, "margin", margin_, 1.0) {} 16 | USE_OPERATOR_CONTEXT_FUNCTIONS; 17 | 18 | bool RunOnDevice() override; 19 | 20 | protected: 21 | float margin_; 22 | }; 23 | 24 | template 25 | class MarginRankingCriterionGradientOp final : public Operator { 26 | public: 27 | MarginRankingCriterionGradientOp(const OperatorDef& def, Workspace* ws) 28 | : Operator(def, ws), 29 | OP_SINGLE_ARG(float, "margin", margin_, 1.0) {} 30 | USE_OPERATOR_CONTEXT_FUNCTIONS; 31 | 32 | bool RunOnDevice() override; 33 | 34 | protected: 35 | float margin_; 36 | }; 37 | 38 | } // namespace caffe2 39 | 40 | #endif // CAFFE2_OPERATORS_MARGIN_RANKING_CRITERION_OP_H_ 41 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/math_ops.h: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE2_OPERATORS_MATH_OP_H_ 2 | #define CAFFE2_OPERATORS_MATH_OP_H_ 3 | 4 | #include "caffe2/core/common_omp.h" 5 | #include "caffe2/core/context.h" 6 | #include "caffe2/core/logging.h" 7 | #include "caffe2/core/operator.h" 8 | #include "caffe2/core/tensor.h" 9 | #include "caffe2/operators/elementwise_op.h" 10 | #include "caffe2/utils/math.h" 11 | 12 | namespace caffe2 { 13 | 14 | struct PowFunctor { 15 | explicit PowFunctor(OperatorBase& op) { 16 | exponent_ = op.GetSingleArgument("exponent", 0); 17 | } 18 | 19 | template 20 | inline void 21 | operator()(const int n, const T* x, T* y, Context* device_context) { 22 | math::Powx(n, x, exponent_, y, device_context); 23 | } 24 | 25 | float exponent_; 26 | }; 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/max_pool_with_index.h: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE2_OPERATORS_MAX_POOL_WITH_INDEX_H_ 2 | #define CAFFE2_OPERATORS_MAX_POOL_WITH_INDEX_H_ 3 | 4 | #include 5 | #include "caffe2/core/context.h" 6 | #include "caffe2/core/context_gpu.h" 7 | #include "caffe2/core/logging.h" 8 | #include "caffe2/core/operator.h" 9 | #include "caffe2/operators/conv_pool_op_base.h" 10 | #include "caffe2/operators/pool_op.h" 11 | #include "caffe2/utils/math.h" 12 | 13 | namespace caffe2 { 14 | 15 | class MaxPoolWithIndexOp final : public ConvPoolOpBase { 16 | public: 17 | USE_CONV_POOL_BASE_FUNCTIONS(CUDAContext); 18 | MaxPoolWithIndexOp(const OperatorDef& operator_def, Workspace* ws) 19 | : ConvPoolOpBase(operator_def, ws) {} 20 | ~MaxPoolWithIndexOp() {} 21 | 22 | template 23 | bool DoRunWithType(); 24 | 25 | bool RunOnDevice() override; 26 | 27 | // Input: X 28 | // Output: Y, mask 29 | }; 30 | 31 | class MaxPoolWithIndexGradientOp final : public ConvPoolOpBase { 32 | public: 33 | USE_CONV_POOL_BASE_FUNCTIONS(CUDAContext); 34 | MaxPoolWithIndexGradientOp(const OperatorDef& operator_def, Workspace* ws) 35 | : ConvPoolOpBase(operator_def, ws) {} 36 | ~MaxPoolWithIndexGradientOp() {} 37 | 38 | template 39 | bool DoRunWithType(); 40 | 41 | bool RunOnDevice() override; 42 | 43 | // Input: X, dY, mask 44 | // Output: dX 45 | }; 46 | 47 | }; // namespace caffe2 48 | 49 | #endif // CAFFE2_OPERATORS_MAX_POOL_WITH_INDEX_H_ 50 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/multi_class_accuracy_op.h: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE2_OPERATORS_MULTI_CLASS_ACCURACY_OP_H_ 2 | #define CAFFE2_OPERATORS_MULTI_CLASS_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 MultiClassAccuracyOp final : public Operator { 11 | public: 12 | USE_SIMPLE_CTOR_DTOR(MultiClassAccuracyOp); 13 | USE_OPERATOR_CONTEXT_FUNCTIONS; 14 | bool RunOnDevice() override; 15 | 16 | protected: 17 | INPUT_TAGS(PREDICTION, LABEL); 18 | }; 19 | 20 | } // namespace caffe2 21 | 22 | #endif // CAFFE2_OPERATORS_MULTI_CLASS_ACCURACY_OP_H_ 23 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/no_default_engine_op.h: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE2_OPERATORS_NO_DEFAULT_ENGINE_OP_H_ 2 | #define CAFFE2_OPERATORS_NO_DEFAULT_ENGINE_OP_H_ 3 | 4 | #include "caffe2/core/context.h" 5 | #include "caffe2/core/logging.h" 6 | #include "caffe2/core/operator.h" 7 | 8 | namespace caffe2 { 9 | 10 | /** 11 | * A helper class to denote that an op does not have a default engine. 12 | * 13 | * NoDefaultEngineOp is a helper class that one can use to denote that a 14 | * specific operator is not intended to be called without an explicit engine 15 | * given. This is the case for e.g. the communication operators where one has 16 | * to specify a backend (like MPI or ZEROMQ). 17 | */ 18 | template 19 | class NoDefaultEngineOp final : public Operator { 20 | public: 21 | USE_SIMPLE_CTOR_DTOR(NoDefaultEngineOp); 22 | USE_OPERATOR_CONTEXT_FUNCTIONS; 23 | 24 | bool RunOnDevice() override { 25 | CAFFE_THROW( 26 | "The operator ", 27 | this->debug_def().type(), 28 | " does not have a default engine implementation. Please " 29 | "specify an engine explicitly for this operator."); 30 | } 31 | }; 32 | 33 | } // namespace caffe2 34 | 35 | #endif // CAFFE2_OPERATORS_NO_DEFAULT_ENGINE_OP_H_ 36 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/order_switch_ops.h: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE2_OPERATORS_ORDER_SWITCH_OPS_H_ 2 | #define CAFFE2_OPERATORS_ORDER_SWITCH_OPS_H_ 3 | 4 | #include "caffe2/core/operator.h" 5 | 6 | namespace caffe2 { 7 | 8 | // Note(Yangqing): I think it is possible to do a more general swapaxes operator 9 | // but I am a little afraid of going down that general path. Only implementing 10 | // the two actually needed ones here. 11 | 12 | template 13 | class NHWC2NCHWOp final : public Operator { 14 | public: 15 | USE_SIMPLE_CTOR_DTOR(NHWC2NCHWOp); 16 | USE_OPERATOR_CONTEXT_FUNCTIONS; 17 | bool RunOnDevice() override; 18 | 19 | protected: 20 | }; 21 | 22 | template 23 | class NCHW2NHWCOp final : public Operator { 24 | public: 25 | USE_SIMPLE_CTOR_DTOR(NCHW2NHWCOp); 26 | USE_OPERATOR_CONTEXT_FUNCTIONS; 27 | bool RunOnDevice() override; 28 | 29 | protected: 30 | }; 31 | 32 | } // namespace caffe2 33 | 34 | #endif // CAFFE2_OPERATORS_ORDER_SWITCH_OPS_H_ 35 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/perplexity_op.h: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE2_OPERATORS_PERPLEXITY_OP_H_ 2 | #define CAFFE2_OPERATORS_PERPLEXITY_OP_H_ 3 | 4 | #include "caffe2/core/context.h" 5 | #include "caffe2/core/operator.h" 6 | 7 | namespace caffe2 { 8 | 9 | template 10 | class PerplexityOp final : public Operator { 11 | public: 12 | USE_SIMPLE_CTOR_DTOR(PerplexityOp); 13 | USE_OPERATOR_CONTEXT_FUNCTIONS; 14 | bool RunOnDevice() override; 15 | }; 16 | 17 | } // namespace caffe2 18 | 19 | #endif // CAFFE2_OPERATORS_PERPLEXITY_OP_H_ 20 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/prelu_op.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "caffe2/core/context.h" 4 | #include "caffe2/core/logging.h" 5 | #include "caffe2/core/operator.h" 6 | 7 | namespace caffe2 { 8 | 9 | template 10 | class PReluOp final : public Operator { 11 | public: 12 | PReluOp(const OperatorDef& operator_def, Workspace* ws) 13 | : Operator(operator_def, ws), 14 | order_(StringToStorageOrder( 15 | OperatorBase::GetSingleArgument("order", "NCHW"))) {} 16 | 17 | USE_OPERATOR_CONTEXT_FUNCTIONS; 18 | 19 | bool RunOnDevice() override; 20 | 21 | protected: 22 | StorageOrder order_; 23 | }; 24 | 25 | template 26 | class PReluGradientOp final : public Operator { 27 | public: 28 | PReluGradientOp(const OperatorDef& operator_def, Workspace* ws) 29 | : Operator(operator_def, ws), 30 | order_(StringToStorageOrder( 31 | OperatorBase::GetSingleArgument("order", "NCHW"))) {} 32 | USE_OPERATOR_CONTEXT_FUNCTIONS; 33 | 34 | bool RunOnDevice() override; 35 | 36 | protected: 37 | StorageOrder order_; 38 | }; 39 | 40 | } // namespace caffe2 41 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/rank_loss_op.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "caffe2/core/context.h" 4 | #include "caffe2/core/logging.h" 5 | #include "caffe2/core/operator.h" 6 | #include "caffe2/utils/math.h" 7 | 8 | namespace caffe2 { 9 | 10 | // support multiple batches of sessions 11 | template 12 | class PairWiseLossOp final : public Operator { 13 | public: 14 | USE_SIMPLE_CTOR_DTOR(PairWiseLossOp); 15 | USE_OPERATOR_CONTEXT_FUNCTIONS; 16 | bool RunOnDevice() override; 17 | 18 | private: 19 | INPUT_TAGS(XVALUE, LABEL, LENGTHS); 20 | OUTPUT_TAGS(YVALUE); 21 | }; 22 | 23 | template 24 | class PairWiseLossGradientOp final : public Operator { 25 | public: 26 | USE_SIMPLE_CTOR_DTOR(PairWiseLossGradientOp); 27 | USE_OPERATOR_CONTEXT_FUNCTIONS; 28 | bool RunOnDevice() override; 29 | 30 | private: 31 | INPUT_TAGS(XVALUE, LABEL, DYVALUE, LENGTHS); 32 | OUTPUT_TAGS(DXVALUE); 33 | }; 34 | 35 | } // namespace caffe2 36 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/relu_op.h: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE2_OPERATORS_RELU_OP_H_ 2 | #define CAFFE2_OPERATORS_RELU_OP_H_ 3 | 4 | #include "caffe2/core/common_omp.h" 5 | #include "caffe2/core/context.h" 6 | #include "caffe2/core/logging.h" 7 | #include "caffe2/core/operator.h" 8 | 9 | namespace caffe2 { 10 | 11 | template 12 | class ReluOp final : public Operator { 13 | public: 14 | USE_SIMPLE_CTOR_DTOR(ReluOp); 15 | USE_OPERATOR_CONTEXT_FUNCTIONS; 16 | 17 | bool RunOnDevice() override; 18 | 19 | protected: 20 | }; 21 | 22 | template 23 | class ReluGradientOp final : public Operator { 24 | public: 25 | USE_SIMPLE_CTOR_DTOR(ReluGradientOp); 26 | USE_OPERATOR_CONTEXT_FUNCTIONS; 27 | 28 | bool RunOnDevice() override; 29 | 30 | protected: 31 | // Input: Y, dY; Output: dX 32 | }; 33 | 34 | } // namespace caffe2 35 | 36 | #endif // CAFFE2_OPERATORS_RELU_OP_H_ 37 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/replace_nan_op.h: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE_OPERATORS_REPLACE_NAN_OP_H_ 2 | #define CAFFE_OPERATORS_REPLACE_NAN_OP_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 ReplaceNaNOp final : public Operator { 13 | public: 14 | USE_OPERATOR_CONTEXT_FUNCTIONS; 15 | ReplaceNaNOp(const OperatorDef& operator_def, Workspace* ws) 16 | : Operator(operator_def, ws) {} 17 | 18 | bool RunOnDevice() override { 19 | return DispatchHelper>::call(this, Input(0)); 20 | } 21 | 22 | template 23 | bool DoRunWithType() { 24 | T value = OperatorBase::GetSingleArgument("value", 0); 25 | 26 | auto& input = Input(0); 27 | auto* output = Output(0); 28 | output->ResizeLike(input); 29 | 30 | const T* input_data = input.template data(); 31 | T* output_data = output->template mutable_data(); 32 | for (TIndex i = 0; i < input.size(); i++) { 33 | if (std::isnan(input_data[i])) { 34 | output_data[i] = value; 35 | } else { 36 | output_data[i] = input_data[i]; 37 | } 38 | } 39 | 40 | return true; 41 | } 42 | }; 43 | 44 | } // namespace caffe2 45 | 46 | #endif // CAFFE_OPERATORS_REPLACE_NAN_OP_H_ 47 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/rmac_regions_op.h: -------------------------------------------------------------------------------- 1 | // Copyright 2004-present Facebook. All Rights Reserved. 2 | 3 | #ifndef CAFFE2_OPERATORS_RMAC_REGIONS_OP_H 4 | #define CAFFE2_OPERATORS_RMAC_REGIONS_OP_H 5 | 6 | #include "caffe2/core/operator.h" 7 | 8 | namespace caffe2 { 9 | 10 | template 11 | class RMACRegionsOp final : public Operator { 12 | public: 13 | RMACRegionsOp(const OperatorDef& operator_def, Workspace* ws) 14 | : Operator(operator_def, ws), 15 | scales_(OperatorBase::GetSingleArgument("scales", 3)), 16 | overlap_(OperatorBase::GetSingleArgument("overlap", 0.4)) {} 17 | 18 | USE_OPERATOR_CONTEXT_FUNCTIONS; 19 | 20 | bool RunOnDevice() override; 21 | 22 | protected: 23 | int scales_; 24 | float overlap_; 25 | Tensor num_rois_; 26 | }; 27 | 28 | } // namespace caffe2 29 | 30 | #endif // CAFFE2_OPERATORS_RMAC_REGIONS_OP_H 31 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/scale_op.h: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE2_OPERATORS_SCALE_OP_H_ 2 | #define CAFFE2_OPERATORS_SCALE_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 ScaleOp final : public Operator { 12 | public: 13 | USE_OPERATOR_CONTEXT_FUNCTIONS; 14 | ScaleOp(const OperatorDef& operator_def, Workspace* ws) 15 | : Operator(operator_def, ws), 16 | scale_(OperatorBase::GetSingleArgument("scale", 1.0)) {} 17 | 18 | template 19 | bool DoRunWithType() { 20 | auto& X = Input(0); 21 | auto* Y = Output(0); 22 | Y->ResizeLike(X); 23 | math::Scale( 24 | X.size(), 25 | scale_, 26 | X.template data(), 27 | Y->template mutable_data(), 28 | &context_); 29 | return true; 30 | } 31 | 32 | bool RunOnDevice() override { 33 | return DispatchHelper>::call(this, Input(0)); 34 | } 35 | 36 | protected: 37 | float scale_; 38 | }; 39 | 40 | } // namespace caffe2 41 | 42 | #endif // CAFFE2_OPERATORS_SCALE_OP_H_ 43 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/shape_op.h: -------------------------------------------------------------------------------- 1 | // Copyright 2004-present Facebook. All Rights Reserved. 2 | 3 | #pragma once 4 | 5 | #include "caffe2/core/context.h" 6 | #include "caffe2/core/operator.h" 7 | 8 | namespace caffe2 { 9 | 10 | // RecordShapeOp records the shape of the input tensor to a vector of int. You 11 | // mostly don't need this operator explicitly, and it is mostly used in the 12 | // autodiff process. 13 | template 14 | class ShapeOp : public Operator { 15 | public: 16 | USE_OPERATOR_CONTEXT_FUNCTIONS; 17 | USE_SIMPLE_CTOR_DTOR(ShapeOp); 18 | 19 | bool RunOnDevice() override { 20 | auto& input = Input(0); 21 | auto* output = OperatorBase::Output>(0); 22 | output->Resize(input.ndim()); 23 | TIndex* output_data = output->template mutable_data(); 24 | context_.template CopyBytes( 25 | input.ndim() * sizeof(TIndex), input.dims().data(), output_data); 26 | return true; 27 | } 28 | }; 29 | 30 | } // namespace caffe2 31 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/softmax_op.h: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE2_OPERATORS_SOFTMAX_OP_H_ 2 | #define CAFFE2_OPERATORS_SOFTMAX_OP_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 SoftmaxOp final : public Operator { 13 | public: 14 | SoftmaxOp(const OperatorDef& operator_def, Workspace* ws) 15 | : Operator(operator_def, ws), 16 | axis_(OperatorBase::GetSingleArgument("axis", 1)) {} 17 | USE_OPERATOR_CONTEXT_FUNCTIONS; 18 | bool RunOnDevice() override; 19 | 20 | protected: 21 | int axis_; 22 | Tensor scale_; 23 | Tensor rowmax_; 24 | Tensor sum_multiplier_; 25 | }; 26 | 27 | template 28 | class SoftmaxGradientOp final : public Operator { 29 | public: 30 | SoftmaxGradientOp(const OperatorDef& operator_def, Workspace* ws) 31 | : Operator(operator_def, ws), 32 | axis_(OperatorBase::GetSingleArgument("axis", 1)) {} 33 | USE_OPERATOR_CONTEXT_FUNCTIONS; 34 | bool RunOnDevice() override; 35 | 36 | protected: 37 | int axis_; 38 | Tensor scale_; 39 | Tensor sum_multiplier_; 40 | }; 41 | 42 | } // namespace caffe2 43 | 44 | #endif // CAFFE2_OPERATORS_SOFTMAX_OP_H_ 45 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/softmax_shared.h: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE2_OPERATORS_SOFTMAX_SHARED_H_ 2 | #define CAFFE2_OPERATORS_SOFTMAX_SHARED_H_ 3 | 4 | #include "caffe2/core/context.h" 5 | #include "caffe2/core/operator.h" 6 | 7 | namespace caffe2 { 8 | 9 | void SoftmaxCPU( 10 | CPUContext& context, 11 | const int N, 12 | const int D, 13 | const float* Xdata, 14 | float* Ydata, 15 | float* scale, 16 | const float* sum_multiplier, 17 | bool logarithmic, 18 | float* rowmax); 19 | } // namespace caffe2 20 | 21 | #endif // #define CAFFE2_OPERATORS_SOFTMAX_SHARED_H_ 22 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/softplus_op.h: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE2_OPERATORS_SOFTPLUS_OP_H_ 2 | #define CAFFE2_OPERATORS_SOFTPLUS_OP_H_ 3 | 4 | #include "caffe2/core/common_omp.h" 5 | #include "caffe2/core/context.h" 6 | #include "caffe2/core/logging.h" 7 | #include "caffe2/core/operator.h" 8 | 9 | namespace caffe2 { 10 | 11 | template 12 | class SoftplusOp final : public Operator { 13 | public: 14 | USE_SIMPLE_CTOR_DTOR(SoftplusOp) 15 | USE_OPERATOR_CONTEXT_FUNCTIONS; 16 | 17 | bool RunOnDevice() override; 18 | 19 | protected: 20 | }; 21 | 22 | template 23 | class SoftplusGradientOp final : public Operator { 24 | public: 25 | USE_SIMPLE_CTOR_DTOR(SoftplusGradientOp) 26 | USE_OPERATOR_CONTEXT_FUNCTIONS; 27 | 28 | bool RunOnDevice() override; 29 | 30 | protected: 31 | // Input: Y, dY; Output: dX 32 | }; 33 | 34 | } // namespace caffe2 35 | 36 | #endif // CAFFE2_OPERATORS_SOFTPLUS_OP_H_ 37 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/stop_gradient.h: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE2_OPERATORS_STOP_GRADIENT_H_ 2 | #define CAFFE2_OPERATORS_STOP_GRADIENT_H_ 3 | 4 | #include "caffe2/core/operator.h" 5 | 6 | namespace caffe2 { 7 | 8 | template 9 | class StopGradientOp : public Operator { 10 | public: 11 | USE_SIMPLE_CTOR_DTOR(StopGradientOp) 12 | USE_OPERATOR_CONTEXT_FUNCTIONS; 13 | bool RunOnDevice() override { 14 | const auto& in = Input(0); 15 | auto* out = Output(0); 16 | if (out != &in) { 17 | out->CopyFrom(in, &context_); 18 | } 19 | return true; 20 | } 21 | }; 22 | 23 | } // namespace caffe2 24 | 25 | #endif // CAFFE2_OPERATORS_STOP_GRADIENT_H_ 26 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/top_k.h: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE2_OPERATORS_TOP_K_H_ 2 | #define CAFFE2_OPERATORS_TOP_K_H_ 3 | 4 | #include "caffe2/core/logging.h" 5 | #include "caffe2/core/operator.h" 6 | #include "caffe2/utils/math.h" 7 | 8 | namespace caffe2 { 9 | 10 | template 11 | class TopKOp : public Operator { 12 | public: 13 | USE_OPERATOR_CONTEXT_FUNCTIONS; 14 | 15 | TopKOp(const OperatorDef& operator_def, Workspace* ws) 16 | : Operator(operator_def, ws), OP_SINGLE_ARG(int, "k", k_, -1) { 17 | CAFFE_ENFORCE(k_ >= 1, "k argument must be >= 1"); 18 | } 19 | 20 | bool RunOnDevice() override; 21 | 22 | private: 23 | int k_; 24 | }; 25 | 26 | template 27 | class TopKGradientOp : public Operator { 28 | public: 29 | USE_OPERATOR_CONTEXT_FUNCTIONS; 30 | 31 | TopKGradientOp(const OperatorDef& operator_def, Workspace* ws) 32 | : Operator(operator_def, ws) {} 33 | 34 | bool RunOnDevice() override; 35 | }; 36 | 37 | } // namespace caffe2 38 | 39 | #endif // CAFFE2_OPERATORS_TOP_K_H_ 40 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/while_op.h: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE2_OPERATORS_WHILE_OP_H_ 2 | #define CAFFE2_OPERATORS_WHILE_OP_H_ 3 | 4 | #include "caffe2/core/context.h" 5 | #include "caffe2/core/logging.h" 6 | #include "caffe2/core/operator.h" 7 | 8 | namespace caffe2 { 9 | 10 | template 11 | class WhileOp final : public Operator { 12 | public: 13 | WhileOp(const OperatorDef& operator_def, Workspace* ws) 14 | : Operator(operator_def, ws) { 15 | CAFFE_ENFORCE( 16 | this->template HasSingleArgumentOfType("loop_net"), 17 | "loop_net must be specified in While operator"); 18 | loop_net_def_ = 19 | this->template GetSingleArgument("loop_net", NetDef()); 20 | loop_net_ = CreateNet(loop_net_def_, ws); 21 | CAFFE_ENFORCE(loop_net_, "Failed to initialize loop subnet"); 22 | 23 | cond_net_ = nullptr; 24 | bool has_cond_net = 25 | this->template HasSingleArgumentOfType("cond_net"); 26 | if (has_cond_net) { 27 | cond_net_def_ = 28 | this->template GetSingleArgument("cond_net", NetDef()); 29 | cond_net_ = CreateNet(cond_net_def_, ws); 30 | CAFFE_ENFORCE(cond_net_, "Failed to initialize condition subnet"); 31 | } 32 | } 33 | 34 | USE_OPERATOR_CONTEXT_FUNCTIONS; 35 | bool RunOnDevice() override; 36 | 37 | private: 38 | NetDef loop_net_def_; 39 | std::unique_ptr loop_net_; 40 | 41 | NetDef cond_net_def_; 42 | std::unique_ptr cond_net_; 43 | }; 44 | 45 | } // namespace caffe2 46 | 47 | #endif // CAFFE2_OPERATORS_WHILE_OP_H_ 48 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/operators/zero_gradient_op.h: -------------------------------------------------------------------------------- 1 | // Copyright 2004-present Facebook. All Rights Reserved. 2 | 3 | #pragma once 4 | 5 | #include "caffe2/core/context.h" 6 | #include "caffe2/core/operator.h" 7 | 8 | namespace caffe2 { 9 | 10 | template 11 | class ZeroGradientOp final : public Operator { 12 | public: 13 | USE_OPERATOR_CONTEXT_FUNCTIONS; 14 | USE_SIMPLE_CTOR_DTOR(ZeroGradientOp); 15 | 16 | bool RunOnDevice() override { 17 | return true; 18 | } 19 | }; 20 | 21 | } // namespace caffe2 22 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/perfkernels/cvtsh_ss_bugfix.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if defined(__APPLE__) && ((__clang_major__ < 8) || ((__clang_major__ == 8) && (__clang_minor__ < 1))) 4 | 5 | #include 6 | 7 | // This version of apple clang has a bug that _cvtsh_ss is not defined, see 8 | // https://reviews.llvm.org/D16177 9 | static __inline float 10 | __attribute__((__always_inline__, __nodebug__, __target__("f16c"))) 11 | _cvtsh_ss(unsigned short a) 12 | { 13 | __v8hi v = {(short)a, 0, 0, 0, 0, 0, 0, 0}; 14 | __v4sf r = __builtin_ia32_vcvtph2ps(v); 15 | return r[0]; 16 | } 17 | 18 | #endif // defined(__APPLE__) && (__clang_major__ < 8) 19 | 20 | #ifdef _MSC_VER 21 | 22 | // It seems that microsoft msvc does not have a _cvtsh_ss implementation so 23 | // we will add a dummy version to it. 24 | 25 | static inline float 26 | _cvtsh_ss(unsigned short x) { 27 | union { 28 | uint32_t intval; 29 | float floatval; 30 | } t1; 31 | uint32_t t2, t3; 32 | t1.intval = x & 0x7fff; // Non-sign bits 33 | t2 = x & 0x8000; // Sign bit 34 | t3 = x & 0x7c00; // Exponent 35 | t1.intval <<= 13; // Align mantissa on MSB 36 | t2 <<= 16; // Shift sign bit into position 37 | t1.intval += 0x38000000; // Adjust bias 38 | t1.intval = (t3 == 0 ? 0 : t1.intval); // Denormals-as-zero 39 | t1.intval |= t2; // Re-insert sign bit 40 | return t1.floatval; 41 | } 42 | 43 | #endif // _MSC_VER 44 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/perfkernels/embedding_lookup.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "caffe2/core/common.h" 4 | 5 | namespace caffe2 { 6 | 7 | /** 8 | * Embedding lookup with reduction. 9 | * 10 | * `input` of size data_size * block_size 11 | * `indices` of size index_size 12 | * `lengths` of size output_size 13 | * `weights` nullptr or array of size index_size 14 | * `out` of size output_size * block_size 15 | * sum(lengths[i]) == index_size 16 | * 17 | * Behavior is roughly equivalent to pseudocode: 18 | * 19 | * pos = 0 20 | * for (i = 0..index_size-1) 21 | * for (k = 0..block_size-1) 22 | * out[i*block_size + k] = 0 23 | * for (j = 0..lengths[i]-1) 24 | * for (k = 0..block_size-1) 25 | * out[i*block_size + k] += input[indices[pos]*block_size + k] * 26 | * (weights ? weights[pos] : 1.0) 27 | * pos += 1 28 | * if (normalize_weights && lengths[i] > 0) 29 | * for (k = 0..block_size-1) 30 | * out[i*block_size + k] /= lengths[i] 31 | * 32 | */ 33 | template 34 | void EmbeddingLookup( 35 | const TIndex block_size, 36 | const TIndex output_size, 37 | const TIndex index_size, 38 | const TIndex data_size, 39 | const InType* input, 40 | const IndexType* indices, 41 | const int* lengths, 42 | const float* weights, // optional, can be null for non-weighted sum 43 | const float* scale_bias, // optional scale & bias params for uint8 input 44 | bool normalize_by_lengths, 45 | OutType* out); 46 | 47 | } // namespace caffe2 48 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/perfkernels/typed_axpy.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace caffe2 { 4 | 5 | // Similar to Axpy that calculate y = a * x + y, but allowing x and y to be 6 | // of different data types. 7 | // It also provides a performance optimization hint (use_a) to see if a is going 8 | // to be 1 or not. 9 | template 10 | void TypedAxpy(int N, const OUT a, const IN* x, OUT* y); 11 | 12 | } // namespace caffe2 13 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/queue/rebatching_queue.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "caffe2/core/logging.h" 10 | #include "caffe2/core/operator.h" 11 | #include "caffe2/core/stats.h" 12 | #include "caffe2/core/tensor.h" 13 | 14 | namespace caffe2 { 15 | 16 | // TODO: This is a very naive implementation with a single mutex. We can do the 17 | // atomic index + circular queue optimizations or pull something more 18 | // heavy-weight later 19 | 20 | class RebatchingQueue { 21 | public: 22 | RebatchingQueue(size_t capacity, size_t numBlobs); 23 | 24 | ~RebatchingQueue(); 25 | 26 | bool enqueueOne( 27 | CPUContext& context, 28 | const std::vector& inputs); 29 | 30 | bool enqueueMany( 31 | CPUContext& context, 32 | const std::vector& inputs); 33 | 34 | bool dequeue( 35 | CPUContext& context, 36 | size_t numElements, 37 | const std::vector& outputs); 38 | 39 | size_t capacity() const; 40 | 41 | size_t numBlobs() const; 42 | 43 | bool isClosed() const; 44 | 45 | void close(); 46 | 47 | private: 48 | bool enqueue(std::vector> splittedInputs); 49 | 50 | bool canWrite() const; 51 | bool canRead() const; 52 | 53 | const size_t capacity_; 54 | const size_t numBlobs_; 55 | 56 | mutable std::mutex mutex_; 57 | 58 | bool isClosed_{false}; 59 | 60 | uint64_t head_{0}; 61 | uint64_t tail_{0}; 62 | 63 | std::condition_variable cvEmpty_; 64 | std::condition_variable cvOverflow_; 65 | 66 | std::vector> queue_; 67 | }; 68 | } // caffe2 69 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/transforms/conv_to_nnpack_transform.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "caffe2/core/common.h" 4 | #include "caffe2/proto/caffe2.pb.h" 5 | #include "caffe2/transforms/single_op_transform.h" 6 | #include "caffe2/utils/proto_utils.h" 7 | 8 | namespace caffe2 { 9 | 10 | class ConvToNNPackTransform : public SingleOpTransform { 11 | protected: 12 | // Specify what the op needs to be to match the pattern. 13 | bool MatchOperator(const OperatorDef& op) override { 14 | return ( 15 | op.type() == "Conv" && op.device_option().device_type() == CPU && 16 | op.engine() != "NNPACK"); 17 | } 18 | 19 | // Specify how the operator should be replaced. 20 | void ReplaceOperator(OperatorDef* op) override { 21 | op->set_engine("NNPACK"); 22 | } 23 | }; 24 | 25 | } // namespace caffe2 26 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/transforms/single_op_transform.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "caffe2/core/common.h" 4 | #include "caffe2/core/transform.h" 5 | #include "caffe2/proto/caffe2.pb.h" 6 | #include "caffe2/utils/proto_utils.h" 7 | 8 | namespace caffe2 { 9 | 10 | /** 11 | * Single Op Transform Base class 12 | * 13 | * A transform which is applied to a single node, in place. 14 | * 15 | * Transforms which derive from SingleOpTransform need to override: 16 | * ReplaceOperator and MatchOperator. 17 | */ 18 | class SingleOpTransform : public Transform { 19 | protected: 20 | bool PatternRule( 21 | const transform::Graph& g, 22 | const std::vector& subgraph, 23 | int idx) override; 24 | bool ValidatorRule( 25 | const transform::Graph& g, 26 | const std::vector& subgraph) override; 27 | bool ReplaceRule(const std::vector& subgraph, transform::Graph* g_ptr) 28 | override; 29 | 30 | // Specify what the op needs to be to match the pattern. 31 | virtual bool MatchOperator(const OperatorDef& op) = 0; 32 | 33 | // Specify how the operator should be replaced. 34 | virtual void ReplaceOperator(OperatorDef* op) = 0; 35 | }; 36 | 37 | } // namespace caffe2 38 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/utils/cast.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace caffe2 { 6 | 7 | namespace cast { 8 | 9 | inline TensorProto_DataType GetCastDataType(const ArgumentHelper& helper, std::string arg) { 10 | TensorProto_DataType to; 11 | if (helper.HasSingleArgumentOfType(arg)) { 12 | #ifndef CAFFE2_USE_LITE_PROTO 13 | string s = helper.GetSingleArgument(arg, "float"); 14 | std::transform(s.begin(), s.end(), s.begin(), ::toupper); 15 | CAFFE_ENFORCE(TensorProto_DataType_Parse(s, &to), "Unknown 'to' argument: ", s); 16 | #else 17 | CAFFE_THROW("String cast op not supported"); 18 | #endif 19 | } else { 20 | to = static_cast( 21 | helper.GetSingleArgument(arg, TensorProto_DataType_FLOAT)); 22 | } 23 | return to; 24 | } 25 | 26 | }; // namespace cast 27 | 28 | }; // namespace caffe2 29 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/utils/cpu_neon.h: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE2_UTILS_CPU_NEON_H_ 2 | #define CAFFE2_UTILS_CPU_NEON_H_ 3 | 4 | // Provides a variety of ARM NEON-specific utility functions 5 | #ifdef __ARM_NEON__ 6 | #include 7 | 8 | namespace caffe2 { 9 | 10 | template 11 | inline bool isPointerAligned(T* p, size_t align) { 12 | return (reinterpret_cast(p) % align == 0); 13 | } 14 | 15 | inline float32x4_t vert_sum_f32(float32x4_t v0, 16 | float32x4_t v1, 17 | float32x4_t v2, 18 | float32x4_t v3) { 19 | v0 = vaddq_f32(v0, v1); 20 | v2 = vaddq_f32(v2, v3); 21 | return vaddq_f32(v0, v2); 22 | } 23 | 24 | inline float horizontal_sum_f32(float32x4_t v0, 25 | float32x4_t v1, 26 | float32x4_t v2, 27 | float32x4_t v3) { 28 | v0 = vert_sum_f32(v0, v1, v2, v3); 29 | float32x2_t v = vadd_f32(vget_high_f32(v0), vget_low_f32(v0)); 30 | return vget_lane_f32(vpadd_f32(v, v), 0); 31 | } 32 | 33 | // Load/store functions that assume alignment 34 | 35 | inline float32x4_t vld1q_f32_aligned(const float* p) { 36 | return vld1q_f32((const float*) 37 | __builtin_assume_aligned(p, sizeof(float32x4_t))); 38 | } 39 | 40 | inline void vst1q_f32_aligned(float* p, float32x4_t v) { 41 | vst1q_f32((float*) __builtin_assume_aligned(p, sizeof(float32x4_t)), v); 42 | } 43 | 44 | inline void vst4_u8_aligned(uint8_t* p, uint8x8x4_t v) { 45 | vst4_u8((uint8_t*) 46 | __builtin_assume_aligned(p, sizeof(uint8x8x4_t)), v); 47 | } 48 | 49 | } // namespace caffe2 50 | 51 | #endif // __ARM_NEON__ 52 | 53 | #endif // CAFFE2_UTILS_CPU_NEON_H_ 54 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/utils/murmur_hash3.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // MurmurHash3 was written by Austin Appleby, and is placed in the public 3 | // domain. The author hereby disclaims copyright to this source code. 4 | 5 | #pragma once 6 | 7 | //----------------------------------------------------------------------------- 8 | // Platform-specific functions and macros 9 | 10 | // Microsoft Visual Studio 11 | 12 | #if defined(_MSC_VER) && (_MSC_VER < 1600) 13 | 14 | typedef unsigned char uint8_t; 15 | typedef unsigned int uint32_t; 16 | typedef unsigned __int64 uint64_t; 17 | 18 | // Other compilers 19 | 20 | #else // defined(_MSC_VER) 21 | 22 | #include 23 | 24 | #endif // !defined(_MSC_VER) 25 | 26 | namespace caffe2 { 27 | 28 | void MurmurHash3_x86_32(const void* key, int len, uint32_t seed, void* out); 29 | 30 | void MurmurHash3_x86_128(const void* key, int len, uint32_t seed, void* out); 31 | 32 | void MurmurHash3_x64_128(const void* key, int len, uint32_t seed, void* out); 33 | 34 | } // namespace caffe2 35 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/utils/signal_handler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if defined(__APPLE__) 4 | #define CAFFE2_SUPPORTS_SIGNAL_HANDLER 5 | #elif defined(__linux__) 6 | #define CAFFE2_SUPPORTS_FATAL_SIGNAL_HANDLERS 7 | #define CAFFE2_SUPPORTS_SIGNAL_HANDLER 8 | #endif 9 | 10 | namespace caffe2 { 11 | 12 | class SignalHandler { 13 | public: 14 | enum class Action { 15 | NONE, 16 | STOP 17 | }; 18 | 19 | // Contructor. Specify what action to take when a signal is received. 20 | SignalHandler(Action SIGINT_action, 21 | Action SIGHUP_action); 22 | ~SignalHandler(); 23 | 24 | Action CheckForSignals(); 25 | 26 | private: 27 | bool GotSIGINT(); 28 | bool GotSIGHUP(); 29 | Action SIGINT_action_; 30 | Action SIGHUP_action_; 31 | unsigned long my_sigint_count_; 32 | unsigned long my_sighup_count_; 33 | }; 34 | 35 | #if defined(CAFFE2_SUPPORTS_FATAL_SIGNAL_HANDLERS) 36 | // This works by setting up certain fatal signal handlers. Previous fatal 37 | // signal handlers will still be called when the signal is raised. Defaults 38 | // to being off. 39 | void setPrintStackTracesOnFatalSignal(bool print); 40 | bool printStackTracesOnFatalSignal(); 41 | #endif // defined(CAFFE2_SUPPORTS_SIGNAL_HANDLER) 42 | 43 | } // namespace caffe2 44 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/utils/smart_tensor_printer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "caffe2/core/tensor.h" 4 | 5 | namespace caffe2 { 6 | 7 | // This is a wrapper around the TensorPrinter that doesn't require the user to 8 | // explicit specify the type of the tensor while calling the Print() method. 9 | // It also supports a convenience function with a default constructed printer as 10 | // a static method. 11 | class SmartTensorPrinter { 12 | public: 13 | // The proliferation of constructors is to give the feature parity with 14 | // TensorPrinter 15 | // yet not repeat the default arguments explicitly in case they change in the 16 | // future. 17 | SmartTensorPrinter() = default; 18 | 19 | explicit SmartTensorPrinter(const std::string& tensor_name); 20 | 21 | SmartTensorPrinter( 22 | const std::string& tensor_name, 23 | const std::string& file_name); 24 | 25 | SmartTensorPrinter( 26 | const std::string& tensor_name, 27 | const std::string& file_name, 28 | int limit); 29 | 30 | void Print(const Tensor& tensor); 31 | 32 | template 33 | void PrintMeta(const Tensor& tensor) { 34 | tensorPrinter_.PrintMeta(tensor); 35 | } 36 | 37 | // Uses a default constructed SmartTensorPrinter 38 | static void PrintTensor(const Tensor& tensor); 39 | 40 | // Uses a default constructed SmartTensorPrinter 41 | template 42 | void PrintTensorMeta(const Tensor& tensor) { 43 | DefaultTensorPrinter().PrintMeta(tensor); 44 | } 45 | 46 | private: 47 | // Returns a thread local default constructed TensorPrinter 48 | static SmartTensorPrinter& DefaultTensorPrinter(); 49 | 50 | TensorPrinter tensorPrinter_; 51 | }; 52 | } 53 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/utils/string_utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace caffe2 { 8 | 9 | std::vector split(char separator, const std::string& string); 10 | size_t editDistance( 11 | const std::string& s1, const std::string& s2, size_t max_distance = 0); 12 | 13 | int32_t editDistanceHelper(const char* s1, 14 | size_t s1_len, 15 | const char* s2, 16 | size_t s2_len, 17 | std::vector ¤t, 18 | std::vector &previous, 19 | std::vector &previous1, 20 | size_t max_distance); 21 | } // namespace caffe2 22 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/utils/threadpool/ThreadPool.h: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE2_UTILS_THREADPOOL_H_ 2 | #define CAFFE2_UTILS_THREADPOOL_H_ 3 | 4 | #include "ThreadPoolCommon.h" 5 | 6 | #ifndef CAFFE2_THREADPOOL_MOBILE 7 | #error "mobile build state not defined" 8 | #endif 9 | 10 | // ThreadPool only used in mobile builds at the moment 11 | #if CAFFE2_THREADPOOL_MOBILE 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | // 18 | // A work-stealing threadpool loosely based off of pthreadpool 19 | // 20 | 21 | namespace caffe2 { 22 | 23 | class Task; 24 | class WorkersPool; 25 | 26 | constexpr size_t kCacheLineSize = 64; 27 | 28 | class alignas(kCacheLineSize) ThreadPool { 29 | public: 30 | // Constructs a work-stealing threadpool with the given number of 31 | // threads 32 | static std::unique_ptr defaultThreadPool(); 33 | ThreadPool(int numThreads); 34 | ~ThreadPool(); 35 | // Returns the number of threads currently in use 36 | int getNumThreads() const; 37 | 38 | // Sets the minimum work size (range) for which to invoke the 39 | // threadpool; work sizes smaller than this will just be run on the 40 | // main (calling) thread 41 | void setMinWorkSize(size_t size); 42 | size_t getMinWorkSize() const { return minWorkSize_; } 43 | void run(const std::function& fn, size_t range); 44 | 45 | private: 46 | mutable std::mutex executionMutex_; 47 | size_t minWorkSize_; 48 | size_t numThreads_; 49 | std::shared_ptr workersPool_; 50 | std::vector> tasks_; 51 | }; 52 | 53 | } // namespace caffe2 54 | 55 | #endif // CAFFE2_THREADPOOL_MOBILE 56 | 57 | #endif // CAFFE2_UTILS_THREADPOOL_H_ 58 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/utils/threadpool/ThreadPoolCommon.h: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE2_UTILS_THREADPOOL_COMMON_H_ 2 | #define CAFFE2_UTILS_THREADPOOL_COMMON_H_ 3 | 4 | #ifdef __APPLE__ 5 | #include 6 | #endif 7 | 8 | // caffe2 depends upon NNPACK, which depends upon this threadpool, so 9 | // unfortunately we can't reference core/common.h here 10 | 11 | // This is copied from core/common.h's definition of CAFFE2_MOBILE 12 | // Define enabled when building for iOS or Android devices 13 | #if !defined(CAFFE2_THREADPOOL_MOBILE) 14 | #if defined(__ANDROID__) 15 | #define CAFFE2_ANDROID 1 16 | #define CAFFE2_THREADPOOL_MOBILE 1 17 | #elif (defined(__APPLE__) && \ 18 | (TARGET_IPHONE_SIMULATOR || TARGET_OS_SIMULATOR || TARGET_OS_IPHONE)) 19 | #define CAFFE2_IOS 1 20 | #define CAFFE2_THREADPOOL_MOBILE 1 21 | #elif (defined(__APPLE__) && TARGET_OS_MAC) 22 | #define CAFFE2_IOS 1 23 | #define CAFFE2_THREADPOOL_MOBILE 1 24 | #else 25 | #define CAFFE2_THREADPOOL_MOBILE 0 26 | #endif // ANDROID / IOS / MACOS 27 | #endif // CAFFE2_THREADPOOL_MOBILE 28 | 29 | #endif // CAFFE2_UTILS_THREADPOOL_COMMON_H_ 30 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/caffe2/utils/threadpool/pthreadpool_impl.h: -------------------------------------------------------------------------------- 1 | #ifndef CAFFE2_UTILS_PTHREADPOOL_IMPL_H_ 2 | #define CAFFE2_UTILS_PTHREADPOOL_IMPL_H_ 3 | 4 | #include "ThreadPoolCommon.h" 5 | 6 | #ifndef CAFFE2_THREADPOOL_MOBILE 7 | #error "mobile build state not defined" 8 | #endif 9 | 10 | #if CAFFE2_THREADPOOL_MOBILE 11 | 12 | namespace caffe2 { 13 | 14 | struct ThreadPool; 15 | 16 | } // namespace caffe2 17 | 18 | extern "C" { 19 | 20 | // Wrapper for the caffe2 threadpool for the usage of NNPACK 21 | struct pthreadpool { 22 | pthreadpool(caffe2::ThreadPool* pool) : pool_(pool) {} 23 | caffe2::ThreadPool* pool_; 24 | }; 25 | 26 | } // extern "C" 27 | 28 | #endif // CAFFE2_THREADPOOL_MOBILE 29 | 30 | #endif // CAFFE2_UTILS_PTHREADPOOL_IMPL_H_ 31 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/camera/native_debug.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define LOG_TAG "CAMERA-SAMPLE" 4 | #define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__) 5 | #define LOGW(...) __android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__) 6 | #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__) 7 | #define ASSERT(cond, fmt, ...) \ 8 | if (!(cond)) { \ 9 | __android_log_assert(#cond, LOG_TAG, fmt, ##__VA_ARGS__); \ 10 | } 11 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/opencv/cxmisc.h: -------------------------------------------------------------------------------- 1 | #ifndef __OPENCV_OLD_CXMISC_H__ 2 | #define __OPENCV_OLD_CXMISC_H__ 3 | 4 | #include "opencv2/core/internal.hpp" 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/opencv2/flann/dummy.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef OPENCV_FLANN_DUMMY_H_ 3 | #define OPENCV_FLANN_DUMMY_H_ 4 | 5 | namespace cvflann 6 | { 7 | 8 | #if (defined WIN32 || defined _WIN32 || defined WINCE) && defined CVAPI_EXPORTS 9 | __declspec(dllexport) 10 | #endif 11 | void dummyfunc(); 12 | 13 | } 14 | 15 | 16 | #endif /* OPENCV_FLANN_DUMMY_H_ */ 17 | -------------------------------------------------------------------------------- /texture-view/src/main/cpp/opencv2/opencv_modules.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * ** File generated automatically, do not modify ** 3 | * 4 | * This file defines the list of modules available in current build configuration 5 | * 6 | * 7 | */ 8 | 9 | #define HAVE_OPENCV_CALIB3D 10 | #define HAVE_OPENCV_CONTRIB 11 | #define HAVE_OPENCV_CORE 12 | #define HAVE_OPENCV_FEATURES2D 13 | #define HAVE_OPENCV_FLANN 14 | #define HAVE_OPENCV_HIGHGUI 15 | #define HAVE_OPENCV_IMGPROC 16 | #define HAVE_OPENCV_LEGACY 17 | #define HAVE_OPENCV_ML 18 | #define HAVE_OPENCV_OBJDETECT 19 | #define HAVE_OPENCV_OCL 20 | #define HAVE_OPENCV_PHOTO 21 | #define HAVE_OPENCV_STITCHING 22 | #define HAVE_OPENCV_SUPERRES 23 | #define HAVE_OPENCV_TS 24 | #define HAVE_OPENCV_VIDEO 25 | #define HAVE_OPENCV_VIDEOSTAB 26 | 27 | 28 | -------------------------------------------------------------------------------- /texture-view/src/main/libs/armeabi-v7a/libCAFFE2_NNPACK.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/src/main/libs/armeabi-v7a/libCAFFE2_NNPACK.a -------------------------------------------------------------------------------- /texture-view/src/main/libs/armeabi-v7a/libCAFFE2_PTHREADPOOL.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/src/main/libs/armeabi-v7a/libCAFFE2_PTHREADPOOL.a -------------------------------------------------------------------------------- /texture-view/src/main/libs/armeabi-v7a/libCaffe2_CPU.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/src/main/libs/armeabi-v7a/libCaffe2_CPU.a -------------------------------------------------------------------------------- /texture-view/src/main/libs/armeabi-v7a/libcpufeatures.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/src/main/libs/armeabi-v7a/libcpufeatures.a -------------------------------------------------------------------------------- /texture-view/src/main/libs/armeabi-v7a/libglog.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/src/main/libs/armeabi-v7a/libglog.so -------------------------------------------------------------------------------- /texture-view/src/main/libs/armeabi-v7a/libgnustl_shared.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/src/main/libs/armeabi-v7a/libgnustl_shared.so -------------------------------------------------------------------------------- /texture-view/src/main/libs/armeabi-v7a/libprotobuf-lite.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/src/main/libs/armeabi-v7a/libprotobuf-lite.a -------------------------------------------------------------------------------- /texture-view/src/main/libs/armeabi-v7a/libprotobuf.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/src/main/libs/armeabi-v7a/libprotobuf.a -------------------------------------------------------------------------------- /texture-view/src/main/libs/armeabi-v7a/opencv/libIlmImf.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/src/main/libs/armeabi-v7a/opencv/libIlmImf.a -------------------------------------------------------------------------------- /texture-view/src/main/libs/armeabi-v7a/opencv/liblibjasper.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/src/main/libs/armeabi-v7a/opencv/liblibjasper.a -------------------------------------------------------------------------------- /texture-view/src/main/libs/armeabi-v7a/opencv/liblibjpeg.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/src/main/libs/armeabi-v7a/opencv/liblibjpeg.a -------------------------------------------------------------------------------- /texture-view/src/main/libs/armeabi-v7a/opencv/liblibpng.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/src/main/libs/armeabi-v7a/opencv/liblibpng.a -------------------------------------------------------------------------------- /texture-view/src/main/libs/armeabi-v7a/opencv/liblibtiff.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/src/main/libs/armeabi-v7a/opencv/liblibtiff.a -------------------------------------------------------------------------------- /texture-view/src/main/libs/armeabi-v7a/opencv/libopencv_core.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/src/main/libs/armeabi-v7a/opencv/libopencv_core.a -------------------------------------------------------------------------------- /texture-view/src/main/libs/armeabi-v7a/opencv/libopencv_highgui.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/src/main/libs/armeabi-v7a/opencv/libopencv_highgui.a -------------------------------------------------------------------------------- /texture-view/src/main/libs/armeabi-v7a/opencv/libopencv_imgproc.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/src/main/libs/armeabi-v7a/opencv/libopencv_imgproc.a -------------------------------------------------------------------------------- /texture-view/src/main/libs/armeabi-v7a/opencv/libtbb.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/src/main/libs/armeabi-v7a/opencv/libtbb.a -------------------------------------------------------------------------------- /texture-view/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /texture-view/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /texture-view/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /texture-view/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yge58/caffe2-opencv-ndkcamera/ad7117787cfdd70d4a276a2ec12286b9d88e04df/texture-view/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /texture-view/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | 20 | 21 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /texture-view/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | texture-view 5 | 6 | 7 | --------------------------------------------------------------------------------