├── .gitignore ├── LICENSE ├── NeonGaussian ├── CMakeLists.txt ├── README.txt ├── adbshell.sh ├── build.sh ├── build_android │ ├── CMakeCache.txt │ ├── CMakeFiles │ │ ├── 3.12.2 │ │ │ ├── CMakeCCompiler.cmake │ │ │ ├── CMakeCXXCompiler.cmake │ │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ │ └── CMakeSystem.cmake │ │ ├── CMakeDirectoryInformation.cmake │ │ ├── CMakeOutput.log │ │ ├── Makefile.cmake │ │ ├── Makefile2 │ │ ├── TargetDirectories.txt │ │ ├── cmake.check_cache │ │ ├── feature_tests.bin │ │ ├── feature_tests.c │ │ ├── feature_tests.cxx │ │ └── progress.marks │ ├── Makefile │ ├── cmake_install.cmake │ ├── install │ │ └── bin │ │ │ └── gaussian_example │ ├── install_manifest.txt │ └── src │ │ ├── CMakeFiles │ │ ├── CMakeDirectoryInformation.cmake │ │ ├── gaussian_example.dir │ │ │ ├── C.includecache │ │ │ ├── DependInfo.cmake │ │ │ ├── build.make │ │ │ ├── cmake_clean.cmake │ │ │ ├── depend.internal │ │ │ ├── depend.make │ │ │ ├── flags.make │ │ │ ├── link.txt │ │ │ └── progress.make │ │ └── progress.marks │ │ ├── Makefile │ │ ├── cmake_install.cmake │ │ └── gaussian_example ├── cmake │ ├── config.cmake │ └── config │ │ └── android │ │ ├── android_arm32.cmake │ │ └── android_arm64.cmake ├── data │ └── gray_4095x2161.raw ├── jni │ ├── Android.mk │ └── Application.mk └── src │ ├── CMakeLists.txt │ ├── inc │ ├── data_type.h │ └── gaussian3x3.h │ └── test │ ├── example.c │ └── gaussian3x3_neon.c ├── OpenCLGaussian ├── CMakeLists.txt ├── README.md ├── gaussian.cl ├── main.cpp ├── mtk_adbshell.sh ├── mtk_test.sh ├── opencl │ ├── mtk │ │ └── opencl210 │ │ │ ├── include │ │ │ └── CL │ │ │ │ ├── cl.h │ │ │ │ ├── cl2.hpp │ │ │ │ ├── cl_d3d10.h │ │ │ │ ├── cl_d3d11.h │ │ │ │ ├── cl_dx9_media_sharing.h │ │ │ │ ├── cl_dx9_media_sharing_intel.h │ │ │ │ ├── cl_egl.h │ │ │ │ ├── cl_ext.h │ │ │ │ ├── cl_ext_intel.h │ │ │ │ ├── cl_gl.h │ │ │ │ ├── cl_gl_ext.h │ │ │ │ ├── cl_platform.h │ │ │ │ ├── cl_va_api_media_sharing_intel.h │ │ │ │ ├── cl_version.h │ │ │ │ └── opencl.h │ │ │ ├── lib │ │ │ └── libOpenCL.so │ │ │ └── lib64 │ │ │ └── libOpenCL.so │ └── qcom │ │ └── opencl200 │ │ ├── include │ │ └── CL │ │ │ ├── cl.h │ │ │ ├── cl.hpp │ │ │ ├── cl2.hpp │ │ │ ├── cl_egl.h │ │ │ ├── cl_ext.h │ │ │ ├── cl_ext_qcom.h │ │ │ ├── cl_gl.h │ │ │ ├── cl_gl_ext.h │ │ │ ├── cl_platform.h │ │ │ └── opencl.h │ │ ├── lib │ │ └── libOpenCL.so │ │ └── lib64 │ │ └── libOpenCL.so ├── qcom_adbshell.sh └── qcom_test.sh ├── OpenCLTranspose ├── CMakeLists.txt ├── Readme.md ├── kerneltest.cl ├── main.cpp ├── mtk_adbshell.sh ├── mtk_test.sh ├── opencl │ ├── mtk │ │ └── opencl210 │ │ │ ├── include │ │ │ └── CL │ │ │ │ ├── cl.h │ │ │ │ ├── cl2.hpp │ │ │ │ ├── cl_d3d10.h │ │ │ │ ├── cl_d3d11.h │ │ │ │ ├── cl_dx9_media_sharing.h │ │ │ │ ├── cl_dx9_media_sharing_intel.h │ │ │ │ ├── cl_egl.h │ │ │ │ ├── cl_ext.h │ │ │ │ ├── cl_ext_intel.h │ │ │ │ ├── cl_gl.h │ │ │ │ ├── cl_gl_ext.h │ │ │ │ ├── cl_platform.h │ │ │ │ ├── cl_va_api_media_sharing_intel.h │ │ │ │ ├── cl_version.h │ │ │ │ └── opencl.h │ │ │ ├── lib │ │ │ └── libOpenCL.so │ │ │ └── lib64 │ │ │ └── libOpenCL.so │ └── qcom │ │ └── opencl200 │ │ ├── include │ │ └── CL │ │ │ ├── cl.h │ │ │ ├── cl.hpp │ │ │ ├── cl2.hpp │ │ │ ├── cl_egl.h │ │ │ ├── cl_ext.h │ │ │ ├── cl_ext_qcom.h │ │ │ ├── cl_gl.h │ │ │ ├── cl_gl_ext.h │ │ │ ├── cl_platform.h │ │ │ └── opencl.h │ │ ├── lib │ │ └── libOpenCL.so │ │ └── lib64 │ │ └── libOpenCL.so ├── qcom_adbshell.sh └── qcom_test.sh └── README.md /.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 | -------------------------------------------------------------------------------- /NeonGaussian/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # min cmake version 2 | cmake_minimum_required(VERSION 2.8.10) 3 | 4 | include(cmake/config.cmake) 5 | 6 | # toolchain file 7 | if(CMAKE_TOOLCHAIN_FILE) 8 | set(LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_BINARY_DIR} CACHE PATH "root for library output, set this to change where android libs are compiled to") 9 | get_filename_component(CMAKE_TOOLCHAIN_FILE_NAME ${CMAKE_TOOLCHAIN_FILE} NAME) 10 | find_file(CMAKE_TOOLCHAIN_FILE ${CMAKE_TOOLCHAIN_FILE_NAME} PATHS ${CMAKE_SOURCE_DIR} NO_DEFAULT_PATH) 11 | 12 | message(STATUS "CMAKE_TOOLCHAIN_FILE = ${CMAKE_TOOLCHAIN_FILE}") 13 | endif() 14 | 15 | # set install prefix 16 | if(NOT DEFINED CMAKE_INSTALL_PREFIX) 17 | set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Installation Directory") 18 | endif() 19 | 20 | message(STATUS "CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}") 21 | 22 | # set build type 23 | if(NOT DEFINED CMAKE_BUILD_TYPE) 24 | set(CMAKE_BUILD_TYPE "debug" CACHE STRING "debug build type" FORCE) 25 | endif() 26 | 27 | if(CMAKE_BUILD_TYPE MATCHES "(Release|RELEASE|release)") 28 | add_definitions(-DRELEASE) 29 | else() 30 | add_definitions(-DDEBUG) 31 | endif() 32 | 33 | message(STATUS "CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}") 34 | 35 | project(gauss3x3) 36 | 37 | # for windows platform 38 | if(WIN32) 39 | add_definitions(-D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE) 40 | add_definitions(-DNOMINMAX) 41 | add_definitions(-DWIN32) 42 | else() 43 | add_definitions(-Wall -Wextra) 44 | add_definitions(-fPIC) 45 | 46 | # for android platform 47 | if(ANDROID) 48 | # definitions setting 49 | add_definitions(-DANDROID) 50 | add_definitions(-Ofast) 51 | add_definitions(-ffast-math) 52 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -fno-exceptions") 53 | 54 | # extra libs and use gold link for android 55 | link_libraries("log") 56 | link_libraries("-fuse-ld=gold") 57 | endif() 58 | endif() 59 | 60 | add_subdirectory(src) 61 | -------------------------------------------------------------------------------- /NeonGaussian/README.txt: -------------------------------------------------------------------------------- 1 | # 移动端算法优化 - CPU 优化技术 - NEON 优化实例 2 | 3 | ### 运行说明 4 | 本代码在Android手机平台编译运行通过。编译运行请按照以下步骤: 5 | 1. 使用adb devices和adb shell检查手机连接状况。 6 | 2. 设置环境变量${NDK_PATH}为NDK根目录。 7 | 3. 修改 adbshell.sh 和 build.sh 中可执行文件保存的路径。 8 | 4. README当前目录下,运行./build.sh。 9 | 10 | ### 高通骁龙888运行示例 11 | 12 | Gaussian3x3 None average time = 15.589470 13 | Gaussian3x3 Neon average time = 3.236440 14 | Gaussian3x3None and Gaussian3x3Neon result bit matched 15 | gausaian_testcase done! 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /NeonGaussian/adbshell.sh: -------------------------------------------------------------------------------- 1 | echo -e "\033[41;37m begin run sample code! \033[0m" 2 | 3 | cd /data/local/Gaussian/bin/ 4 | ./gaussian_example 5 | 6 | echo "test finish!" -------------------------------------------------------------------------------- /NeonGaussian/build.sh: -------------------------------------------------------------------------------- 1 | rm -rf build_android/ 2 | mkdir build_android && cd build_android 3 | cmake -DCONFIG=android_arm64 -DCMAKE_BUILD_TYPE=Release .. 4 | make install 5 | adb shell mkdir -p /data/local/Gaussian/bin/ 6 | adb push install/bin/* /data/local/Gaussian/bin/ 7 | 8 | adb shell mkdir -p /data/local/Gaussian/bin/data/ 9 | adb push ../data/* /data/local/Gaussian/bin/data/ 10 | 11 | adb shell < ../adbshell.sh 12 | -------------------------------------------------------------------------------- /NeonGaussian/build_android/CMakeFiles/3.12.2/CMakeCCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_C_COMPILER "/home/mi/tools/android/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang") 2 | set(CMAKE_C_COMPILER_ARG1 "") 3 | set(CMAKE_C_COMPILER_ID "Clang") 4 | set(CMAKE_C_COMPILER_VERSION "8.0") 5 | set(CMAKE_C_COMPILER_VERSION_INTERNAL "") 6 | set(CMAKE_C_COMPILER_WRAPPER "") 7 | set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11") 8 | set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert") 9 | set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") 10 | set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") 11 | set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") 12 | 13 | set(CMAKE_C_PLATFORM_ID "") 14 | set(CMAKE_C_SIMULATE_ID "") 15 | set(CMAKE_C_SIMULATE_VERSION "") 16 | 17 | 18 | 19 | set(CMAKE_AR "/home/mi/tools/android/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ar") 20 | set(CMAKE_C_COMPILER_AR "CMAKE_C_COMPILER_AR-NOTFOUND") 21 | set(CMAKE_RANLIB "/home/mi/tools/android/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ranlib") 22 | set(CMAKE_C_COMPILER_RANLIB "CMAKE_C_COMPILER_RANLIB-NOTFOUND") 23 | set(CMAKE_LINKER "/home/mi/tools/android/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ld") 24 | set(CMAKE_COMPILER_IS_GNUCC ) 25 | set(CMAKE_C_COMPILER_LOADED 1) 26 | set(CMAKE_C_COMPILER_WORKS TRUE) 27 | set(CMAKE_C_ABI_COMPILED TRUE) 28 | set(CMAKE_COMPILER_IS_MINGW ) 29 | set(CMAKE_COMPILER_IS_CYGWIN ) 30 | if(CMAKE_COMPILER_IS_CYGWIN) 31 | set(CYGWIN 1) 32 | set(UNIX 1) 33 | endif() 34 | 35 | set(CMAKE_C_COMPILER_ENV_VAR "CC") 36 | 37 | if(CMAKE_COMPILER_IS_MINGW) 38 | set(MINGW 1) 39 | endif() 40 | set(CMAKE_C_COMPILER_ID_RUN 1) 41 | set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) 42 | set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) 43 | set(CMAKE_C_LINKER_PREFERENCE 10) 44 | 45 | # Save compiler ABI information. 46 | set(CMAKE_C_SIZEOF_DATA_PTR "8") 47 | set(CMAKE_C_COMPILER_ABI "ELF") 48 | set(CMAKE_C_LIBRARY_ARCHITECTURE "") 49 | 50 | if(CMAKE_C_SIZEOF_DATA_PTR) 51 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") 52 | endif() 53 | 54 | if(CMAKE_C_COMPILER_ABI) 55 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") 56 | endif() 57 | 58 | if(CMAKE_C_LIBRARY_ARCHITECTURE) 59 | set(CMAKE_LIBRARY_ARCHITECTURE "") 60 | endif() 61 | 62 | set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") 63 | if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) 64 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") 65 | endif() 66 | 67 | 68 | 69 | 70 | 71 | set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "gcc;dl;c;gcc;dl") 72 | set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/home/mi/tools/android/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/8.0.2/lib/linux/aarch64;/home/mi/tools/android/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/lib/gcc/aarch64-linux-android/4.9.x;/home/mi/tools/android/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/aarch64-linux-android/lib64;/home/mi/tools/android/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/23;/home/mi/tools/android/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android;/home/mi/tools/android/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/aarch64-linux-android/lib;/home/mi/tools/android/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib") 73 | set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 74 | -------------------------------------------------------------------------------- /NeonGaussian/build_android/CMakeFiles/3.12.2/CMakeCXXCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_CXX_COMPILER "/home/mi/tools/android/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++") 2 | set(CMAKE_CXX_COMPILER_ARG1 "") 3 | set(CMAKE_CXX_COMPILER_ID "Clang") 4 | set(CMAKE_CXX_COMPILER_VERSION "8.0") 5 | set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") 6 | set(CMAKE_CXX_COMPILER_WRAPPER "") 7 | set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "14") 8 | set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20") 9 | set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") 10 | set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") 11 | set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") 12 | set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") 13 | set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20") 14 | 15 | set(CMAKE_CXX_PLATFORM_ID "") 16 | set(CMAKE_CXX_SIMULATE_ID "") 17 | set(CMAKE_CXX_SIMULATE_VERSION "") 18 | 19 | 20 | 21 | set(CMAKE_AR "/home/mi/tools/android/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ar") 22 | set(CMAKE_CXX_COMPILER_AR "CMAKE_CXX_COMPILER_AR-NOTFOUND") 23 | set(CMAKE_RANLIB "/home/mi/tools/android/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ranlib") 24 | set(CMAKE_CXX_COMPILER_RANLIB "CMAKE_CXX_COMPILER_RANLIB-NOTFOUND") 25 | set(CMAKE_LINKER "/home/mi/tools/android/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ld") 26 | set(CMAKE_COMPILER_IS_GNUCXX ) 27 | set(CMAKE_CXX_COMPILER_LOADED 1) 28 | set(CMAKE_CXX_COMPILER_WORKS TRUE) 29 | set(CMAKE_CXX_ABI_COMPILED TRUE) 30 | set(CMAKE_COMPILER_IS_MINGW ) 31 | set(CMAKE_COMPILER_IS_CYGWIN ) 32 | if(CMAKE_COMPILER_IS_CYGWIN) 33 | set(CYGWIN 1) 34 | set(UNIX 1) 35 | endif() 36 | 37 | set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") 38 | 39 | if(CMAKE_COMPILER_IS_MINGW) 40 | set(MINGW 1) 41 | endif() 42 | set(CMAKE_CXX_COMPILER_ID_RUN 1) 43 | set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) 44 | set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;mm;CPP) 45 | set(CMAKE_CXX_LINKER_PREFERENCE 30) 46 | set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) 47 | 48 | # Save compiler ABI information. 49 | set(CMAKE_CXX_SIZEOF_DATA_PTR "8") 50 | set(CMAKE_CXX_COMPILER_ABI "ELF") 51 | set(CMAKE_CXX_LIBRARY_ARCHITECTURE "") 52 | 53 | if(CMAKE_CXX_SIZEOF_DATA_PTR) 54 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") 55 | endif() 56 | 57 | if(CMAKE_CXX_COMPILER_ABI) 58 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") 59 | endif() 60 | 61 | if(CMAKE_CXX_LIBRARY_ARCHITECTURE) 62 | set(CMAKE_LIBRARY_ARCHITECTURE "") 63 | endif() 64 | 65 | set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") 66 | if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) 67 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") 68 | endif() 69 | 70 | 71 | 72 | 73 | 74 | set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "c++;m;gcc;gcc;dl;c;gcc;gcc;dl") 75 | set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/home/mi/tools/android/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/8.0.2/lib/linux/aarch64;/home/mi/tools/android/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/lib/gcc/aarch64-linux-android/4.9.x;/home/mi/tools/android/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/aarch64-linux-android/lib64;/home/mi/tools/android/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/23;/home/mi/tools/android/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android;/home/mi/tools/android/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/aarch64-linux-android/lib;/home/mi/tools/android/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib") 76 | set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 77 | -------------------------------------------------------------------------------- /NeonGaussian/build_android/CMakeFiles/3.12.2/CMakeDetermineCompilerABI_C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mobile-algorithm-optimization/guide/0a10dcca06dac53a856cf0b6bccf431d6f5282ba/NeonGaussian/build_android/CMakeFiles/3.12.2/CMakeDetermineCompilerABI_C.bin -------------------------------------------------------------------------------- /NeonGaussian/build_android/CMakeFiles/3.12.2/CMakeDetermineCompilerABI_CXX.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mobile-algorithm-optimization/guide/0a10dcca06dac53a856cf0b6bccf431d6f5282ba/NeonGaussian/build_android/CMakeFiles/3.12.2/CMakeDetermineCompilerABI_CXX.bin -------------------------------------------------------------------------------- /NeonGaussian/build_android/CMakeFiles/3.12.2/CMakeSystem.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_HOST_SYSTEM "Linux-4.15.0-142-generic") 2 | set(CMAKE_HOST_SYSTEM_NAME "Linux") 3 | set(CMAKE_HOST_SYSTEM_VERSION "4.15.0-142-generic") 4 | set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64") 5 | 6 | include("/home/mi/tools/android/android-ndk-r19c/build/cmake/android.toolchain.cmake") 7 | 8 | set(CMAKE_SYSTEM "Android-1") 9 | set(CMAKE_SYSTEM_NAME "Android") 10 | set(CMAKE_SYSTEM_VERSION "1") 11 | set(CMAKE_SYSTEM_PROCESSOR "aarch64") 12 | 13 | set(CMAKE_CROSSCOMPILING "TRUE") 14 | 15 | set(CMAKE_SYSTEM_LOADED 1) 16 | -------------------------------------------------------------------------------- /NeonGaussian/build_android/CMakeFiles/CMakeDirectoryInformation.cmake: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.12 3 | 4 | # Relative path conversion top directories. 5 | set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/mi/workspaces/guide/NeonGaussian") 6 | set(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/mi/workspaces/guide/NeonGaussian/build_android") 7 | 8 | # Force unix paths in dependencies. 9 | set(CMAKE_FORCE_UNIX_PATHS 1) 10 | 11 | 12 | # The C and CXX include file regular expressions for this directory. 13 | set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") 14 | set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") 15 | set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) 16 | set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) 17 | -------------------------------------------------------------------------------- /NeonGaussian/build_android/CMakeFiles/Makefile.cmake: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.12 3 | 4 | # The generator used is: 5 | set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles") 6 | 7 | # The top level Makefile was generated from the following files: 8 | set(CMAKE_MAKEFILE_DEPENDS 9 | "CMakeCache.txt" 10 | "/home/mi/tools/android/android-ndk-r19c/build/cmake/android.toolchain.cmake" 11 | "/home/mi/tools/android/android-ndk-r19c/build/cmake/platforms.cmake" 12 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/CMakeCCompiler.cmake.in" 13 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/CMakeCCompilerABI.c" 14 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/CMakeCInformation.cmake" 15 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/CMakeCXXCompiler.cmake.in" 16 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/CMakeCXXCompilerABI.cpp" 17 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/CMakeCXXInformation.cmake" 18 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/CMakeCommonLanguageInclude.cmake" 19 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/CMakeDetermineCCompiler.cmake" 20 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/CMakeDetermineCXXCompiler.cmake" 21 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/CMakeDetermineCompileFeatures.cmake" 22 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/CMakeDetermineCompiler.cmake" 23 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/CMakeDetermineCompilerABI.cmake" 24 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/CMakeDetermineSystem.cmake" 25 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/CMakeFindBinUtils.cmake" 26 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/CMakeGenericSystem.cmake" 27 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/CMakeInitializeConfigs.cmake" 28 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/CMakeLanguageInformation.cmake" 29 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/CMakeParseImplicitLinkInfo.cmake" 30 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/CMakeSystem.cmake.in" 31 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/CMakeSystemSpecificInformation.cmake" 32 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/CMakeSystemSpecificInitialize.cmake" 33 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/CMakeTestCCompiler.cmake" 34 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/CMakeTestCXXCompiler.cmake" 35 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/CMakeTestCompilerCommon.cmake" 36 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/CMakeUnixFindMake.cmake" 37 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/Compiler/CMakeCommonCompilerMacros.cmake" 38 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/Compiler/Clang-C-FeatureTests.cmake" 39 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/Compiler/Clang-C.cmake" 40 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/Compiler/Clang-CXX-FeatureTests.cmake" 41 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/Compiler/Clang-CXX-TestableFeatures.cmake" 42 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/Compiler/Clang-CXX.cmake" 43 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/Compiler/Clang-FindBinUtils.cmake" 44 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/Compiler/Clang.cmake" 45 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/Compiler/GNU.cmake" 46 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/Internal/FeatureTesting.cmake" 47 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/Platform/Android-Clang-C.cmake" 48 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/Platform/Android-Clang-CXX.cmake" 49 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/Platform/Android-Clang.cmake" 50 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/Platform/Android-Determine-C.cmake" 51 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/Platform/Android-Determine-CXX.cmake" 52 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/Platform/Android-Determine.cmake" 53 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/Platform/Android-Initialize.cmake" 54 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/Platform/Android.cmake" 55 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/Platform/Android/Determine-Compiler.cmake" 56 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/Platform/Linux.cmake" 57 | "/home/mi/tools/cmake-3.12.2-Linux-x86_64/share/cmake-3.12/Modules/Platform/UnixPaths.cmake" 58 | "../CMakeLists.txt" 59 | "CMakeFiles/3.12.2/CMakeCCompiler.cmake" 60 | "CMakeFiles/3.12.2/CMakeCXXCompiler.cmake" 61 | "CMakeFiles/3.12.2/CMakeSystem.cmake" 62 | "CMakeFiles/feature_tests.c" 63 | "CMakeFiles/feature_tests.cxx" 64 | "../cmake/config.cmake" 65 | "../cmake/config/android/android_arm64.cmake" 66 | "../src/CMakeLists.txt" 67 | ) 68 | 69 | # The corresponding makefile is: 70 | set(CMAKE_MAKEFILE_OUTPUTS 71 | "Makefile" 72 | "CMakeFiles/cmake.check_cache" 73 | ) 74 | 75 | # Byproducts of CMake generate step: 76 | set(CMAKE_MAKEFILE_PRODUCTS 77 | "CMakeFiles/3.12.2/CMakeSystem.cmake" 78 | "CMakeFiles/3.12.2/CMakeCCompiler.cmake" 79 | "CMakeFiles/3.12.2/CMakeCXXCompiler.cmake" 80 | "CMakeFiles/3.12.2/CMakeCCompiler.cmake" 81 | "CMakeFiles/3.12.2/CMakeCXXCompiler.cmake" 82 | "CMakeFiles/CMakeDirectoryInformation.cmake" 83 | "src/CMakeFiles/CMakeDirectoryInformation.cmake" 84 | ) 85 | 86 | # Dependency information for all targets: 87 | set(CMAKE_DEPEND_INFO_FILES 88 | "src/CMakeFiles/gaussian_example.dir/DependInfo.cmake" 89 | ) 90 | -------------------------------------------------------------------------------- /NeonGaussian/build_android/CMakeFiles/Makefile2: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.12 3 | 4 | # Default target executed when no arguments are given to make. 5 | default_target: all 6 | 7 | .PHONY : default_target 8 | 9 | # The main recursive all target 10 | all: 11 | 12 | .PHONY : all 13 | 14 | # The main recursive preinstall target 15 | preinstall: 16 | 17 | .PHONY : preinstall 18 | 19 | # The main recursive clean target 20 | clean: 21 | 22 | .PHONY : clean 23 | 24 | #============================================================================= 25 | # Special targets provided by cmake. 26 | 27 | # Disable implicit rules so canonical targets will work. 28 | .SUFFIXES: 29 | 30 | 31 | # Remove some rules from gmake that .SUFFIXES does not remove. 32 | SUFFIXES = 33 | 34 | .SUFFIXES: .hpux_make_needs_suffix_list 35 | 36 | 37 | # Suppress display of executed commands. 38 | $(VERBOSE).SILENT: 39 | 40 | 41 | # A target that is always out of date. 42 | cmake_force: 43 | 44 | .PHONY : cmake_force 45 | 46 | #============================================================================= 47 | # Set environment variables for the build. 48 | 49 | # The shell in which to execute make rules. 50 | SHELL = /bin/sh 51 | 52 | # The CMake executable. 53 | CMAKE_COMMAND = /home/mi/tools/cmake-3.12.2-Linux-x86_64/bin/cmake 54 | 55 | # The command to remove a file. 56 | RM = /home/mi/tools/cmake-3.12.2-Linux-x86_64/bin/cmake -E remove -f 57 | 58 | # Escaping for special characters. 59 | EQUALS = = 60 | 61 | # The top-level source directory on which CMake was run. 62 | CMAKE_SOURCE_DIR = /home/mi/workspaces/guide/NeonGaussian 63 | 64 | # The top-level build directory on which CMake was run. 65 | CMAKE_BINARY_DIR = /home/mi/workspaces/guide/NeonGaussian/build_android 66 | 67 | #============================================================================= 68 | # Directory level rules for directory src 69 | 70 | # Convenience name for "all" pass in the directory. 71 | src/all: src/CMakeFiles/gaussian_example.dir/all 72 | 73 | .PHONY : src/all 74 | 75 | # Convenience name for "clean" pass in the directory. 76 | src/clean: src/CMakeFiles/gaussian_example.dir/clean 77 | 78 | .PHONY : src/clean 79 | 80 | # Convenience name for "preinstall" pass in the directory. 81 | src/preinstall: 82 | 83 | .PHONY : src/preinstall 84 | 85 | #============================================================================= 86 | # Target rules for target src/CMakeFiles/gaussian_example.dir 87 | 88 | # All Build rule for target. 89 | src/CMakeFiles/gaussian_example.dir/all: 90 | $(MAKE) -f src/CMakeFiles/gaussian_example.dir/build.make src/CMakeFiles/gaussian_example.dir/depend 91 | $(MAKE) -f src/CMakeFiles/gaussian_example.dir/build.make src/CMakeFiles/gaussian_example.dir/build 92 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/home/mi/workspaces/guide/NeonGaussian/build_android/CMakeFiles --progress-num=1,2,3 "Built target gaussian_example" 93 | .PHONY : src/CMakeFiles/gaussian_example.dir/all 94 | 95 | # Include target in all. 96 | all: src/CMakeFiles/gaussian_example.dir/all 97 | 98 | .PHONY : all 99 | 100 | # Build rule for subdir invocation for target. 101 | src/CMakeFiles/gaussian_example.dir/rule: cmake_check_build_system 102 | $(CMAKE_COMMAND) -E cmake_progress_start /home/mi/workspaces/guide/NeonGaussian/build_android/CMakeFiles 3 103 | $(MAKE) -f CMakeFiles/Makefile2 src/CMakeFiles/gaussian_example.dir/all 104 | $(CMAKE_COMMAND) -E cmake_progress_start /home/mi/workspaces/guide/NeonGaussian/build_android/CMakeFiles 0 105 | .PHONY : src/CMakeFiles/gaussian_example.dir/rule 106 | 107 | # Convenience name for target. 108 | gaussian_example: src/CMakeFiles/gaussian_example.dir/rule 109 | 110 | .PHONY : gaussian_example 111 | 112 | # clean rule for target. 113 | src/CMakeFiles/gaussian_example.dir/clean: 114 | $(MAKE) -f src/CMakeFiles/gaussian_example.dir/build.make src/CMakeFiles/gaussian_example.dir/clean 115 | .PHONY : src/CMakeFiles/gaussian_example.dir/clean 116 | 117 | # clean rule for target. 118 | clean: src/CMakeFiles/gaussian_example.dir/clean 119 | 120 | .PHONY : clean 121 | 122 | #============================================================================= 123 | # Special targets to cleanup operation of make. 124 | 125 | # Special rule to run CMake to check the build system integrity. 126 | # No rule that depends on this can have commands that come from listfiles 127 | # because they might be regenerated. 128 | cmake_check_build_system: 129 | $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 130 | .PHONY : cmake_check_build_system 131 | 132 | -------------------------------------------------------------------------------- /NeonGaussian/build_android/CMakeFiles/TargetDirectories.txt: -------------------------------------------------------------------------------- 1 | /home/mi/workspaces/guide/NeonGaussian/build_android/CMakeFiles/install/strip.dir 2 | /home/mi/workspaces/guide/NeonGaussian/build_android/CMakeFiles/install/local.dir 3 | /home/mi/workspaces/guide/NeonGaussian/build_android/CMakeFiles/edit_cache.dir 4 | /home/mi/workspaces/guide/NeonGaussian/build_android/CMakeFiles/rebuild_cache.dir 5 | /home/mi/workspaces/guide/NeonGaussian/build_android/CMakeFiles/list_install_components.dir 6 | /home/mi/workspaces/guide/NeonGaussian/build_android/CMakeFiles/install.dir 7 | /home/mi/workspaces/guide/NeonGaussian/build_android/src/CMakeFiles/install/strip.dir 8 | /home/mi/workspaces/guide/NeonGaussian/build_android/src/CMakeFiles/install/local.dir 9 | /home/mi/workspaces/guide/NeonGaussian/build_android/src/CMakeFiles/edit_cache.dir 10 | /home/mi/workspaces/guide/NeonGaussian/build_android/src/CMakeFiles/gaussian_example.dir 11 | /home/mi/workspaces/guide/NeonGaussian/build_android/src/CMakeFiles/rebuild_cache.dir 12 | /home/mi/workspaces/guide/NeonGaussian/build_android/src/CMakeFiles/install.dir 13 | /home/mi/workspaces/guide/NeonGaussian/build_android/src/CMakeFiles/list_install_components.dir 14 | -------------------------------------------------------------------------------- /NeonGaussian/build_android/CMakeFiles/cmake.check_cache: -------------------------------------------------------------------------------- 1 | # This file is generated by cmake for dependency checking of the CMakeCache.txt file 2 | -------------------------------------------------------------------------------- /NeonGaussian/build_android/CMakeFiles/feature_tests.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mobile-algorithm-optimization/guide/0a10dcca06dac53a856cf0b6bccf431d6f5282ba/NeonGaussian/build_android/CMakeFiles/feature_tests.bin -------------------------------------------------------------------------------- /NeonGaussian/build_android/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 | -------------------------------------------------------------------------------- /NeonGaussian/build_android/CMakeFiles/progress.marks: -------------------------------------------------------------------------------- 1 | 3 2 | -------------------------------------------------------------------------------- /NeonGaussian/build_android/Makefile: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.12 3 | 4 | # Default target executed when no arguments are given to make. 5 | default_target: all 6 | 7 | .PHONY : default_target 8 | 9 | # Allow only one "make -f Makefile2" at a time, but pass parallelism. 10 | .NOTPARALLEL: 11 | 12 | 13 | #============================================================================= 14 | # Special targets provided by cmake. 15 | 16 | # Disable implicit rules so canonical targets will work. 17 | .SUFFIXES: 18 | 19 | 20 | # Remove some rules from gmake that .SUFFIXES does not remove. 21 | SUFFIXES = 22 | 23 | .SUFFIXES: .hpux_make_needs_suffix_list 24 | 25 | 26 | # Suppress display of executed commands. 27 | $(VERBOSE).SILENT: 28 | 29 | 30 | # A target that is always out of date. 31 | cmake_force: 32 | 33 | .PHONY : cmake_force 34 | 35 | #============================================================================= 36 | # Set environment variables for the build. 37 | 38 | # The shell in which to execute make rules. 39 | SHELL = /bin/sh 40 | 41 | # The CMake executable. 42 | CMAKE_COMMAND = /home/mi/tools/cmake-3.12.2-Linux-x86_64/bin/cmake 43 | 44 | # The command to remove a file. 45 | RM = /home/mi/tools/cmake-3.12.2-Linux-x86_64/bin/cmake -E remove -f 46 | 47 | # Escaping for special characters. 48 | EQUALS = = 49 | 50 | # The top-level source directory on which CMake was run. 51 | CMAKE_SOURCE_DIR = /home/mi/workspaces/guide/NeonGaussian 52 | 53 | # The top-level build directory on which CMake was run. 54 | CMAKE_BINARY_DIR = /home/mi/workspaces/guide/NeonGaussian/build_android 55 | 56 | #============================================================================= 57 | # Targets provided globally by CMake. 58 | 59 | # Special rule for the target install/strip 60 | install/strip: preinstall 61 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." 62 | /home/mi/tools/cmake-3.12.2-Linux-x86_64/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake 63 | .PHONY : install/strip 64 | 65 | # Special rule for the target install/strip 66 | install/strip/fast: preinstall/fast 67 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." 68 | /home/mi/tools/cmake-3.12.2-Linux-x86_64/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake 69 | .PHONY : install/strip/fast 70 | 71 | # Special rule for the target install/local 72 | install/local: preinstall 73 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." 74 | /home/mi/tools/cmake-3.12.2-Linux-x86_64/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake 75 | .PHONY : install/local 76 | 77 | # Special rule for the target install/local 78 | install/local/fast: preinstall/fast 79 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." 80 | /home/mi/tools/cmake-3.12.2-Linux-x86_64/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake 81 | .PHONY : install/local/fast 82 | 83 | # Special rule for the target edit_cache 84 | edit_cache: 85 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." 86 | /home/mi/tools/cmake-3.12.2-Linux-x86_64/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) 87 | .PHONY : edit_cache 88 | 89 | # Special rule for the target edit_cache 90 | edit_cache/fast: edit_cache 91 | 92 | .PHONY : edit_cache/fast 93 | 94 | # Special rule for the target rebuild_cache 95 | rebuild_cache: 96 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." 97 | /home/mi/tools/cmake-3.12.2-Linux-x86_64/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) 98 | .PHONY : rebuild_cache 99 | 100 | # Special rule for the target rebuild_cache 101 | rebuild_cache/fast: rebuild_cache 102 | 103 | .PHONY : rebuild_cache/fast 104 | 105 | # Special rule for the target list_install_components 106 | list_install_components: 107 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" 108 | .PHONY : list_install_components 109 | 110 | # Special rule for the target list_install_components 111 | list_install_components/fast: list_install_components 112 | 113 | .PHONY : list_install_components/fast 114 | 115 | # Special rule for the target install 116 | install: preinstall 117 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." 118 | /home/mi/tools/cmake-3.12.2-Linux-x86_64/bin/cmake -P cmake_install.cmake 119 | .PHONY : install 120 | 121 | # Special rule for the target install 122 | install/fast: preinstall/fast 123 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." 124 | /home/mi/tools/cmake-3.12.2-Linux-x86_64/bin/cmake -P cmake_install.cmake 125 | .PHONY : install/fast 126 | 127 | # The main all target 128 | all: cmake_check_build_system 129 | $(CMAKE_COMMAND) -E cmake_progress_start /home/mi/workspaces/guide/NeonGaussian/build_android/CMakeFiles /home/mi/workspaces/guide/NeonGaussian/build_android/CMakeFiles/progress.marks 130 | $(MAKE) -f CMakeFiles/Makefile2 all 131 | $(CMAKE_COMMAND) -E cmake_progress_start /home/mi/workspaces/guide/NeonGaussian/build_android/CMakeFiles 0 132 | .PHONY : all 133 | 134 | # The main clean target 135 | clean: 136 | $(MAKE) -f CMakeFiles/Makefile2 clean 137 | .PHONY : clean 138 | 139 | # The main clean target 140 | clean/fast: clean 141 | 142 | .PHONY : clean/fast 143 | 144 | # Prepare targets for installation. 145 | preinstall: all 146 | $(MAKE) -f CMakeFiles/Makefile2 preinstall 147 | .PHONY : preinstall 148 | 149 | # Prepare targets for installation. 150 | preinstall/fast: 151 | $(MAKE) -f CMakeFiles/Makefile2 preinstall 152 | .PHONY : preinstall/fast 153 | 154 | # clear depends 155 | depend: 156 | $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 157 | .PHONY : depend 158 | 159 | #============================================================================= 160 | # Target rules for targets named gaussian_example 161 | 162 | # Build rule for target. 163 | gaussian_example: cmake_check_build_system 164 | $(MAKE) -f CMakeFiles/Makefile2 gaussian_example 165 | .PHONY : gaussian_example 166 | 167 | # fast build rule for target. 168 | gaussian_example/fast: 169 | $(MAKE) -f src/CMakeFiles/gaussian_example.dir/build.make src/CMakeFiles/gaussian_example.dir/build 170 | .PHONY : gaussian_example/fast 171 | 172 | # Help Target 173 | help: 174 | @echo "The following are some of the valid targets for this Makefile:" 175 | @echo "... all (the default if no target is provided)" 176 | @echo "... clean" 177 | @echo "... depend" 178 | @echo "... install/strip" 179 | @echo "... install/local" 180 | @echo "... edit_cache" 181 | @echo "... rebuild_cache" 182 | @echo "... list_install_components" 183 | @echo "... install" 184 | @echo "... gaussian_example" 185 | .PHONY : help 186 | 187 | 188 | 189 | #============================================================================= 190 | # Special targets to cleanup operation of make. 191 | 192 | # Special rule to run CMake to check the build system integrity. 193 | # No rule that depends on this can have commands that come from listfiles 194 | # because they might be regenerated. 195 | cmake_check_build_system: 196 | $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 197 | .PHONY : cmake_check_build_system 198 | 199 | -------------------------------------------------------------------------------- /NeonGaussian/build_android/cmake_install.cmake: -------------------------------------------------------------------------------- 1 | # Install script for directory: /home/mi/workspaces/guide/NeonGaussian 2 | 3 | # Set the install prefix 4 | if(NOT DEFINED CMAKE_INSTALL_PREFIX) 5 | set(CMAKE_INSTALL_PREFIX "/home/mi/workspaces/guide/NeonGaussian/build_android/install") 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 | # Is this installation the result of a crosscompile? 36 | if(NOT DEFINED CMAKE_CROSSCOMPILING) 37 | set(CMAKE_CROSSCOMPILING "TRUE") 38 | endif() 39 | 40 | if(NOT CMAKE_INSTALL_LOCAL_ONLY) 41 | # Include the install script for each subdirectory. 42 | include("/home/mi/workspaces/guide/NeonGaussian/build_android/src/cmake_install.cmake") 43 | 44 | endif() 45 | 46 | if(CMAKE_INSTALL_COMPONENT) 47 | set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") 48 | else() 49 | set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") 50 | endif() 51 | 52 | string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT 53 | "${CMAKE_INSTALL_MANIFEST_FILES}") 54 | file(WRITE "/home/mi/workspaces/guide/NeonGaussian/build_android/${CMAKE_INSTALL_MANIFEST}" 55 | "${CMAKE_INSTALL_MANIFEST_CONTENT}") 56 | -------------------------------------------------------------------------------- /NeonGaussian/build_android/install/bin/gaussian_example: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mobile-algorithm-optimization/guide/0a10dcca06dac53a856cf0b6bccf431d6f5282ba/NeonGaussian/build_android/install/bin/gaussian_example -------------------------------------------------------------------------------- /NeonGaussian/build_android/install_manifest.txt: -------------------------------------------------------------------------------- 1 | /home/mi/workspaces/guide/NeonGaussian/build_android/install/bin/gaussian_example -------------------------------------------------------------------------------- /NeonGaussian/build_android/src/CMakeFiles/CMakeDirectoryInformation.cmake: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.12 3 | 4 | # Relative path conversion top directories. 5 | set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/mi/workspaces/guide/NeonGaussian") 6 | set(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/mi/workspaces/guide/NeonGaussian/build_android") 7 | 8 | # Force unix paths in dependencies. 9 | set(CMAKE_FORCE_UNIX_PATHS 1) 10 | 11 | 12 | # The C and CXX include file regular expressions for this directory. 13 | set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") 14 | set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") 15 | set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) 16 | set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) 17 | -------------------------------------------------------------------------------- /NeonGaussian/build_android/src/CMakeFiles/gaussian_example.dir/C.includecache: -------------------------------------------------------------------------------- 1 | #IncludeRegexLine: ^[ ]*[#%][ ]*(include|import)[ ]*[<"]([^">]+)([">]) 2 | 3 | #IncludeRegexScan: ^.*$ 4 | 5 | #IncludeRegexComplain: ^$ 6 | 7 | #IncludeRegexTransform: 8 | 9 | ../src/inc/data_type.h 10 | 11 | ../src/inc/gaussian3x3.h 12 | math.h 13 | - 14 | stdio.h 15 | - 16 | data_type.h 17 | ../src/inc/data_type.h 18 | 19 | /home/mi/workspaces/guide/NeonGaussian/src/test/example.c 20 | stdio.h 21 | - 22 | stdlib.h 23 | - 24 | string.h 25 | - 26 | sys/time.h 27 | - 28 | data_type.h 29 | /home/mi/workspaces/guide/NeonGaussian/src/test/data_type.h 30 | gaussian3x3.h 31 | /home/mi/workspaces/guide/NeonGaussian/src/test/gaussian3x3.h 32 | 33 | /home/mi/workspaces/guide/NeonGaussian/src/test/gaussian3x3_neon.c 34 | gaussian3x3.h 35 | /home/mi/workspaces/guide/NeonGaussian/src/test/gaussian3x3.h 36 | arm_neon.h 37 | - 38 | 39 | -------------------------------------------------------------------------------- /NeonGaussian/build_android/src/CMakeFiles/gaussian_example.dir/DependInfo.cmake: -------------------------------------------------------------------------------- 1 | # The set of languages for which implicit dependencies are needed: 2 | set(CMAKE_DEPENDS_LANGUAGES 3 | "C" 4 | ) 5 | # The set of files for implicit dependencies of each language: 6 | set(CMAKE_DEPENDS_CHECK_C 7 | "/home/mi/workspaces/guide/NeonGaussian/src/test/example.c" "/home/mi/workspaces/guide/NeonGaussian/build_android/src/CMakeFiles/gaussian_example.dir/test/example.c.o" 8 | "/home/mi/workspaces/guide/NeonGaussian/src/test/gaussian3x3_neon.c" "/home/mi/workspaces/guide/NeonGaussian/build_android/src/CMakeFiles/gaussian_example.dir/test/gaussian3x3_neon.c.o" 9 | ) 10 | set(CMAKE_C_COMPILER_ID "Clang") 11 | 12 | # Preprocessor definitions for this target. 13 | set(CMAKE_TARGET_DEFINITIONS_C 14 | "ANDROID" 15 | "RELEASE" 16 | ) 17 | 18 | # The include file search paths: 19 | set(CMAKE_C_TARGET_INCLUDE_PATH 20 | "../src/inc" 21 | ) 22 | 23 | # Targets to which this target links. 24 | set(CMAKE_TARGET_LINKED_INFO_FILES 25 | ) 26 | 27 | # Fortran module output directory. 28 | set(CMAKE_Fortran_TARGET_MODULE_DIR "") 29 | -------------------------------------------------------------------------------- /NeonGaussian/build_android/src/CMakeFiles/gaussian_example.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "CMakeFiles/gaussian_example.dir/test/example.c.o" 3 | "CMakeFiles/gaussian_example.dir/test/gaussian3x3_neon.c.o" 4 | "gaussian_example.pdb" 5 | "gaussian_example" 6 | ) 7 | 8 | # Per-language clean rules from dependency scanning. 9 | foreach(lang C) 10 | include(CMakeFiles/gaussian_example.dir/cmake_clean_${lang}.cmake OPTIONAL) 11 | endforeach() 12 | -------------------------------------------------------------------------------- /NeonGaussian/build_android/src/CMakeFiles/gaussian_example.dir/depend.internal: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.12 3 | 4 | src/CMakeFiles/gaussian_example.dir/test/example.c.o 5 | ../src/inc/data_type.h 6 | ../src/inc/gaussian3x3.h 7 | /home/mi/workspaces/guide/NeonGaussian/src/test/example.c 8 | src/CMakeFiles/gaussian_example.dir/test/gaussian3x3_neon.c.o 9 | ../src/inc/data_type.h 10 | ../src/inc/gaussian3x3.h 11 | /home/mi/workspaces/guide/NeonGaussian/src/test/gaussian3x3_neon.c 12 | -------------------------------------------------------------------------------- /NeonGaussian/build_android/src/CMakeFiles/gaussian_example.dir/depend.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.12 3 | 4 | src/CMakeFiles/gaussian_example.dir/test/example.c.o: ../src/inc/data_type.h 5 | src/CMakeFiles/gaussian_example.dir/test/example.c.o: ../src/inc/gaussian3x3.h 6 | src/CMakeFiles/gaussian_example.dir/test/example.c.o: ../src/test/example.c 7 | 8 | src/CMakeFiles/gaussian_example.dir/test/gaussian3x3_neon.c.o: ../src/inc/data_type.h 9 | src/CMakeFiles/gaussian_example.dir/test/gaussian3x3_neon.c.o: ../src/inc/gaussian3x3.h 10 | src/CMakeFiles/gaussian_example.dir/test/gaussian3x3_neon.c.o: ../src/test/gaussian3x3_neon.c 11 | 12 | -------------------------------------------------------------------------------- /NeonGaussian/build_android/src/CMakeFiles/gaussian_example.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.12 3 | 4 | # compile C with /home/mi/tools/android/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang 5 | C_FLAGS = -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-addrsig -Wa,--noexecstack -Wformat -Werror=format-security -O2 -DNDEBUG -fPIE -Wall -Wextra -fPIC -Ofast -ffast-math 6 | 7 | C_DEFINES = -DANDROID -DRELEASE 8 | 9 | C_INCLUDES = -I/home/mi/workspaces/guide/NeonGaussian/src/inc 10 | 11 | -------------------------------------------------------------------------------- /NeonGaussian/build_android/src/CMakeFiles/gaussian_example.dir/link.txt: -------------------------------------------------------------------------------- 1 | /home/mi/tools/android/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=aarch64-none-linux-android23 --gcc-toolchain=/home/mi/tools/android/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=/home/mi/tools/android/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/sysroot -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-addrsig -Wa,--noexecstack -Wformat -Werror=format-security -O2 -DNDEBUG -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--gc-sections CMakeFiles/gaussian_example.dir/test/example.c.o CMakeFiles/gaussian_example.dir/test/gaussian3x3_neon.c.o -o gaussian_example -llog -fuse-ld=gold -latomic -lm 2 | -------------------------------------------------------------------------------- /NeonGaussian/build_android/src/CMakeFiles/gaussian_example.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 1 2 | CMAKE_PROGRESS_2 = 2 3 | CMAKE_PROGRESS_3 = 3 4 | 5 | -------------------------------------------------------------------------------- /NeonGaussian/build_android/src/CMakeFiles/progress.marks: -------------------------------------------------------------------------------- 1 | 3 2 | -------------------------------------------------------------------------------- /NeonGaussian/build_android/src/cmake_install.cmake: -------------------------------------------------------------------------------- 1 | # Install script for directory: /home/mi/workspaces/guide/NeonGaussian/src 2 | 3 | # Set the install prefix 4 | if(NOT DEFINED CMAKE_INSTALL_PREFIX) 5 | set(CMAKE_INSTALL_PREFIX "/home/mi/workspaces/guide/NeonGaussian/build_android/install") 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 | # Is this installation the result of a crosscompile? 36 | if(NOT DEFINED CMAKE_CROSSCOMPILING) 37 | set(CMAKE_CROSSCOMPILING "TRUE") 38 | endif() 39 | 40 | if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) 41 | file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE EXECUTABLE FILES "/home/mi/workspaces/guide/NeonGaussian/build_android/src/gaussian_example") 42 | if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/gaussian_example" AND 43 | NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/gaussian_example") 44 | if(CMAKE_INSTALL_DO_STRIP) 45 | execute_process(COMMAND "/home/mi/tools/android/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-strip" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/gaussian_example") 46 | endif() 47 | endif() 48 | endif() 49 | 50 | -------------------------------------------------------------------------------- /NeonGaussian/build_android/src/gaussian_example: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mobile-algorithm-optimization/guide/0a10dcca06dac53a856cf0b6bccf431d6f5282ba/NeonGaussian/build_android/src/gaussian_example -------------------------------------------------------------------------------- /NeonGaussian/cmake/config.cmake: -------------------------------------------------------------------------------- 1 | if(CONFIG) 2 | if(${CONFIG} STREQUAL "android_arm32") 3 | include(cmake/config/android/android_arm32.cmake) 4 | elseif(${CONFIG} STREQUAL "android_arm64") 5 | include(cmake/config/android/android_arm64.cmake) 6 | endif() 7 | endif() 8 | 9 | 10 | -------------------------------------------------------------------------------- /NeonGaussian/cmake/config/android/android_arm32.cmake: -------------------------------------------------------------------------------- 1 | message(STATUS "********** android_none_arm32.cmake **********") 2 | 3 | if(NOT DEFINED ENV{NDK_PATH}) 4 | message(FATAL_ERROR "android ndk error") 5 | endif() 6 | 7 | # arm 8 | set(NDK_PATH $ENV{NDK_PATH}) 9 | set(CMAKE_TOOLCHAIN_FILE ${NDK_PATH}/build/cmake/android.toolchain.cmake) 10 | set(ANDROID_ABI armeabi-v7a) 11 | set(ANDROID_ARM_NEON ON) 12 | set(ANDROID_PLATFORM android-23) 13 | 14 | message(STATUS "NDK_PATH = ${NDK_PATH}") 15 | message(STATUS "CMAKE_TOOLCHAIN_FILE = ${CMAKE_TOOLCHAIN_FILE}") 16 | message(STATUS "ANDROID_ABI = ${ANDROID_ABI}") 17 | message(STATUS "ANDROID_ARM_NEON = ${ANDROID_ARM_NEON}") 18 | message(STATUS "ANDROID_PLATFORM = ${ANDROID_PLATFORM}") 19 | 20 | message(STATUS "***************************************") -------------------------------------------------------------------------------- /NeonGaussian/cmake/config/android/android_arm64.cmake: -------------------------------------------------------------------------------- 1 | message(STATUS "********** android_none_arm64.cmake **********") 2 | 3 | if(NOT DEFINED ENV{NDK_PATH}) 4 | message(FATAL_ERROR "android ndk error") 5 | endif() 6 | 7 | # arm 8 | set(NDK_PATH $ENV{NDK_PATH}) 9 | set(CMAKE_TOOLCHAIN_FILE ${NDK_PATH}/build/cmake/android.toolchain.cmake) 10 | set(ANDROID_ABI arm64-v8a) 11 | set(ANDROID_ARM_NEON ON) 12 | set(ANDROID_PLATFORM android-23) 13 | 14 | message(STATUS "NDK_PATH = ${NDK_PATH}") 15 | message(STATUS "CMAKE_TOOLCHAIN_FILE = ${CMAKE_TOOLCHAIN_FILE}") 16 | message(STATUS "ANDROID_ABI = ${ANDROID_ABI}") 17 | message(STATUS "ANDROID_ARM_NEON = ${ANDROID_ARM_NEON}") 18 | message(STATUS "ANDROID_PLATFORM = ${ANDROID_PLATFORM}") 19 | 20 | message(STATUS "***************************************") 21 | -------------------------------------------------------------------------------- /NeonGaussian/data/gray_4095x2161.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mobile-algorithm-optimization/guide/0a10dcca06dac53a856cf0b6bccf431d6f5282ba/NeonGaussian/data/gray_4095x2161.raw -------------------------------------------------------------------------------- /NeonGaussian/jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := ${call my-dir} 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LOCAL_MODULE := gaussian_example 6 | 7 | LOCAL_C_INCLUDES := ../src/inc 8 | 9 | LOCAL_SRC_FILES := ../src/test/example.c 10 | LOCAL_SRC_FILES += ../src/test/gaussian3x3_neon.c 11 | 12 | LOCAL_ARM_MODE := arm 13 | LOCAL_ARM_NEON := true 14 | 15 | #LOCAL_STATIC_LIBRARIES := static_lib 16 | #LOCAL_SHARED_LIBRARIES := share_lib 17 | 18 | #build App 19 | include $(BUILD_EXECUTABLE) 20 | -------------------------------------------------------------------------------- /NeonGaussian/jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_BUILD_SCRIPT=./Android.mk 2 | APP_OPTIM :=release 3 | APP_PLATFORM := android-24 4 | APP_ABI := armeabi-v7a 5 | #APP_ABI := arm64-v8a 6 | APP_CFLAGS := -fexceptions -frtti -fdeclspec 7 | APP_CFLAGS += -DANDROID 8 | APP_STL:=c++_shared 9 | -------------------------------------------------------------------------------- /NeonGaussian/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | include_directories("${CMAKE_CURRENT_SOURCE_DIR}/inc") 3 | add_executable(gaussian_example ${CMAKE_CURRENT_SOURCE_DIR}/test/example.c ${CMAKE_CURRENT_SOURCE_DIR}/test/gaussian3x3_neon.c) 4 | install(TARGETS gaussian_example DESTINATION bin) 5 | -------------------------------------------------------------------------------- /NeonGaussian/src/inc/data_type.h: -------------------------------------------------------------------------------- 1 | #ifndef DATA_TYPE_H_ 2 | #define DATA_TYPE_H_ 3 | 4 | typedef int int32_t; 5 | typedef unsigned int uint32_t; 6 | typedef signed char int8_t; 7 | typedef unsigned char uint8_t; 8 | typedef short int16_t; 9 | typedef unsigned short uint16_t; 10 | 11 | #define CAST_U8(t) (uint8_t)(!((t) & ~255) ? (t) : (t) > 0 ? 255 : 0) 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /NeonGaussian/src/inc/gaussian3x3.h: -------------------------------------------------------------------------------- 1 | #ifndef GAUSSIAN3x3_H 2 | #define GAUSSIAN3x3_H 3 | 4 | #include 5 | #include 6 | #include "data_type.h" 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | int32_t Gaussian3x3Sigma0NeonU8C1(const uint8_t *p_src, uint8_t *p_dst, int32_t heigh, int32_t width, int32_t istride, 13 | int32_t ostride); 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | 19 | #endif //GAUSSIAN3x3_H 20 | -------------------------------------------------------------------------------- /NeonGaussian/src/test/example.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "data_type.h" 6 | #include "gaussian3x3.h" 7 | 8 | static void GetTime(double *time) 9 | { 10 | struct timeval tv; 11 | gettimeofday(&tv, NULL); 12 | (*time) = (tv.tv_sec * 1000.0) + (tv.tv_usec / 1000.0); 13 | } 14 | 15 | static int32_t CompareResult(uint8_t *pt0, uint8_t *pt1, uint32_t stride, uint32_t width, uint32_t height) 16 | { 17 | int32_t ret = 0; 18 | 19 | for (uint32_t i = 0; i < height; i++) 20 | { 21 | uint8_t *pt_tmp0 = pt0 + i * stride; 22 | uint8_t *pt_tmp1 = pt1 + i * stride; 23 | for (uint32_t j = 0; j < width; j++) 24 | { 25 | if (pt_tmp0[j] != pt_tmp1[j]) 26 | { 27 | ret = -1; 28 | return ret; 29 | } 30 | } 31 | } 32 | return ret; 33 | } 34 | 35 | int32_t Gaussian3x3Sigma0NoneU8C1(const uint8_t *src, int32_t height, int32_t width, int32_t istride, 36 | int32_t ostride, uint8_t *dst) 37 | { 38 | if ((NULL == src) || (NULL == dst)) 39 | { 40 | printf("input param invalid!\n"); 41 | return -1; 42 | } 43 | 44 | //reflect101 45 | const uint8_t * __restrict p_src0 = src + istride; 46 | const uint8_t * __restrict p_src1 = src; 47 | const uint8_t * __restrict p_src2 = src + istride; 48 | 49 | uint8_t *__restrict p_dst = dst; 50 | 51 | uint32_t acc = 0; 52 | uint16_t res = 0; 53 | 54 | //process first row 55 | for (int32_t col = 0; col < width; col++) 56 | { 57 | int32_t idx_l = (col == 0) ? 1 : ((col == width - 1) ? width - 2 : col - 1); 58 | int32_t idx_r = (col == 0) ? 1 : ((col == width - 1) ? width - 2 : col + 1); 59 | 60 | acc = 0; 61 | acc += (p_src0[idx_l] + p_src0[idx_r]); 62 | acc += (p_src0[col] * 2); 63 | 64 | acc += (p_src1[idx_l] + p_src1[idx_r]) * 2; 65 | acc += (p_src1[col] * 4); 66 | 67 | acc += (p_src2[idx_l] + p_src2[idx_r]); 68 | acc += (p_src2[col] * 2); 69 | 70 | res = ((acc + (1 << 3)) >> 4) & 0xFFFF; 71 | p_dst[col] = CAST_U8(res); 72 | } 73 | 74 | p_src0 = src + (height - 2) * istride; 75 | p_src1 = src + (height - 1) * istride; 76 | p_src2 = src + (height - 2) * istride; 77 | p_dst = dst + (height - 1) * ostride; 78 | //process last row 79 | for (int32_t col = 0; col < width; col++) 80 | { 81 | int32_t idx_l = (col == 0) ? 1 : ((col == width - 1) ? width - 2 : col - 1); 82 | int32_t idx_r = (col == 0) ? 1 : ((col == width - 1) ? width - 2 : col + 1); 83 | 84 | acc = 0; 85 | acc += (p_src0[idx_l] + p_src0[idx_r]); 86 | acc += (p_src0[col] * 2); 87 | 88 | acc += (p_src1[idx_l] + p_src1[idx_r]) * 2; 89 | acc += (p_src1[col] * 4); 90 | 91 | acc += (p_src2[idx_l] + p_src2[idx_r]); 92 | acc += (p_src2[col] * 2); 93 | 94 | res = ((acc + (1 << 3)) >> 4) & 0xFFFF; 95 | p_dst[col] = CAST_U8(res); 96 | } 97 | 98 | //process body 99 | for (int32_t row = 1; row < height - 1; row++) 100 | { 101 | p_src0 = src + (row - 1) * istride; 102 | p_src1 = src + (row - 0) * istride; 103 | p_src2 = src + (row + 1) * istride; 104 | 105 | p_dst = dst + row * ostride; 106 | 107 | for (int32_t col = 1; col < width - 1; col++) 108 | { 109 | acc = 0; 110 | acc += (p_src0[col - 1] + p_src0[col + 1]); 111 | acc += (p_src0[col - 0] * 2); 112 | 113 | acc += (p_src1[col - 1] + p_src1[col + 1])* 2; 114 | acc += (p_src1[col - 0] * 4); 115 | 116 | acc += (p_src2[col - 1] + p_src2[col + 1]); 117 | acc += (p_src2[col - 0] * 2); 118 | 119 | res = ((acc + (1 << 3)) >> 4) & 0xFFFF; 120 | p_dst[col] = CAST_U8(res); 121 | } 122 | 123 | //process first col reflect101 124 | { 125 | acc = 0; 126 | acc += (p_src0[1] + p_src0[1]); 127 | acc += (p_src0[0] * 2); 128 | 129 | acc += (p_src1[1] + p_src1[1]) * 2; 130 | acc += (p_src1[0] * 4); 131 | 132 | acc += (p_src2[1] + p_src2[1]); 133 | acc += (p_src2[0] * 2); 134 | 135 | res = ((acc + (1 << 3)) >> 4) & 0xFFFF; 136 | p_dst[0] = CAST_U8(res); 137 | } 138 | 139 | //process last col reflect101 140 | { 141 | int32_t idx = width - 1; 142 | acc = 0; 143 | acc += (p_src0[idx - 1] + p_src0[idx - 1]); 144 | acc += (p_src0[idx + 0] * 2); 145 | 146 | acc += (p_src1[idx - 1] + p_src1[idx - 1]) * 2; 147 | acc += (p_src1[idx + 0] * 4); 148 | 149 | acc += (p_src2[idx - 1] + p_src2[idx - 1]); 150 | acc += (p_src2[idx + 0] * 2); 151 | 152 | res = ((acc + (1 << 3)) >> 4) & 0xFFFF; 153 | p_dst[idx] = CAST_U8(res); 154 | } 155 | 156 | } 157 | 158 | return 0; 159 | } 160 | 161 | int32_t main() 162 | { 163 | int32_t width = 4095; 164 | int32_t height = 2161; 165 | int32_t ret = 0; 166 | FILE *fp = NULL; 167 | double c_time, t1, t2; 168 | int32_t run_cnt = 100; 169 | 170 | uint8_t *p_src = (uint8_t *)malloc(width * height * sizeof(uint8_t)); 171 | uint8_t *p_dst_ref = (uint8_t *)malloc(width * height * sizeof(uint8_t)); 172 | uint8_t *p_dst_neon = (uint8_t *)malloc(width * height * sizeof(uint8_t)); 173 | 174 | if ((NULL == p_src) || (NULL == p_dst_ref) || (NULL == p_dst_neon)) 175 | { 176 | printf("malloc failed\n"); 177 | if (p_src) 178 | { 179 | free(p_src); 180 | p_src = NULL; 181 | } 182 | if (p_dst_ref) 183 | { 184 | free(p_dst_ref); 185 | p_dst_ref = NULL; 186 | } 187 | if (p_dst_neon) 188 | { 189 | free(p_dst_neon); 190 | p_dst_neon = NULL; 191 | } 192 | } 193 | 194 | fp = fopen("./data/gray_4095x2161.raw", "rb"); 195 | if (NULL == fp) 196 | { 197 | printf("fopen gray_4095x2161.raw failed\n"); 198 | goto EXIT; 199 | } 200 | fread(p_src, sizeof(uint8_t), height * width, fp); 201 | fclose(fp); 202 | 203 | //none c test 204 | c_time = 0.0f; 205 | for (int32_t i = 0; i < run_cnt; i++) 206 | { 207 | GetTime(&t1); 208 | ret |= Gaussian3x3Sigma0NoneU8C1(p_src, height, width, width, width, p_dst_ref); 209 | 210 | if (ret != 0) 211 | { 212 | printf("Gaussian3x3Sigma0NoneU8C1 failed\n"); 213 | goto EXIT; 214 | } 215 | GetTime(&t2); 216 | c_time += (t2 - t1); 217 | } 218 | printf("Gaussian3x3 None average time = %f \n", c_time / run_cnt); 219 | 220 | c_time = 0.0f; 221 | for (int32_t i = 0; i < run_cnt; i++) 222 | { 223 | GetTime(&t1); 224 | ret |= Gaussian3x3Sigma0NeonU8C1(p_src, p_dst_neon, height, width, width, width); 225 | 226 | if (ret != 0) 227 | { 228 | printf("Gaussian3x3Sigma0NeonU8C1 failed\n"); 229 | goto EXIT; 230 | } 231 | GetTime(&t2); 232 | c_time += (t2 - t1); 233 | } 234 | printf("Gaussian3x3 Neon average time = %f \n", c_time / run_cnt); 235 | 236 | if (!CompareResult(p_dst_ref, p_dst_neon, width, width, height)) 237 | { 238 | printf("Gaussian3x3None and Gaussian3x3Neon result bit matched\n"); 239 | } 240 | else 241 | { 242 | printf("Gaussian3x3None and Gaussian3x3Neon result not matched\n"); 243 | } 244 | EXIT: 245 | free(p_src); 246 | free(p_dst_ref); 247 | free(p_dst_neon); 248 | p_src = NULL; 249 | p_dst_ref = NULL; 250 | p_dst_neon = NULL; 251 | printf("gausaian_testcase done! \n"); 252 | return 0; 253 | } 254 | -------------------------------------------------------------------------------- /NeonGaussian/src/test/gaussian3x3_neon.c: -------------------------------------------------------------------------------- 1 | #include "gaussian3x3.h" 2 | #ifdef ANDROID 3 | #include 4 | #endif 5 | 6 | static inline int32_t Gaussian3x3RowCalcu(const uint8_t *src0, const uint8_t *src1, 7 | const uint8_t *src2, uint8_t *dst, int32_t width) 8 | { 9 | if ((NULL == src0) || (NULL == src1) || (NULL == src2) || (NULL == dst)) 10 | { 11 | printf("input param invalid!\n"); 12 | return -1; 13 | } 14 | 15 | int32_t col = 0; 16 | uint16x8_t vqn0, vqn1, vs_1, vs, vs1; 17 | uint8x8_t v_lnp; 18 | 19 | int32_t width_t = (width - 9) & (-8); 20 | 21 | uint8x8_t v_ld00 = vld1_u8(src0); 22 | uint8x8_t v_ld01 = vld1_u8(src0 + 8); 23 | uint8x8_t v_ld10 = vld1_u8(src1); 24 | uint8x8_t v_ld11 = vld1_u8(src1 + 8); 25 | uint8x8_t v_ld20 = vld1_u8(src2); 26 | uint8x8_t v_ld21 = vld1_u8(src2 + 8); 27 | uint8x8_t v_zero = vdup_n_u8(0); 28 | 29 | vqn0 = vaddl_u8(v_ld00, v_ld20); 30 | vqn0 = vaddq_u16(vqn0, vshll_n_u8(v_ld10, 1)); 31 | vqn1 = vaddl_u8(v_ld01, v_ld21); 32 | vqn1 = vaddq_u16(vqn1, vshll_n_u8(v_ld11, 1)); 33 | 34 | vs_1 = vextq_u16(vextq_u16(vqn0, vqn0, 2), vqn0, 7); 35 | vs1 = vextq_u16(vqn0, vqn1, 1); 36 | vs = vaddq_u16(vaddq_u16(vqn0, vqn0), vaddq_u16(vs_1, vs1)); 37 | 38 | v_lnp = vqrshrn_n_u16(vs, 4); 39 | vst1_u8(dst, v_lnp); 40 | vs_1 = vextq_u16(vqn0, vqn1, 7); 41 | 42 | for (col = 8; col < width_t; col += 8) 43 | { 44 | uint8x8_t v_ld0 = vld1_u8(src0 + col + 8); 45 | uint8x8_t v_ld1 = vld1_u8(src1 + col + 8); 46 | uint8x8_t v_ld2 = vld1_u8(src2 + col + 8); 47 | 48 | uint16x8_t vqn2 = vaddl_u8(v_ld0, v_ld2); 49 | vqn2 = vaddq_u16(vqn2, vshll_n_u8(v_ld1, 1)); 50 | 51 | vs1 = vextq_u16(vqn1, vqn2, 1); 52 | uint16x8_t vtmp = vshlq_n_u16(vqn1, 1); 53 | 54 | uint16x8_t v_sum = vaddq_u16(vtmp, vaddq_u16(vs1, vs_1)); 55 | uint8x8_t v_rst = vqrshrn_n_u16(v_sum, 4); 56 | vst1_u8(dst + col, v_rst); 57 | 58 | vs_1 = vextq_u16(vqn1, vqn2, 7); 59 | vqn1 = vqn2; 60 | } 61 | 62 | { 63 | uint8x8_t v_ld0 = v_zero, v_ld1 = v_zero, v_ld2 = v_zero; 64 | 65 | v_ld0 = vld1_lane_u8(src0 + col + 8, v_ld0, 0); 66 | v_ld1 = vld1_lane_u8(src1 + col + 8, v_ld1, 0); 67 | v_ld2 = vld1_lane_u8(src2 + col + 8, v_ld2, 0); 68 | 69 | uint16x8_t vqn2 = vaddl_u8(v_ld0, v_ld2); 70 | vqn2 = vaddq_u16(vqn2, vshll_n_u8(v_ld1, 1)); 71 | 72 | vs1 = vextq_u16(vqn1, vqn2, 1); 73 | uint16x8_t vtmp = vshlq_n_u16(vqn1, 1); 74 | 75 | uint16x8_t v_sum = vaddq_u16(vtmp, vaddq_u16(vs1, vs_1)); 76 | uint8x8_t v_rst = vqrshrn_n_u16(v_sum, 4); 77 | vst1_u8(dst + col, v_rst); 78 | col += 8; 79 | } 80 | 81 | for (; col < width; col++) 82 | { 83 | int32_t idx_l = (col == width - 1) ? width - 2 : col - 1; 84 | int32_t idx_r = (col == width - 1) ? width - 2 : col + 1; 85 | 86 | int32_t acc = 0; 87 | acc += (src0[idx_l] + src0[idx_r]); 88 | acc += (src0[col] << 1); 89 | 90 | acc += (src1[idx_l] + src1[idx_r]) << 1; 91 | acc += (src1[col] << 2); 92 | 93 | acc += (src2[idx_l] + src2[idx_r]); 94 | acc += (src2[col] << 1); 95 | 96 | uint16_t res = ((acc + (1 << 3)) >> 4) & 0xFFFF; 97 | dst[col] = CAST_U8(res); 98 | } 99 | 100 | return 0; 101 | } 102 | 103 | int32_t Gaussian3x3Sigma0NeonU8C1(const uint8_t *src, uint8_t *dst, int32_t height, int32_t width, int32_t istride, 104 | int32_t ostride) 105 | { 106 | if ((NULL == src) || (NULL == dst)) 107 | { 108 | printf("input param invalid!\n"); 109 | return -1; 110 | } 111 | 112 | //reflect101 113 | const uint8_t *p_src0 = src + istride; 114 | const uint8_t *p_src1 = src; 115 | const uint8_t *p_src2 = src + istride; 116 | 117 | uint8_t *p_dst = dst; 118 | 119 | //process first row 120 | { 121 | Gaussian3x3RowCalcu(p_src0, p_src1, p_src2, p_dst, width); 122 | } 123 | 124 | //process mid 125 | for (int32_t row = 1; row < height - 1; row++) 126 | { 127 | p_src0 = src + (row - 1) * istride; 128 | p_src1 = src + (row - 0) * istride; 129 | p_src2 = src + (row + 1) * istride; 130 | p_dst = dst + row * ostride; 131 | 132 | Gaussian3x3RowCalcu(p_src0, p_src1, p_src2, p_dst, width); 133 | } 134 | 135 | //process last row 136 | { 137 | p_src0 = src + (height - 2) * istride; 138 | p_src1 = src + (height - 1) * istride; 139 | p_src2 = src + (height - 2) * istride; 140 | p_dst = dst + (height - 1) * ostride; 141 | 142 | Gaussian3x3RowCalcu(p_src0, p_src1, p_src2, p_dst, width); 143 | } 144 | 145 | return 0; 146 | } 147 | -------------------------------------------------------------------------------- /OpenCLGaussian/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.0.0) 2 | 3 | ################################### NDK Toolchain ######################################## 4 | if (ANDROID) 5 | # set command lines for Android and neon 6 | set(NDK_PATH $ENV{NDK_PATH}) 7 | set(CMAKE_TOOLCHAIN_FILE ${NDK_PATH}/build/cmake/android.toolchain.cmake) 8 | set(ANDROID_ABI "arm64-v8a") 9 | set(ANDROID_ARM_NEON ON) 10 | set(ANDROID_PLATFORM android-23) 11 | 12 | message(STATUS "NDK_PATH = ${NDK_PATH}") 13 | message(STATUS "CMAKE_TOOLCHAIN_FILE = ${CMAKE_TOOLCHAIN_FILE}") 14 | message(STATUS "ANDROID_ABI = ${ANDROID_ABI}") 15 | message(STATUS "ANDROID_ARM_NEON = ${ANDROID_ARM_NEON}") 16 | message(STATUS "ANDROID_PLATFORM = ${ANDROID_PLATFORM}") 17 | endif() 18 | 19 | # toolchain file 20 | if (CMAKE_TOOLCHAIN_FILE) 21 | set(LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_BINARY_DIR} CACHE PATH "root for library output, set this to change where android libs are compiled to") 22 | message("LIBRARY_OUTPUT_PATH_ROOT = ${LIBRARY_OUTPUT_PATH_ROOT}") 23 | get_filename_component(CMAKE_TOOLCHAIN_FILE_NAME ${CMAKE_TOOLCHAIN_FILE} NAME) 24 | find_file(CMAKE_TOOLCHAIN_FILE ${CMAKE_TOOLCHAIN_FILE_NAME} PATHS ${CMAKE_SOURCE_DIR} NO_DEFAULT_PATH) 25 | message(STATUS "CMAKE_TOOLCHAIN_FILE = ${CMAKE_TOOLCHAIN_FILE}") 26 | endif() 27 | 28 | 29 | ################################### Build Type Default = debug ######################################## 30 | 31 | # set build type 32 | if(NOT DEFINED CMAKE_BUILD_TYPE) 33 | set(CMAKE_BUILD_TYPE "debug" CACHE STRING "debug build type" FORCE) 34 | endif() 35 | 36 | if(CMAKE_BUILD_TYPE MATCHES "(Release|RELEASE|release)") 37 | add_definitions(-DRELEASE) 38 | else() 39 | add_definitions(-DDEBUG) 40 | endif() 41 | 42 | # C/CXX FLAGS 43 | 44 | add_definitions(-Wall -Wextra) 45 | add_definitions(-fPIC) 46 | 47 | if (ANDROID) 48 | add_definitions(-Ofast) 49 | add_definitions(-ffast-math) 50 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -frtti -fno-exceptions") 51 | add_definitions(-DANDROID) 52 | add_definitions(-DQCOM) 53 | # extra libs and use gold link for android 54 | link_libraries("log") 55 | link_libraries("-fuse-ld=gold") 56 | endif() 57 | 58 | # set install 59 | if(NOT DEFINED CMAKE_INSTALL_PREFIX) 60 | set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Installation Directory") 61 | endif() 62 | message(STATUS "CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}") 63 | 64 | #########################Find OpenCL###################################### 65 | if (QCOM) 66 | set(OpenCL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/opencl/qcom/opencl200/include/") 67 | set(OpenCL_SHARED_LIB "${CMAKE_CURRENT_SOURCE_DIR}/opencl/qcom/opencl200/lib64/libOpenCL.so") 68 | add_definitions(-DQCOM_DEVICE) 69 | 70 | include_directories(${OpenCL_DIR}) 71 | link_libraries( ${OpenCL_SHARED_LIB}) 72 | message(STATUS "QCOMM opencl set") 73 | 74 | add_definitions(-DKERNEL_PROFILING) 75 | endif() 76 | if (MTK) 77 | set(OpenCL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/opencl/mtk/opencl210/include/") 78 | set(OpenCL_SHARED_LIB "${CMAKE_CURRENT_SOURCE_DIR}/opencl/mtk/opencl210/lib64/libOpenCL.so") 79 | add_definitions(-DMTK_DEVICE) 80 | add_definitions(-DCL_TARGET_OPENCL_VERSION=210) 81 | 82 | include_directories(${OpenCL_DIR}) 83 | link_libraries( ${OpenCL_SHARED_LIB}) 84 | message(STATUS "MTK opencl set") 85 | endif() 86 | ############################################################### 87 | 88 | project(main) 89 | add_executable(main ./main.cpp) 90 | install(TARGETS main DESTINATION bin) 91 | install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/gaussian.cl" DESTINATION bin) 92 | -------------------------------------------------------------------------------- /OpenCLGaussian/README.md: -------------------------------------------------------------------------------- 1 | # 移动端算法优化 - OpenCL kernel 开发 2 | 3 | ### 运行说明 4 | 本代码在高通8450平台编译运行通过。编译运行请按照以下步骤: 5 | 1. 使用adb devices和adb shell检查手机连接状况。 6 | 2. 设置环境变量${NDK_PATH}为NDK根目录。 7 | 3. 修改qcom/mtk_test.sh和qcom/mtk_adbshell.sh中可执行文件和cl文件保存的路径。 8 | 4. Readme当前目录下,高通平台运行./qcom_test.sh,MTK平台运行./mtk_test.sh。 9 | 10 | ### 高通骁龙8450运行示例 11 | ```text 12 | Kernel Gauss3x3u8c1Buffer max workgroup size=1024 13 | Kernel Gauss3x3u8c1Buffer perferred workgroup size multiple=128 14 | Matrix Width =4096 Height=4096 15 | Cpu Gaussian consume average time: 35203 us 16 | global_work_size=(1022,4096) 17 | local_work_size=(32,32) 18 | queue -> submit : 22.016000us 19 | submit -> start : 8.960000us 20 | start -> end : 1647.104000us 21 | end -> finish : 0.000000us 22 | OpenCL Gaussian consume average time: 1959 us 23 | A and B match! 24 | ``` 25 | -------------------------------------------------------------------------------- /OpenCLGaussian/gaussian.cl: -------------------------------------------------------------------------------- 1 | 2 | __kernel void Gauss3x3u8c1Buffer(__global uchar *src, int row, int col, 3 | int src_pitch, int dst_pitch, 4 | __global uchar *dst) 5 | { 6 | int x = get_global_id(0) << 2; 7 | int y = get_global_id(1); 8 | 9 | if ( x >= col || y >= row) 10 | { 11 | return; 12 | } 13 | 14 | int r1_index = mad24(y, src_pitch, x); 15 | int r0_index = select(mad24(y - 1, src_pitch, x), mad24(y + 1, src_pitch, x), ((y - 1) < 0)); 16 | int r2_index = select(r1_index - src_pitch, r1_index + src_pitch, ((y + 1) < row)); 17 | 18 | int8 r0 = convert_int8(vload8(0, src + r0_index)); 19 | int8 r1 = convert_int8(vload8(0, src + r1_index)); 20 | int8 r2 = convert_int8(vload8(0, src + r2_index)); 21 | 22 | int8 vert_sum = (r0 + r2) + (r1 << (int8)(1)); 23 | int4 v_hori_s0 = vert_sum.lo; 24 | int4 v_hori_s1 = (int4)(vert_sum.s1234); 25 | int4 v_hori_s2 = (int4)(vert_sum.s2345); 26 | int4 v_res = (v_hori_s0 + v_hori_s2 + (v_hori_s1 << (int4)(1)) + (int4)(1 << 3)) >> (int4)(4); 27 | uchar4 v_dst = convert_uchar4_sat(v_res); 28 | 29 | int dst_index = mad24(y, dst_pitch, x + 1); 30 | vstore4(v_dst, 0, dst + dst_index); 31 | } 32 | -------------------------------------------------------------------------------- /OpenCLGaussian/mtk_adbshell.sh: -------------------------------------------------------------------------------- 1 | cd /data/local/Gaussian/bin/ 2 | export LD_LIBRARY_PATH=$(pwd):/vendor/lib64/:/vendor/lib64/egl 3 | ./main 4 | -------------------------------------------------------------------------------- /OpenCLGaussian/mtk_test.sh: -------------------------------------------------------------------------------- 1 | cd build_android 2 | rm -r * 3 | cmake -DANDROID=android -DMTK=mtk -DCMAKE_BUILD_TYPE=Release .. 4 | make install 5 | adb push install/bin/* /data/local/Gaussian/bin/ 6 | adb shell < ../mtk_adbshell.sh 7 | -------------------------------------------------------------------------------- /OpenCLGaussian/opencl/mtk/opencl210/include/CL/cl_d3d10.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * Copyright (c) 2008-2015 The Khronos Group Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and/or associated documentation files (the 6 | * "Materials"), to deal in the Materials without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Materials, and to 9 | * permit persons to whom the Materials are furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Materials. 14 | * 15 | * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS 16 | * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS 17 | * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT 18 | * https://www.khronos.org/registry/ 19 | * 20 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 27 | **********************************************************************************/ 28 | 29 | /* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */ 30 | 31 | #ifndef __OPENCL_CL_D3D10_H 32 | #define __OPENCL_CL_D3D10_H 33 | 34 | #include 35 | #include 36 | #include 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | /****************************************************************************** 43 | * cl_khr_d3d10_sharing */ 44 | #define cl_khr_d3d10_sharing 1 45 | 46 | typedef cl_uint cl_d3d10_device_source_khr; 47 | typedef cl_uint cl_d3d10_device_set_khr; 48 | 49 | /******************************************************************************/ 50 | 51 | /* Error Codes */ 52 | #define CL_INVALID_D3D10_DEVICE_KHR -1002 53 | #define CL_INVALID_D3D10_RESOURCE_KHR -1003 54 | #define CL_D3D10_RESOURCE_ALREADY_ACQUIRED_KHR -1004 55 | #define CL_D3D10_RESOURCE_NOT_ACQUIRED_KHR -1005 56 | 57 | /* cl_d3d10_device_source_nv */ 58 | #define CL_D3D10_DEVICE_KHR 0x4010 59 | #define CL_D3D10_DXGI_ADAPTER_KHR 0x4011 60 | 61 | /* cl_d3d10_device_set_nv */ 62 | #define CL_PREFERRED_DEVICES_FOR_D3D10_KHR 0x4012 63 | #define CL_ALL_DEVICES_FOR_D3D10_KHR 0x4013 64 | 65 | /* cl_context_info */ 66 | #define CL_CONTEXT_D3D10_DEVICE_KHR 0x4014 67 | #define CL_CONTEXT_D3D10_PREFER_SHARED_RESOURCES_KHR 0x402C 68 | 69 | /* cl_mem_info */ 70 | #define CL_MEM_D3D10_RESOURCE_KHR 0x4015 71 | 72 | /* cl_image_info */ 73 | #define CL_IMAGE_D3D10_SUBRESOURCE_KHR 0x4016 74 | 75 | /* cl_command_type */ 76 | #define CL_COMMAND_ACQUIRE_D3D10_OBJECTS_KHR 0x4017 77 | #define CL_COMMAND_RELEASE_D3D10_OBJECTS_KHR 0x4018 78 | 79 | /******************************************************************************/ 80 | 81 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D10KHR_fn)( 82 | cl_platform_id platform, 83 | cl_d3d10_device_source_khr d3d_device_source, 84 | void * d3d_object, 85 | cl_d3d10_device_set_khr d3d_device_set, 86 | cl_uint num_entries, 87 | cl_device_id * devices, 88 | cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_0; 89 | 90 | typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10BufferKHR_fn)( 91 | cl_context context, 92 | cl_mem_flags flags, 93 | ID3D10Buffer * resource, 94 | cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; 95 | 96 | typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture2DKHR_fn)( 97 | cl_context context, 98 | cl_mem_flags flags, 99 | ID3D10Texture2D * resource, 100 | UINT subresource, 101 | cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; 102 | 103 | typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture3DKHR_fn)( 104 | cl_context context, 105 | cl_mem_flags flags, 106 | ID3D10Texture3D * resource, 107 | UINT subresource, 108 | cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; 109 | 110 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D10ObjectsKHR_fn)( 111 | cl_command_queue command_queue, 112 | cl_uint num_objects, 113 | const cl_mem * mem_objects, 114 | cl_uint num_events_in_wait_list, 115 | const cl_event * event_wait_list, 116 | cl_event * event) CL_API_SUFFIX__VERSION_1_0; 117 | 118 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseD3D10ObjectsKHR_fn)( 119 | cl_command_queue command_queue, 120 | cl_uint num_objects, 121 | const cl_mem * mem_objects, 122 | cl_uint num_events_in_wait_list, 123 | const cl_event * event_wait_list, 124 | cl_event * event) CL_API_SUFFIX__VERSION_1_0; 125 | 126 | #ifdef __cplusplus 127 | } 128 | #endif 129 | 130 | #endif /* __OPENCL_CL_D3D10_H */ 131 | 132 | -------------------------------------------------------------------------------- /OpenCLGaussian/opencl/mtk/opencl210/include/CL/cl_d3d11.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * Copyright (c) 2008-2015 The Khronos Group Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and/or associated documentation files (the 6 | * "Materials"), to deal in the Materials without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Materials, and to 9 | * permit persons to whom the Materials are furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Materials. 14 | * 15 | * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS 16 | * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS 17 | * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT 18 | * https://www.khronos.org/registry/ 19 | * 20 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 27 | **********************************************************************************/ 28 | 29 | /* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */ 30 | 31 | #ifndef __OPENCL_CL_D3D11_H 32 | #define __OPENCL_CL_D3D11_H 33 | 34 | #include 35 | #include 36 | #include 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | /****************************************************************************** 43 | * cl_khr_d3d11_sharing */ 44 | #define cl_khr_d3d11_sharing 1 45 | 46 | typedef cl_uint cl_d3d11_device_source_khr; 47 | typedef cl_uint cl_d3d11_device_set_khr; 48 | 49 | /******************************************************************************/ 50 | 51 | /* Error Codes */ 52 | #define CL_INVALID_D3D11_DEVICE_KHR -1006 53 | #define CL_INVALID_D3D11_RESOURCE_KHR -1007 54 | #define CL_D3D11_RESOURCE_ALREADY_ACQUIRED_KHR -1008 55 | #define CL_D3D11_RESOURCE_NOT_ACQUIRED_KHR -1009 56 | 57 | /* cl_d3d11_device_source */ 58 | #define CL_D3D11_DEVICE_KHR 0x4019 59 | #define CL_D3D11_DXGI_ADAPTER_KHR 0x401A 60 | 61 | /* cl_d3d11_device_set */ 62 | #define CL_PREFERRED_DEVICES_FOR_D3D11_KHR 0x401B 63 | #define CL_ALL_DEVICES_FOR_D3D11_KHR 0x401C 64 | 65 | /* cl_context_info */ 66 | #define CL_CONTEXT_D3D11_DEVICE_KHR 0x401D 67 | #define CL_CONTEXT_D3D11_PREFER_SHARED_RESOURCES_KHR 0x402D 68 | 69 | /* cl_mem_info */ 70 | #define CL_MEM_D3D11_RESOURCE_KHR 0x401E 71 | 72 | /* cl_image_info */ 73 | #define CL_IMAGE_D3D11_SUBRESOURCE_KHR 0x401F 74 | 75 | /* cl_command_type */ 76 | #define CL_COMMAND_ACQUIRE_D3D11_OBJECTS_KHR 0x4020 77 | #define CL_COMMAND_RELEASE_D3D11_OBJECTS_KHR 0x4021 78 | 79 | /******************************************************************************/ 80 | 81 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D11KHR_fn)( 82 | cl_platform_id platform, 83 | cl_d3d11_device_source_khr d3d_device_source, 84 | void * d3d_object, 85 | cl_d3d11_device_set_khr d3d_device_set, 86 | cl_uint num_entries, 87 | cl_device_id * devices, 88 | cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_2; 89 | 90 | typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11BufferKHR_fn)( 91 | cl_context context, 92 | cl_mem_flags flags, 93 | ID3D11Buffer * resource, 94 | cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2; 95 | 96 | typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11Texture2DKHR_fn)( 97 | cl_context context, 98 | cl_mem_flags flags, 99 | ID3D11Texture2D * resource, 100 | UINT subresource, 101 | cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2; 102 | 103 | typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11Texture3DKHR_fn)( 104 | cl_context context, 105 | cl_mem_flags flags, 106 | ID3D11Texture3D * resource, 107 | UINT subresource, 108 | cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2; 109 | 110 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D11ObjectsKHR_fn)( 111 | cl_command_queue command_queue, 112 | cl_uint num_objects, 113 | const cl_mem * mem_objects, 114 | cl_uint num_events_in_wait_list, 115 | const cl_event * event_wait_list, 116 | cl_event * event) CL_API_SUFFIX__VERSION_1_2; 117 | 118 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseD3D11ObjectsKHR_fn)( 119 | cl_command_queue command_queue, 120 | cl_uint num_objects, 121 | const cl_mem * mem_objects, 122 | cl_uint num_events_in_wait_list, 123 | const cl_event * event_wait_list, 124 | cl_event * event) CL_API_SUFFIX__VERSION_1_2; 125 | 126 | #ifdef __cplusplus 127 | } 128 | #endif 129 | 130 | #endif /* __OPENCL_CL_D3D11_H */ 131 | 132 | -------------------------------------------------------------------------------- /OpenCLGaussian/opencl/mtk/opencl210/include/CL/cl_dx9_media_sharing.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * Copyright (c) 2008-2015 The Khronos Group Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and/or associated documentation files (the 6 | * "Materials"), to deal in the Materials without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Materials, and to 9 | * permit persons to whom the Materials are furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Materials. 14 | * 15 | * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS 16 | * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS 17 | * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT 18 | * https://www.khronos.org/registry/ 19 | * 20 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 27 | **********************************************************************************/ 28 | 29 | /* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */ 30 | 31 | #ifndef __OPENCL_CL_DX9_MEDIA_SHARING_H 32 | #define __OPENCL_CL_DX9_MEDIA_SHARING_H 33 | 34 | #include 35 | #include 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | /******************************************************************************/ 42 | /* cl_khr_dx9_media_sharing */ 43 | #define cl_khr_dx9_media_sharing 1 44 | 45 | typedef cl_uint cl_dx9_media_adapter_type_khr; 46 | typedef cl_uint cl_dx9_media_adapter_set_khr; 47 | 48 | #if defined(_WIN32) 49 | #include 50 | typedef struct _cl_dx9_surface_info_khr 51 | { 52 | IDirect3DSurface9 *resource; 53 | HANDLE shared_handle; 54 | } cl_dx9_surface_info_khr; 55 | #endif 56 | 57 | 58 | /******************************************************************************/ 59 | 60 | /* Error Codes */ 61 | #define CL_INVALID_DX9_MEDIA_ADAPTER_KHR -1010 62 | #define CL_INVALID_DX9_MEDIA_SURFACE_KHR -1011 63 | #define CL_DX9_MEDIA_SURFACE_ALREADY_ACQUIRED_KHR -1012 64 | #define CL_DX9_MEDIA_SURFACE_NOT_ACQUIRED_KHR -1013 65 | 66 | /* cl_media_adapter_type_khr */ 67 | #define CL_ADAPTER_D3D9_KHR 0x2020 68 | #define CL_ADAPTER_D3D9EX_KHR 0x2021 69 | #define CL_ADAPTER_DXVA_KHR 0x2022 70 | 71 | /* cl_media_adapter_set_khr */ 72 | #define CL_PREFERRED_DEVICES_FOR_DX9_MEDIA_ADAPTER_KHR 0x2023 73 | #define CL_ALL_DEVICES_FOR_DX9_MEDIA_ADAPTER_KHR 0x2024 74 | 75 | /* cl_context_info */ 76 | #define CL_CONTEXT_ADAPTER_D3D9_KHR 0x2025 77 | #define CL_CONTEXT_ADAPTER_D3D9EX_KHR 0x2026 78 | #define CL_CONTEXT_ADAPTER_DXVA_KHR 0x2027 79 | 80 | /* cl_mem_info */ 81 | #define CL_MEM_DX9_MEDIA_ADAPTER_TYPE_KHR 0x2028 82 | #define CL_MEM_DX9_MEDIA_SURFACE_INFO_KHR 0x2029 83 | 84 | /* cl_image_info */ 85 | #define CL_IMAGE_DX9_MEDIA_PLANE_KHR 0x202A 86 | 87 | /* cl_command_type */ 88 | #define CL_COMMAND_ACQUIRE_DX9_MEDIA_SURFACES_KHR 0x202B 89 | #define CL_COMMAND_RELEASE_DX9_MEDIA_SURFACES_KHR 0x202C 90 | 91 | /******************************************************************************/ 92 | 93 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromDX9MediaAdapterKHR_fn)( 94 | cl_platform_id platform, 95 | cl_uint num_media_adapters, 96 | cl_dx9_media_adapter_type_khr * media_adapter_type, 97 | void * media_adapters, 98 | cl_dx9_media_adapter_set_khr media_adapter_set, 99 | cl_uint num_entries, 100 | cl_device_id * devices, 101 | cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_2; 102 | 103 | typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromDX9MediaSurfaceKHR_fn)( 104 | cl_context context, 105 | cl_mem_flags flags, 106 | cl_dx9_media_adapter_type_khr adapter_type, 107 | void * surface_info, 108 | cl_uint plane, 109 | cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2; 110 | 111 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireDX9MediaSurfacesKHR_fn)( 112 | cl_command_queue command_queue, 113 | cl_uint num_objects, 114 | const cl_mem * mem_objects, 115 | cl_uint num_events_in_wait_list, 116 | const cl_event * event_wait_list, 117 | cl_event * event) CL_API_SUFFIX__VERSION_1_2; 118 | 119 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseDX9MediaSurfacesKHR_fn)( 120 | cl_command_queue command_queue, 121 | cl_uint num_objects, 122 | const cl_mem * mem_objects, 123 | cl_uint num_events_in_wait_list, 124 | const cl_event * event_wait_list, 125 | cl_event * event) CL_API_SUFFIX__VERSION_1_2; 126 | 127 | #ifdef __cplusplus 128 | } 129 | #endif 130 | 131 | #endif /* __OPENCL_CL_DX9_MEDIA_SHARING_H */ 132 | 133 | -------------------------------------------------------------------------------- /OpenCLGaussian/opencl/mtk/opencl210/include/CL/cl_egl.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2008-2015 The Khronos Group Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and/or associated documentation files (the 6 | * "Materials"), to deal in the Materials without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Materials, and to 9 | * permit persons to whom the Materials are furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Materials. 14 | * 15 | * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS 16 | * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS 17 | * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT 18 | * https://www.khronos.org/registry/ 19 | * 20 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 27 | ******************************************************************************/ 28 | 29 | #ifndef __OPENCL_CL_EGL_H 30 | #define __OPENCL_CL_EGL_H 31 | 32 | #ifdef __APPLE__ 33 | 34 | #else 35 | #include 36 | #endif 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | 43 | /* Command type for events created with clEnqueueAcquireEGLObjectsKHR */ 44 | #define CL_COMMAND_EGL_FENCE_SYNC_OBJECT_KHR 0x202F 45 | #define CL_COMMAND_ACQUIRE_EGL_OBJECTS_KHR 0x202D 46 | #define CL_COMMAND_RELEASE_EGL_OBJECTS_KHR 0x202E 47 | 48 | /* Error type for clCreateFromEGLImageKHR */ 49 | #define CL_INVALID_EGL_OBJECT_KHR -1093 50 | #define CL_EGL_RESOURCE_NOT_ACQUIRED_KHR -1092 51 | 52 | /* CLeglImageKHR is an opaque handle to an EGLImage */ 53 | typedef void* CLeglImageKHR; 54 | 55 | /* CLeglDisplayKHR is an opaque handle to an EGLDisplay */ 56 | typedef void* CLeglDisplayKHR; 57 | 58 | /* CLeglSyncKHR is an opaque handle to an EGLSync object */ 59 | typedef void* CLeglSyncKHR; 60 | 61 | /* properties passed to clCreateFromEGLImageKHR */ 62 | typedef intptr_t cl_egl_image_properties_khr; 63 | 64 | 65 | #define cl_khr_egl_image 1 66 | 67 | extern CL_API_ENTRY cl_mem CL_API_CALL 68 | clCreateFromEGLImageKHR(cl_context /* context */, 69 | CLeglDisplayKHR /* egldisplay */, 70 | CLeglImageKHR /* eglimage */, 71 | cl_mem_flags /* flags */, 72 | const cl_egl_image_properties_khr * /* properties */, 73 | cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; 74 | 75 | typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromEGLImageKHR_fn)( 76 | cl_context context, 77 | CLeglDisplayKHR egldisplay, 78 | CLeglImageKHR eglimage, 79 | cl_mem_flags flags, 80 | const cl_egl_image_properties_khr * properties, 81 | cl_int * errcode_ret); 82 | 83 | 84 | extern CL_API_ENTRY cl_int CL_API_CALL 85 | clEnqueueAcquireEGLObjectsKHR(cl_command_queue /* command_queue */, 86 | cl_uint /* num_objects */, 87 | const cl_mem * /* mem_objects */, 88 | cl_uint /* num_events_in_wait_list */, 89 | const cl_event * /* event_wait_list */, 90 | cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; 91 | 92 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireEGLObjectsKHR_fn)( 93 | cl_command_queue command_queue, 94 | cl_uint num_objects, 95 | const cl_mem * mem_objects, 96 | cl_uint num_events_in_wait_list, 97 | const cl_event * event_wait_list, 98 | cl_event * event); 99 | 100 | 101 | extern CL_API_ENTRY cl_int CL_API_CALL 102 | clEnqueueReleaseEGLObjectsKHR(cl_command_queue /* command_queue */, 103 | cl_uint /* num_objects */, 104 | const cl_mem * /* mem_objects */, 105 | cl_uint /* num_events_in_wait_list */, 106 | const cl_event * /* event_wait_list */, 107 | cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; 108 | 109 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseEGLObjectsKHR_fn)( 110 | cl_command_queue command_queue, 111 | cl_uint num_objects, 112 | const cl_mem * mem_objects, 113 | cl_uint num_events_in_wait_list, 114 | const cl_event * event_wait_list, 115 | cl_event * event); 116 | 117 | 118 | #define cl_khr_egl_event 1 119 | 120 | extern CL_API_ENTRY cl_event CL_API_CALL 121 | clCreateEventFromEGLSyncKHR(cl_context /* context */, 122 | CLeglSyncKHR /* sync */, 123 | CLeglDisplayKHR /* display */, 124 | cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; 125 | 126 | typedef CL_API_ENTRY cl_event (CL_API_CALL *clCreateEventFromEGLSyncKHR_fn)( 127 | cl_context context, 128 | CLeglSyncKHR sync, 129 | CLeglDisplayKHR display, 130 | cl_int * errcode_ret); 131 | 132 | #ifdef __cplusplus 133 | } 134 | #endif 135 | 136 | #endif /* __OPENCL_CL_EGL_H */ 137 | -------------------------------------------------------------------------------- /OpenCLGaussian/opencl/mtk/opencl210/include/CL/cl_gl.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * Copyright (c) 2008-2018 The Khronos Group Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and/or associated documentation files (the 6 | * "Materials"), to deal in the Materials without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Materials, and to 9 | * permit persons to whom the Materials are furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Materials. 14 | * 15 | * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS 16 | * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS 17 | * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT 18 | * https://www.khronos.org/registry/ 19 | * 20 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 27 | **********************************************************************************/ 28 | 29 | #ifndef __OPENCL_CL_GL_H 30 | #define __OPENCL_CL_GL_H 31 | 32 | #ifdef __APPLE__ 33 | #include 34 | #else 35 | #include 36 | #endif 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | typedef cl_uint cl_gl_object_type; 43 | typedef cl_uint cl_gl_texture_info; 44 | typedef cl_uint cl_gl_platform_info; 45 | typedef struct __GLsync *cl_GLsync; 46 | 47 | /* cl_gl_object_type = 0x2000 - 0x200F enum values are currently taken */ 48 | #define CL_GL_OBJECT_BUFFER 0x2000 49 | #define CL_GL_OBJECT_TEXTURE2D 0x2001 50 | #define CL_GL_OBJECT_TEXTURE3D 0x2002 51 | #define CL_GL_OBJECT_RENDERBUFFER 0x2003 52 | #ifdef CL_VERSION_1_2 53 | #define CL_GL_OBJECT_TEXTURE2D_ARRAY 0x200E 54 | #define CL_GL_OBJECT_TEXTURE1D 0x200F 55 | #define CL_GL_OBJECT_TEXTURE1D_ARRAY 0x2010 56 | #define CL_GL_OBJECT_TEXTURE_BUFFER 0x2011 57 | #endif 58 | 59 | /* cl_gl_texture_info */ 60 | #define CL_GL_TEXTURE_TARGET 0x2004 61 | #define CL_GL_MIPMAP_LEVEL 0x2005 62 | #ifdef CL_VERSION_1_2 63 | #define CL_GL_NUM_SAMPLES 0x2012 64 | #endif 65 | 66 | 67 | extern CL_API_ENTRY cl_mem CL_API_CALL 68 | clCreateFromGLBuffer(cl_context /* context */, 69 | cl_mem_flags /* flags */, 70 | cl_GLuint /* bufobj */, 71 | int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; 72 | 73 | #ifdef CL_VERSION_1_2 74 | 75 | extern CL_API_ENTRY cl_mem CL_API_CALL 76 | clCreateFromGLTexture(cl_context /* context */, 77 | cl_mem_flags /* flags */, 78 | cl_GLenum /* target */, 79 | cl_GLint /* miplevel */, 80 | cl_GLuint /* texture */, 81 | cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_2; 82 | 83 | #endif 84 | 85 | extern CL_API_ENTRY cl_mem CL_API_CALL 86 | clCreateFromGLRenderbuffer(cl_context /* context */, 87 | cl_mem_flags /* flags */, 88 | cl_GLuint /* renderbuffer */, 89 | cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; 90 | 91 | extern CL_API_ENTRY cl_int CL_API_CALL 92 | clGetGLObjectInfo(cl_mem /* memobj */, 93 | cl_gl_object_type * /* gl_object_type */, 94 | cl_GLuint * /* gl_object_name */) CL_API_SUFFIX__VERSION_1_0; 95 | 96 | extern CL_API_ENTRY cl_int CL_API_CALL 97 | clGetGLTextureInfo(cl_mem /* memobj */, 98 | cl_gl_texture_info /* param_name */, 99 | size_t /* param_value_size */, 100 | void * /* param_value */, 101 | size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; 102 | 103 | extern CL_API_ENTRY cl_int CL_API_CALL 104 | clEnqueueAcquireGLObjects(cl_command_queue /* command_queue */, 105 | cl_uint /* num_objects */, 106 | const cl_mem * /* mem_objects */, 107 | cl_uint /* num_events_in_wait_list */, 108 | const cl_event * /* event_wait_list */, 109 | cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; 110 | 111 | extern CL_API_ENTRY cl_int CL_API_CALL 112 | clEnqueueReleaseGLObjects(cl_command_queue /* command_queue */, 113 | cl_uint /* num_objects */, 114 | const cl_mem * /* mem_objects */, 115 | cl_uint /* num_events_in_wait_list */, 116 | const cl_event * /* event_wait_list */, 117 | cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; 118 | 119 | 120 | /* Deprecated OpenCL 1.1 APIs */ 121 | extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL 122 | clCreateFromGLTexture2D(cl_context /* context */, 123 | cl_mem_flags /* flags */, 124 | cl_GLenum /* target */, 125 | cl_GLint /* miplevel */, 126 | cl_GLuint /* texture */, 127 | cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED; 128 | 129 | extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL 130 | clCreateFromGLTexture3D(cl_context /* context */, 131 | cl_mem_flags /* flags */, 132 | cl_GLenum /* target */, 133 | cl_GLint /* miplevel */, 134 | cl_GLuint /* texture */, 135 | cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED; 136 | 137 | /* cl_khr_gl_sharing extension */ 138 | 139 | #define cl_khr_gl_sharing 1 140 | 141 | typedef cl_uint cl_gl_context_info; 142 | 143 | /* Additional Error Codes */ 144 | #define CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR -1000 145 | 146 | /* cl_gl_context_info */ 147 | #define CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR 0x2006 148 | #define CL_DEVICES_FOR_GL_CONTEXT_KHR 0x2007 149 | 150 | /* Additional cl_context_properties */ 151 | #define CL_GL_CONTEXT_KHR 0x2008 152 | #define CL_EGL_DISPLAY_KHR 0x2009 153 | #define CL_GLX_DISPLAY_KHR 0x200A 154 | #define CL_WGL_HDC_KHR 0x200B 155 | #define CL_CGL_SHAREGROUP_KHR 0x200C 156 | 157 | extern CL_API_ENTRY cl_int CL_API_CALL 158 | clGetGLContextInfoKHR(const cl_context_properties * /* properties */, 159 | cl_gl_context_info /* param_name */, 160 | size_t /* param_value_size */, 161 | void * /* param_value */, 162 | size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; 163 | 164 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetGLContextInfoKHR_fn)( 165 | const cl_context_properties * properties, 166 | cl_gl_context_info param_name, 167 | size_t param_value_size, 168 | void * param_value, 169 | size_t * param_value_size_ret); 170 | 171 | #ifdef __cplusplus 172 | } 173 | #endif 174 | 175 | #endif /* __OPENCL_CL_GL_H */ 176 | -------------------------------------------------------------------------------- /OpenCLGaussian/opencl/mtk/opencl210/include/CL/cl_gl_ext.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * Copyright (c) 2008-2015 The Khronos Group Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and/or associated documentation files (the 6 | * "Materials"), to deal in the Materials without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Materials, and to 9 | * permit persons to whom the Materials are furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Materials. 14 | * 15 | * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS 16 | * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS 17 | * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT 18 | * https://www.khronos.org/registry/ 19 | * 20 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 27 | **********************************************************************************/ 28 | 29 | /* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */ 30 | 31 | /* cl_gl_ext.h contains vendor (non-KHR) OpenCL extensions which have */ 32 | /* OpenGL dependencies. */ 33 | 34 | #ifndef __OPENCL_CL_GL_EXT_H 35 | #define __OPENCL_CL_GL_EXT_H 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | #ifdef __APPLE__ 42 | #include 43 | #else 44 | #include 45 | #endif 46 | 47 | /* 48 | * For each extension, follow this template 49 | * cl_VEN_extname extension */ 50 | /* #define cl_VEN_extname 1 51 | * ... define new types, if any 52 | * ... define new tokens, if any 53 | * ... define new APIs, if any 54 | * 55 | * If you need GLtypes here, mirror them with a cl_GLtype, rather than including a GL header 56 | * This allows us to avoid having to decide whether to include GL headers or GLES here. 57 | */ 58 | 59 | /* 60 | * cl_khr_gl_event extension 61 | * See section 9.9 in the OpenCL 1.1 spec for more information 62 | */ 63 | #define CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR 0x200D 64 | 65 | extern CL_API_ENTRY cl_event CL_API_CALL 66 | clCreateEventFromGLsyncKHR(cl_context /* context */, 67 | cl_GLsync /* cl_GLsync */, 68 | cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1; 69 | 70 | #ifdef __cplusplus 71 | } 72 | #endif 73 | 74 | #endif /* __OPENCL_CL_GL_EXT_H */ 75 | -------------------------------------------------------------------------------- /OpenCLGaussian/opencl/mtk/opencl210/include/CL/cl_va_api_media_sharing_intel.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * Copyright (c) 2008-2016 The Khronos Group Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and/or associated documentation files (the 6 | * "Materials"), to deal in the Materials without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Materials, and to 9 | * permit persons to whom the Materials are furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Materials. 14 | * 15 | * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS 16 | * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS 17 | * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT 18 | * https://www.khronos.org/registry/ 19 | * 20 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 27 | **********************************************************************************/ 28 | /*****************************************************************************\ 29 | 30 | Copyright (c) 2013-2016 Intel Corporation All Rights Reserved. 31 | 32 | THESE MATERIALS ARE PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 33 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 34 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 35 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR ITS 36 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 37 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 38 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 39 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 40 | OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR TORT (INCLUDING 41 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THESE 42 | MATERIALS, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 43 | 44 | File Name: cl_va_api_media_sharing_intel.h 45 | 46 | Abstract: 47 | 48 | Notes: 49 | 50 | \*****************************************************************************/ 51 | 52 | 53 | #ifndef __OPENCL_CL_VA_API_MEDIA_SHARING_INTEL_H 54 | #define __OPENCL_CL_VA_API_MEDIA_SHARING_INTEL_H 55 | 56 | #include 57 | #include 58 | #include 59 | 60 | #ifdef __cplusplus 61 | extern "C" { 62 | #endif 63 | 64 | /****************************************** 65 | * cl_intel_va_api_media_sharing extension * 66 | *******************************************/ 67 | 68 | #define cl_intel_va_api_media_sharing 1 69 | 70 | /* error codes */ 71 | #define CL_INVALID_VA_API_MEDIA_ADAPTER_INTEL -1098 72 | #define CL_INVALID_VA_API_MEDIA_SURFACE_INTEL -1099 73 | #define CL_VA_API_MEDIA_SURFACE_ALREADY_ACQUIRED_INTEL -1100 74 | #define CL_VA_API_MEDIA_SURFACE_NOT_ACQUIRED_INTEL -1101 75 | 76 | /* cl_va_api_device_source_intel */ 77 | #define CL_VA_API_DISPLAY_INTEL 0x4094 78 | 79 | /* cl_va_api_device_set_intel */ 80 | #define CL_PREFERRED_DEVICES_FOR_VA_API_INTEL 0x4095 81 | #define CL_ALL_DEVICES_FOR_VA_API_INTEL 0x4096 82 | 83 | /* cl_context_info */ 84 | #define CL_CONTEXT_VA_API_DISPLAY_INTEL 0x4097 85 | 86 | /* cl_mem_info */ 87 | #define CL_MEM_VA_API_MEDIA_SURFACE_INTEL 0x4098 88 | 89 | /* cl_image_info */ 90 | #define CL_IMAGE_VA_API_PLANE_INTEL 0x4099 91 | 92 | /* cl_command_type */ 93 | #define CL_COMMAND_ACQUIRE_VA_API_MEDIA_SURFACES_INTEL 0x409A 94 | #define CL_COMMAND_RELEASE_VA_API_MEDIA_SURFACES_INTEL 0x409B 95 | 96 | typedef cl_uint cl_va_api_device_source_intel; 97 | typedef cl_uint cl_va_api_device_set_intel; 98 | 99 | extern CL_API_ENTRY cl_int CL_API_CALL 100 | clGetDeviceIDsFromVA_APIMediaAdapterINTEL( 101 | cl_platform_id /* platform */, 102 | cl_va_api_device_source_intel /* media_adapter_type */, 103 | void* /* media_adapter */, 104 | cl_va_api_device_set_intel /* media_adapter_set */, 105 | cl_uint /* num_entries */, 106 | cl_device_id* /* devices */, 107 | cl_uint* /* num_devices */) CL_EXT_SUFFIX__VERSION_1_2; 108 | 109 | typedef CL_API_ENTRY cl_int (CL_API_CALL * clGetDeviceIDsFromVA_APIMediaAdapterINTEL_fn)( 110 | cl_platform_id /* platform */, 111 | cl_va_api_device_source_intel /* media_adapter_type */, 112 | void* /* media_adapter */, 113 | cl_va_api_device_set_intel /* media_adapter_set */, 114 | cl_uint /* num_entries */, 115 | cl_device_id* /* devices */, 116 | cl_uint* /* num_devices */) CL_EXT_SUFFIX__VERSION_1_2; 117 | 118 | extern CL_API_ENTRY cl_mem CL_API_CALL 119 | clCreateFromVA_APIMediaSurfaceINTEL( 120 | cl_context /* context */, 121 | cl_mem_flags /* flags */, 122 | VASurfaceID* /* surface */, 123 | cl_uint /* plane */, 124 | cl_int* /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_2; 125 | 126 | typedef CL_API_ENTRY cl_mem (CL_API_CALL * clCreateFromVA_APIMediaSurfaceINTEL_fn)( 127 | cl_context /* context */, 128 | cl_mem_flags /* flags */, 129 | VASurfaceID* /* surface */, 130 | cl_uint /* plane */, 131 | cl_int* /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_2; 132 | 133 | extern CL_API_ENTRY cl_int CL_API_CALL 134 | clEnqueueAcquireVA_APIMediaSurfacesINTEL( 135 | cl_command_queue /* command_queue */, 136 | cl_uint /* num_objects */, 137 | const cl_mem* /* mem_objects */, 138 | cl_uint /* num_events_in_wait_list */, 139 | const cl_event* /* event_wait_list */, 140 | cl_event* /* event */) CL_EXT_SUFFIX__VERSION_1_2; 141 | 142 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireVA_APIMediaSurfacesINTEL_fn)( 143 | cl_command_queue /* command_queue */, 144 | cl_uint /* num_objects */, 145 | const cl_mem* /* mem_objects */, 146 | cl_uint /* num_events_in_wait_list */, 147 | const cl_event* /* event_wait_list */, 148 | cl_event* /* event */) CL_EXT_SUFFIX__VERSION_1_2; 149 | 150 | extern CL_API_ENTRY cl_int CL_API_CALL 151 | clEnqueueReleaseVA_APIMediaSurfacesINTEL( 152 | cl_command_queue /* command_queue */, 153 | cl_uint /* num_objects */, 154 | const cl_mem* /* mem_objects */, 155 | cl_uint /* num_events_in_wait_list */, 156 | const cl_event* /* event_wait_list */, 157 | cl_event* /* event */) CL_EXT_SUFFIX__VERSION_1_2; 158 | 159 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseVA_APIMediaSurfacesINTEL_fn)( 160 | cl_command_queue /* command_queue */, 161 | cl_uint /* num_objects */, 162 | const cl_mem* /* mem_objects */, 163 | cl_uint /* num_events_in_wait_list */, 164 | const cl_event* /* event_wait_list */, 165 | cl_event* /* event */) CL_EXT_SUFFIX__VERSION_1_2; 166 | 167 | #ifdef __cplusplus 168 | } 169 | #endif 170 | 171 | #endif /* __OPENCL_CL_VA_API_MEDIA_SHARING_INTEL_H */ 172 | 173 | -------------------------------------------------------------------------------- /OpenCLGaussian/opencl/mtk/opencl210/include/CL/cl_version.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2018 The Khronos Group Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and/or associated documentation files (the 6 | * "Materials"), to deal in the Materials without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Materials, and to 9 | * permit persons to whom the Materials are furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Materials. 14 | * 15 | * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS 16 | * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS 17 | * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT 18 | * https://www.khronos.org/registry/ 19 | * 20 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 27 | ******************************************************************************/ 28 | 29 | #ifndef __CL_VERSION_H 30 | #define __CL_VERSION_H 31 | 32 | /* Detect which version to target */ 33 | #if !defined(CL_TARGET_OPENCL_VERSION) 34 | #pragma message("cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 220 (OpenCL 2.2)") 35 | #define CL_TARGET_OPENCL_VERSION 220 36 | #endif 37 | #if CL_TARGET_OPENCL_VERSION != 100 && \ 38 | CL_TARGET_OPENCL_VERSION != 110 && \ 39 | CL_TARGET_OPENCL_VERSION != 120 && \ 40 | CL_TARGET_OPENCL_VERSION != 200 && \ 41 | CL_TARGET_OPENCL_VERSION != 210 && \ 42 | CL_TARGET_OPENCL_VERSION != 220 43 | #pragma message("cl_version: CL_TARGET_OPENCL_VERSION is not a valid value (100, 110, 120, 200, 210, 220). Defaulting to 220 (OpenCL 2.2)") 44 | #undef CL_TARGET_OPENCL_VERSION 45 | #define CL_TARGET_OPENCL_VERSION 220 46 | #endif 47 | 48 | 49 | /* OpenCL Version */ 50 | #if CL_TARGET_OPENCL_VERSION >= 220 && !defined(CL_VERSION_2_2) 51 | #define CL_VERSION_2_2 1 52 | #endif 53 | #if CL_TARGET_OPENCL_VERSION >= 210 && !defined(CL_VERSION_2_1) 54 | #define CL_VERSION_2_1 1 55 | #endif 56 | #if CL_TARGET_OPENCL_VERSION >= 200 && !defined(CL_VERSION_2_0) 57 | #define CL_VERSION_2_0 1 58 | #endif 59 | #if CL_TARGET_OPENCL_VERSION >= 120 && !defined(CL_VERSION_1_2) 60 | #define CL_VERSION_1_2 1 61 | #endif 62 | #if CL_TARGET_OPENCL_VERSION >= 110 && !defined(CL_VERSION_1_1) 63 | #define CL_VERSION_1_1 1 64 | #endif 65 | #if CL_TARGET_OPENCL_VERSION >= 100 && !defined(CL_VERSION_1_0) 66 | #define CL_VERSION_1_0 1 67 | #endif 68 | 69 | /* Allow deprecated APIs for older OpenCL versions. */ 70 | #if CL_TARGET_OPENCL_VERSION <= 210 && !defined(CL_USE_DEPRECATED_OPENCL_2_1_APIS) 71 | #define CL_USE_DEPRECATED_OPENCL_2_1_APIS 72 | #endif 73 | #if CL_TARGET_OPENCL_VERSION <= 200 && !defined(CL_USE_DEPRECATED_OPENCL_2_0_APIS) 74 | #define CL_USE_DEPRECATED_OPENCL_2_0_APIS 75 | #endif 76 | #if CL_TARGET_OPENCL_VERSION <= 120 && !defined(CL_USE_DEPRECATED_OPENCL_1_2_APIS) 77 | #define CL_USE_DEPRECATED_OPENCL_1_2_APIS 78 | #endif 79 | #if CL_TARGET_OPENCL_VERSION <= 110 && !defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) 80 | #define CL_USE_DEPRECATED_OPENCL_1_1_APIS 81 | #endif 82 | #if CL_TARGET_OPENCL_VERSION <= 100 && !defined(CL_USE_DEPRECATED_OPENCL_1_0_APIS) 83 | #define CL_USE_DEPRECATED_OPENCL_1_0_APIS 84 | #endif 85 | 86 | #endif /* __CL_VERSION_H */ 87 | -------------------------------------------------------------------------------- /OpenCLGaussian/opencl/mtk/opencl210/include/CL/opencl.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2008-2015 The Khronos Group Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and/or associated documentation files (the 6 | * "Materials"), to deal in the Materials without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Materials, and to 9 | * permit persons to whom the Materials are furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Materials. 14 | * 15 | * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS 16 | * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS 17 | * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT 18 | * https://www.khronos.org/registry/ 19 | * 20 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 27 | ******************************************************************************/ 28 | 29 | /* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */ 30 | 31 | #ifndef __OPENCL_H 32 | #define __OPENCL_H 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | #ifdef __APPLE__ 39 | 40 | #include 41 | #include 42 | #include 43 | #include 44 | 45 | #else 46 | 47 | #include 48 | #include 49 | #include 50 | #include 51 | 52 | #endif 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif /* __OPENCL_H */ 59 | 60 | -------------------------------------------------------------------------------- /OpenCLGaussian/opencl/mtk/opencl210/lib/libOpenCL.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mobile-algorithm-optimization/guide/0a10dcca06dac53a856cf0b6bccf431d6f5282ba/OpenCLGaussian/opencl/mtk/opencl210/lib/libOpenCL.so -------------------------------------------------------------------------------- /OpenCLGaussian/opencl/mtk/opencl210/lib64/libOpenCL.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mobile-algorithm-optimization/guide/0a10dcca06dac53a856cf0b6bccf431d6f5282ba/OpenCLGaussian/opencl/mtk/opencl210/lib64/libOpenCL.so -------------------------------------------------------------------------------- /OpenCLGaussian/opencl/qcom/opencl200/include/CL/cl_egl.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2008-2015 The Khronos Group Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and/or associated documentation files (the 6 | * "Materials"), to deal in the Materials without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Materials, and to 9 | * permit persons to whom the Materials are furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Materials. 14 | * 15 | * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS 16 | * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS 17 | * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT 18 | * https://www.khronos.org/registry/ 19 | * 20 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 27 | ******************************************************************************/ 28 | 29 | #ifndef __OPENCL_CL_EGL_H 30 | #define __OPENCL_CL_EGL_H 31 | 32 | #ifdef __APPLE__ 33 | 34 | #else 35 | #include 36 | #endif 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | 43 | /* Command type for events created with clEnqueueAcquireEGLObjectsKHR */ 44 | #define CL_COMMAND_EGL_FENCE_SYNC_OBJECT_KHR 0x202F 45 | #define CL_COMMAND_ACQUIRE_EGL_OBJECTS_KHR 0x202D 46 | #define CL_COMMAND_RELEASE_EGL_OBJECTS_KHR 0x202E 47 | 48 | /* Error type for clCreateFromEGLImageKHR */ 49 | #define CL_INVALID_EGL_OBJECT_KHR -1093 50 | #define CL_EGL_RESOURCE_NOT_ACQUIRED_KHR -1092 51 | 52 | /* CLeglImageKHR is an opaque handle to an EGLImage */ 53 | typedef void* CLeglImageKHR; 54 | 55 | /* CLeglDisplayKHR is an opaque handle to an EGLDisplay */ 56 | typedef void* CLeglDisplayKHR; 57 | 58 | /* CLeglSyncKHR is an opaque handle to an EGLSync object */ 59 | typedef void* CLeglSyncKHR; 60 | 61 | /* properties passed to clCreateFromEGLImageKHR */ 62 | typedef intptr_t cl_egl_image_properties_khr; 63 | 64 | 65 | #define cl_khr_egl_image 1 66 | 67 | extern CL_API_ENTRY cl_mem CL_API_CALL 68 | clCreateFromEGLImageKHR(cl_context /* context */, 69 | CLeglDisplayKHR /* egldisplay */, 70 | CLeglImageKHR /* eglimage */, 71 | cl_mem_flags /* flags */, 72 | const cl_egl_image_properties_khr * /* properties */, 73 | cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; 74 | 75 | typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromEGLImageKHR_fn)( 76 | cl_context context, 77 | CLeglDisplayKHR egldisplay, 78 | CLeglImageKHR eglimage, 79 | cl_mem_flags flags, 80 | const cl_egl_image_properties_khr * properties, 81 | cl_int * errcode_ret); 82 | 83 | 84 | extern CL_API_ENTRY cl_int CL_API_CALL 85 | clEnqueueAcquireEGLObjectsKHR(cl_command_queue /* command_queue */, 86 | cl_uint /* num_objects */, 87 | const cl_mem * /* mem_objects */, 88 | cl_uint /* num_events_in_wait_list */, 89 | const cl_event * /* event_wait_list */, 90 | cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; 91 | 92 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireEGLObjectsKHR_fn)( 93 | cl_command_queue command_queue, 94 | cl_uint num_objects, 95 | const cl_mem * mem_objects, 96 | cl_uint num_events_in_wait_list, 97 | const cl_event * event_wait_list, 98 | cl_event * event); 99 | 100 | 101 | extern CL_API_ENTRY cl_int CL_API_CALL 102 | clEnqueueReleaseEGLObjectsKHR(cl_command_queue /* command_queue */, 103 | cl_uint /* num_objects */, 104 | const cl_mem * /* mem_objects */, 105 | cl_uint /* num_events_in_wait_list */, 106 | const cl_event * /* event_wait_list */, 107 | cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; 108 | 109 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseEGLObjectsKHR_fn)( 110 | cl_command_queue command_queue, 111 | cl_uint num_objects, 112 | const cl_mem * mem_objects, 113 | cl_uint num_events_in_wait_list, 114 | const cl_event * event_wait_list, 115 | cl_event * event); 116 | 117 | 118 | #define cl_khr_egl_event 1 119 | 120 | extern CL_API_ENTRY cl_event CL_API_CALL 121 | clCreateEventFromEGLSyncKHR(cl_context /* context */, 122 | CLeglSyncKHR /* sync */, 123 | CLeglDisplayKHR /* display */, 124 | cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; 125 | 126 | typedef CL_API_ENTRY cl_event (CL_API_CALL *clCreateEventFromEGLSyncKHR_fn)( 127 | cl_context context, 128 | CLeglSyncKHR sync, 129 | CLeglDisplayKHR display, 130 | cl_int * errcode_ret); 131 | 132 | #ifdef __cplusplus 133 | } 134 | #endif 135 | 136 | #endif /* __OPENCL_CL_EGL_H */ 137 | -------------------------------------------------------------------------------- /OpenCLGaussian/opencl/qcom/opencl200/include/CL/cl_gl.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * Copyright (c) 2008-2015 The Khronos Group Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and/or associated documentation files (the 6 | * "Materials"), to deal in the Materials without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Materials, and to 9 | * permit persons to whom the Materials are furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Materials. 14 | * 15 | * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS 16 | * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS 17 | * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT 18 | * https://www.khronos.org/registry/ 19 | * 20 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 27 | **********************************************************************************/ 28 | 29 | #ifndef __OPENCL_CL_GL_H 30 | #define __OPENCL_CL_GL_H 31 | 32 | #ifdef __APPLE__ 33 | #include 34 | #else 35 | #include 36 | #endif 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | typedef cl_uint cl_gl_object_type; 43 | typedef cl_uint cl_gl_texture_info; 44 | typedef cl_uint cl_gl_platform_info; 45 | typedef struct __GLsync *cl_GLsync; 46 | 47 | /* cl_gl_object_type = 0x2000 - 0x200F enum values are currently taken */ 48 | #define CL_GL_OBJECT_BUFFER 0x2000 49 | #define CL_GL_OBJECT_TEXTURE2D 0x2001 50 | #define CL_GL_OBJECT_TEXTURE3D 0x2002 51 | #define CL_GL_OBJECT_RENDERBUFFER 0x2003 52 | #define CL_GL_OBJECT_TEXTURE2D_ARRAY 0x200E 53 | #define CL_GL_OBJECT_TEXTURE1D 0x200F 54 | #define CL_GL_OBJECT_TEXTURE1D_ARRAY 0x2010 55 | #define CL_GL_OBJECT_TEXTURE_BUFFER 0x2011 56 | 57 | /* cl_gl_texture_info */ 58 | #define CL_GL_TEXTURE_TARGET 0x2004 59 | #define CL_GL_MIPMAP_LEVEL 0x2005 60 | #define CL_GL_NUM_SAMPLES 0x2012 61 | 62 | 63 | extern CL_API_ENTRY cl_mem CL_API_CALL 64 | clCreateFromGLBuffer(cl_context /* context */, 65 | cl_mem_flags /* flags */, 66 | cl_GLuint /* bufobj */, 67 | int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; 68 | 69 | extern CL_API_ENTRY cl_mem CL_API_CALL 70 | clCreateFromGLTexture(cl_context /* context */, 71 | cl_mem_flags /* flags */, 72 | cl_GLenum /* target */, 73 | cl_GLint /* miplevel */, 74 | cl_GLuint /* texture */, 75 | cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_2; 76 | 77 | extern CL_API_ENTRY cl_mem CL_API_CALL 78 | clCreateFromGLRenderbuffer(cl_context /* context */, 79 | cl_mem_flags /* flags */, 80 | cl_GLuint /* renderbuffer */, 81 | cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; 82 | 83 | extern CL_API_ENTRY cl_int CL_API_CALL 84 | clGetGLObjectInfo(cl_mem /* memobj */, 85 | cl_gl_object_type * /* gl_object_type */, 86 | cl_GLuint * /* gl_object_name */) CL_API_SUFFIX__VERSION_1_0; 87 | 88 | extern CL_API_ENTRY cl_int CL_API_CALL 89 | clGetGLTextureInfo(cl_mem /* memobj */, 90 | cl_gl_texture_info /* param_name */, 91 | size_t /* param_value_size */, 92 | void * /* param_value */, 93 | size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; 94 | 95 | extern CL_API_ENTRY cl_int CL_API_CALL 96 | clEnqueueAcquireGLObjects(cl_command_queue /* command_queue */, 97 | cl_uint /* num_objects */, 98 | const cl_mem * /* mem_objects */, 99 | cl_uint /* num_events_in_wait_list */, 100 | const cl_event * /* event_wait_list */, 101 | cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; 102 | 103 | extern CL_API_ENTRY cl_int CL_API_CALL 104 | clEnqueueReleaseGLObjects(cl_command_queue /* command_queue */, 105 | cl_uint /* num_objects */, 106 | const cl_mem * /* mem_objects */, 107 | cl_uint /* num_events_in_wait_list */, 108 | const cl_event * /* event_wait_list */, 109 | cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; 110 | 111 | 112 | /* Deprecated OpenCL 1.1 APIs */ 113 | extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL 114 | clCreateFromGLTexture2D(cl_context /* context */, 115 | cl_mem_flags /* flags */, 116 | cl_GLenum /* target */, 117 | cl_GLint /* miplevel */, 118 | cl_GLuint /* texture */, 119 | cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED; 120 | 121 | extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL 122 | clCreateFromGLTexture3D(cl_context /* context */, 123 | cl_mem_flags /* flags */, 124 | cl_GLenum /* target */, 125 | cl_GLint /* miplevel */, 126 | cl_GLuint /* texture */, 127 | cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED; 128 | 129 | /* cl_khr_gl_sharing extension */ 130 | 131 | #define cl_khr_gl_sharing 1 132 | 133 | typedef cl_uint cl_gl_context_info; 134 | 135 | /* Additional Error Codes */ 136 | #define CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR -1000 137 | 138 | /* cl_gl_context_info */ 139 | #define CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR 0x2006 140 | #define CL_DEVICES_FOR_GL_CONTEXT_KHR 0x2007 141 | 142 | /* Additional cl_context_properties */ 143 | #define CL_GL_CONTEXT_KHR 0x2008 144 | #define CL_EGL_DISPLAY_KHR 0x2009 145 | #define CL_GLX_DISPLAY_KHR 0x200A 146 | #define CL_WGL_HDC_KHR 0x200B 147 | #define CL_CGL_SHAREGROUP_KHR 0x200C 148 | 149 | extern CL_API_ENTRY cl_int CL_API_CALL 150 | clGetGLContextInfoKHR(const cl_context_properties * /* properties */, 151 | cl_gl_context_info /* param_name */, 152 | size_t /* param_value_size */, 153 | void * /* param_value */, 154 | size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; 155 | 156 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetGLContextInfoKHR_fn)( 157 | const cl_context_properties * properties, 158 | cl_gl_context_info param_name, 159 | size_t param_value_size, 160 | void * param_value, 161 | size_t * param_value_size_ret); 162 | 163 | #ifdef __cplusplus 164 | } 165 | #endif 166 | 167 | #endif /* __OPENCL_CL_GL_H */ 168 | -------------------------------------------------------------------------------- /OpenCLGaussian/opencl/qcom/opencl200/include/CL/cl_gl_ext.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * Copyright (c) 2008-2015 The Khronos Group Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and/or associated documentation files (the 6 | * "Materials"), to deal in the Materials without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Materials, and to 9 | * permit persons to whom the Materials are furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Materials. 14 | * 15 | * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS 16 | * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS 17 | * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT 18 | * https://www.khronos.org/registry/ 19 | * 20 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 27 | **********************************************************************************/ 28 | 29 | /* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */ 30 | 31 | /* cl_gl_ext.h contains vendor (non-KHR) OpenCL extensions which have */ 32 | /* OpenGL dependencies. */ 33 | 34 | #ifndef __OPENCL_CL_GL_EXT_H 35 | #define __OPENCL_CL_GL_EXT_H 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | #ifdef __APPLE__ 42 | #include 43 | #else 44 | #include 45 | #endif 46 | 47 | /* 48 | * For each extension, follow this template 49 | * cl_VEN_extname extension */ 50 | /* #define cl_VEN_extname 1 51 | * ... define new types, if any 52 | * ... define new tokens, if any 53 | * ... define new APIs, if any 54 | * 55 | * If you need GLtypes here, mirror them with a cl_GLtype, rather than including a GL header 56 | * This allows us to avoid having to decide whether to include GL headers or GLES here. 57 | */ 58 | 59 | /* 60 | * cl_khr_gl_event extension 61 | * See section 9.9 in the OpenCL 1.1 spec for more information 62 | */ 63 | #define CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR 0x200D 64 | 65 | extern CL_API_ENTRY cl_event CL_API_CALL 66 | clCreateEventFromGLsyncKHR(cl_context /* context */, 67 | cl_GLsync /* cl_GLsync */, 68 | cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1; 69 | 70 | #ifdef __cplusplus 71 | } 72 | #endif 73 | 74 | #endif /* __OPENCL_CL_GL_EXT_H */ 75 | -------------------------------------------------------------------------------- /OpenCLGaussian/opencl/qcom/opencl200/include/CL/opencl.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2008-2015 The Khronos Group Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and/or associated documentation files (the 6 | * "Materials"), to deal in the Materials without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Materials, and to 9 | * permit persons to whom the Materials are furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Materials. 14 | * 15 | * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS 16 | * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS 17 | * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT 18 | * https://www.khronos.org/registry/ 19 | * 20 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 27 | ******************************************************************************/ 28 | 29 | /* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */ 30 | 31 | #ifndef __OPENCL_H 32 | #define __OPENCL_H 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | #ifdef __APPLE__ 39 | 40 | #include 41 | #include 42 | #include 43 | #include 44 | 45 | #else 46 | 47 | #include 48 | #include 49 | #include 50 | #include 51 | 52 | #endif 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif /* __OPENCL_H */ 59 | 60 | -------------------------------------------------------------------------------- /OpenCLGaussian/opencl/qcom/opencl200/lib/libOpenCL.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mobile-algorithm-optimization/guide/0a10dcca06dac53a856cf0b6bccf431d6f5282ba/OpenCLGaussian/opencl/qcom/opencl200/lib/libOpenCL.so -------------------------------------------------------------------------------- /OpenCLGaussian/opencl/qcom/opencl200/lib64/libOpenCL.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mobile-algorithm-optimization/guide/0a10dcca06dac53a856cf0b6bccf431d6f5282ba/OpenCLGaussian/opencl/qcom/opencl200/lib64/libOpenCL.so -------------------------------------------------------------------------------- /OpenCLGaussian/qcom_adbshell.sh: -------------------------------------------------------------------------------- 1 | cd /data/local/Gaussian/bin/ 2 | export LD_LIBRARY_PATH=${pwd}:/vendor/lib64 3 | ./main 4 | -------------------------------------------------------------------------------- /OpenCLGaussian/qcom_test.sh: -------------------------------------------------------------------------------- 1 | cd build_android 2 | rm -r * 3 | cmake -DANDROID=android -DQCOM=qcom -DCMAKE_BUILD_TYPE=Release .. 4 | make install 5 | adb push install/bin/* /data/local/Gaussian/bin/ 6 | adb shell < ../qcom_adbshell.sh 7 | -------------------------------------------------------------------------------- /OpenCLTranspose/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.0.0) 2 | 3 | ################################### NDK Toolchain ######################################## 4 | if (ANDROID) 5 | # set command lines for Android and neon 6 | set(NDK_PATH $ENV{NDK_PATH}) 7 | set(CMAKE_TOOLCHAIN_FILE ${NDK_PATH}/build/cmake/android.toolchain.cmake) 8 | set(ANDROID_ABI "arm64-v8a") 9 | set(ANDROID_ARM_NEON ON) 10 | set(ANDROID_PLATFORM android-23) 11 | 12 | message(STATUS "NDK_PATH = ${NDK_PATH}") 13 | message(STATUS "CMAKE_TOOLCHAIN_FILE = ${CMAKE_TOOLCHAIN_FILE}") 14 | message(STATUS "ANDROID_ABI = ${ANDROID_ABI}") 15 | message(STATUS "ANDROID_ARM_NEON = ${ANDROID_ARM_NEON}") 16 | message(STATUS "ANDROID_PLATFORM = ${ANDROID_PLATFORM}") 17 | endif() 18 | 19 | # toolchain file 20 | if (CMAKE_TOOLCHAIN_FILE) 21 | set(LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_BINARY_DIR} CACHE PATH "root for library output, set this to change where android libs are compiled to") 22 | message("LIBRARY_OUTPUT_PATH_ROOT = ${LIBRARY_OUTPUT_PATH_ROOT}") 23 | get_filename_component(CMAKE_TOOLCHAIN_FILE_NAME ${CMAKE_TOOLCHAIN_FILE} NAME) 24 | find_file(CMAKE_TOOLCHAIN_FILE ${CMAKE_TOOLCHAIN_FILE_NAME} PATHS ${CMAKE_SOURCE_DIR} NO_DEFAULT_PATH) 25 | message(STATUS "CMAKE_TOOLCHAIN_FILE = ${CMAKE_TOOLCHAIN_FILE}") 26 | endif() 27 | 28 | 29 | ################################### Build Type Default = debug ######################################## 30 | 31 | # set build type 32 | if(NOT DEFINED CMAKE_BUILD_TYPE) 33 | set(CMAKE_BUILD_TYPE "debug" CACHE STRING "debug build type" FORCE) 34 | endif() 35 | 36 | if(CMAKE_BUILD_TYPE MATCHES "(Release|RELEASE|release)") 37 | add_definitions(-DRELEASE) 38 | else() 39 | add_definitions(-DDEBUG) 40 | endif() 41 | 42 | # C/CXX FLAGS 43 | 44 | add_definitions(-Wall -Wextra) 45 | add_definitions(-fPIC) 46 | 47 | if (ANDROID) 48 | add_definitions(-Ofast) 49 | add_definitions(-ffast-math) 50 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -frtti -fno-exceptions") 51 | add_definitions(-DANDROID) 52 | add_definitions(-DQCOM) 53 | # extra libs and use gold link for android 54 | link_libraries("log") 55 | link_libraries("-fuse-ld=gold") 56 | endif() 57 | 58 | # set install 59 | if(NOT DEFINED CMAKE_INSTALL_PREFIX) 60 | set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Installation Directory") 61 | endif() 62 | message(STATUS "CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}") 63 | 64 | #########################Find OpenCL###################################### 65 | if (QCOM) 66 | set(OpenCL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/opencl/qcom/opencl200/include/") 67 | set(OpenCL_SHARED_LIB "${CMAKE_CURRENT_SOURCE_DIR}/opencl/qcom/opencl200/lib64/libOpenCL.so") 68 | add_definitions(-DQCOM_DEVICE) 69 | 70 | include_directories(${OpenCL_DIR}) 71 | link_libraries( ${OpenCL_SHARED_LIB}) 72 | message(STATUS "QCOMM opencl set") 73 | 74 | add_definitions(-DKERNEL_PROFILING) 75 | endif() 76 | if (MTK) 77 | set(OpenCL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/opencl/mtk/opencl210/include/") 78 | set(OpenCL_SHARED_LIB "${CMAKE_CURRENT_SOURCE_DIR}/opencl/mtk/opencl210/lib64/libOpenCL.so") 79 | add_definitions(-DMTK_DEVICE) 80 | add_definitions(-DCL_TARGET_OPENCL_VERSION=210) 81 | 82 | include_directories(${OpenCL_DIR}) 83 | link_libraries( ${OpenCL_SHARED_LIB}) 84 | message(STATUS "MTK opencl set") 85 | endif() 86 | ############################################################### 87 | 88 | project(main) 89 | add_executable(main ./main.cpp) 90 | install(TARGETS main DESTINATION bin) 91 | install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/kerneltest.cl" DESTINATION bin) -------------------------------------------------------------------------------- /OpenCLTranspose/Readme.md: -------------------------------------------------------------------------------- 1 | # 移动端算法优化 - GPU 优化技术-OpenCL 运行时 API 介绍 2 | 3 | ### 运行说明 4 | 本代码在高通865平台和MTK820平台编译运行通过。编译运行请按照以下步骤: 5 | 1. 使用adb devices和adb shell检查手机连接状况。 6 | 2. 设置环境变量${NDK_PATH}为NDK根目录。 7 | 3. 修改qcom/mtk_test.sh和qcom/mtk_adbshell.sh中可执行文件和cl文件保存的路径。 8 | 4. Readme当前目录下,高通平台运行./qcom_test.sh,MTK平台运行./mtk_test.sh。 9 | 10 | ### 高通骁龙865运行示例 11 | ```text 12 | Kernel TransposeKernel max workgroup size=1024 13 | Kernel TransposeKernel perferred workgroup size multiple=128 14 | Matrix Width =4096 Height=4096 15 | Cpu Transpose consume average time: 142126 us 16 | global_work_size=(4096,4096) 17 | local_work_size=(32,32) 18 | OpenCL Transpose consume average time: 11620 us 19 | A and B match! 20 | ``` 21 | 22 | ### MTK天玑820运行示例 23 | ```test 24 | Kernel TransposeKernel max workgroup size=512 25 | Kernel TransposeKernel perferred workgroup size multiple=16 26 | Matrix Width =4096 Height=4096 27 | Cpu Transpose consume average time: 426811 us 28 | global_work_size=(4096,4096) 29 | local_work_size=(16,16) 30 | OpenCL Transpose consume average time: 13208 us 31 | A and B match! 32 | ``` 33 | -------------------------------------------------------------------------------- /OpenCLTranspose/kerneltest.cl: -------------------------------------------------------------------------------- 1 | __kernel void TransposeKernel(__global uchar *src, __global uchar *dst, int width, int height) 2 | { 3 | uint g_idx = get_global_id(0); 4 | uint g_idy = get_global_id(1); 5 | if ((g_idx >= width) || (g_idy >= height)) 6 | return; 7 | dst[g_idx * height + g_idy] = src[g_idy * width + g_idx]; 8 | } 9 | -------------------------------------------------------------------------------- /OpenCLTranspose/mtk_adbshell.sh: -------------------------------------------------------------------------------- 1 | cd /data/local/Transpose/bin/ 2 | export LD_LIBRARY_PATH=$(pwd):/vendor/lib64/:/vendor/lib64/egl 3 | ./main -------------------------------------------------------------------------------- /OpenCLTranspose/mtk_test.sh: -------------------------------------------------------------------------------- 1 | cd build_android 2 | rm -r * 3 | cmake -DANDROID=android -DMTK=mtk -DCMAKE_BUILD_TYPE=Release .. 4 | make install 5 | adb push install/bin/* /data/local/Transpose/bin/ 6 | adb shell < ../mtk_adbshell.sh -------------------------------------------------------------------------------- /OpenCLTranspose/opencl/mtk/opencl210/include/CL/cl_d3d10.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * Copyright (c) 2008-2015 The Khronos Group Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and/or associated documentation files (the 6 | * "Materials"), to deal in the Materials without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Materials, and to 9 | * permit persons to whom the Materials are furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Materials. 14 | * 15 | * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS 16 | * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS 17 | * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT 18 | * https://www.khronos.org/registry/ 19 | * 20 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 27 | **********************************************************************************/ 28 | 29 | /* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */ 30 | 31 | #ifndef __OPENCL_CL_D3D10_H 32 | #define __OPENCL_CL_D3D10_H 33 | 34 | #include 35 | #include 36 | #include 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | /****************************************************************************** 43 | * cl_khr_d3d10_sharing */ 44 | #define cl_khr_d3d10_sharing 1 45 | 46 | typedef cl_uint cl_d3d10_device_source_khr; 47 | typedef cl_uint cl_d3d10_device_set_khr; 48 | 49 | /******************************************************************************/ 50 | 51 | /* Error Codes */ 52 | #define CL_INVALID_D3D10_DEVICE_KHR -1002 53 | #define CL_INVALID_D3D10_RESOURCE_KHR -1003 54 | #define CL_D3D10_RESOURCE_ALREADY_ACQUIRED_KHR -1004 55 | #define CL_D3D10_RESOURCE_NOT_ACQUIRED_KHR -1005 56 | 57 | /* cl_d3d10_device_source_nv */ 58 | #define CL_D3D10_DEVICE_KHR 0x4010 59 | #define CL_D3D10_DXGI_ADAPTER_KHR 0x4011 60 | 61 | /* cl_d3d10_device_set_nv */ 62 | #define CL_PREFERRED_DEVICES_FOR_D3D10_KHR 0x4012 63 | #define CL_ALL_DEVICES_FOR_D3D10_KHR 0x4013 64 | 65 | /* cl_context_info */ 66 | #define CL_CONTEXT_D3D10_DEVICE_KHR 0x4014 67 | #define CL_CONTEXT_D3D10_PREFER_SHARED_RESOURCES_KHR 0x402C 68 | 69 | /* cl_mem_info */ 70 | #define CL_MEM_D3D10_RESOURCE_KHR 0x4015 71 | 72 | /* cl_image_info */ 73 | #define CL_IMAGE_D3D10_SUBRESOURCE_KHR 0x4016 74 | 75 | /* cl_command_type */ 76 | #define CL_COMMAND_ACQUIRE_D3D10_OBJECTS_KHR 0x4017 77 | #define CL_COMMAND_RELEASE_D3D10_OBJECTS_KHR 0x4018 78 | 79 | /******************************************************************************/ 80 | 81 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D10KHR_fn)( 82 | cl_platform_id platform, 83 | cl_d3d10_device_source_khr d3d_device_source, 84 | void * d3d_object, 85 | cl_d3d10_device_set_khr d3d_device_set, 86 | cl_uint num_entries, 87 | cl_device_id * devices, 88 | cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_0; 89 | 90 | typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10BufferKHR_fn)( 91 | cl_context context, 92 | cl_mem_flags flags, 93 | ID3D10Buffer * resource, 94 | cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; 95 | 96 | typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture2DKHR_fn)( 97 | cl_context context, 98 | cl_mem_flags flags, 99 | ID3D10Texture2D * resource, 100 | UINT subresource, 101 | cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; 102 | 103 | typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture3DKHR_fn)( 104 | cl_context context, 105 | cl_mem_flags flags, 106 | ID3D10Texture3D * resource, 107 | UINT subresource, 108 | cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; 109 | 110 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D10ObjectsKHR_fn)( 111 | cl_command_queue command_queue, 112 | cl_uint num_objects, 113 | const cl_mem * mem_objects, 114 | cl_uint num_events_in_wait_list, 115 | const cl_event * event_wait_list, 116 | cl_event * event) CL_API_SUFFIX__VERSION_1_0; 117 | 118 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseD3D10ObjectsKHR_fn)( 119 | cl_command_queue command_queue, 120 | cl_uint num_objects, 121 | const cl_mem * mem_objects, 122 | cl_uint num_events_in_wait_list, 123 | const cl_event * event_wait_list, 124 | cl_event * event) CL_API_SUFFIX__VERSION_1_0; 125 | 126 | #ifdef __cplusplus 127 | } 128 | #endif 129 | 130 | #endif /* __OPENCL_CL_D3D10_H */ 131 | 132 | -------------------------------------------------------------------------------- /OpenCLTranspose/opencl/mtk/opencl210/include/CL/cl_d3d11.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * Copyright (c) 2008-2015 The Khronos Group Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and/or associated documentation files (the 6 | * "Materials"), to deal in the Materials without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Materials, and to 9 | * permit persons to whom the Materials are furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Materials. 14 | * 15 | * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS 16 | * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS 17 | * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT 18 | * https://www.khronos.org/registry/ 19 | * 20 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 27 | **********************************************************************************/ 28 | 29 | /* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */ 30 | 31 | #ifndef __OPENCL_CL_D3D11_H 32 | #define __OPENCL_CL_D3D11_H 33 | 34 | #include 35 | #include 36 | #include 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | /****************************************************************************** 43 | * cl_khr_d3d11_sharing */ 44 | #define cl_khr_d3d11_sharing 1 45 | 46 | typedef cl_uint cl_d3d11_device_source_khr; 47 | typedef cl_uint cl_d3d11_device_set_khr; 48 | 49 | /******************************************************************************/ 50 | 51 | /* Error Codes */ 52 | #define CL_INVALID_D3D11_DEVICE_KHR -1006 53 | #define CL_INVALID_D3D11_RESOURCE_KHR -1007 54 | #define CL_D3D11_RESOURCE_ALREADY_ACQUIRED_KHR -1008 55 | #define CL_D3D11_RESOURCE_NOT_ACQUIRED_KHR -1009 56 | 57 | /* cl_d3d11_device_source */ 58 | #define CL_D3D11_DEVICE_KHR 0x4019 59 | #define CL_D3D11_DXGI_ADAPTER_KHR 0x401A 60 | 61 | /* cl_d3d11_device_set */ 62 | #define CL_PREFERRED_DEVICES_FOR_D3D11_KHR 0x401B 63 | #define CL_ALL_DEVICES_FOR_D3D11_KHR 0x401C 64 | 65 | /* cl_context_info */ 66 | #define CL_CONTEXT_D3D11_DEVICE_KHR 0x401D 67 | #define CL_CONTEXT_D3D11_PREFER_SHARED_RESOURCES_KHR 0x402D 68 | 69 | /* cl_mem_info */ 70 | #define CL_MEM_D3D11_RESOURCE_KHR 0x401E 71 | 72 | /* cl_image_info */ 73 | #define CL_IMAGE_D3D11_SUBRESOURCE_KHR 0x401F 74 | 75 | /* cl_command_type */ 76 | #define CL_COMMAND_ACQUIRE_D3D11_OBJECTS_KHR 0x4020 77 | #define CL_COMMAND_RELEASE_D3D11_OBJECTS_KHR 0x4021 78 | 79 | /******************************************************************************/ 80 | 81 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D11KHR_fn)( 82 | cl_platform_id platform, 83 | cl_d3d11_device_source_khr d3d_device_source, 84 | void * d3d_object, 85 | cl_d3d11_device_set_khr d3d_device_set, 86 | cl_uint num_entries, 87 | cl_device_id * devices, 88 | cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_2; 89 | 90 | typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11BufferKHR_fn)( 91 | cl_context context, 92 | cl_mem_flags flags, 93 | ID3D11Buffer * resource, 94 | cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2; 95 | 96 | typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11Texture2DKHR_fn)( 97 | cl_context context, 98 | cl_mem_flags flags, 99 | ID3D11Texture2D * resource, 100 | UINT subresource, 101 | cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2; 102 | 103 | typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11Texture3DKHR_fn)( 104 | cl_context context, 105 | cl_mem_flags flags, 106 | ID3D11Texture3D * resource, 107 | UINT subresource, 108 | cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2; 109 | 110 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D11ObjectsKHR_fn)( 111 | cl_command_queue command_queue, 112 | cl_uint num_objects, 113 | const cl_mem * mem_objects, 114 | cl_uint num_events_in_wait_list, 115 | const cl_event * event_wait_list, 116 | cl_event * event) CL_API_SUFFIX__VERSION_1_2; 117 | 118 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseD3D11ObjectsKHR_fn)( 119 | cl_command_queue command_queue, 120 | cl_uint num_objects, 121 | const cl_mem * mem_objects, 122 | cl_uint num_events_in_wait_list, 123 | const cl_event * event_wait_list, 124 | cl_event * event) CL_API_SUFFIX__VERSION_1_2; 125 | 126 | #ifdef __cplusplus 127 | } 128 | #endif 129 | 130 | #endif /* __OPENCL_CL_D3D11_H */ 131 | 132 | -------------------------------------------------------------------------------- /OpenCLTranspose/opencl/mtk/opencl210/include/CL/cl_dx9_media_sharing.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * Copyright (c) 2008-2015 The Khronos Group Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and/or associated documentation files (the 6 | * "Materials"), to deal in the Materials without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Materials, and to 9 | * permit persons to whom the Materials are furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Materials. 14 | * 15 | * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS 16 | * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS 17 | * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT 18 | * https://www.khronos.org/registry/ 19 | * 20 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 27 | **********************************************************************************/ 28 | 29 | /* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */ 30 | 31 | #ifndef __OPENCL_CL_DX9_MEDIA_SHARING_H 32 | #define __OPENCL_CL_DX9_MEDIA_SHARING_H 33 | 34 | #include 35 | #include 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | /******************************************************************************/ 42 | /* cl_khr_dx9_media_sharing */ 43 | #define cl_khr_dx9_media_sharing 1 44 | 45 | typedef cl_uint cl_dx9_media_adapter_type_khr; 46 | typedef cl_uint cl_dx9_media_adapter_set_khr; 47 | 48 | #if defined(_WIN32) 49 | #include 50 | typedef struct _cl_dx9_surface_info_khr 51 | { 52 | IDirect3DSurface9 *resource; 53 | HANDLE shared_handle; 54 | } cl_dx9_surface_info_khr; 55 | #endif 56 | 57 | 58 | /******************************************************************************/ 59 | 60 | /* Error Codes */ 61 | #define CL_INVALID_DX9_MEDIA_ADAPTER_KHR -1010 62 | #define CL_INVALID_DX9_MEDIA_SURFACE_KHR -1011 63 | #define CL_DX9_MEDIA_SURFACE_ALREADY_ACQUIRED_KHR -1012 64 | #define CL_DX9_MEDIA_SURFACE_NOT_ACQUIRED_KHR -1013 65 | 66 | /* cl_media_adapter_type_khr */ 67 | #define CL_ADAPTER_D3D9_KHR 0x2020 68 | #define CL_ADAPTER_D3D9EX_KHR 0x2021 69 | #define CL_ADAPTER_DXVA_KHR 0x2022 70 | 71 | /* cl_media_adapter_set_khr */ 72 | #define CL_PREFERRED_DEVICES_FOR_DX9_MEDIA_ADAPTER_KHR 0x2023 73 | #define CL_ALL_DEVICES_FOR_DX9_MEDIA_ADAPTER_KHR 0x2024 74 | 75 | /* cl_context_info */ 76 | #define CL_CONTEXT_ADAPTER_D3D9_KHR 0x2025 77 | #define CL_CONTEXT_ADAPTER_D3D9EX_KHR 0x2026 78 | #define CL_CONTEXT_ADAPTER_DXVA_KHR 0x2027 79 | 80 | /* cl_mem_info */ 81 | #define CL_MEM_DX9_MEDIA_ADAPTER_TYPE_KHR 0x2028 82 | #define CL_MEM_DX9_MEDIA_SURFACE_INFO_KHR 0x2029 83 | 84 | /* cl_image_info */ 85 | #define CL_IMAGE_DX9_MEDIA_PLANE_KHR 0x202A 86 | 87 | /* cl_command_type */ 88 | #define CL_COMMAND_ACQUIRE_DX9_MEDIA_SURFACES_KHR 0x202B 89 | #define CL_COMMAND_RELEASE_DX9_MEDIA_SURFACES_KHR 0x202C 90 | 91 | /******************************************************************************/ 92 | 93 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromDX9MediaAdapterKHR_fn)( 94 | cl_platform_id platform, 95 | cl_uint num_media_adapters, 96 | cl_dx9_media_adapter_type_khr * media_adapter_type, 97 | void * media_adapters, 98 | cl_dx9_media_adapter_set_khr media_adapter_set, 99 | cl_uint num_entries, 100 | cl_device_id * devices, 101 | cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_2; 102 | 103 | typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromDX9MediaSurfaceKHR_fn)( 104 | cl_context context, 105 | cl_mem_flags flags, 106 | cl_dx9_media_adapter_type_khr adapter_type, 107 | void * surface_info, 108 | cl_uint plane, 109 | cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2; 110 | 111 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireDX9MediaSurfacesKHR_fn)( 112 | cl_command_queue command_queue, 113 | cl_uint num_objects, 114 | const cl_mem * mem_objects, 115 | cl_uint num_events_in_wait_list, 116 | const cl_event * event_wait_list, 117 | cl_event * event) CL_API_SUFFIX__VERSION_1_2; 118 | 119 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseDX9MediaSurfacesKHR_fn)( 120 | cl_command_queue command_queue, 121 | cl_uint num_objects, 122 | const cl_mem * mem_objects, 123 | cl_uint num_events_in_wait_list, 124 | const cl_event * event_wait_list, 125 | cl_event * event) CL_API_SUFFIX__VERSION_1_2; 126 | 127 | #ifdef __cplusplus 128 | } 129 | #endif 130 | 131 | #endif /* __OPENCL_CL_DX9_MEDIA_SHARING_H */ 132 | 133 | -------------------------------------------------------------------------------- /OpenCLTranspose/opencl/mtk/opencl210/include/CL/cl_egl.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2008-2015 The Khronos Group Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and/or associated documentation files (the 6 | * "Materials"), to deal in the Materials without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Materials, and to 9 | * permit persons to whom the Materials are furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Materials. 14 | * 15 | * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS 16 | * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS 17 | * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT 18 | * https://www.khronos.org/registry/ 19 | * 20 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 27 | ******************************************************************************/ 28 | 29 | #ifndef __OPENCL_CL_EGL_H 30 | #define __OPENCL_CL_EGL_H 31 | 32 | #ifdef __APPLE__ 33 | 34 | #else 35 | #include 36 | #endif 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | 43 | /* Command type for events created with clEnqueueAcquireEGLObjectsKHR */ 44 | #define CL_COMMAND_EGL_FENCE_SYNC_OBJECT_KHR 0x202F 45 | #define CL_COMMAND_ACQUIRE_EGL_OBJECTS_KHR 0x202D 46 | #define CL_COMMAND_RELEASE_EGL_OBJECTS_KHR 0x202E 47 | 48 | /* Error type for clCreateFromEGLImageKHR */ 49 | #define CL_INVALID_EGL_OBJECT_KHR -1093 50 | #define CL_EGL_RESOURCE_NOT_ACQUIRED_KHR -1092 51 | 52 | /* CLeglImageKHR is an opaque handle to an EGLImage */ 53 | typedef void* CLeglImageKHR; 54 | 55 | /* CLeglDisplayKHR is an opaque handle to an EGLDisplay */ 56 | typedef void* CLeglDisplayKHR; 57 | 58 | /* CLeglSyncKHR is an opaque handle to an EGLSync object */ 59 | typedef void* CLeglSyncKHR; 60 | 61 | /* properties passed to clCreateFromEGLImageKHR */ 62 | typedef intptr_t cl_egl_image_properties_khr; 63 | 64 | 65 | #define cl_khr_egl_image 1 66 | 67 | extern CL_API_ENTRY cl_mem CL_API_CALL 68 | clCreateFromEGLImageKHR(cl_context /* context */, 69 | CLeglDisplayKHR /* egldisplay */, 70 | CLeglImageKHR /* eglimage */, 71 | cl_mem_flags /* flags */, 72 | const cl_egl_image_properties_khr * /* properties */, 73 | cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; 74 | 75 | typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromEGLImageKHR_fn)( 76 | cl_context context, 77 | CLeglDisplayKHR egldisplay, 78 | CLeglImageKHR eglimage, 79 | cl_mem_flags flags, 80 | const cl_egl_image_properties_khr * properties, 81 | cl_int * errcode_ret); 82 | 83 | 84 | extern CL_API_ENTRY cl_int CL_API_CALL 85 | clEnqueueAcquireEGLObjectsKHR(cl_command_queue /* command_queue */, 86 | cl_uint /* num_objects */, 87 | const cl_mem * /* mem_objects */, 88 | cl_uint /* num_events_in_wait_list */, 89 | const cl_event * /* event_wait_list */, 90 | cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; 91 | 92 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireEGLObjectsKHR_fn)( 93 | cl_command_queue command_queue, 94 | cl_uint num_objects, 95 | const cl_mem * mem_objects, 96 | cl_uint num_events_in_wait_list, 97 | const cl_event * event_wait_list, 98 | cl_event * event); 99 | 100 | 101 | extern CL_API_ENTRY cl_int CL_API_CALL 102 | clEnqueueReleaseEGLObjectsKHR(cl_command_queue /* command_queue */, 103 | cl_uint /* num_objects */, 104 | const cl_mem * /* mem_objects */, 105 | cl_uint /* num_events_in_wait_list */, 106 | const cl_event * /* event_wait_list */, 107 | cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; 108 | 109 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseEGLObjectsKHR_fn)( 110 | cl_command_queue command_queue, 111 | cl_uint num_objects, 112 | const cl_mem * mem_objects, 113 | cl_uint num_events_in_wait_list, 114 | const cl_event * event_wait_list, 115 | cl_event * event); 116 | 117 | 118 | #define cl_khr_egl_event 1 119 | 120 | extern CL_API_ENTRY cl_event CL_API_CALL 121 | clCreateEventFromEGLSyncKHR(cl_context /* context */, 122 | CLeglSyncKHR /* sync */, 123 | CLeglDisplayKHR /* display */, 124 | cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; 125 | 126 | typedef CL_API_ENTRY cl_event (CL_API_CALL *clCreateEventFromEGLSyncKHR_fn)( 127 | cl_context context, 128 | CLeglSyncKHR sync, 129 | CLeglDisplayKHR display, 130 | cl_int * errcode_ret); 131 | 132 | #ifdef __cplusplus 133 | } 134 | #endif 135 | 136 | #endif /* __OPENCL_CL_EGL_H */ 137 | -------------------------------------------------------------------------------- /OpenCLTranspose/opencl/mtk/opencl210/include/CL/cl_gl.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * Copyright (c) 2008-2018 The Khronos Group Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and/or associated documentation files (the 6 | * "Materials"), to deal in the Materials without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Materials, and to 9 | * permit persons to whom the Materials are furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Materials. 14 | * 15 | * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS 16 | * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS 17 | * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT 18 | * https://www.khronos.org/registry/ 19 | * 20 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 27 | **********************************************************************************/ 28 | 29 | #ifndef __OPENCL_CL_GL_H 30 | #define __OPENCL_CL_GL_H 31 | 32 | #ifdef __APPLE__ 33 | #include 34 | #else 35 | #include 36 | #endif 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | typedef cl_uint cl_gl_object_type; 43 | typedef cl_uint cl_gl_texture_info; 44 | typedef cl_uint cl_gl_platform_info; 45 | typedef struct __GLsync *cl_GLsync; 46 | 47 | /* cl_gl_object_type = 0x2000 - 0x200F enum values are currently taken */ 48 | #define CL_GL_OBJECT_BUFFER 0x2000 49 | #define CL_GL_OBJECT_TEXTURE2D 0x2001 50 | #define CL_GL_OBJECT_TEXTURE3D 0x2002 51 | #define CL_GL_OBJECT_RENDERBUFFER 0x2003 52 | #ifdef CL_VERSION_1_2 53 | #define CL_GL_OBJECT_TEXTURE2D_ARRAY 0x200E 54 | #define CL_GL_OBJECT_TEXTURE1D 0x200F 55 | #define CL_GL_OBJECT_TEXTURE1D_ARRAY 0x2010 56 | #define CL_GL_OBJECT_TEXTURE_BUFFER 0x2011 57 | #endif 58 | 59 | /* cl_gl_texture_info */ 60 | #define CL_GL_TEXTURE_TARGET 0x2004 61 | #define CL_GL_MIPMAP_LEVEL 0x2005 62 | #ifdef CL_VERSION_1_2 63 | #define CL_GL_NUM_SAMPLES 0x2012 64 | #endif 65 | 66 | 67 | extern CL_API_ENTRY cl_mem CL_API_CALL 68 | clCreateFromGLBuffer(cl_context /* context */, 69 | cl_mem_flags /* flags */, 70 | cl_GLuint /* bufobj */, 71 | int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; 72 | 73 | #ifdef CL_VERSION_1_2 74 | 75 | extern CL_API_ENTRY cl_mem CL_API_CALL 76 | clCreateFromGLTexture(cl_context /* context */, 77 | cl_mem_flags /* flags */, 78 | cl_GLenum /* target */, 79 | cl_GLint /* miplevel */, 80 | cl_GLuint /* texture */, 81 | cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_2; 82 | 83 | #endif 84 | 85 | extern CL_API_ENTRY cl_mem CL_API_CALL 86 | clCreateFromGLRenderbuffer(cl_context /* context */, 87 | cl_mem_flags /* flags */, 88 | cl_GLuint /* renderbuffer */, 89 | cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; 90 | 91 | extern CL_API_ENTRY cl_int CL_API_CALL 92 | clGetGLObjectInfo(cl_mem /* memobj */, 93 | cl_gl_object_type * /* gl_object_type */, 94 | cl_GLuint * /* gl_object_name */) CL_API_SUFFIX__VERSION_1_0; 95 | 96 | extern CL_API_ENTRY cl_int CL_API_CALL 97 | clGetGLTextureInfo(cl_mem /* memobj */, 98 | cl_gl_texture_info /* param_name */, 99 | size_t /* param_value_size */, 100 | void * /* param_value */, 101 | size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; 102 | 103 | extern CL_API_ENTRY cl_int CL_API_CALL 104 | clEnqueueAcquireGLObjects(cl_command_queue /* command_queue */, 105 | cl_uint /* num_objects */, 106 | const cl_mem * /* mem_objects */, 107 | cl_uint /* num_events_in_wait_list */, 108 | const cl_event * /* event_wait_list */, 109 | cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; 110 | 111 | extern CL_API_ENTRY cl_int CL_API_CALL 112 | clEnqueueReleaseGLObjects(cl_command_queue /* command_queue */, 113 | cl_uint /* num_objects */, 114 | const cl_mem * /* mem_objects */, 115 | cl_uint /* num_events_in_wait_list */, 116 | const cl_event * /* event_wait_list */, 117 | cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; 118 | 119 | 120 | /* Deprecated OpenCL 1.1 APIs */ 121 | extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL 122 | clCreateFromGLTexture2D(cl_context /* context */, 123 | cl_mem_flags /* flags */, 124 | cl_GLenum /* target */, 125 | cl_GLint /* miplevel */, 126 | cl_GLuint /* texture */, 127 | cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED; 128 | 129 | extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL 130 | clCreateFromGLTexture3D(cl_context /* context */, 131 | cl_mem_flags /* flags */, 132 | cl_GLenum /* target */, 133 | cl_GLint /* miplevel */, 134 | cl_GLuint /* texture */, 135 | cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED; 136 | 137 | /* cl_khr_gl_sharing extension */ 138 | 139 | #define cl_khr_gl_sharing 1 140 | 141 | typedef cl_uint cl_gl_context_info; 142 | 143 | /* Additional Error Codes */ 144 | #define CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR -1000 145 | 146 | /* cl_gl_context_info */ 147 | #define CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR 0x2006 148 | #define CL_DEVICES_FOR_GL_CONTEXT_KHR 0x2007 149 | 150 | /* Additional cl_context_properties */ 151 | #define CL_GL_CONTEXT_KHR 0x2008 152 | #define CL_EGL_DISPLAY_KHR 0x2009 153 | #define CL_GLX_DISPLAY_KHR 0x200A 154 | #define CL_WGL_HDC_KHR 0x200B 155 | #define CL_CGL_SHAREGROUP_KHR 0x200C 156 | 157 | extern CL_API_ENTRY cl_int CL_API_CALL 158 | clGetGLContextInfoKHR(const cl_context_properties * /* properties */, 159 | cl_gl_context_info /* param_name */, 160 | size_t /* param_value_size */, 161 | void * /* param_value */, 162 | size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; 163 | 164 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetGLContextInfoKHR_fn)( 165 | const cl_context_properties * properties, 166 | cl_gl_context_info param_name, 167 | size_t param_value_size, 168 | void * param_value, 169 | size_t * param_value_size_ret); 170 | 171 | #ifdef __cplusplus 172 | } 173 | #endif 174 | 175 | #endif /* __OPENCL_CL_GL_H */ 176 | -------------------------------------------------------------------------------- /OpenCLTranspose/opencl/mtk/opencl210/include/CL/cl_gl_ext.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * Copyright (c) 2008-2015 The Khronos Group Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and/or associated documentation files (the 6 | * "Materials"), to deal in the Materials without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Materials, and to 9 | * permit persons to whom the Materials are furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Materials. 14 | * 15 | * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS 16 | * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS 17 | * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT 18 | * https://www.khronos.org/registry/ 19 | * 20 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 27 | **********************************************************************************/ 28 | 29 | /* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */ 30 | 31 | /* cl_gl_ext.h contains vendor (non-KHR) OpenCL extensions which have */ 32 | /* OpenGL dependencies. */ 33 | 34 | #ifndef __OPENCL_CL_GL_EXT_H 35 | #define __OPENCL_CL_GL_EXT_H 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | #ifdef __APPLE__ 42 | #include 43 | #else 44 | #include 45 | #endif 46 | 47 | /* 48 | * For each extension, follow this template 49 | * cl_VEN_extname extension */ 50 | /* #define cl_VEN_extname 1 51 | * ... define new types, if any 52 | * ... define new tokens, if any 53 | * ... define new APIs, if any 54 | * 55 | * If you need GLtypes here, mirror them with a cl_GLtype, rather than including a GL header 56 | * This allows us to avoid having to decide whether to include GL headers or GLES here. 57 | */ 58 | 59 | /* 60 | * cl_khr_gl_event extension 61 | * See section 9.9 in the OpenCL 1.1 spec for more information 62 | */ 63 | #define CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR 0x200D 64 | 65 | extern CL_API_ENTRY cl_event CL_API_CALL 66 | clCreateEventFromGLsyncKHR(cl_context /* context */, 67 | cl_GLsync /* cl_GLsync */, 68 | cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1; 69 | 70 | #ifdef __cplusplus 71 | } 72 | #endif 73 | 74 | #endif /* __OPENCL_CL_GL_EXT_H */ 75 | -------------------------------------------------------------------------------- /OpenCLTranspose/opencl/mtk/opencl210/include/CL/cl_va_api_media_sharing_intel.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * Copyright (c) 2008-2016 The Khronos Group Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and/or associated documentation files (the 6 | * "Materials"), to deal in the Materials without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Materials, and to 9 | * permit persons to whom the Materials are furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Materials. 14 | * 15 | * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS 16 | * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS 17 | * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT 18 | * https://www.khronos.org/registry/ 19 | * 20 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 27 | **********************************************************************************/ 28 | /*****************************************************************************\ 29 | 30 | Copyright (c) 2013-2016 Intel Corporation All Rights Reserved. 31 | 32 | THESE MATERIALS ARE PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 33 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 34 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 35 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR ITS 36 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 37 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 38 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 39 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 40 | OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR TORT (INCLUDING 41 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THESE 42 | MATERIALS, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 43 | 44 | File Name: cl_va_api_media_sharing_intel.h 45 | 46 | Abstract: 47 | 48 | Notes: 49 | 50 | \*****************************************************************************/ 51 | 52 | 53 | #ifndef __OPENCL_CL_VA_API_MEDIA_SHARING_INTEL_H 54 | #define __OPENCL_CL_VA_API_MEDIA_SHARING_INTEL_H 55 | 56 | #include 57 | #include 58 | #include 59 | 60 | #ifdef __cplusplus 61 | extern "C" { 62 | #endif 63 | 64 | /****************************************** 65 | * cl_intel_va_api_media_sharing extension * 66 | *******************************************/ 67 | 68 | #define cl_intel_va_api_media_sharing 1 69 | 70 | /* error codes */ 71 | #define CL_INVALID_VA_API_MEDIA_ADAPTER_INTEL -1098 72 | #define CL_INVALID_VA_API_MEDIA_SURFACE_INTEL -1099 73 | #define CL_VA_API_MEDIA_SURFACE_ALREADY_ACQUIRED_INTEL -1100 74 | #define CL_VA_API_MEDIA_SURFACE_NOT_ACQUIRED_INTEL -1101 75 | 76 | /* cl_va_api_device_source_intel */ 77 | #define CL_VA_API_DISPLAY_INTEL 0x4094 78 | 79 | /* cl_va_api_device_set_intel */ 80 | #define CL_PREFERRED_DEVICES_FOR_VA_API_INTEL 0x4095 81 | #define CL_ALL_DEVICES_FOR_VA_API_INTEL 0x4096 82 | 83 | /* cl_context_info */ 84 | #define CL_CONTEXT_VA_API_DISPLAY_INTEL 0x4097 85 | 86 | /* cl_mem_info */ 87 | #define CL_MEM_VA_API_MEDIA_SURFACE_INTEL 0x4098 88 | 89 | /* cl_image_info */ 90 | #define CL_IMAGE_VA_API_PLANE_INTEL 0x4099 91 | 92 | /* cl_command_type */ 93 | #define CL_COMMAND_ACQUIRE_VA_API_MEDIA_SURFACES_INTEL 0x409A 94 | #define CL_COMMAND_RELEASE_VA_API_MEDIA_SURFACES_INTEL 0x409B 95 | 96 | typedef cl_uint cl_va_api_device_source_intel; 97 | typedef cl_uint cl_va_api_device_set_intel; 98 | 99 | extern CL_API_ENTRY cl_int CL_API_CALL 100 | clGetDeviceIDsFromVA_APIMediaAdapterINTEL( 101 | cl_platform_id /* platform */, 102 | cl_va_api_device_source_intel /* media_adapter_type */, 103 | void* /* media_adapter */, 104 | cl_va_api_device_set_intel /* media_adapter_set */, 105 | cl_uint /* num_entries */, 106 | cl_device_id* /* devices */, 107 | cl_uint* /* num_devices */) CL_EXT_SUFFIX__VERSION_1_2; 108 | 109 | typedef CL_API_ENTRY cl_int (CL_API_CALL * clGetDeviceIDsFromVA_APIMediaAdapterINTEL_fn)( 110 | cl_platform_id /* platform */, 111 | cl_va_api_device_source_intel /* media_adapter_type */, 112 | void* /* media_adapter */, 113 | cl_va_api_device_set_intel /* media_adapter_set */, 114 | cl_uint /* num_entries */, 115 | cl_device_id* /* devices */, 116 | cl_uint* /* num_devices */) CL_EXT_SUFFIX__VERSION_1_2; 117 | 118 | extern CL_API_ENTRY cl_mem CL_API_CALL 119 | clCreateFromVA_APIMediaSurfaceINTEL( 120 | cl_context /* context */, 121 | cl_mem_flags /* flags */, 122 | VASurfaceID* /* surface */, 123 | cl_uint /* plane */, 124 | cl_int* /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_2; 125 | 126 | typedef CL_API_ENTRY cl_mem (CL_API_CALL * clCreateFromVA_APIMediaSurfaceINTEL_fn)( 127 | cl_context /* context */, 128 | cl_mem_flags /* flags */, 129 | VASurfaceID* /* surface */, 130 | cl_uint /* plane */, 131 | cl_int* /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_2; 132 | 133 | extern CL_API_ENTRY cl_int CL_API_CALL 134 | clEnqueueAcquireVA_APIMediaSurfacesINTEL( 135 | cl_command_queue /* command_queue */, 136 | cl_uint /* num_objects */, 137 | const cl_mem* /* mem_objects */, 138 | cl_uint /* num_events_in_wait_list */, 139 | const cl_event* /* event_wait_list */, 140 | cl_event* /* event */) CL_EXT_SUFFIX__VERSION_1_2; 141 | 142 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireVA_APIMediaSurfacesINTEL_fn)( 143 | cl_command_queue /* command_queue */, 144 | cl_uint /* num_objects */, 145 | const cl_mem* /* mem_objects */, 146 | cl_uint /* num_events_in_wait_list */, 147 | const cl_event* /* event_wait_list */, 148 | cl_event* /* event */) CL_EXT_SUFFIX__VERSION_1_2; 149 | 150 | extern CL_API_ENTRY cl_int CL_API_CALL 151 | clEnqueueReleaseVA_APIMediaSurfacesINTEL( 152 | cl_command_queue /* command_queue */, 153 | cl_uint /* num_objects */, 154 | const cl_mem* /* mem_objects */, 155 | cl_uint /* num_events_in_wait_list */, 156 | const cl_event* /* event_wait_list */, 157 | cl_event* /* event */) CL_EXT_SUFFIX__VERSION_1_2; 158 | 159 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseVA_APIMediaSurfacesINTEL_fn)( 160 | cl_command_queue /* command_queue */, 161 | cl_uint /* num_objects */, 162 | const cl_mem* /* mem_objects */, 163 | cl_uint /* num_events_in_wait_list */, 164 | const cl_event* /* event_wait_list */, 165 | cl_event* /* event */) CL_EXT_SUFFIX__VERSION_1_2; 166 | 167 | #ifdef __cplusplus 168 | } 169 | #endif 170 | 171 | #endif /* __OPENCL_CL_VA_API_MEDIA_SHARING_INTEL_H */ 172 | 173 | -------------------------------------------------------------------------------- /OpenCLTranspose/opencl/mtk/opencl210/include/CL/cl_version.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2018 The Khronos Group Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and/or associated documentation files (the 6 | * "Materials"), to deal in the Materials without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Materials, and to 9 | * permit persons to whom the Materials are furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Materials. 14 | * 15 | * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS 16 | * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS 17 | * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT 18 | * https://www.khronos.org/registry/ 19 | * 20 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 27 | ******************************************************************************/ 28 | 29 | #ifndef __CL_VERSION_H 30 | #define __CL_VERSION_H 31 | 32 | /* Detect which version to target */ 33 | #if !defined(CL_TARGET_OPENCL_VERSION) 34 | #pragma message("cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 220 (OpenCL 2.2)") 35 | #define CL_TARGET_OPENCL_VERSION 220 36 | #endif 37 | #if CL_TARGET_OPENCL_VERSION != 100 && \ 38 | CL_TARGET_OPENCL_VERSION != 110 && \ 39 | CL_TARGET_OPENCL_VERSION != 120 && \ 40 | CL_TARGET_OPENCL_VERSION != 200 && \ 41 | CL_TARGET_OPENCL_VERSION != 210 && \ 42 | CL_TARGET_OPENCL_VERSION != 220 43 | #pragma message("cl_version: CL_TARGET_OPENCL_VERSION is not a valid value (100, 110, 120, 200, 210, 220). Defaulting to 220 (OpenCL 2.2)") 44 | #undef CL_TARGET_OPENCL_VERSION 45 | #define CL_TARGET_OPENCL_VERSION 220 46 | #endif 47 | 48 | 49 | /* OpenCL Version */ 50 | #if CL_TARGET_OPENCL_VERSION >= 220 && !defined(CL_VERSION_2_2) 51 | #define CL_VERSION_2_2 1 52 | #endif 53 | #if CL_TARGET_OPENCL_VERSION >= 210 && !defined(CL_VERSION_2_1) 54 | #define CL_VERSION_2_1 1 55 | #endif 56 | #if CL_TARGET_OPENCL_VERSION >= 200 && !defined(CL_VERSION_2_0) 57 | #define CL_VERSION_2_0 1 58 | #endif 59 | #if CL_TARGET_OPENCL_VERSION >= 120 && !defined(CL_VERSION_1_2) 60 | #define CL_VERSION_1_2 1 61 | #endif 62 | #if CL_TARGET_OPENCL_VERSION >= 110 && !defined(CL_VERSION_1_1) 63 | #define CL_VERSION_1_1 1 64 | #endif 65 | #if CL_TARGET_OPENCL_VERSION >= 100 && !defined(CL_VERSION_1_0) 66 | #define CL_VERSION_1_0 1 67 | #endif 68 | 69 | /* Allow deprecated APIs for older OpenCL versions. */ 70 | #if CL_TARGET_OPENCL_VERSION <= 210 && !defined(CL_USE_DEPRECATED_OPENCL_2_1_APIS) 71 | #define CL_USE_DEPRECATED_OPENCL_2_1_APIS 72 | #endif 73 | #if CL_TARGET_OPENCL_VERSION <= 200 && !defined(CL_USE_DEPRECATED_OPENCL_2_0_APIS) 74 | #define CL_USE_DEPRECATED_OPENCL_2_0_APIS 75 | #endif 76 | #if CL_TARGET_OPENCL_VERSION <= 120 && !defined(CL_USE_DEPRECATED_OPENCL_1_2_APIS) 77 | #define CL_USE_DEPRECATED_OPENCL_1_2_APIS 78 | #endif 79 | #if CL_TARGET_OPENCL_VERSION <= 110 && !defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) 80 | #define CL_USE_DEPRECATED_OPENCL_1_1_APIS 81 | #endif 82 | #if CL_TARGET_OPENCL_VERSION <= 100 && !defined(CL_USE_DEPRECATED_OPENCL_1_0_APIS) 83 | #define CL_USE_DEPRECATED_OPENCL_1_0_APIS 84 | #endif 85 | 86 | #endif /* __CL_VERSION_H */ 87 | -------------------------------------------------------------------------------- /OpenCLTranspose/opencl/mtk/opencl210/include/CL/opencl.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2008-2015 The Khronos Group Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and/or associated documentation files (the 6 | * "Materials"), to deal in the Materials without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Materials, and to 9 | * permit persons to whom the Materials are furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Materials. 14 | * 15 | * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS 16 | * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS 17 | * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT 18 | * https://www.khronos.org/registry/ 19 | * 20 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 27 | ******************************************************************************/ 28 | 29 | /* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */ 30 | 31 | #ifndef __OPENCL_H 32 | #define __OPENCL_H 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | #ifdef __APPLE__ 39 | 40 | #include 41 | #include 42 | #include 43 | #include 44 | 45 | #else 46 | 47 | #include 48 | #include 49 | #include 50 | #include 51 | 52 | #endif 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif /* __OPENCL_H */ 59 | 60 | -------------------------------------------------------------------------------- /OpenCLTranspose/opencl/mtk/opencl210/lib/libOpenCL.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mobile-algorithm-optimization/guide/0a10dcca06dac53a856cf0b6bccf431d6f5282ba/OpenCLTranspose/opencl/mtk/opencl210/lib/libOpenCL.so -------------------------------------------------------------------------------- /OpenCLTranspose/opencl/mtk/opencl210/lib64/libOpenCL.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mobile-algorithm-optimization/guide/0a10dcca06dac53a856cf0b6bccf431d6f5282ba/OpenCLTranspose/opencl/mtk/opencl210/lib64/libOpenCL.so -------------------------------------------------------------------------------- /OpenCLTranspose/opencl/qcom/opencl200/include/CL/cl_egl.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2008-2015 The Khronos Group Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and/or associated documentation files (the 6 | * "Materials"), to deal in the Materials without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Materials, and to 9 | * permit persons to whom the Materials are furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Materials. 14 | * 15 | * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS 16 | * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS 17 | * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT 18 | * https://www.khronos.org/registry/ 19 | * 20 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 27 | ******************************************************************************/ 28 | 29 | #ifndef __OPENCL_CL_EGL_H 30 | #define __OPENCL_CL_EGL_H 31 | 32 | #ifdef __APPLE__ 33 | 34 | #else 35 | #include 36 | #endif 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | 43 | /* Command type for events created with clEnqueueAcquireEGLObjectsKHR */ 44 | #define CL_COMMAND_EGL_FENCE_SYNC_OBJECT_KHR 0x202F 45 | #define CL_COMMAND_ACQUIRE_EGL_OBJECTS_KHR 0x202D 46 | #define CL_COMMAND_RELEASE_EGL_OBJECTS_KHR 0x202E 47 | 48 | /* Error type for clCreateFromEGLImageKHR */ 49 | #define CL_INVALID_EGL_OBJECT_KHR -1093 50 | #define CL_EGL_RESOURCE_NOT_ACQUIRED_KHR -1092 51 | 52 | /* CLeglImageKHR is an opaque handle to an EGLImage */ 53 | typedef void* CLeglImageKHR; 54 | 55 | /* CLeglDisplayKHR is an opaque handle to an EGLDisplay */ 56 | typedef void* CLeglDisplayKHR; 57 | 58 | /* CLeglSyncKHR is an opaque handle to an EGLSync object */ 59 | typedef void* CLeglSyncKHR; 60 | 61 | /* properties passed to clCreateFromEGLImageKHR */ 62 | typedef intptr_t cl_egl_image_properties_khr; 63 | 64 | 65 | #define cl_khr_egl_image 1 66 | 67 | extern CL_API_ENTRY cl_mem CL_API_CALL 68 | clCreateFromEGLImageKHR(cl_context /* context */, 69 | CLeglDisplayKHR /* egldisplay */, 70 | CLeglImageKHR /* eglimage */, 71 | cl_mem_flags /* flags */, 72 | const cl_egl_image_properties_khr * /* properties */, 73 | cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; 74 | 75 | typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromEGLImageKHR_fn)( 76 | cl_context context, 77 | CLeglDisplayKHR egldisplay, 78 | CLeglImageKHR eglimage, 79 | cl_mem_flags flags, 80 | const cl_egl_image_properties_khr * properties, 81 | cl_int * errcode_ret); 82 | 83 | 84 | extern CL_API_ENTRY cl_int CL_API_CALL 85 | clEnqueueAcquireEGLObjectsKHR(cl_command_queue /* command_queue */, 86 | cl_uint /* num_objects */, 87 | const cl_mem * /* mem_objects */, 88 | cl_uint /* num_events_in_wait_list */, 89 | const cl_event * /* event_wait_list */, 90 | cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; 91 | 92 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireEGLObjectsKHR_fn)( 93 | cl_command_queue command_queue, 94 | cl_uint num_objects, 95 | const cl_mem * mem_objects, 96 | cl_uint num_events_in_wait_list, 97 | const cl_event * event_wait_list, 98 | cl_event * event); 99 | 100 | 101 | extern CL_API_ENTRY cl_int CL_API_CALL 102 | clEnqueueReleaseEGLObjectsKHR(cl_command_queue /* command_queue */, 103 | cl_uint /* num_objects */, 104 | const cl_mem * /* mem_objects */, 105 | cl_uint /* num_events_in_wait_list */, 106 | const cl_event * /* event_wait_list */, 107 | cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; 108 | 109 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseEGLObjectsKHR_fn)( 110 | cl_command_queue command_queue, 111 | cl_uint num_objects, 112 | const cl_mem * mem_objects, 113 | cl_uint num_events_in_wait_list, 114 | const cl_event * event_wait_list, 115 | cl_event * event); 116 | 117 | 118 | #define cl_khr_egl_event 1 119 | 120 | extern CL_API_ENTRY cl_event CL_API_CALL 121 | clCreateEventFromEGLSyncKHR(cl_context /* context */, 122 | CLeglSyncKHR /* sync */, 123 | CLeglDisplayKHR /* display */, 124 | cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; 125 | 126 | typedef CL_API_ENTRY cl_event (CL_API_CALL *clCreateEventFromEGLSyncKHR_fn)( 127 | cl_context context, 128 | CLeglSyncKHR sync, 129 | CLeglDisplayKHR display, 130 | cl_int * errcode_ret); 131 | 132 | #ifdef __cplusplus 133 | } 134 | #endif 135 | 136 | #endif /* __OPENCL_CL_EGL_H */ 137 | -------------------------------------------------------------------------------- /OpenCLTranspose/opencl/qcom/opencl200/include/CL/cl_gl.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * Copyright (c) 2008-2015 The Khronos Group Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and/or associated documentation files (the 6 | * "Materials"), to deal in the Materials without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Materials, and to 9 | * permit persons to whom the Materials are furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Materials. 14 | * 15 | * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS 16 | * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS 17 | * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT 18 | * https://www.khronos.org/registry/ 19 | * 20 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 27 | **********************************************************************************/ 28 | 29 | #ifndef __OPENCL_CL_GL_H 30 | #define __OPENCL_CL_GL_H 31 | 32 | #ifdef __APPLE__ 33 | #include 34 | #else 35 | #include 36 | #endif 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | typedef cl_uint cl_gl_object_type; 43 | typedef cl_uint cl_gl_texture_info; 44 | typedef cl_uint cl_gl_platform_info; 45 | typedef struct __GLsync *cl_GLsync; 46 | 47 | /* cl_gl_object_type = 0x2000 - 0x200F enum values are currently taken */ 48 | #define CL_GL_OBJECT_BUFFER 0x2000 49 | #define CL_GL_OBJECT_TEXTURE2D 0x2001 50 | #define CL_GL_OBJECT_TEXTURE3D 0x2002 51 | #define CL_GL_OBJECT_RENDERBUFFER 0x2003 52 | #define CL_GL_OBJECT_TEXTURE2D_ARRAY 0x200E 53 | #define CL_GL_OBJECT_TEXTURE1D 0x200F 54 | #define CL_GL_OBJECT_TEXTURE1D_ARRAY 0x2010 55 | #define CL_GL_OBJECT_TEXTURE_BUFFER 0x2011 56 | 57 | /* cl_gl_texture_info */ 58 | #define CL_GL_TEXTURE_TARGET 0x2004 59 | #define CL_GL_MIPMAP_LEVEL 0x2005 60 | #define CL_GL_NUM_SAMPLES 0x2012 61 | 62 | 63 | extern CL_API_ENTRY cl_mem CL_API_CALL 64 | clCreateFromGLBuffer(cl_context /* context */, 65 | cl_mem_flags /* flags */, 66 | cl_GLuint /* bufobj */, 67 | int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; 68 | 69 | extern CL_API_ENTRY cl_mem CL_API_CALL 70 | clCreateFromGLTexture(cl_context /* context */, 71 | cl_mem_flags /* flags */, 72 | cl_GLenum /* target */, 73 | cl_GLint /* miplevel */, 74 | cl_GLuint /* texture */, 75 | cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_2; 76 | 77 | extern CL_API_ENTRY cl_mem CL_API_CALL 78 | clCreateFromGLRenderbuffer(cl_context /* context */, 79 | cl_mem_flags /* flags */, 80 | cl_GLuint /* renderbuffer */, 81 | cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; 82 | 83 | extern CL_API_ENTRY cl_int CL_API_CALL 84 | clGetGLObjectInfo(cl_mem /* memobj */, 85 | cl_gl_object_type * /* gl_object_type */, 86 | cl_GLuint * /* gl_object_name */) CL_API_SUFFIX__VERSION_1_0; 87 | 88 | extern CL_API_ENTRY cl_int CL_API_CALL 89 | clGetGLTextureInfo(cl_mem /* memobj */, 90 | cl_gl_texture_info /* param_name */, 91 | size_t /* param_value_size */, 92 | void * /* param_value */, 93 | size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; 94 | 95 | extern CL_API_ENTRY cl_int CL_API_CALL 96 | clEnqueueAcquireGLObjects(cl_command_queue /* command_queue */, 97 | cl_uint /* num_objects */, 98 | const cl_mem * /* mem_objects */, 99 | cl_uint /* num_events_in_wait_list */, 100 | const cl_event * /* event_wait_list */, 101 | cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; 102 | 103 | extern CL_API_ENTRY cl_int CL_API_CALL 104 | clEnqueueReleaseGLObjects(cl_command_queue /* command_queue */, 105 | cl_uint /* num_objects */, 106 | const cl_mem * /* mem_objects */, 107 | cl_uint /* num_events_in_wait_list */, 108 | const cl_event * /* event_wait_list */, 109 | cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; 110 | 111 | 112 | /* Deprecated OpenCL 1.1 APIs */ 113 | extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL 114 | clCreateFromGLTexture2D(cl_context /* context */, 115 | cl_mem_flags /* flags */, 116 | cl_GLenum /* target */, 117 | cl_GLint /* miplevel */, 118 | cl_GLuint /* texture */, 119 | cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED; 120 | 121 | extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL 122 | clCreateFromGLTexture3D(cl_context /* context */, 123 | cl_mem_flags /* flags */, 124 | cl_GLenum /* target */, 125 | cl_GLint /* miplevel */, 126 | cl_GLuint /* texture */, 127 | cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED; 128 | 129 | /* cl_khr_gl_sharing extension */ 130 | 131 | #define cl_khr_gl_sharing 1 132 | 133 | typedef cl_uint cl_gl_context_info; 134 | 135 | /* Additional Error Codes */ 136 | #define CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR -1000 137 | 138 | /* cl_gl_context_info */ 139 | #define CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR 0x2006 140 | #define CL_DEVICES_FOR_GL_CONTEXT_KHR 0x2007 141 | 142 | /* Additional cl_context_properties */ 143 | #define CL_GL_CONTEXT_KHR 0x2008 144 | #define CL_EGL_DISPLAY_KHR 0x2009 145 | #define CL_GLX_DISPLAY_KHR 0x200A 146 | #define CL_WGL_HDC_KHR 0x200B 147 | #define CL_CGL_SHAREGROUP_KHR 0x200C 148 | 149 | extern CL_API_ENTRY cl_int CL_API_CALL 150 | clGetGLContextInfoKHR(const cl_context_properties * /* properties */, 151 | cl_gl_context_info /* param_name */, 152 | size_t /* param_value_size */, 153 | void * /* param_value */, 154 | size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; 155 | 156 | typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetGLContextInfoKHR_fn)( 157 | const cl_context_properties * properties, 158 | cl_gl_context_info param_name, 159 | size_t param_value_size, 160 | void * param_value, 161 | size_t * param_value_size_ret); 162 | 163 | #ifdef __cplusplus 164 | } 165 | #endif 166 | 167 | #endif /* __OPENCL_CL_GL_H */ 168 | -------------------------------------------------------------------------------- /OpenCLTranspose/opencl/qcom/opencl200/include/CL/cl_gl_ext.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * Copyright (c) 2008-2015 The Khronos Group Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and/or associated documentation files (the 6 | * "Materials"), to deal in the Materials without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Materials, and to 9 | * permit persons to whom the Materials are furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Materials. 14 | * 15 | * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS 16 | * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS 17 | * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT 18 | * https://www.khronos.org/registry/ 19 | * 20 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 27 | **********************************************************************************/ 28 | 29 | /* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */ 30 | 31 | /* cl_gl_ext.h contains vendor (non-KHR) OpenCL extensions which have */ 32 | /* OpenGL dependencies. */ 33 | 34 | #ifndef __OPENCL_CL_GL_EXT_H 35 | #define __OPENCL_CL_GL_EXT_H 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | #ifdef __APPLE__ 42 | #include 43 | #else 44 | #include 45 | #endif 46 | 47 | /* 48 | * For each extension, follow this template 49 | * cl_VEN_extname extension */ 50 | /* #define cl_VEN_extname 1 51 | * ... define new types, if any 52 | * ... define new tokens, if any 53 | * ... define new APIs, if any 54 | * 55 | * If you need GLtypes here, mirror them with a cl_GLtype, rather than including a GL header 56 | * This allows us to avoid having to decide whether to include GL headers or GLES here. 57 | */ 58 | 59 | /* 60 | * cl_khr_gl_event extension 61 | * See section 9.9 in the OpenCL 1.1 spec for more information 62 | */ 63 | #define CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR 0x200D 64 | 65 | extern CL_API_ENTRY cl_event CL_API_CALL 66 | clCreateEventFromGLsyncKHR(cl_context /* context */, 67 | cl_GLsync /* cl_GLsync */, 68 | cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1; 69 | 70 | #ifdef __cplusplus 71 | } 72 | #endif 73 | 74 | #endif /* __OPENCL_CL_GL_EXT_H */ 75 | -------------------------------------------------------------------------------- /OpenCLTranspose/opencl/qcom/opencl200/include/CL/opencl.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2008-2015 The Khronos Group Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and/or associated documentation files (the 6 | * "Materials"), to deal in the Materials without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Materials, and to 9 | * permit persons to whom the Materials are furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Materials. 14 | * 15 | * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS 16 | * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS 17 | * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT 18 | * https://www.khronos.org/registry/ 19 | * 20 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 27 | ******************************************************************************/ 28 | 29 | /* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */ 30 | 31 | #ifndef __OPENCL_H 32 | #define __OPENCL_H 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | #ifdef __APPLE__ 39 | 40 | #include 41 | #include 42 | #include 43 | #include 44 | 45 | #else 46 | 47 | #include 48 | #include 49 | #include 50 | #include 51 | 52 | #endif 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif /* __OPENCL_H */ 59 | 60 | -------------------------------------------------------------------------------- /OpenCLTranspose/opencl/qcom/opencl200/lib/libOpenCL.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mobile-algorithm-optimization/guide/0a10dcca06dac53a856cf0b6bccf431d6f5282ba/OpenCLTranspose/opencl/qcom/opencl200/lib/libOpenCL.so -------------------------------------------------------------------------------- /OpenCLTranspose/opencl/qcom/opencl200/lib64/libOpenCL.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mobile-algorithm-optimization/guide/0a10dcca06dac53a856cf0b6bccf431d6f5282ba/OpenCLTranspose/opencl/qcom/opencl200/lib64/libOpenCL.so -------------------------------------------------------------------------------- /OpenCLTranspose/qcom_adbshell.sh: -------------------------------------------------------------------------------- 1 | cd /data/local/Transpose/bin/ 2 | export LD_LIBRARY_PATH=${pwd}:/vendor/lib64 3 | ./main -------------------------------------------------------------------------------- /OpenCLTranspose/qcom_test.sh: -------------------------------------------------------------------------------- 1 | cd build_android 2 | rm -r * 3 | cmake -DANDROID=android -DQCOM=qcom -DCMAKE_BUILD_TYPE=Release .. 4 | make install 5 | adb push install/bin/* /data/local/Transpose/bin/ 6 | adb shell < ../qcom_adbshell.sh -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # guide 2 | there are guide examples for mobile cv algorithms optimization. 3 | --------------------------------------------------------------------------------