Commit Graph

36 Commits

Author SHA1 Message Date
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
Maksim Shabunin
7bbe002a2f Add install component for 3rdparty libraries licenses 2018-03-06 16:32:30 +03:00
Alexander Alekhin
e45d5446f2 cleanup unused 3rdparty files 2017-07-21 15:20:13 +03:00
Alexander Alekhin
ca8312b0b3 remove legacy intermediate unused files 2015-07-01 16:46:54 +03:00
Roman Donchenko
e45fd939c2 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/ocl/src/cl_runtime/cl_runtime.cpp
	modules/ocl/src/cl_runtime/clamdblas_runtime.cpp
	modules/ocl/src/cl_runtime/clamdfft_runtime.cpp
	modules/ocl/src/cl_runtime/generator/template/clamdblas_runtime.cpp.in
	modules/ocl/src/cl_runtime/generator/template/clamdfft_runtime.cpp.in
2014-01-20 15:10:19 +04:00
Dinar Valeev
711f07a34c Use __vector instead of vector as suggests Eigen
This fixes build on PowerPC where Eigen unsets vector, bool and pixel

Signed-off-by: Dinar Valeev <dvaleev@suse.com>
2014-01-16 21:53:49 +01:00
ahb
49dfa5a17f Fix the following error for ocl::getOpenCLPlatforms() on Ubuntu 12.04 with gcc 4.8
OpenCV Error: Unknown error code -6 (OpenCL function is not available: [clGetPlatformIDs]) in opencl_check_fn, file /home/ahb/software/opencv/modules/ocl/src/cl_runtime/cl_runtime.cpp, line 83

The issue results from modules/ocl/src/cl_runtime/cl_runtime.cpp checking for
"linux" instead of "__linux__" (cp.  http://sourceforge.net/p/predef/wiki/OperatingSystems/)

Adjust all other occurrences of "defined(linux)" as well.
2014-01-13 16:09:42 +01:00
Andrey Pavlenko
734bf8babd removing legacy stuff 2013-12-26 15:49:12 +04:00
Roman Donchenko
11c7053b0f Fixed a -Wundef warning in cl_platform.h.
_MSC_VER -> defined _MSC_VER. Fixes building with MinGW.
Similar to fbc91c5ee.
2013-12-04 12:39:20 +04:00
Alexander Alekhin
fbc91c5ee9 ocl: fix cl_platform.h:95: #elif _WIN32 -> #elif defined(_WIN32) 2013-11-22 18:24:20 +04:00
Alexander Alekhin
9d380ecc08 added Khronos OpenCL 1.2 header files 2013-10-18 15:44:55 +04:00
Alexander Karsakov
cee308312a Updated build of ffmpeg library (v 2.0.2). Builded with mingw (gcc 4.6.1) with
folowing additional options: --enable-w32threads, --arch=i686 (for 32-bit
library, workaround for http://trac.ffmpeg.org/ticket/2363)
2013-10-17 12:29:00 +04:00
OpenCV Buildbot
04384a71e4 Normalize line endings and whitespace 2012-10-17 15:32:23 +04:00
Andrey Kamaev
e1c4fd9e1f Merged the trunk r8345:8376 2012-05-18 13:18:37 +00:00
Vadim Pisarevsky
213a23e860 updated ffmpeg to 0.10.2 2012-04-09 17:21:54 +00:00
Vadim Pisarevsky
f1e8b43c7a updated opencv_ffmpeg binaries, headers and libs to ffmpeg 0.8.2 2011-08-16 12:27:15 +00:00
Vadim Pisarevsky
d4fbb2c4fb added missing bdatypes.h 2011-06-23 11:57:27 +00:00
Alexander Shishkov
c5787c5262 added missing audevcod.h 2011-06-16 14:28:29 +00:00
Vadim Pisarevsky
1987de1d77 added missing errors.h 2011-06-16 13:21:22 +00:00
Vadim Pisarevsky
498451872b another small correction to build cap_dshow.cpp in highgui 2011-06-16 10:11:43 +00:00
Vadim Pisarevsky
17b18de531 added missing evcode.h; made videoinput optional (ticket #1142) 2011-06-16 09:51:34 +00:00
Vadim Pisarevsky
412e7a835f videoInput is now integrated into highgui and built from sources 2011-06-15 22:59:41 +00:00
Vadim Pisarevsky
6985540744 moved image codecs' headers to the respective subdirectories; allow the user to use system zlib. 2011-04-26 15:46:15 +00:00
Vadim Pisarevsky
4aaa2700f6 do not use Lapack anymore 2011-04-25 21:50:25 +00:00
Marius Muja
16b1f61c83 Updated FLANN to version 1.5 2010-10-12 19:47:50 +00:00
Vadim Pisarevsky
39918a2755 eliminated freeze in SVD. 2010-09-14 15:13:10 +00:00
Vadim Pisarevsky
2154a0ce63 fixed ffopencv build with Mingw 2010-09-02 14:01:04 +00:00
Vadim Pisarevsky
e48a456d48 optimized lapack' SVD for noticeably better performance on small matrices 2010-08-30 16:37:22 +00:00
Vadim Pisarevsky
40273e6c4f another stdint.h -> msc_stdint.h fix 2010-08-06 23:46:11 +00:00
Vadim Pisarevsky
37f47c9fa3 stdint.h -> msc_stdint.h 2010-08-06 11:07:03 +00:00
Vadim Pisarevsky
26c6b955a8 updated ffmpeg to 0.6.0 2010-08-05 17:24:41 +00:00
Vadim Pisarevsky
641c2ba83e repaired build on mac after libtiff update 2010-07-16 15:04:34 +00:00
Vadim Pisarevsky
f78a3b4cc1 updated 3rd party libs: CLapack 3.1.1.1 => 3.2.1, zlib 1.2.3 => 1.2.5, libpng 1.2.x => 1.4.3, libtiff 3.7.x => 3.9.4. fixed many 64-bit related VS2010 warnings 2010-07-16 12:54:53 +00:00
Vadim Pisarevsky
576adb434d removed embedded (obsolete) OpenEXR files; repaired OpenEXR bindings 2010-07-04 12:32:31 +00:00
Vadim Pisarevsky
b94e09bfeb renamed cv::flann to cv::cvflann to avoid name conflicts 2010-05-21 20:37:05 +00:00
Vadim Pisarevsky
127d6649a1 "atomic bomb" commit. Reorganized OpenCV directory structure 2010-05-11 17:44:00 +00:00