Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
34e9d1eb
Commit
34e9d1eb
authored
Oct 29, 2018
by
Wu Zhiwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dnn/Vulkan: support log softmax
Signed-off-by:
Wu Zhiwen
<
zhiwen.wu@intel.com
>
parent
3914c17b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
61 deletions
+69
-61
softmax.comp
modules/dnn/src/vkcom/shader/softmax.comp
+2
-2
softmax_spv.cpp
modules/dnn/src/vkcom/shader/softmax_spv.cpp
+64
-57
spv_shader.hpp
modules/dnn/src/vkcom/shader/spv_shader.hpp
+1
-1
op_softmax.cpp
modules/dnn/src/vkcom/src/op_softmax.cpp
+2
-1
No files found.
modules/dnn/src/vkcom/shader/softmax.comp
View file @
34e9d1eb
...
@@ -18,6 +18,7 @@ layout(push_constant) uniform pushBlock {
...
@@ -18,6 +18,7 @@ layout(push_constant) uniform pushBlock {
int channel_size;
int channel_size;
int outer_size;
int outer_size;
int channels;
int channels;
int logsoftmax;
} p;
} p;
layout(local_size_x = LOCAL_SZ_X, local_size_y = 1, local_size_z = 1) in;
layout(local_size_x = LOCAL_SZ_X, local_size_y = 1, local_size_z = 1) in;
...
@@ -68,9 +69,8 @@ void main()
...
@@ -68,9 +69,8 @@ void main()
for (int i = 0; i < p.channel_size; ++i)
for (int i = 0; i < p.channel_size; ++i)
{
{
float v = output_buffer[index] / sum_buffer[reduced_buffer_off + i];
float v = output_buffer[index] / sum_buffer[reduced_buffer_off + i];
#ifdef LOG_SOFTMAX
if (p.logsoftmax == 1)
v = log(v);
v = log(v);
#endif
output_buffer[index] = v;
output_buffer[index] = v;
index++;
index++;
}
}
...
...
modules/dnn/src/vkcom/shader/softmax_spv.cpp
View file @
34e9d1eb
...
@@ -9,8 +9,8 @@
...
@@ -9,8 +9,8 @@
namespace
cv
{
namespace
dnn
{
namespace
vkcom
{
namespace
cv
{
namespace
dnn
{
namespace
vkcom
{
extern
const
unsigned
int
softmax_spv
[
14
40
]
=
{
extern
const
unsigned
int
softmax_spv
[
14
96
]
=
{
0x07230203
,
0x00010000
,
0x00080001
,
0x000000
ec
,
0x00000000
,
0x00020011
,
0x00000001
,
0x0006000b
,
0x07230203
,
0x00010000
,
0x00080001
,
0x000000
f4
,
0x00000000
,
0x00020011
,
0x00000001
,
0x0006000b
,
0x00000001
,
0x4c534c47
,
0x6474732e
,
0x3035342e
,
0x00000000
,
0x0003000e
,
0x00000000
,
0x00000001
,
0x00000001
,
0x4c534c47
,
0x6474732e
,
0x3035342e
,
0x00000000
,
0x0003000e
,
0x00000000
,
0x00000001
,
0x0006000f
,
0x00000005
,
0x00000004
,
0x6e69616d
,
0x00000000
,
0x0000000c
,
0x00060010
,
0x00000004
,
0x0006000f
,
0x00000005
,
0x00000004
,
0x6e69616d
,
0x00000000
,
0x0000000c
,
0x00060010
,
0x00000004
,
0x00000011
,
0x00000100
,
0x00000001
,
0x00000001
,
0x00030003
,
0x00000002
,
0x000001c2
,
0x00040005
,
0x00000011
,
0x00000100
,
0x00000001
,
0x00000001
,
0x00030003
,
0x00000002
,
0x000001c2
,
0x00040005
,
...
@@ -18,53 +18,55 @@ extern const unsigned int softmax_spv[1440] = {
...
@@ -18,53 +18,55 @@ extern const unsigned int softmax_spv[1440] = {
0x475f6c67
,
0x61626f6c
,
0x766e496c
,
0x7461636f
,
0x496e6f69
,
0x00000044
,
0x00050005
,
0x00000013
,
0x475f6c67
,
0x61626f6c
,
0x766e496c
,
0x7461636f
,
0x496e6f69
,
0x00000044
,
0x00050005
,
0x00000013
,
0x68737570
,
0x636f6c42
,
0x0000006b
,
0x00070006
,
0x00000013
,
0x00000000
,
0x6e616863
,
0x5f6c656e
,
0x68737570
,
0x636f6c42
,
0x0000006b
,
0x00070006
,
0x00000013
,
0x00000000
,
0x6e616863
,
0x5f6c656e
,
0x657a6973
,
0x00000000
,
0x00060006
,
0x00000013
,
0x00000001
,
0x6574756f
,
0x69735f72
,
0x0000657a
,
0x657a6973
,
0x00000000
,
0x00060006
,
0x00000013
,
0x00000001
,
0x6574756f
,
0x69735f72
,
0x0000657a
,
0x00060006
,
0x00000013
,
0x00000002
,
0x6e616863
,
0x736c656e
,
0x00000000
,
0x00030005
,
0x00000015
,
0x00060006
,
0x00000013
,
0x00000002
,
0x6e616863
,
0x736c656e
,
0x00000000
,
0x00060006
,
0x00000013
,
0x00000070
,
0x00050005
,
0x0000001f
,
0x626f6c67
,
0x6f5f6c61
,
0x00006666
,
0x00070005
,
0x00000029
,
0x00000003
,
0x73676f6c
,
0x6d74666f
,
0x00007861
,
0x00030005
,
0x00000015
,
0x00000070
,
0x00050005
,
0x75646572
,
0x5f646563
,
0x66667562
,
0x6f5f7265
,
0x00006666
,
0x00040005
,
0x0000002e
,
0x65646e69
,
0x0000001f
,
0x626f6c67
,
0x6f5f6c61
,
0x00006666
,
0x00070005
,
0x00000029
,
0x75646572
,
0x5f646563
,
0x00000078
,
0x00030005
,
0x00000030
,
0x00000069
,
0x00040005
,
0x0000003c
,
0x31667562
,
0x00000000
,
0x66667562
,
0x6f5f7265
,
0x00006666
,
0x00040005
,
0x0000002e
,
0x65646e69
,
0x00000078
,
0x00030005
,
0x00060006
,
0x0000003c
,
0x00000000
,
0x5f78616d
,
0x66667562
,
0x00007265
,
0x00030005
,
0x0000003e
,
0x00000030
,
0x00000069
,
0x00040005
,
0x0000003c
,
0x31667562
,
0x00000000
,
0x00060006
,
0x0000003c
,
0x00000000
,
0x00040005
,
0x00000043
,
0x30667562
,
0x00000000
,
0x00070006
,
0x00000043
,
0x00000000
,
0x00000000
,
0x5f78616d
,
0x66667562
,
0x00007265
,
0x00030005
,
0x0000003e
,
0x00000000
,
0x00040005
,
0x75706e69
,
0x75625f74
,
0x72656666
,
0x00000000
,
0x00030005
,
0x00000045
,
0x00000000
,
0x00030005
,
0x00000043
,
0x30667562
,
0x00000000
,
0x00070006
,
0x00000043
,
0x00000000
,
0x75706e69
,
0x75625f74
,
0x0000004f
,
0x00000063
,
0x00030005
,
0x00000059
,
0x00000069
,
0x00030005
,
0x00000076
,
0x00000069
,
0x72656666
,
0x00000000
,
0x00030005
,
0x00000045
,
0x00000000
,
0x00030005
,
0x0000004f
,
0x00000063
,
0x00040005
,
0x00000081
,
0x32667562
,
0x00000000
,
0x00060006
,
0x00000081
,
0x00000000
,
0x5f6d7573
,
0x00030005
,
0x00000059
,
0x00000069
,
0x00030005
,
0x00000076
,
0x00000069
,
0x00040005
,
0x00000081
,
0x66667562
,
0x00007265
,
0x00030005
,
0x00000083
,
0x00000000
,
0x00030005
,
0x0000008c
,
0x00000063
,
0x32667562
,
0x00000000
,
0x00060006
,
0x00000081
,
0x00000000
,
0x5f6d7573
,
0x66667562
,
0x00007265
,
0x00030005
,
0x00000096
,
0x00000069
,
0x00040005
,
0x000000a1
,
0x5f707865
,
0x006c6176
,
0x00040005
,
0x00030005
,
0x00000083
,
0x00000000
,
0x00030005
,
0x0000008c
,
0x00000063
,
0x00030005
,
0x00000096
,
0x000000ad
,
0x33667562
,
0x00000000
,
0x00070006
,
0x000000ad
,
0x00000000
,
0x7074756f
,
0x625f7475
,
0x00000069
,
0x00040005
,
0x000000a1
,
0x5f707865
,
0x006c6176
,
0x00040005
,
0x000000ad
,
0x33667562
,
0x65666675
,
0x00000072
,
0x00030005
,
0x000000af
,
0x00000000
,
0x00030005
,
0x000000c2
,
0x00000063
,
0x00000000
,
0x00070006
,
0x000000ad
,
0x00000000
,
0x7074756f
,
0x625f7475
,
0x65666675
,
0x00000072
,
0x00030005
,
0x000000cc
,
0x00000069
,
0x00030005
,
0x000000d6
,
0x00000076
,
0x00040047
,
0x0000000c
,
0x00030005
,
0x000000af
,
0x00000000
,
0x00030005
,
0x000000c2
,
0x00000063
,
0x00030005
,
0x000000cc
,
0x0000000b
,
0x0000001c
,
0x00050048
,
0x00000013
,
0x00000000
,
0x00000023
,
0x00000000
,
0x00050048
,
0x00000069
,
0x00030005
,
0x000000d6
,
0x00000076
,
0x00040047
,
0x0000000c
,
0x0000000b
,
0x0000001c
,
0x00000013
,
0x00000001
,
0x00000023
,
0x00000004
,
0x00050048
,
0x00000013
,
0x00000002
,
0x00000023
,
0x00050048
,
0x00000013
,
0x00000000
,
0x00000023
,
0x00000000
,
0x00050048
,
0x00000013
,
0x00000001
,
0x00000008
,
0x00030047
,
0x00000013
,
0x00000002
,
0x00040047
,
0x0000003b
,
0x00000006
,
0x00000004
,
0x00000023
,
0x00000004
,
0x00050048
,
0x00000013
,
0x00000002
,
0x00000023
,
0x00000008
,
0x00050048
,
0x00050048
,
0x0000003c
,
0x00000000
,
0x00000023
,
0x00000000
,
0x00030047
,
0x0000003c
,
0x00000003
,
0x00000013
,
0x00000003
,
0x00000023
,
0x0000000c
,
0x00030047
,
0x00000013
,
0x00000002
,
0x00040047
,
0x00040047
,
0x0000003e
,
0x00000022
,
0x00000000
,
0x00040047
,
0x0000003e
,
0x00000021
,
0x00000001
,
0x0000003b
,
0x00000006
,
0x00000004
,
0x00050048
,
0x0000003c
,
0x00000000
,
0x00000023
,
0x00000000
,
0x00040047
,
0x00000042
,
0x00000006
,
0x00000004
,
0x00040048
,
0x00000043
,
0x00000000
,
0x00000018
,
0x00030047
,
0x0000003c
,
0x00000003
,
0x00040047
,
0x0000003e
,
0x00000022
,
0x00000000
,
0x00040047
,
0x00050048
,
0x00000043
,
0x00000000
,
0x00000023
,
0x00000000
,
0x00030047
,
0x00000043
,
0x00000003
,
0x0000003e
,
0x00000021
,
0x00000001
,
0x00040047
,
0x00000042
,
0x00000006
,
0x00000004
,
0x00040048
,
0x00040047
,
0x00000045
,
0x00000022
,
0x00000000
,
0x00040047
,
0x00000045
,
0x00000021
,
0x00000000
,
0x00000043
,
0x00000000
,
0x00000018
,
0x00050048
,
0x00000043
,
0x00000000
,
0x00000023
,
0x00000000
,
0x00040047
,
0x00000080
,
0x00000006
,
0x00000004
,
0x00050048
,
0x00000081
,
0x00000000
,
0x00000023
,
0x00030047
,
0x00000043
,
0x00000003
,
0x00040047
,
0x00000045
,
0x00000022
,
0x00000000
,
0x00040047
,
0x00000000
,
0x00030047
,
0x00000081
,
0x00000003
,
0x00040047
,
0x00000083
,
0x00000022
,
0x00000000
,
0x00000045
,
0x00000021
,
0x00000000
,
0x00040047
,
0x00000080
,
0x00000006
,
0x00000004
,
0x00050048
,
0x00040047
,
0x00000083
,
0x00000021
,
0x00000002
,
0x00040047
,
0x000000ac
,
0x00000006
,
0x00000004
,
0x00000081
,
0x00000000
,
0x00000023
,
0x00000000
,
0x00030047
,
0x00000081
,
0x00000003
,
0x00040047
,
0x00050048
,
0x000000ad
,
0x00000000
,
0x00000023
,
0x00000000
,
0x00030047
,
0x000000ad
,
0x00000003
,
0x00000083
,
0x00000022
,
0x00000000
,
0x00040047
,
0x00000083
,
0x00000021
,
0x00000002
,
0x00040047
,
0x00040047
,
0x000000af
,
0x00000022
,
0x00000000
,
0x00040047
,
0x000000af
,
0x00000021
,
0x00000003
,
0x000000ac
,
0x00000006
,
0x00000004
,
0x00050048
,
0x000000ad
,
0x00000000
,
0x00000023
,
0x00000000
,
0x00040047
,
0x000000eb
,
0x0000000b
,
0x00000019
,
0x00020013
,
0x00000002
,
0x00030021
,
0x00000003
,
0x00030047
,
0x000000ad
,
0x00000003
,
0x00040047
,
0x000000af
,
0x00000022
,
0x00000000
,
0x00040047
,
0x00000002
,
0x00040015
,
0x00000006
,
0x00000020
,
0x00000001
,
0x00040020
,
0x00000007
,
0x00000007
,
0x000000af
,
0x00000021
,
0x00000003
,
0x00040047
,
0x000000f3
,
0x0000000b
,
0x00000019
,
0x00020013
,
0x00000006
,
0x00040015
,
0x00000009
,
0x00000020
,
0x00000000
,
0x00040017
,
0x0000000a
,
0x00000009
,
0x00000002
,
0x00030021
,
0x00000003
,
0x00000002
,
0x00040015
,
0x00000006
,
0x00000020
,
0x00000001
,
0x00000003
,
0x00040020
,
0x0000000b
,
0x00000001
,
0x0000000a
,
0x0004003b
,
0x0000000b
,
0x0000000c
,
0x00040020
,
0x00000007
,
0x00000007
,
0x00000006
,
0x00040015
,
0x00000009
,
0x00000020
,
0x00000000
,
0x00000001
,
0x0004002b
,
0x00000009
,
0x0000000d
,
0x00000000
,
0x00040020
,
0x0000000e
,
0x00000001
,
0x00040017
,
0x0000000a
,
0x00000009
,
0x00000003
,
0x00040020
,
0x0000000b
,
0x00000001
,
0x0000000a
,
0x00000009
,
0x0005001e
,
0x00000013
,
0x00000006
,
0x00000006
,
0x00000006
,
0x00040020
,
0x00000014
,
0x0004003b
,
0x0000000b
,
0x0000000c
,
0x00000001
,
0x0004002b
,
0x00000009
,
0x0000000d
,
0x00000000
,
0x00000009
,
0x00000013
,
0x0004003b
,
0x00000014
,
0x00000015
,
0x00000009
,
0x0004002b
,
0x00000006
,
0x00040020
,
0x0000000e
,
0x00000001
,
0x00000009
,
0x0006001e
,
0x00000013
,
0x00000006
,
0x00000006
,
0x00000016
,
0x00000001
,
0x00040020
,
0x00000017
,
0x00000009
,
0x00000006
,
0x00020014
,
0x0000001a
,
0x00000006
,
0x00000006
,
0x00040020
,
0x00000014
,
0x00000009
,
0x00000013
,
0x0004003b
,
0x00000014
,
0x0004002b
,
0x00000006
,
0x00000021
,
0x00000002
,
0x0004002b
,
0x00000006
,
0x00000025
,
0x00000000
,
0x00000015
,
0x00000009
,
0x0004002b
,
0x00000006
,
0x00000016
,
0x00000001
,
0x00040020
,
0x00000017
,
0x00030016
,
0x0000003a
,
0x00000020
,
0x0003001d
,
0x0000003b
,
0x0000003a
,
0x0003001e
,
0x0000003c
,
0x00000009
,
0x00000006
,
0x00020014
,
0x0000001a
,
0x0004002b
,
0x00000006
,
0x00000021
,
0x00000002
,
0x0000003b
,
0x00040020
,
0x0000003d
,
0x00000002
,
0x0000003c
,
0x0004003b
,
0x0000003d
,
0x0000003e
,
0x0004002b
,
0x00000006
,
0x00000025
,
0x00000000
,
0x00030016
,
0x0000003a
,
0x00000020
,
0x0003001d
,
0x00000002
,
0x0003001d
,
0x00000042
,
0x0000003a
,
0x0003001e
,
0x00000043
,
0x00000042
,
0x00040020
,
0x0000003b
,
0x0000003a
,
0x0003001e
,
0x0000003c
,
0x0000003b
,
0x00040020
,
0x0000003d
,
0x00000002
,
0x00000044
,
0x00000002
,
0x00000043
,
0x0004003b
,
0x00000044
,
0x00000045
,
0x00000002
,
0x00040020
,
0x0000003c
,
0x0004003b
,
0x0000003d
,
0x0000003e
,
0x00000002
,
0x0003001d
,
0x00000042
,
0x0000003a
,
0x00000047
,
0x00000002
,
0x0000003a
,
0x0003001d
,
0x00000080
,
0x0000003a
,
0x0003001e
,
0x00000081
,
0x0003001e
,
0x00000043
,
0x00000042
,
0x00040020
,
0x00000044
,
0x00000002
,
0x00000043
,
0x0004003b
,
0x00000080
,
0x00040020
,
0x00000082
,
0x00000002
,
0x00000081
,
0x0004003b
,
0x00000082
,
0x00000083
,
0x00000044
,
0x00000045
,
0x00000002
,
0x00040020
,
0x00000047
,
0x00000002
,
0x0000003a
,
0x0003001d
,
0x00000002
,
0x0004002b
,
0x0000003a
,
0x00000087
,
0x00000000
,
0x00040020
,
0x000000a0
,
0x00000007
,
0x00000080
,
0x0000003a
,
0x0003001e
,
0x00000081
,
0x00000080
,
0x00040020
,
0x00000082
,
0x00000002
,
0x0000003a
,
0x0003001d
,
0x000000ac
,
0x0000003a
,
0x0003001e
,
0x000000ad
,
0x000000ac
,
0x00040020
,
0x00000081
,
0x0004003b
,
0x00000082
,
0x00000083
,
0x00000002
,
0x0004002b
,
0x0000003a
,
0x00000087
,
0x000000ae
,
0x00000002
,
0x000000ad
,
0x0004003b
,
0x000000ae
,
0x000000af
,
0x00000002
,
0x0004002b
,
0x00000000
,
0x00040020
,
0x000000a0
,
0x00000007
,
0x0000003a
,
0x0003001d
,
0x000000ac
,
0x0000003a
,
0x00000009
,
0x000000e9
,
0x00000100
,
0x0004002b
,
0x00000009
,
0x000000ea
,
0x00000001
,
0x0006002c
,
0x0003001e
,
0x000000ad
,
0x000000ac
,
0x00040020
,
0x000000ae
,
0x00000002
,
0x000000ad
,
0x0004003b
,
0x0000000a
,
0x000000eb
,
0x000000e9
,
0x000000ea
,
0x000000ea
,
0x00050036
,
0x00000002
,
0x00000004
,
0x000000ae
,
0x000000af
,
0x00000002
,
0x0004002b
,
0x00000006
,
0x000000e0
,
0x00000003
,
0x0004002b
,
0x00000009
,
0x000000f1
,
0x00000100
,
0x0004002b
,
0x00000009
,
0x000000f2
,
0x00000001
,
0x0006002c
,
0x0000000a
,
0x000000f3
,
0x000000f1
,
0x000000f2
,
0x000000f2
,
0x00050036
,
0x00000002
,
0x00000004
,
0x00000000
,
0x00000003
,
0x000200f8
,
0x00000005
,
0x0004003b
,
0x00000007
,
0x00000008
,
0x00000007
,
0x00000000
,
0x00000003
,
0x000200f8
,
0x00000005
,
0x0004003b
,
0x00000007
,
0x00000008
,
0x00000007
,
0x0004003b
,
0x00000007
,
0x0000001f
,
0x00000007
,
0x0004003b
,
0x00000007
,
0x00000029
,
0x00000007
,
0x0004003b
,
0x00000007
,
0x0000001f
,
0x00000007
,
0x0004003b
,
0x00000007
,
0x00000029
,
0x00000007
,
0x0004003b
,
0x00000007
,
0x0000002e
,
0x00000007
,
0x0004003b
,
0x00000007
,
0x00000030
,
0x00000007
,
0x0004003b
,
0x00000007
,
0x0000002e
,
0x00000007
,
0x0004003b
,
0x00000007
,
0x00000030
,
0x00000007
,
...
@@ -181,15 +183,20 @@ extern const unsigned int softmax_spv[1440] = {
...
@@ -181,15 +183,20 @@ extern const unsigned int softmax_spv[1440] = {
0x000000db
,
0x000000cc
,
0x00050080
,
0x00000006
,
0x000000dc
,
0x000000da
,
0x000000db
,
0x00060041
,
0x000000db
,
0x000000cc
,
0x00050080
,
0x00000006
,
0x000000dc
,
0x000000da
,
0x000000db
,
0x00060041
,
0x00000047
,
0x000000dd
,
0x00000083
,
0x00000025
,
0x000000dc
,
0x0004003d
,
0x0000003a
,
0x000000de
,
0x00000047
,
0x000000dd
,
0x00000083
,
0x00000025
,
0x000000dc
,
0x0004003d
,
0x0000003a
,
0x000000de
,
0x000000dd
,
0x00050088
,
0x0000003a
,
0x000000df
,
0x000000d9
,
0x000000de
,
0x0003003e
,
0x000000d6
,
0x000000dd
,
0x00050088
,
0x0000003a
,
0x000000df
,
0x000000d9
,
0x000000de
,
0x0003003e
,
0x000000d6
,
0x000000df
,
0x0004003d
,
0x00000006
,
0x000000e0
,
0x0000002e
,
0x0004003d
,
0x0000003a
,
0x000000e1
,
0x000000df
,
0x00050041
,
0x00000017
,
0x000000e1
,
0x00000015
,
0x000000e0
,
0x0004003d
,
0x00000006
,
0x000000d6
,
0x00060041
,
0x00000047
,
0x000000e2
,
0x000000af
,
0x00000025
,
0x000000e0
,
0x0003003e
,
0x000000e2
,
0x000000e1
,
0x000500aa
,
0x0000001a
,
0x000000e3
,
0x000000e2
,
0x00000016
,
0x000300f7
,
0x000000e2
,
0x000000e1
,
0x0004003d
,
0x00000006
,
0x000000e3
,
0x0000002e
,
0x00050080
,
0x00000006
,
0x000000e5
,
0x00000000
,
0x000400fa
,
0x000000e3
,
0x000000e4
,
0x000000e5
,
0x000200f8
,
0x000000e4
,
0x000000e4
,
0x000000e3
,
0x00000016
,
0x0003003e
,
0x0000002e
,
0x000000e4
,
0x000200f9
,
0x000000d0
,
0x0004003d
,
0x0000003a
,
0x000000e6
,
0x000000d6
,
0x0006000c
,
0x0000003a
,
0x000000e7
,
0x00000001
,
0x000200f8
,
0x000000d0
,
0x0004003d
,
0x00000006
,
0x000000e5
,
0x000000cc
,
0x00050080
,
0x00000006
,
0x0000001c
,
0x000000e6
,
0x0003003e
,
0x000000d6
,
0x000000e7
,
0x000200f9
,
0x000000e5
,
0x000200f8
,
0x000000e6
,
0x000000e5
,
0x00000016
,
0x0003003e
,
0x000000cc
,
0x000000e6
,
0x000200f9
,
0x000000cd
,
0x000000e5
,
0x0004003d
,
0x00000006
,
0x000000e8
,
0x0000002e
,
0x0004003d
,
0x0000003a
,
0x000000e9
,
0x000000d6
,
0x00060041
,
0x00000047
,
0x000000ea
,
0x000000af
,
0x00000025
,
0x000000e8
,
0x0003003e
,
0x000000ea
,
0x000000e9
,
0x0004003d
,
0x00000006
,
0x000000eb
,
0x0000002e
,
0x00050080
,
0x00000006
,
0x000000ec
,
0x000000eb
,
0x00000016
,
0x0003003e
,
0x0000002e
,
0x000000ec
,
0x000200f9
,
0x000000d0
,
0x000200f8
,
0x000000d0
,
0x0004003d
,
0x00000006
,
0x000000ed
,
0x000000cc
,
0x00050080
,
0x00000006
,
0x000000ee
,
0x000000ed
,
0x00000016
,
0x0003003e
,
0x000000cc
,
0x000000ee
,
0x000200f9
,
0x000000cd
,
0x000200f8
,
0x000000cf
,
0x000200f9
,
0x000000c6
,
0x000200f8
,
0x000000c6
,
0x0004003d
,
0x00000006
,
0x000200f8
,
0x000000cf
,
0x000200f9
,
0x000000c6
,
0x000200f8
,
0x000000c6
,
0x0004003d
,
0x00000006
,
0x000000e
7
,
0x000000c2
,
0x00050080
,
0x00000006
,
0x000000e8
,
0x000000e7
,
0x00000016
,
0x0003003e
,
0x000000e
f
,
0x000000c2
,
0x00050080
,
0x00000006
,
0x000000f0
,
0x000000ef
,
0x00000016
,
0x0003003e
,
0x000000c2
,
0x000000
e8
,
0x000200f9
,
0x000000c3
,
0x000200f8
,
0x000000c5
,
0x000100fd
,
0x00010038
0x000000c2
,
0x000000
f0
,
0x000200f9
,
0x000000c3
,
0x000200f8
,
0x000000c5
,
0x000100fd
,
0x00010038
};
};
}}}
// namespace cv::dnn::vkcom
}}}
// namespace cv::dnn::vkcom
modules/dnn/src/vkcom/shader/spv_shader.hpp
View file @
34e9d1eb
...
@@ -16,7 +16,7 @@ extern const unsigned int permute_spv[765];
...
@@ -16,7 +16,7 @@ extern const unsigned int permute_spv[765];
extern
const
unsigned
int
lrn_spv
[
1845
];
extern
const
unsigned
int
lrn_spv
[
1845
];
extern
const
unsigned
int
concat_spv
[
541
];
extern
const
unsigned
int
concat_spv
[
541
];
extern
const
unsigned
int
avg_pool_spv
[
1538
];
extern
const
unsigned
int
avg_pool_spv
[
1538
];
extern
const
unsigned
int
softmax_spv
[
14
40
];
extern
const
unsigned
int
softmax_spv
[
14
96
];
extern
const
unsigned
int
prior_box_spv
[
1480
];
extern
const
unsigned
int
prior_box_spv
[
1480
];
extern
const
unsigned
int
max_pool_spv
[
1449
];
extern
const
unsigned
int
max_pool_spv
[
1449
];
extern
const
unsigned
int
relu_spv
[
502
];
extern
const
unsigned
int
relu_spv
[
502
];
...
...
modules/dnn/src/vkcom/src/op_softmax.cpp
View file @
34e9d1eb
...
@@ -22,6 +22,7 @@ struct SoftmaxParam {
...
@@ -22,6 +22,7 @@ struct SoftmaxParam {
int
channel_size
;
int
channel_size
;
int
outer_size
;
int
outer_size
;
int
channels
;
int
channels
;
int
logsoftmax
;
};
};
OpSoftmax
::
OpSoftmax
(
const
int
axis
,
const
bool
log_softmax
)
OpSoftmax
::
OpSoftmax
(
const
int
axis
,
const
bool
log_softmax
)
...
@@ -90,7 +91,7 @@ bool OpSoftmax::forward(Tensor& in, Tensor& out)
...
@@ -90,7 +91,7 @@ bool OpSoftmax::forward(Tensor& in, Tensor& out)
bindTensor
(
device_
,
*
max_tensor_
,
1
,
descriptor_set_
);
bindTensor
(
device_
,
*
max_tensor_
,
1
,
descriptor_set_
);
bindTensor
(
device_
,
*
sum_tensor_
,
2
,
descriptor_set_
);
bindTensor
(
device_
,
*
sum_tensor_
,
2
,
descriptor_set_
);
bindTensor
(
device_
,
out
,
3
,
descriptor_set_
);
bindTensor
(
device_
,
out
,
3
,
descriptor_set_
);
SoftmaxParam
param
=
{
channel_size_
,
outer_size_
,
channels_
};
SoftmaxParam
param
=
{
channel_size_
,
outer_size_
,
channels_
,
log_softmax_
==
true
?
1
:
0
};
recordCommandBuffer
((
void
*
)
&
param
,
sizeof
(
SoftmaxParam
));
recordCommandBuffer
((
void
*
)
&
param
,
sizeof
(
SoftmaxParam
));
runCommandBuffer
();
runCommandBuffer
();
return
true
;
return
true
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment