Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use native dawn dev package for development #338

Merged
merged 31 commits into from
Jul 21, 2020

Conversation

NALLEIN
Copy link
Collaborator

@NALLEIN NALLEIN commented Jun 7, 2020

To fix #334

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under OpenCV (BSD) License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

Copy link
Owner

@huningxin huningxin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@huningxin , rebase the gsoc_2020_gpu to master

@NALLEIN , please take a look at comments and add a standalone dawn sample into this PR.

modules/dnn/src/webgpu/src/context.cpp Outdated Show resolved Hide resolved
modules/dnn/src/webgpu/src/context.cpp Outdated Show resolved Hide resolved
modules/dnn/src/webgpu/src/context.cpp Outdated Show resolved Hide resolved
modules/dnn/src/webgpu/src/context.cpp Outdated Show resolved Hide resolved
modules/dnn/src/webgpu/src/op_base.cpp Outdated Show resolved Hide resolved
modules/dnn/src/webgpu/src/op_base.cpp Outdated Show resolved Hide resolved
modules/dnn/src/webgpu/src/op_base.cpp Show resolved Hide resolved
}
// queue submit succeed
fence.Release();
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please create a standalone simple dawn example to exercise the dawn API usages here.

modules/dnn/src/webgpu/include/tensor.hpp Show resolved Hide resolved
@huningxin
Copy link
Owner

@NALLEIN , please change "base" branch of this PR: master => gsoc_2020_gpu (use "Edit" button near PR title)

@NALLEIN NALLEIN changed the base branch from master to gsoc_2020_gpu June 9, 2020 03:06
@huningxin
Copy link
Owner

@huningxin , rebase the gsoc_2020_gpu to master

done

@huningxin
Copy link
Owner

@NALLEIN , please provide the build instructions for this PR.

@huningxin
Copy link
Owner

@huningxin
Copy link
Owner

huningxin commented Jun 23, 2020

There are two tests to be added:

@huningxin
Copy link
Owner

@NALLEIN , I tried your branch with build instructions as

> cmake -D CMAKE_BUILD_TYPE=Release -DWITH_WEBGPU=ON -D CMAKE_INSTALL_PREFIX=/usr/local ..
> make -j8

It reports error when compiling helloCompute.cpp. The error is:

/home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp: In function ‘wgpu::Device createCppDawnDevice()’:
/home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:165:16: error: ‘make_unique’ is not a member of ‘std’
     instance = std::make_unique<dawn_native::Instance>();
                ^
/home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:165:54: error: expected primary-expression before ‘>’ token
     instance = std::make_unique<dawn_native::Instance>();
                                                      ^
/home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:165:56: error: expected primary-expression before ‘)’ token
     instance = std::make_unique<dawn_native::Instance>();
                                                        ^
/home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp: In function ‘int main(int, char**)’:
/home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:254:74: error: no matching function for call to ‘std::vector<wgpu::BindGroupLayoutEntry>::vector(<brace-enclosed initializer list>)’
         {2, wgpu::ShaderStage::Compute, wgpu::BindingType::StorageBuffer}};
                                                                          ^
In file included from /usr/include/c++/5/vector:64:0,
                 from /home/nhu/code/opencv/3rdparty/include/webgpu/include/dawn_native/DawnNative.h:23,
                 from /home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:3:
/usr/include/c++/5/bits/stl_vector.h:401:9: note: candidate: template<class _InputIterator, class> std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&)
         vector(_InputIterator __first, _InputIterator __last,
         ^
/usr/include/c++/5/bits/stl_vector.h:401:9: note:   template argument deduction/substitution failed:
/home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:254:74: note:   cannot convert ‘{2, Compute, StorageBuffer}’ (type ‘<brace-enclosed initializer list>’) to type ‘const allocator_type& {aka const std::allocator<wgpu::BindGroupLayoutEntry>&}’
         {2, wgpu::ShaderStage::Compute, wgpu::BindingType::StorageBuffer}};
                                                                          ^
In file included from /usr/include/c++/5/vector:64:0,
                 from /home/nhu/code/opencv/3rdparty/include/webgpu/include/dawn_native/DawnNative.h:23,
                 from /home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:3:
/usr/include/c++/5/bits/stl_vector.h:373:7: note: candidate: std::vector<_Tp, _Alloc>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = wgpu::BindGroupLayoutEntry; _Alloc = std::allocator<wgpu::BindGroupLayoutEntry>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<wgpu::BindGroupLayoutEntry>]
       vector(initializer_list<value_type> __l,
       ^
/usr/include/c++/5/bits/stl_vector.h:373:7: note:   candidate expects 2 arguments, 3 provided
In file included from /usr/include/c++/5/vector:64:0,
                 from /home/nhu/code/opencv/3rdparty/include/webgpu/include/dawn_native/DawnNative.h:23,
                 from /home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:3:
/usr/include/c++/5/bits/stl_vector.h:348:7: note: candidate: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&) [with _Tp = wgpu::BindGroupLayoutEntry; _Alloc = std::allocator<wgpu::BindGroupLayoutEntry>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<wgpu::BindGroupLayoutEntry>]
       vector(vector&& __rv, const allocator_type& __m)
       ^
/usr/include/c++/5/bits/stl_vector.h:348:7: note:   candidate expects 2 arguments, 3 provided
/usr/include/c++/5/bits/stl_vector.h:339:7: note: candidate: std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&, const allocator_type&) [with _Tp = wgpu::BindGroupLayoutEntry; _Alloc = std::allocator<wgpu::BindGroupLayoutEntry>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<wgpu::BindGroupLayoutEntry>]
       vector(const vector& __x, const allocator_type& __a)
       ^
/usr/include/c++/5/bits/stl_vector.h:339:7: note:   candidate expects 2 arguments, 3 provided
/usr/include/c++/5/bits/stl_vector.h:335:7: note: candidate: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&) [with _Tp = wgpu::BindGroupLayoutEntry; _Alloc = std::allocator<wgpu::BindGroupLayoutEntry>]
       vector(vector&& __x) noexcept
       ^
/usr/include/c++/5/bits/stl_vector.h:335:7: note:   candidate expects 1 argument, 3 provided
In file included from /usr/include/c++/5/vector:64:0,
                 from /home/nhu/code/opencv/3rdparty/include/webgpu/include/dawn_native/DawnNative.h:23,
                 from /home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:3:
/usr/include/c++/5/bits/stl_vector.h:318:7: note: candidate: std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = wgpu::BindGroupLayoutEntry; _Alloc = std::allocator<wgpu::BindGroupLayoutEntry>]
       vector(const vector& __x)
       ^
/usr/include/c++/5/bits/stl_vector.h:318:7: note:   candidate expects 1 argument, 3 provided
In file included from /usr/include/c++/5/vector:64:0,
                 from /home/nhu/code/opencv/3rdparty/include/webgpu/include/dawn_native/DawnNative.h:23,
                 from /home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:3:
/usr/include/c++/5/bits/stl_vector.h:289:7: note: candidate: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>::size_type, const value_type&, const allocator_type&) [with _Tp = wgpu::BindGroupLayoutEntry; _Alloc = std::allocator<wgpu::BindGroupLayoutEntry>; std::vector<_Tp, _Alloc>::size_type = long unsigned int; std::vector<_Tp, _Alloc>::value_type = wgpu::BindGroupLayoutEntry; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<wgpu::BindGroupLayoutEntry>]
       vector(size_type __n, const value_type& __value,
       ^
/usr/include/c++/5/bits/stl_vector.h:289:7: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘std::vector<wgpu::BindGroupLayoutEntry>::size_type {aka long unsigned int}’
In file included from /usr/include/c++/5/vector:64:0,
                 from /home/nhu/code/opencv/3rdparty/include/webgpu/include/dawn_native/DawnNative.h:23,
                 from /home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:3:
/usr/include/c++/5/bits/stl_vector.h:277:7: note: candidate: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>::size_type, const allocator_type&) [with _Tp = wgpu::BindGroupLayoutEntry; _Alloc = std::allocator<wgpu::BindGroupLayoutEntry>; std::vector<_Tp, _Alloc>::size_type = long unsigned int; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<wgpu::BindGroupLayoutEntry>]
       vector(size_type __n, const allocator_type& __a = allocator_type())
       ^
/usr/include/c++/5/bits/stl_vector.h:277:7: note:   candidate expects 2 arguments, 3 provided
In file included from /usr/include/c++/5/vector:64:0,
                 from /home/nhu/code/opencv/3rdparty/include/webgpu/include/dawn_native/DawnNative.h:23,
                 from /home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:3:
/usr/include/c++/5/bits/stl_vector.h:264:7: note: candidate: std::vector<_Tp, _Alloc>::vector(const allocator_type&) [with _Tp = wgpu::BindGroupLayoutEntry; _Alloc = std::allocator<wgpu::BindGroupLayoutEntry>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<wgpu::BindGroupLayoutEntry>]
       vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT
       ^
/usr/include/c++/5/bits/stl_vector.h:264:7: note:   candidate expects 1 argument, 3 provided
/usr/include/c++/5/bits/stl_vector.h:253:7: note: candidate: std::vector<_Tp, _Alloc>::vector() [with _Tp = wgpu::BindGroupLayoutEntry; _Alloc = std::allocator<wgpu::BindGroupLayoutEntry>]
       vector()
       ^
/usr/include/c++/5/bits/stl_vector.h:253:7: note:   candidate expects 0 arguments, 3 provided
/home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:263:69: error: no matching function for call to ‘std::vector<wgpu::BindGroupEntry>::vector(<brace-enclosed initializer list>)’
         { 2, resultBuffer, 0, sizeof(float) * 6, nullptr, nullptr } };
                                                                     ^
In file included from /usr/include/c++/5/vector:64:0,
                 from /home/nhu/code/opencv/3rdparty/include/webgpu/include/dawn_native/DawnNative.h:23,
                 from /home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:3:
/usr/include/c++/5/bits/stl_vector.h:401:9: note: candidate: template<class _InputIterator, class> std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&)
         vector(_InputIterator __first, _InputIterator __last,
         ^
/usr/include/c++/5/bits/stl_vector.h:401:9: note:   template argument deduction/substitution failed:
/home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:263:69: note:   cannot convert ‘{2, resultBuffer, 0, (sizeof (float) * 6ul), nullptr, nullptr}’ (type ‘<brace-enclosed initializer list>’) to type ‘const allocator_type& {aka const std::allocator<wgpu::BindGroupEntry>&}’
         { 2, resultBuffer, 0, sizeof(float) * 6, nullptr, nullptr } };
                                                                     ^
In file included from /usr/include/c++/5/vector:64:0,
                 from /home/nhu/code/opencv/3rdparty/include/webgpu/include/dawn_native/DawnNative.h:23,
                 from /home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:3:
/usr/include/c++/5/bits/stl_vector.h:373:7: note: candidate: std::vector<_Tp, _Alloc>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = wgpu::BindGroupEntry; _Alloc = std::allocator<wgpu::BindGroupEntry>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<wgpu::BindGroupEntry>]
       vector(initializer_list<value_type> __l,
       ^
/usr/include/c++/5/bits/stl_vector.h:373:7: note:   candidate expects 2 arguments, 3 provided
In file included from /usr/include/c++/5/vector:64:0,
                 from /home/nhu/code/opencv/3rdparty/include/webgpu/include/dawn_native/DawnNative.h:23,
                 from /home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:3:
/usr/include/c++/5/bits/stl_vector.h:348:7: note: candidate: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&) [with _Tp = wgpu::BindGroupEntry; _Alloc = std::allocator<wgpu::BindGroupEntry>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<wgpu::BindGroupEntry>]
       vector(vector&& __rv, const allocator_type& __m)
       ^
/usr/include/c++/5/bits/stl_vector.h:348:7: note:   candidate expects 2 arguments, 3 provided
/usr/include/c++/5/bits/stl_vector.h:339:7: note: candidate: std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&, const allocator_type&) [with _Tp = wgpu::BindGroupEntry; _Alloc = std::allocator<wgpu::BindGroupEntry>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<wgpu::BindGroupEntry>]
       vector(const vector& __x, const allocator_type& __a)
       ^
/usr/include/c++/5/bits/stl_vector.h:339:7: note:   candidate expects 2 arguments, 3 provided
/usr/include/c++/5/bits/stl_vector.h:335:7: note: candidate: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&) [with _Tp = wgpu::BindGroupEntry; _Alloc = std::allocator<wgpu::BindGroupEntry>]
       vector(vector&& __x) noexcept
       ^
/usr/include/c++/5/bits/stl_vector.h:335:7: note:   candidate expects 1 argument, 3 provided
In file included from /usr/include/c++/5/vector:64:0,
                 from /home/nhu/code/opencv/3rdparty/include/webgpu/include/dawn_native/DawnNative.h:23,
                 from /home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:3:
/usr/include/c++/5/bits/stl_vector.h:318:7: note: candidate: std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = wgpu::BindGroupEntry; _Alloc = std::allocator<wgpu::BindGroupEntry>]
       vector(const vector& __x)
       ^
/usr/include/c++/5/bits/stl_vector.h:318:7: note:   candidate expects 1 argument, 3 provided
In file included from /usr/include/c++/5/vector:64:0,
                 from /home/nhu/code/opencv/3rdparty/include/webgpu/include/dawn_native/DawnNative.h:23,
                 from /home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:3:
/usr/include/c++/5/bits/stl_vector.h:289:7: note: candidate: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>::size_type, const value_type&, const allocator_type&) [with _Tp = wgpu::BindGroupEntry; _Alloc = std::allocator<wgpu::BindGroupEntry>; std::vector<_Tp, _Alloc>::size_type = long unsigned int; std::vector<_Tp, _Alloc>::value_type = wgpu::BindGroupEntry; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<wgpu::BindGroupEntry>]
       vector(size_type __n, const value_type& __value,
       ^
/usr/include/c++/5/bits/stl_vector.h:289:7: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘std::vector<wgpu::BindGroupEntry>::size_type {aka long unsigned int}’
In file included from /usr/include/c++/5/vector:64:0,
                 from /home/nhu/code/opencv/3rdparty/include/webgpu/include/dawn_native/DawnNative.h:23,
                 from /home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:3:
/usr/include/c++/5/bits/stl_vector.h:277:7: note: candidate: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>::size_type, const allocator_type&) [with _Tp = wgpu::BindGroupEntry; _Alloc = std::allocator<wgpu::BindGroupEntry>; std::vector<_Tp, _Alloc>::size_type = long unsigned int; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<wgpu::BindGroupEntry>]
       vector(size_type __n, const allocator_type& __a = allocator_type())
       ^
/usr/include/c++/5/bits/stl_vector.h:277:7: note:   candidate expects 2 arguments, 3 provided
In file included from /usr/include/c++/5/vector:64:0,
                 from /home/nhu/code/opencv/3rdparty/include/webgpu/include/dawn_native/DawnNative.h:23,
                 from /home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:3:
/usr/include/c++/5/bits/stl_vector.h:264:7: note: candidate: std::vector<_Tp, _Alloc>::vector(const allocator_type&) [with _Tp = wgpu::BindGroupEntry; _Alloc = std::allocator<wgpu::BindGroupEntry>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<wgpu::BindGroupEntry>]
       vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT
       ^
/usr/include/c++/5/bits/stl_vector.h:264:7: note:   candidate expects 1 argument, 3 provided
/usr/include/c++/5/bits/stl_vector.h:253:7: note: candidate: std::vector<_Tp, _Alloc>::vector() [with _Tp = wgpu::BindGroupEntry; _Alloc = std::allocator<wgpu::BindGroupEntry>]
       vector()
       ^
/usr/include/c++/5/bits/stl_vector.h:253:7: note:   candidate expects 0 arguments, 3 provided
modules/dnn/CMakeFiles/opencv_dnn.dir/build.make:1463: recipe for target 'modules/dnn/CMakeFiles/opencv_dnn.dir/src/webgpu/dawnAPITest/helloCompute.cpp.o' failed
make[3]: *** [modules/dnn/CMakeFiles/opencv_dnn.dir/src/webgpu/dawnAPITest/helloCompute.cpp.o] Error 1
CMakeFiles/Makefile2:2482: recipe for target 'modules/dnn/CMakeFiles/opencv_dnn.dir/all' failed
make[2]: *** [modules/dnn/CMakeFiles/opencv_dnn.dir/all] Error 2
CMakeFiles/Makefile2:2489: recipe for target 'modules/dnn/CMakeFiles/opencv_dnn.dir/rule' failed
make[1]: *** [modules/dnn/CMakeFiles/opencv_dnn.dir/rule] Error 2
Makefile:607: recipe for target 'opencv_dnn' failed
make: *** [opencv_dnn] Error 2

I am using Ubuntu 16.04 with gcc 5.4.0. I can build vanilla opencv successfully.

@NALLEIN
Copy link
Collaborator Author

NALLEIN commented Jun 28, 2020

@NALLEIN , I tried your branch with build instructions as

> cmake -D CMAKE_BUILD_TYPE=Release -DWITH_WEBGPU=ON -D CMAKE_INSTALL_PREFIX=/usr/local ..
> make -j8

It reports error when compiling helloCompute.cpp. The error is:

/home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp: In function ‘wgpu::Device createCppDawnDevice()’:
/home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:165:16: error: ‘make_unique’ is not a member of ‘std’
     instance = std::make_unique<dawn_native::Instance>();
                ^
/home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:165:54: error: expected primary-expression before ‘>’ token
     instance = std::make_unique<dawn_native::Instance>();
                                                      ^
/home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:165:56: error: expected primary-expression before ‘)’ token
     instance = std::make_unique<dawn_native::Instance>();
                                                        ^
/home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp: In function ‘int main(int, char**)’:
/home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:254:74: error: no matching function for call to ‘std::vector<wgpu::BindGroupLayoutEntry>::vector(<brace-enclosed initializer list>)’
         {2, wgpu::ShaderStage::Compute, wgpu::BindingType::StorageBuffer}};
                                                                          ^
In file included from /usr/include/c++/5/vector:64:0,
                 from /home/nhu/code/opencv/3rdparty/include/webgpu/include/dawn_native/DawnNative.h:23,
                 from /home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:3:
/usr/include/c++/5/bits/stl_vector.h:401:9: note: candidate: template<class _InputIterator, class> std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&)
         vector(_InputIterator __first, _InputIterator __last,
         ^
/usr/include/c++/5/bits/stl_vector.h:401:9: note:   template argument deduction/substitution failed:
/home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:254:74: note:   cannot convert ‘{2, Compute, StorageBuffer}’ (type ‘<brace-enclosed initializer list>’) to type ‘const allocator_type& {aka const std::allocator<wgpu::BindGroupLayoutEntry>&}’
         {2, wgpu::ShaderStage::Compute, wgpu::BindingType::StorageBuffer}};
                                                                          ^
In file included from /usr/include/c++/5/vector:64:0,
                 from /home/nhu/code/opencv/3rdparty/include/webgpu/include/dawn_native/DawnNative.h:23,
                 from /home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:3:
/usr/include/c++/5/bits/stl_vector.h:373:7: note: candidate: std::vector<_Tp, _Alloc>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = wgpu::BindGroupLayoutEntry; _Alloc = std::allocator<wgpu::BindGroupLayoutEntry>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<wgpu::BindGroupLayoutEntry>]
       vector(initializer_list<value_type> __l,
       ^
/usr/include/c++/5/bits/stl_vector.h:373:7: note:   candidate expects 2 arguments, 3 provided
In file included from /usr/include/c++/5/vector:64:0,
                 from /home/nhu/code/opencv/3rdparty/include/webgpu/include/dawn_native/DawnNative.h:23,
                 from /home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:3:
/usr/include/c++/5/bits/stl_vector.h:348:7: note: candidate: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&) [with _Tp = wgpu::BindGroupLayoutEntry; _Alloc = std::allocator<wgpu::BindGroupLayoutEntry>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<wgpu::BindGroupLayoutEntry>]
       vector(vector&& __rv, const allocator_type& __m)
       ^
/usr/include/c++/5/bits/stl_vector.h:348:7: note:   candidate expects 2 arguments, 3 provided
/usr/include/c++/5/bits/stl_vector.h:339:7: note: candidate: std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&, const allocator_type&) [with _Tp = wgpu::BindGroupLayoutEntry; _Alloc = std::allocator<wgpu::BindGroupLayoutEntry>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<wgpu::BindGroupLayoutEntry>]
       vector(const vector& __x, const allocator_type& __a)
       ^
/usr/include/c++/5/bits/stl_vector.h:339:7: note:   candidate expects 2 arguments, 3 provided
/usr/include/c++/5/bits/stl_vector.h:335:7: note: candidate: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&) [with _Tp = wgpu::BindGroupLayoutEntry; _Alloc = std::allocator<wgpu::BindGroupLayoutEntry>]
       vector(vector&& __x) noexcept
       ^
/usr/include/c++/5/bits/stl_vector.h:335:7: note:   candidate expects 1 argument, 3 provided
In file included from /usr/include/c++/5/vector:64:0,
                 from /home/nhu/code/opencv/3rdparty/include/webgpu/include/dawn_native/DawnNative.h:23,
                 from /home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:3:
/usr/include/c++/5/bits/stl_vector.h:318:7: note: candidate: std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = wgpu::BindGroupLayoutEntry; _Alloc = std::allocator<wgpu::BindGroupLayoutEntry>]
       vector(const vector& __x)
       ^
/usr/include/c++/5/bits/stl_vector.h:318:7: note:   candidate expects 1 argument, 3 provided
In file included from /usr/include/c++/5/vector:64:0,
                 from /home/nhu/code/opencv/3rdparty/include/webgpu/include/dawn_native/DawnNative.h:23,
                 from /home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:3:
/usr/include/c++/5/bits/stl_vector.h:289:7: note: candidate: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>::size_type, const value_type&, const allocator_type&) [with _Tp = wgpu::BindGroupLayoutEntry; _Alloc = std::allocator<wgpu::BindGroupLayoutEntry>; std::vector<_Tp, _Alloc>::size_type = long unsigned int; std::vector<_Tp, _Alloc>::value_type = wgpu::BindGroupLayoutEntry; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<wgpu::BindGroupLayoutEntry>]
       vector(size_type __n, const value_type& __value,
       ^
/usr/include/c++/5/bits/stl_vector.h:289:7: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘std::vector<wgpu::BindGroupLayoutEntry>::size_type {aka long unsigned int}’
In file included from /usr/include/c++/5/vector:64:0,
                 from /home/nhu/code/opencv/3rdparty/include/webgpu/include/dawn_native/DawnNative.h:23,
                 from /home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:3:
/usr/include/c++/5/bits/stl_vector.h:277:7: note: candidate: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>::size_type, const allocator_type&) [with _Tp = wgpu::BindGroupLayoutEntry; _Alloc = std::allocator<wgpu::BindGroupLayoutEntry>; std::vector<_Tp, _Alloc>::size_type = long unsigned int; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<wgpu::BindGroupLayoutEntry>]
       vector(size_type __n, const allocator_type& __a = allocator_type())
       ^
/usr/include/c++/5/bits/stl_vector.h:277:7: note:   candidate expects 2 arguments, 3 provided
In file included from /usr/include/c++/5/vector:64:0,
                 from /home/nhu/code/opencv/3rdparty/include/webgpu/include/dawn_native/DawnNative.h:23,
                 from /home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:3:
/usr/include/c++/5/bits/stl_vector.h:264:7: note: candidate: std::vector<_Tp, _Alloc>::vector(const allocator_type&) [with _Tp = wgpu::BindGroupLayoutEntry; _Alloc = std::allocator<wgpu::BindGroupLayoutEntry>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<wgpu::BindGroupLayoutEntry>]
       vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT
       ^
/usr/include/c++/5/bits/stl_vector.h:264:7: note:   candidate expects 1 argument, 3 provided
/usr/include/c++/5/bits/stl_vector.h:253:7: note: candidate: std::vector<_Tp, _Alloc>::vector() [with _Tp = wgpu::BindGroupLayoutEntry; _Alloc = std::allocator<wgpu::BindGroupLayoutEntry>]
       vector()
       ^
/usr/include/c++/5/bits/stl_vector.h:253:7: note:   candidate expects 0 arguments, 3 provided
/home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:263:69: error: no matching function for call to ‘std::vector<wgpu::BindGroupEntry>::vector(<brace-enclosed initializer list>)’
         { 2, resultBuffer, 0, sizeof(float) * 6, nullptr, nullptr } };
                                                                     ^
In file included from /usr/include/c++/5/vector:64:0,
                 from /home/nhu/code/opencv/3rdparty/include/webgpu/include/dawn_native/DawnNative.h:23,
                 from /home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:3:
/usr/include/c++/5/bits/stl_vector.h:401:9: note: candidate: template<class _InputIterator, class> std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&)
         vector(_InputIterator __first, _InputIterator __last,
         ^
/usr/include/c++/5/bits/stl_vector.h:401:9: note:   template argument deduction/substitution failed:
/home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:263:69: note:   cannot convert ‘{2, resultBuffer, 0, (sizeof (float) * 6ul), nullptr, nullptr}’ (type ‘<brace-enclosed initializer list>’) to type ‘const allocator_type& {aka const std::allocator<wgpu::BindGroupEntry>&}’
         { 2, resultBuffer, 0, sizeof(float) * 6, nullptr, nullptr } };
                                                                     ^
In file included from /usr/include/c++/5/vector:64:0,
                 from /home/nhu/code/opencv/3rdparty/include/webgpu/include/dawn_native/DawnNative.h:23,
                 from /home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:3:
/usr/include/c++/5/bits/stl_vector.h:373:7: note: candidate: std::vector<_Tp, _Alloc>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = wgpu::BindGroupEntry; _Alloc = std::allocator<wgpu::BindGroupEntry>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<wgpu::BindGroupEntry>]
       vector(initializer_list<value_type> __l,
       ^
/usr/include/c++/5/bits/stl_vector.h:373:7: note:   candidate expects 2 arguments, 3 provided
In file included from /usr/include/c++/5/vector:64:0,
                 from /home/nhu/code/opencv/3rdparty/include/webgpu/include/dawn_native/DawnNative.h:23,
                 from /home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:3:
/usr/include/c++/5/bits/stl_vector.h:348:7: note: candidate: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&) [with _Tp = wgpu::BindGroupEntry; _Alloc = std::allocator<wgpu::BindGroupEntry>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<wgpu::BindGroupEntry>]
       vector(vector&& __rv, const allocator_type& __m)
       ^
/usr/include/c++/5/bits/stl_vector.h:348:7: note:   candidate expects 2 arguments, 3 provided
/usr/include/c++/5/bits/stl_vector.h:339:7: note: candidate: std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&, const allocator_type&) [with _Tp = wgpu::BindGroupEntry; _Alloc = std::allocator<wgpu::BindGroupEntry>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<wgpu::BindGroupEntry>]
       vector(const vector& __x, const allocator_type& __a)
       ^
/usr/include/c++/5/bits/stl_vector.h:339:7: note:   candidate expects 2 arguments, 3 provided
/usr/include/c++/5/bits/stl_vector.h:335:7: note: candidate: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&) [with _Tp = wgpu::BindGroupEntry; _Alloc = std::allocator<wgpu::BindGroupEntry>]
       vector(vector&& __x) noexcept
       ^
/usr/include/c++/5/bits/stl_vector.h:335:7: note:   candidate expects 1 argument, 3 provided
In file included from /usr/include/c++/5/vector:64:0,
                 from /home/nhu/code/opencv/3rdparty/include/webgpu/include/dawn_native/DawnNative.h:23,
                 from /home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:3:
/usr/include/c++/5/bits/stl_vector.h:318:7: note: candidate: std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = wgpu::BindGroupEntry; _Alloc = std::allocator<wgpu::BindGroupEntry>]
       vector(const vector& __x)
       ^
/usr/include/c++/5/bits/stl_vector.h:318:7: note:   candidate expects 1 argument, 3 provided
In file included from /usr/include/c++/5/vector:64:0,
                 from /home/nhu/code/opencv/3rdparty/include/webgpu/include/dawn_native/DawnNative.h:23,
                 from /home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:3:
/usr/include/c++/5/bits/stl_vector.h:289:7: note: candidate: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>::size_type, const value_type&, const allocator_type&) [with _Tp = wgpu::BindGroupEntry; _Alloc = std::allocator<wgpu::BindGroupEntry>; std::vector<_Tp, _Alloc>::size_type = long unsigned int; std::vector<_Tp, _Alloc>::value_type = wgpu::BindGroupEntry; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<wgpu::BindGroupEntry>]
       vector(size_type __n, const value_type& __value,
       ^
/usr/include/c++/5/bits/stl_vector.h:289:7: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘std::vector<wgpu::BindGroupEntry>::size_type {aka long unsigned int}’
In file included from /usr/include/c++/5/vector:64:0,
                 from /home/nhu/code/opencv/3rdparty/include/webgpu/include/dawn_native/DawnNative.h:23,
                 from /home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:3:
/usr/include/c++/5/bits/stl_vector.h:277:7: note: candidate: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>::size_type, const allocator_type&) [with _Tp = wgpu::BindGroupEntry; _Alloc = std::allocator<wgpu::BindGroupEntry>; std::vector<_Tp, _Alloc>::size_type = long unsigned int; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<wgpu::BindGroupEntry>]
       vector(size_type __n, const allocator_type& __a = allocator_type())
       ^
/usr/include/c++/5/bits/stl_vector.h:277:7: note:   candidate expects 2 arguments, 3 provided
In file included from /usr/include/c++/5/vector:64:0,
                 from /home/nhu/code/opencv/3rdparty/include/webgpu/include/dawn_native/DawnNative.h:23,
                 from /home/nhu/code/opencv/modules/dnn/src/webgpu/dawnAPITest/helloCompute.cpp:3:
/usr/include/c++/5/bits/stl_vector.h:264:7: note: candidate: std::vector<_Tp, _Alloc>::vector(const allocator_type&) [with _Tp = wgpu::BindGroupEntry; _Alloc = std::allocator<wgpu::BindGroupEntry>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<wgpu::BindGroupEntry>]
       vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT
       ^
/usr/include/c++/5/bits/stl_vector.h:264:7: note:   candidate expects 1 argument, 3 provided
/usr/include/c++/5/bits/stl_vector.h:253:7: note: candidate: std::vector<_Tp, _Alloc>::vector() [with _Tp = wgpu::BindGroupEntry; _Alloc = std::allocator<wgpu::BindGroupEntry>]
       vector()
       ^
/usr/include/c++/5/bits/stl_vector.h:253:7: note:   candidate expects 0 arguments, 3 provided
modules/dnn/CMakeFiles/opencv_dnn.dir/build.make:1463: recipe for target 'modules/dnn/CMakeFiles/opencv_dnn.dir/src/webgpu/dawnAPITest/helloCompute.cpp.o' failed
make[3]: *** [modules/dnn/CMakeFiles/opencv_dnn.dir/src/webgpu/dawnAPITest/helloCompute.cpp.o] Error 1
CMakeFiles/Makefile2:2482: recipe for target 'modules/dnn/CMakeFiles/opencv_dnn.dir/all' failed
make[2]: *** [modules/dnn/CMakeFiles/opencv_dnn.dir/all] Error 2
CMakeFiles/Makefile2:2489: recipe for target 'modules/dnn/CMakeFiles/opencv_dnn.dir/rule' failed
make[1]: *** [modules/dnn/CMakeFiles/opencv_dnn.dir/rule] Error 2
Makefile:607: recipe for target 'opencv_dnn' failed
make: *** [opencv_dnn] Error 2

I am using Ubuntu 16.04 with gcc 5.4.0. I can build vanilla opencv successfully.

Did you try to compile on branch dev2? I can make successfully on branch dev2. Please run this command git checkout -b dev2 origin/dev2 and have a try to compile.
The helloCompute file is compiled separately, not in the entire opencv cmake. You can test the case using thses command

git clone https://github.com/NALLEIN/opencv.git
git checkout dawnAPITest origin/dawnAPITest
cd ${opencvSourceDir}/modules/dnn/src/webgpu/dawnAPITest
mkdir build  & cd build
cmake ..
make
./WEBGPU

@NALLEIN
Copy link
Collaborator Author

NALLEIN commented Jun 28, 2020

@NALLEIN , please provide the build instructions for this PR.

The repo dev2 can be built successfully on branch dev2. You can execute the following command to compile.

git clone https://github.com/NALLEIN/opencv.git
git checkout -b dawnBuild origin/dawnBuild
mkdir build & cd build
cmake -D CMAKE_BUILD_TYPE=Release -DWITH_WEBGPU=ON -D CMAKE_INSTALL_PREFIX=/usr/local ..
make -j8

@huningxin
Copy link
Owner

I tried dawnBuild branch because it is used in this PR. If dev2 branch works, why not use that in this PR? It would be better to let reviewers to test based on the PR that will be merged. So please update this PR with the branch that actually works. Thanks!

@NALLEIN
Copy link
Collaborator Author

NALLEIN commented Jun 28, 2020

I tried dawnBuild branch because it is used in this PR. If dev2 branch works, why not use that in this PR? It would be better to let reviewers to test based on the PR that will be merged. So please update this PR with the branch that actually works. Thanks!

Sorry, I've updated this PR,.

@NALLEIN
Copy link
Collaborator Author

NALLEIN commented Jun 28, 2020

There are two tests to be added:

I made a unit test. It seems that the API wrapper of dawn in dnn/src/webgpu dictionary can work normally. I will modify the module that reads wgpu::Buffer asynchronously.

git clone https://github.com/NALLEIN/opencv.git
git checkout -b dawnWrapperTest origin/dawnWrapperTest
cd modules/dnn/src/webgpu/dawnWrapperTest
mkdir build & cd build
cmake ..
./softmaxTest

Format fmt = wFormatInt32); //uniform buffer
Tensor( const void* data, std::vector<int>& shape,
wgpu::BufferUsage usage,
Tensor( const void* data, size_t size_in_byte); //uniform buffer
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing argument "Format fmt" ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that format is not needed in uniform buffer.

if (!buffer_)
{
// TODO: specific data type
buffer_.reset(new Buffer(device_, data, size_in_byte_, usage_));
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if ( size > size_in_byte_ ) , don't fill, but warning and return

Copy link
Collaborator Author

@NALLEIN NALLEIN Jul 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've modified it, but we just set size_in_byte_ (using the alloc flag to reset buffer) before using fillData, do we need to check again?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, ignore this comment.

sizeof(SoftmaxParam),
wgpu::BufferUsage::Uniform | wgpu::BufferUsage::CopyDst,
wFormatInt32);
sizeof(SoftmaxParam));
Copy link
Collaborator

@wzw-intel wzw-intel Jul 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I get your reason why to specify usage flag in the constructor's argument.

However, Tensor is a concept on the context of dnn network or more generally, "computation graph". The uniform buffer is an optimization method specific to a library. e.g. webgpu. I suggest to use webgpu::Buffer object directly for uniform parameters in your operator's implementation. So that we can simply keep the Tensor a read/write ndarray with unified usage ""wgpu::BufferUsage::Storage | wgpu::BufferUsage::CopyDst | wgpu::BufferUsage::CopySrc""

Copy link
Collaborator Author

@NALLEIN NALLEIN Jul 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, can I use different Tensor constructors to omit buffer usage?
@wzw-intel

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to add usage parameter for Tensor constructor, since Tensor object's usage is always "wgpu::BufferUsage::Storage | wgpu::BufferUsage::CopyDst | wgpu::BufferUsage::CopySrc"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made corresponding changes, PTAL. Sorry for the delay. @wzw-intel

wgpu::BufferUsage usage = wgpu::BufferUsage::Storage);

wgpu::BufferUsage usage = wgpu::BufferUsage::Storage |
wgpu::BufferUsage::CopySrc | wgpu::BufferUsage::CopySrc );
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: duplicated wgpu::BufferUsage::CopySrc

@@ -14,8 +14,10 @@ class Buffer
Buffer(const std::shared_ptr<wgpu::Device> device);
Buffer( const std::shared_ptr<wgpu::Device> device,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary blank in "Buffer( const"

@wzw-intel
Copy link
Collaborator

code is ok for me. BTW, please fix the coding style issues

@NALLEIN
Copy link
Collaborator Author

NALLEIN commented Jul 13, 2020

code is ok for me. BTW, please fix the coding style issues

Thanks, done. Sorry for the delay caused by graduation-related matters last week. PTAL. @wzw-intel

const void* data, size_t size,
wgpu::BufferUsage usage = wgpu::BufferUsage::Storage |
wgpu::BufferUsage::CopySrc | wgpu::BufferUsage::CopySrc );
wgpu::BufferUsage::CopyDst | wgpu::BufferUsage::CopySrc );
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unneccesary blank in "wgpu::BufferUsage::CopySrc );", incorrect indent for the parameters list.

Please check coding style conformance for all source files.
https://github.com/opencv/opencv/wiki/Coding_Style_Guide

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I've fix the coding style issue.

@@ -12,7 +12,7 @@ class Buffer;
class Tensor{
public:
Tensor(Format fmt = wFormatFp32);
Tensor( const void* data, std::vector<int>& shape,
Tensor(const void* data, std::vector<int>& shape,
Format fmt = wFormatFp32);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plase correct the wrong indents of paramters, not only for this function.

Copy link
Collaborator Author

@NALLEIN NALLEIN Jul 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plase correct the wrong indents of paramters, not only for this function.

Thanks for your patience, I've modified it. By the way, I've add the layer test for softmax in this repo, please help to check whether it works on your device.

git clone https://github.com/NALLEIN/opencv.git
cd opencv/
git checkout -b layerTest origin/layerTest
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Release -DWITH_WEBGPU=ON -D CMAKE_INSTALL_PREFIX=/usr/local ..
make -j8
$(PATH_TO_OPENCV)/build/bin/opencv_test_dnn --gtest_filter=Layer_Test_Softmax.Accuracy

The test case is here. If there is nothing wrong with the test, I will start to complete other ops for evaluation 2.
@huningxin @wzw-intel PTAL.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test passed on my machine with nVidia GPU.

@NALLEIN NALLEIN force-pushed the dawnBuild branch 2 times, most recently from 6580754 to ec67c9a Compare July 16, 2020 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[GPU] use native dawn devel package for development environment
3 participants