opencv/cmake
WuZhiwen 6e3ea8b49d Merge pull request #12703 from wzw-intel:vkcom
* dnn: Add a Vulkan based backend

This commit adds a new backend "DNN_BACKEND_VKCOM" and a
new target "DNN_TARGET_VULKAN". VKCOM means vulkan based
computation library.

This backend uses Vulkan API and SPIR-V shaders to do
the inference computation for layers. The layer types
that implemented in DNN_BACKEND_VKCOM include:
Conv, Concat, ReLU, LRN, PriorBox, Softmax, MaxPooling,
AvePooling, Permute

This is just a beginning work for Vulkan in OpenCV DNN,
more layer types will be supported and performance
tuning is on the way.

Signed-off-by: Wu Zhiwen <zhiwen.wu@intel.com>

* dnn/vulkan: Add FindVulkan.cmake to detect Vulkan SDK

In order to build dnn with Vulkan support, need installing
Vulkan SDK and setting environment variable "VULKAN_SDK" and
add "-DWITH_VULKAN=ON" to cmake command.

You can download Vulkan SDK from:
https://vulkan.lunarg.com/sdk/home#linux

For how to install, see
https://vulkan.lunarg.com/doc/sdk/latest/linux/getting_started.html
https://vulkan.lunarg.com/doc/sdk/latest/windows/getting_started.html
https://vulkan.lunarg.com/doc/sdk/latest/mac/getting_started.html
respectively for linux, windows and mac.

To run the vulkan backend, also need installing mesa driver.
On Ubuntu, use this command 'sudo apt-get install mesa-vulkan-drivers'

To test, use command '$BUILD_DIR/bin/opencv_test_dnn --gtest_filter=*VkCom*'

Signed-off-by: Wu Zhiwen <zhiwen.wu@intel.com>

* dnn/Vulkan: dynamically load Vulkan runtime

No compile-time dependency on Vulkan library.
If Vulkan runtime is unavailable, fallback to CPU path.

Use environment "OPENCL_VULKAN_RUNTIME" to specify path to your
own vulkan runtime library.

Signed-off-by: Wu Zhiwen <zhiwen.wu@intel.com>

* dnn/Vulkan: Add a python script to compile GLSL shaders to SPIR-V shaders

The SPIR-V shaders are in format of text-based 32-bit hexadecimal
numbers, and inserted into .cpp files as unsigned int32 array.

* dnn/Vulkan: Put Vulkan headers into 3rdparty directory and some other fixes

Vulkan header files are copied from
https://github.com/KhronosGroup/Vulkan-Docs/tree/master/include/vulkan
to 3rdparty/include

Fix the Copyright declaration issue.

Refine OpenCVDetectVulkan.cmake

* dnn/Vulkan: Add vulkan backend tests into existing ones.

Also fixed some test failures.

- Don't use bool variable as uniform for shader
- Fix dispathed group number beyond max issue
- Bypass "group > 1" convolution. This should be support in future.

* dnn/Vulkan: Fix multiple initialization in one thread.
2018-10-29 17:51:26 +03:00
..
android android: refactor Android SDK detection 2018-04-05 19:19:31 +00:00
checks Merge pull request #12703 from wzw-intel:vkcom 2018-10-29 17:51:26 +03:00
FindCUDA Some mist. typo fixes 2018-02-07 06:59:15 -05:00
templates Merge pull request #12703 from wzw-intel:vkcom 2018-10-29 17:51:26 +03:00
cl2cpp.cmake cmake: don't add include <module>/src directory to avoid conflicts 2018-03-19 11:14:15 +03:00
copy_files.cmake cmake: fix android examples dependencies 2018-03-15 14:17:02 +03:00
FindCUDA.cmake Misc. typos 2018-07-31 18:44:23 +03:00
FindFlake8.cmake cmake: added check_flake8 target 2018-05-11 17:32:22 +03:00
FindGstreamerWindows.cmake Newer versions of gstreamer use a slightly different include path on windows. 2016-10-20 11:02:18 -04:00
FindOpenVX.cmake Updated OpenVX detector and wrappers to handle Reference attribute names change 2017-03-22 16:50:38 +03:00
FindPylint.cmake cmake: fix Pylint version detection 2017-08-28 19:03:44 +03:00
FindVulkan.cmake Merge pull request #12703 from wzw-intel:vkcom 2018-10-29 17:51:26 +03:00
OpenCVCompilerDefenses.cmake cmake: avoid amending of CMAKE_COMPILER_IS_[GNUCXX|CLANGCXX|CCACHE] vars 2018-03-27 16:16:59 +03:00
OpenCVCompilerOptimizations.cmake Merge pull request #12925 from alalek:fix_cmake_conditions 2018-10-25 11:52:39 +00:00
OpenCVCompilerOptions.cmake build: eliminate warnings 2018-10-17 08:43:18 +00:00
OpenCVCRTLinkage.cmake cmake: debug info 2018-02-14 13:44:10 +03:00
OpenCVDetectApacheAnt.cmake cmake: simplified configuration output 2017-11-17 11:57:49 +03:00
OpenCVDetectCUDA.cmake Merge pull request #12887 from alalek:fix_cmake_conditions 2018-10-24 13:17:54 +00:00
OpenCVDetectCXXCompiler.cmake cmake: require C++11 and CMake 3.5.1+ 2018-04-10 18:09:54 +03:00
OpenCVDetectDirectX.cmake fix build with Win7 SDK 2015-07-30 23:23:01 +03:00
OpenCVDetectHalide.cmake cmake: add Halide support (#8794) 2017-06-21 14:33:47 +03:00
OpenCVDetectInferenceEngine.cmake openvino: use 2018R3 defines 2018-08-28 15:57:19 +03:00
OpenCVDetectMediaSDK.cmake MediaSDK video backend: Windows support 2017-10-11 16:33:37 +03:00
OpenCVDetectOpenCL.cmake Add install component for 3rdparty libraries licenses 2018-03-06 16:32:30 +03:00
OpenCVDetectPython.cmake cmake: fix Python detection for standalone bindings 2018-10-10 22:59:42 +03:00
OpenCVDetectTBB.cmake Reduced direct TBB dependencies 2018-04-06 14:21:15 +03:00
OpenCVDetectTrace.cmake trace: initial support for code trace 2017-06-26 17:07:13 +03:00
OpenCVDetectVTK.cmake Merge pull request #12887 from alalek:fix_cmake_conditions 2018-10-24 13:17:54 +00:00
OpenCVDetectVulkan.cmake Merge pull request #12703 from wzw-intel:vkcom 2018-10-29 17:51:26 +03:00
OpenCVDownload.cmake cmake: add download helper scripts 2018-08-01 15:57:53 +03:00
OpenCVExtraTargets.cmake Added group targets for samples (opencv_samples, opencv_samples_<group>), install samples/data inseparate component 'samples_data' 2018-02-12 18:42:36 +03:00
OpenCVFindAtlas.cmake moved BLAS/LAPACK detection scripts from opencv_contrib/dnn to the main repository (#7918) 2016-12-22 22:57:44 +03:00
OpenCVFindIntelPerCSDK.cmake Fix notes about cmake files. Fix build warning. 2013-12-17 16:13:55 +04:00
OpenCVFindIPP.cmake Merge pull request #12925 from alalek:fix_cmake_conditions 2018-10-25 11:52:39 +00:00
OpenCVFindIPPIW.cmake Merge pull request #12877 from maver1:3.4 2018-10-24 15:02:53 +03:00
OpenCVFindLAPACK.cmake core(lapack): fix build issues related to 'extern "C"' 2018-01-24 14:53:04 +03:00
OpenCVFindLATEX.cmake Started top-level CMakeLists.txt file reorganization: cmake scripts are moved to separate folder; refactored BUILD_*, INSTALL_*, ENABLE_*, USE_*, WITH_* options. 2012-01-03 13:48:12 +00:00
OpenCVFindLibRealsense.cmake videoio: update librealsense to API 2.0 2018-06-08 18:23:00 +02:00
OpenCVFindLibsGrfmt.cmake Merge pull request #12192 from pasbi:pfm 2018-08-13 13:14:12 +03:00
OpenCVFindLibsGUI.cmake cmake: avoid amending of CMAKE_COMPILER_IS_[GNUCXX|CLANGCXX|CCACHE] vars 2018-03-27 16:16:59 +03:00
OpenCVFindLibsPerf.cmake Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-09-04 18:39:03 +00:00
OpenCVFindLibsVideo.cmake Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-06-04 19:26:10 +03:00
OpenCVFindMKL.cmake cmake: fix variable expand in CMake conditions 2018-10-21 15:02:40 +00:00
OpenCVFindOpenBLAS.cmake cmake: update OpenBLAS support 2017-10-28 10:17:37 +03:00
OpenCVFindOpenEXR.cmake Normalize line endings and whitespace 2012-10-17 15:57:49 +04:00
OpenCVFindOpenNI2.cmake Help Cmake find OpenNI2 include path 2018-03-15 18:39:07 +09:00
OpenCVFindOpenNI.cmake Normalize line endings and whitespace 2012-10-17 15:57:49 +04:00
OpenCVFindProtobuf.cmake Fix install with external protobuf 2018-10-04 13:48:59 +03:00
OpenCVFindVA_INTEL.cmake Removed unnecessary build-time MediaSDK detection 2018-09-13 13:43:11 +03:00
OpenCVFindVA.cmake cmake: allow to specify own libva paths 2018-08-10 16:03:10 +03:00
OpenCVFindWebP.cmake update CMakeList.txt 2018-02-05 16:23:52 +03:00
OpenCVFindXimea.cmake XIMEA cam support: allow on OS X too 2014-09-09 19:25:14 +04:00
OpenCVGenABI.cmake cmake: CMP0026 NEW 2017-08-19 15:15:05 +00:00
OpenCVGenAndroidMK.cmake next(android): java3 -> java4 2018-04-10 18:09:54 +03:00
OpenCVGenConfig.cmake drop legacy headers 2018-09-10 08:33:16 +00:00
OpenCVGenHeaders.cmake cmake: support multiple CPU targets 2017-02-13 19:52:59 +03:00
OpenCVGenInfoPlist.cmake Merge pull request #8009 from Legoless:master 2017-01-20 19:16:01 +03:00
OpenCVGenPkgconfig.cmake cmake: update install paths (Linux) 2018-09-19 15:43:52 +03:00
OpenCVMinDepVersions.cmake Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-10-09 21:20:15 +00:00
OpenCVModule.cmake Merge pull request #12887 from alalek:fix_cmake_conditions 2018-10-24 13:17:54 +00:00
OpenCVPackaging.cmake cmake: fix variable expand in CMake conditions 2018-10-21 15:02:40 +00:00
OpenCVPCHSupport.cmake Misc. typos 2018-07-31 18:44:23 +03:00
OpenCVPylint.cmake cmake: fix Ninja generator warning about pylintrc 2018-04-10 12:23:10 +03:00
OpenCVUtils.cmake Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-10-13 16:19:05 +00:00
OpenCVVersion.cmake Improve the documentation. 2017-08-20 17:21:39 +02:00