Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
134 commits
Select commit Hold shift + click to select a range
12338c1
Update clang toolchain for RVV.
hanliutong Feb 16, 2022
f5105ba
remove const in seamless_cloding APIs for better semantics
zchrissirhcz Feb 21, 2022
b863c25
Merge pull request #21646 from zchrissirhcz:seamless_cloning-remove-c…
alalek Feb 21, 2022
8f1c502
Merge pull request #21618 from sivanov-work:vpp_preproc_core
sivanov-work Feb 24, 2022
cd9edba
Merge pull request #21625 from hanliutong:rvv1p0
alalek Feb 24, 2022
119d8b3
Merge pull request #21553 from VadimLevin:dev/vlevin/scope-for-classe…
VadimLevin Feb 24, 2022
d354ad1
Merge pull request #21630 from shibayan:arm64-msvc-neon
shibayan Feb 26, 2022
375fe81
fix slice and expand
rogday Feb 17, 2022
a332509
Merge pull request #21458 from SinM9:speech_recognition_cpp
SinM9 Feb 28, 2022
5cc27fd
Merge pull request #21542 from rogday:split_expand
alalek Feb 28, 2022
ebb6915
Merge pull request #21645 from chacha21:applyColorMap_8UC1_optimized
chacha21 Mar 1, 2022
ccebbbc
feature: submodule or a class scope for exported classes
VadimLevin Jan 20, 2022
9c7adb7
Merge pull request #21530 from anna-khakimova:ak/simd_divrc
Mar 2, 2022
a082375
Merge pull request #21488 from VadimLevin:dev/vlevin/scope-for-classes
alalek Mar 2, 2022
54693cf
Update stitching_detailed.py
jeremyephron Mar 2, 2022
1ae2320
bugfix convertFromD3D11Texture2D
masa-iwm Mar 2, 2022
87f526d
Merge pull request #21676 from masa-iwm:fix-convertFromD3D11Texture2D
alalek Mar 3, 2022
8fa429c
Merge pull request #21674 from jeremyephron:patch-1
alalek Mar 4, 2022
057c3da
Allow Matx static function to work with Vec.
vrabaud Mar 4, 2022
5be5efd
GAPI Fluid: Dynamic dispatching for Add kernel.
Mar 4, 2022
44c2c77
Merge pull request #21658 from sivanov-work:vpp_core_add_roi
sivanov-work Mar 5, 2022
ecb3040
Added reshape() functionality to CPU backend
Mar 1, 2022
901e0dd
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
alalek Mar 5, 2022
8db7d43
Merge pull request #21692 from UnaNancyOwen:add_softmax
UnaNancyOwen Mar 7, 2022
a80af17
dnn: split dnn.cpp code
alalek Feb 16, 2022
a120add
dnn: add dnn.cpp file with information about git commits history
alalek Feb 28, 2022
852904e
Merge pull request #21669 from rgarnov:rg/cpu_backend_reshape
alalek Mar 9, 2022
5d8134e
Merge pull request #21684 from vrabaud:34_vec
alalek Mar 11, 2022
6390b50
Merge pull request #21701 from chacha21:tiff_10_12_14
chacha21 Mar 11, 2022
eb067fe
videoio(ffmpeg): fix memory leak
alalek Mar 13, 2022
fb768c4
Merge pull request #21710 from alalek:fix_21696
alalek Mar 13, 2022
4199180
Changed call of NodeTypeInfo constructor
ilyachur Mar 14, 2022
5bf3c1d
Merge pull request #21715 from ilyachur:change_type_info_creation
alalek Mar 14, 2022
e16cb8b
Merge pull request #21703 from rogday:transpose
rogday Mar 14, 2022
93353ae
Merge pull request #21522 from rogday:lstm
rogday Mar 15, 2022
54733eb
Merge pull request #21687 from sivanov-work:vpp_pp_integr
sivanov-work Mar 15, 2022
e5f2a8e
Merge pull request #21636 from TolyaTalamanov:at/gapi_modeling_tool_d…
TolyaTalamanov Mar 15, 2022
ac8a27c
Merge pull request #21686 from anna-khakimova:ak/dynamic_disp_add_kernel
alalek Mar 15, 2022
0d16b5f
Fix libva dynamic loading
mshabunin Mar 15, 2022
e0ffd3e
Merge pull request #21722 from mshabunin:fix-va-link
alalek Mar 16, 2022
ef6f421
Merge pull request #21677 from chacha21:rectangle_intersection
chacha21 Mar 16, 2022
685797f
Merge pull request #21662 from alalek:dnn_split
alalek Mar 17, 2022
48cd2d1
Merge pull request #21678 from anna-khakimova:ak/resize_f32c1_scalar
Mar 17, 2022
632e07b
Fix typos in tutorials within docs/
luzpaz Mar 17, 2022
b6b5c27
Support for some reduce layers for onnx
zihaomu Mar 18, 2022
ee9fe12
GAPI Fluid: Enable dynamic dispatching for the Sub kernel.
Mar 17, 2022
f7ac724
Merge pull request #21531 from fengyuentau:add_3rdparty_mirrors
fengyuentau Mar 18, 2022
4c79318
dnn: fix index access
alalek Mar 19, 2022
9ce0e51
Objective-C wrapper header fix-ups to avoid clashes with system macros
komakai Mar 20, 2022
f3699b5
Fix build with LLVM 13 on ppc64le
pkubaj Mar 21, 2022
4eae23a
ts: fix some EXPECT_MAT macros
mshabunin Mar 21, 2022
5939962
cartToPolar/polarToCart: disable inplace mode
mshabunin Mar 17, 2022
0a62de0
Merge pull request #21739 from mshabunin:fix-cart-polar
alalek Mar 21, 2022
63c865a
Merge pull request #21746 from anna-khakimova:ak/dynamic_dispatch_sub
alalek Mar 21, 2022
9d16612
Merge pull request #21756 from komakai:fix-pow
alalek Mar 22, 2022
e76cda6
Update CameraBridgeViewBase error message
alexanderconner Mar 22, 2022
2a218b9
Fix VideoCapture::open() brief description
stal12 Mar 23, 2022
21872e2
Merge pull request #21768 from stal12:4.x
alalek Mar 23, 2022
7b848e2
Merge pull request #21764 from alexanderconner:fixes/CameraBridgeView…
alalek Mar 23, 2022
12bae51
Merge pull request #21759 from pkubaj:patch-1
alalek Mar 23, 2022
9067123
Merge pull request #21743 from luzpaz:typos
alalek Mar 23, 2022
8e8e4bb
dnn: fix various dnn related typos
luzpaz Mar 18, 2022
78bc114
Merge pull request #21772 from luzpaz:typo/dnn
alalek Mar 24, 2022
d98e07c
Merge pull request #21660 from TolyaTalamanov:at/handle-exception-in-…
TolyaTalamanov Mar 25, 2022
9dd8e4d
Merge pull request #21719 from TolyaTalamanov:at/pipeline_modeling_to…
TolyaTalamanov Mar 25, 2022
4d46958
fix: inline namespace handling in header parser
VadimLevin Mar 25, 2022
e5bdab0
Merge pull request #21728 from anna-khakimova:ak/resize_f32c1_avx_simd
Mar 25, 2022
9b2b2c8
Merge pull request #21750 from alalek:dnn_fix_index_access
alalek Mar 25, 2022
c9b9088
Merge pull request #21601 from zihaomu:add_reduceLayer
alalek Mar 26, 2022
1339eba
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
alalek Mar 26, 2022
e4abf6e
Merge pull request #21781 from VadimLevin:dev/vlevin/skip-inline-name…
alalek Mar 26, 2022
386df45
python: ensure publishing of subclasses before derived types
alalek Mar 27, 2022
56f21c4
Merge pull request #21785 from alalek:python_fix_subclass_order
alalek Mar 28, 2022
be38d4e
Merge pull request #21777 from anna-khakimova:ak/convertto_simd
Mar 29, 2022
b060151
add test (DISABLED_open_from_web)
sturkmen72 Mar 29, 2022
5440fd6
videoio: initial FFmpeg 5.0 support
mshabunin Mar 19, 2022
b687bc8
dnn(test): update OpenVINO tests 2021.4.2
alalek Mar 30, 2022
6f5cf8c
dnn: fix ReduceLayer implementation, update OpenVINO tests
alalek Mar 30, 2022
3e4a566
Merge pull request #21351 from hanliutong:rvv-clang
hanliutong Mar 30, 2022
5e43407
Merge pull request #21796 from alalek:dnn_reduce_fixup_21601
alalek Mar 30, 2022
abebbf0
Add CUDA support for LSTM.
rogday Mar 30, 2022
9390c56
Merge pull request #21782 from TolyaTalamanov:at/fix-1d-mat-problems
TolyaTalamanov Mar 31, 2022
4e8c507
Update Condition
yash112-lang Mar 30, 2022
7b582b7
Merge pull request #21036 from fengyuentau:timvx_backend_support
zihaomu Mar 31, 2022
8b44ee2
fix MSA sum overflow issue
Mar 30, 2022
f3945fb
Merge pull request #21688 from sivanov-work:vpp_ie_integration
sivanov-work Apr 1, 2022
b379b67
Merge pull request #21752 from fengyuentau:add_github_actions_for_tim…
fengyuentau Apr 1, 2022
ed1439f
Merge pull request #21754 from mshabunin:fix-ffmpeg5
alalek Apr 1, 2022
a233982
Merge pull request #20938 from JulieBar:lstm_cuda2
alalek Apr 1, 2022
af2b770
Merge pull request #21794 from yash112-lang:3.4
alalek Apr 1, 2022
46b6973
Merge pull request #21798 from gititgo:4.x
alalek Apr 1, 2022
38788a3
Merge pull request #21803 from oguzhanguclu:matches_info_pybinding
oguzhanguclu Apr 1, 2022
3822870
Merge pull request #21644 from sturkmen72:patch-5
alalek Apr 1, 2022
4d927e7
dnn(test): update OpenVINO tests 2022.1.0
alalek Mar 30, 2022
a93fb52
Merge pull request #21795 from alalek:dnn_test_update_openvino_3.4
alalek Apr 2, 2022
13a995c
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
alalek Apr 2, 2022
8ac88cf
add BackgroundSubtractor(KNN|MOG2).getDefaultName() implementation
cpoerschke Apr 3, 2022
84b517f
Fix warning
sivanov-work Apr 4, 2022
4754b0e
Merge pull request #21815 from sivanov-work:gapi_fix_ov_warning
alalek Apr 4, 2022
91a5e75
Merge pull request #21731 from AsyaPronina:asyadev/fix_new_stream_event
AsyaPronina Apr 4, 2022
1b3a06a
videoio(ffmpeg): avoid memory leaks
alalek Apr 1, 2022
b2e20a8
Merge pull request #21812 from cpoerschke:BackgroundSubtractor-getDef…
alalek Apr 4, 2022
84b4a5a
Merge pull request #21821 from alalek:update_zlib
alalek Apr 5, 2022
08d44f5
dnn(test): update OpenVINO tests 2022.1.0 (OpenCV 4.x)
alalek Apr 4, 2022
271f7df
videoio(ffmpeg): avoid memory leaks
alalek Apr 1, 2022
d793ec2
Merge pull request #21779 from eplankin:fix_11303
eplankin Apr 5, 2022
7ed5574
Merge pull request #21504 from smirnov-alexey:as/oak_infer
smirnov-alexey Apr 5, 2022
0bd261d
Merge pull request #21820 from alalek:fix_videoio_ffmpeg_memory_leak_3.4
alalek Apr 5, 2022
092030c
Merge pull request #21819 from alalek:fix_videoio_ffmpeg_memory_leak_4.x
alalek Apr 5, 2022
9aa6470
Merge pull request #21822 from alalek:dnn_test_update_openvino_4.x
alalek Apr 5, 2022
e36948c
add ONNX OP sign, shrink and reciprocal
zihaomu Apr 7, 2022
be4a432
dnn(test): update opencv_face_detector checks
opencv-pushbot Apr 11, 2022
e3a55af
dnn(test): update opencv_face_detector checks
opencv-pushbot Apr 11, 2022
03c9648
Merge pull request #21854 from opencv-pushbot:dnn_test_update_checks_…
opencv-pushbot Apr 12, 2022
3a595ea
Merge pull request #21855 from opencv-pushbot:dnn_test_update_checks_…
opencv-pushbot Apr 12, 2022
554d08c
Merge pull request #21775 from luzpaz:typos/gapi
luzpaz Apr 13, 2022
66f3c26
Merge pull request #21831 from zihaomu:sign_layer_onnx
opencv-pushbot Apr 13, 2022
a2b84e9
add assert to tf graph simplifier to address security concerns
rogday Apr 13, 2022
9aff01c
Merge pull request #21861 from rogday:21852_fix
opencv-pushbot Apr 14, 2022
7daf84f
address security concerns in persistence
rogday Apr 13, 2022
0ee2a58
Document defaults for JPEG settings.
asmorkalov Apr 15, 2022
556d211
Merge pull request #21864 from rogday:21851_fix
opencv-pushbot Apr 15, 2022
2465d93
Merge pull request #21873 from asmorkalov:as/jpeg_options
opencv-pushbot Apr 15, 2022
2985739
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
opencv-pushbot Apr 16, 2022
27c15be
Merge pull request #21834 from victor1234:issue-19138_add_termcriteri…
victor1234 Apr 16, 2022
9cd5a0a
Merge pull request #21884 from rogday:cuda_cleanup
rogday Apr 19, 2022
5cc1541
Merge pull request #21841 from victor1234:calib3d-undistortPoints-tests
victor1234 Apr 19, 2022
438fe3f
Merge pull request #21805 from rogday:pretty_fix
rogday Apr 20, 2022
d231420
add mirrors for tim-vx and others in opencv_contrib
fengyuentau Apr 21, 2022
a55fa83
Merge pull request #21875 from asenyaev:asen/workflow_only_linux
asenyaev Apr 21, 2022
2e41db3
Merge pull request #21876 from asenyaev:asen/workflow_only_linux_4x
asenyaev Apr 21, 2022
2b60166
Merge pull request #21811 from fengyuentau:update_mirrors
opencv-pushbot Apr 22, 2022
767857c
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
opencv-pushbot Apr 23, 2022
0fbd58b
Merge branch 4.x
opencv-pushbot Apr 23, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
GAPI Fluid: Dynamic dispatching for Add kernel.
  • Loading branch information
Anna Khakimova committed Mar 4, 2022
commit 5be5efdacfeb3db855ada3aa84feec6b5d8e1de6
4 changes: 2 additions & 2 deletions modules/gapi/perf/cpu/gapi_core_perf_tests_fluid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ INSTANTIATE_TEST_CASE_P(SqrtPerfTestFluid, SqrtPerfTest,
INSTANTIATE_TEST_CASE_P(AddPerfTestFluid, AddPerfTest,
Combine(Values(Tolerance_FloatRel_IntAbs(1e-6, 1).to_compare_f()),
Values(szSmall128, szVGA, sz720p, sz1080p),
Values(CV_8UC1, CV_8UC3, CV_16SC1, CV_32FC1),
Values(-1, CV_8U, CV_32F),
Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1),
Values(-1, CV_8U, CV_16U, CV_16S, CV_32F),
Values(cv::compile_args(CORE_FLUID))));

INSTANTIATE_TEST_CASE_P(AddCPerfTestFluid, AddCPerfTest,
Expand Down
157 changes: 18 additions & 139 deletions modules/gapi/src/backends/fluid/gfluidcore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,136 +379,6 @@ CV_ALWAYS_INLINE int absdiff_simd(const T in1[], const T in2[], T out[], int len
return 0;
}

template<typename T, typename VT>
CV_ALWAYS_INLINE int add_simd_sametype(const T in1[], const T in2[], T out[], int length)
{
constexpr int nlanes = static_cast<int>(VT::nlanes);

if (length < nlanes)
return 0;

int x = 0;
for (;;)
{
for (; x <= length - nlanes; x += nlanes)
{
VT a = vx_load(&in1[x]);
VT b = vx_load(&in2[x]);
vx_store(&out[x], a + b);
}

if (x < length && (in1 != out) && (in2 != out))
{
x = length - nlanes;
continue; // process one more time (unaligned tail)
}
break;
}

return x;
}

template<typename SRC, typename DST>
CV_ALWAYS_INLINE int add_simd(const SRC in1[], const SRC in2[], DST out[], int length)
{
if (std::is_same<DST, float>::value && !std::is_same<SRC, float>::value)
return 0;

if (std::is_same<DST, SRC>::value)
{
if (std::is_same<DST, uchar>::value)
{
return add_simd_sametype<uchar, v_uint8>(reinterpret_cast<const uchar*>(in1),
reinterpret_cast<const uchar*>(in2),
reinterpret_cast<uchar*>(out), length);
}
else if (std::is_same<DST, short>::value)
{
return add_simd_sametype<short, v_int16>(reinterpret_cast<const short*>(in1),
reinterpret_cast<const short*>(in2),
reinterpret_cast<short*>(out), length);
}
else if (std::is_same<DST, float>::value)
{
return add_simd_sametype<float, v_float32>(reinterpret_cast<const float*>(in1),
reinterpret_cast<const float*>(in2),
reinterpret_cast<float*>(out), length);
}
}
else if (std::is_same<SRC, short>::value && std::is_same<DST, uchar>::value)
{
constexpr int nlanes = static_cast<int>(v_uint8::nlanes);

if (length < nlanes)
return 0;

int x = 0;
for (;;)
{
for (; x <= length - nlanes; x += nlanes)
{
v_int16 a1 = vx_load(reinterpret_cast<const short*>(&in1[x]));
v_int16 a2 = vx_load(reinterpret_cast<const short*>(&in1[x + nlanes / 2]));
v_int16 b1 = vx_load(reinterpret_cast<const short*>(&in2[x]));
v_int16 b2 = vx_load(reinterpret_cast<const short*>(&in2[x + nlanes / 2]));

vx_store(reinterpret_cast<uchar*>(&out[x]), v_pack_u(a1 + b1, a2 + b2));
}

if (x < length)
{
CV_DbgAssert((reinterpret_cast<const short*>(in1) != reinterpret_cast<const short*>(out)) &&
(reinterpret_cast<const short*>(in2) != reinterpret_cast<const short*>(out)));
x = length - nlanes;
continue; // process one more time (unaligned tail)
}
break;
}

return x;
}
else if (std::is_same<SRC, float>::value && std::is_same<DST, uchar>::value)
{
constexpr int nlanes = static_cast<int>(v_uint8::nlanes);

if (length < nlanes)
return 0;

int x = 0;
for (;;)
{
for (; x <= length - nlanes; x += nlanes)
{
v_float32 a1 = vx_load(reinterpret_cast<const float*>(&in1[x]));
v_float32 a2 = vx_load(reinterpret_cast<const float*>(&in1[x + nlanes / 4]));
v_float32 a3 = vx_load(reinterpret_cast<const float*>(&in1[x + 2 * nlanes / 4]));
v_float32 a4 = vx_load(reinterpret_cast<const float*>(&in1[x + 3 * nlanes / 4]));

v_float32 b1 = vx_load(reinterpret_cast<const float*>(&in2[x]));
v_float32 b2 = vx_load(reinterpret_cast<const float*>(&in2[x + nlanes / 4]));
v_float32 b3 = vx_load(reinterpret_cast<const float*>(&in2[x + 2 * nlanes / 4]));
v_float32 b4 = vx_load(reinterpret_cast<const float*>(&in2[x + 3 * nlanes / 4]));

vx_store(reinterpret_cast<uchar*>(&out[x]), v_pack_u(v_pack(v_round(a1 + b1), v_round(a2 + b2)),
v_pack(v_round(a3 + b3), v_round(a4 + b4))));
}

if (x < length)
{
CV_DbgAssert((reinterpret_cast<const float*>(in1) != reinterpret_cast<const float*>(out)) &&
(reinterpret_cast<const float*>(in2) != reinterpret_cast<const float*>(out)));
x = length - nlanes;
continue; // process one more time (unaligned tail)
}
break;
}

return x;
}

return 0;
}

template<typename T, typename VT>
CV_ALWAYS_INLINE int sub_simd_sametype(const T in1[], const T in2[], T out[], int length)
{
Expand Down Expand Up @@ -641,7 +511,7 @@ CV_ALWAYS_INLINE int sub_simd(const SRC in1[], const SRC in2[], DST out[], int l
#endif // CV_SIMD

template<typename DST, typename SRC1, typename SRC2>
static CV_ALWAYS_INLINE void run_arithm(Buffer &dst, const View &src1, const View &src2,
CV_ALWAYS_INLINE void run_arithm(Buffer &dst, const View &src1, const View &src2,
Arithm arithm, double scale=1)
{
static_assert(std::is_same<SRC1, SRC2>::value, "wrong types");
Expand All @@ -652,7 +522,7 @@ static CV_ALWAYS_INLINE void run_arithm(Buffer &dst, const View &src1, const Vie

int width = dst.length();
int chan = dst.meta().chan;
int length = width * chan;
const int length = width * chan;

// NB: assume in/out types are not 64-bits
float _scale = static_cast<float>( scale );
Expand Down Expand Up @@ -708,13 +578,22 @@ GAPI_FLUID_KERNEL(GFluidAdd, cv::gapi::core::GAdd, false)
static void run(const View &src1, const View &src2, int /*dtype*/, Buffer &dst)
{
// DST SRC1 SRC2 OP __VA_ARGS__
BINARY_(uchar , uchar , uchar , run_arithm, dst, src1, src2, ARITHM_ADD);
BINARY_(uchar , short, short, run_arithm, dst, src1, src2, ARITHM_ADD);
BINARY_(uchar , float, float, run_arithm, dst, src1, src2, ARITHM_ADD);
BINARY_( short, short, short, run_arithm, dst, src1, src2, ARITHM_ADD);
BINARY_( float, uchar , uchar , run_arithm, dst, src1, src2, ARITHM_ADD);
BINARY_( float, short, short, run_arithm, dst, src1, src2, ARITHM_ADD);
BINARY_( float, float, float, run_arithm, dst, src1, src2, ARITHM_ADD);
BINARY_(uchar, uchar, uchar, run_arithm, dst, src1, src2, ARITHM_ADD);
BINARY_(uchar, ushort, ushort, run_arithm, dst, src1, src2, ARITHM_ADD);
BINARY_(uchar, short, short, run_arithm, dst, src1, src2, ARITHM_ADD);
BINARY_(uchar, float, float, run_arithm, dst, src1, src2, ARITHM_ADD);
BINARY_(short, short, short, run_arithm, dst, src1, src2, ARITHM_ADD);
BINARY_(short, uchar, uchar, run_arithm, dst, src1, src2, ARITHM_ADD);
BINARY_(short, ushort, ushort, run_arithm, dst, src1, src2, ARITHM_ADD);
BINARY_(short, float, float, run_arithm, dst, src1, src2, ARITHM_ADD);
BINARY_(ushort, ushort, ushort, run_arithm, dst, src1, src2, ARITHM_ADD);
BINARY_(ushort, uchar, uchar, run_arithm, dst, src1, src2, ARITHM_ADD);
BINARY_(ushort, short, short, run_arithm, dst, src1, src2, ARITHM_ADD);
BINARY_(ushort, float, float, run_arithm, dst, src1, src2, ARITHM_ADD);
BINARY_(float, uchar, uchar, run_arithm, dst, src1, src2, ARITHM_ADD);
BINARY_(float, ushort, ushort, run_arithm, dst, src1, src2, ARITHM_ADD);
BINARY_(float, short, short, run_arithm, dst, src1, src2, ARITHM_ADD);
BINARY_(float, float, float, run_arithm, dst, src1, src2, ARITHM_ADD);

CV_Error(cv::Error::StsBadArg, "unsupported combination of types");
}
Expand Down
27 changes: 27 additions & 0 deletions modules/gapi/src/backends/fluid/gfluidcore_func.dispatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,33 @@ int merge4_simd(const uchar in1[], const uchar in2[], const uchar in3[],
CV_CPU_DISPATCH_MODES_ALL);
}

#define ADD_SIMD(SRC, DST) \
int add_simd(const SRC in1[], const SRC in2[], DST out[], const int length) \
{ \
\
CV_CPU_DISPATCH(add_simd, (in1, in2, out, length), \
CV_CPU_DISPATCH_MODES_ALL); \
}

ADD_SIMD(uchar, uchar)
ADD_SIMD(ushort, uchar)
ADD_SIMD(short, uchar)
ADD_SIMD(float, uchar)
ADD_SIMD(short, short)
ADD_SIMD(ushort, short)
ADD_SIMD(uchar, short)
ADD_SIMD(float, short)
ADD_SIMD(ushort, ushort)
ADD_SIMD(uchar, ushort)
ADD_SIMD(short, ushort)
ADD_SIMD(float, ushort)
ADD_SIMD(uchar, float)
ADD_SIMD(ushort, float)
ADD_SIMD(short, float)
ADD_SIMD(float, float)

#undef ADD_SIMD

} // namespace fluid
} // namespace gapi
} // namespace cv
Expand Down
22 changes: 22 additions & 0 deletions modules/gapi/src/backends/fluid/gfluidcore_func.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,28 @@ int merge3_simd(const uchar in1[], const uchar in2[], const uchar in3[],
int merge4_simd(const uchar in1[], const uchar in2[], const uchar in3[],
const uchar in4[], uchar out[], const int width);

#define ADD_SIMD(SRC, DST) \
int add_simd(const SRC in1[], const SRC in2[], DST out[], const int length);

ADD_SIMD(uchar, uchar)
ADD_SIMD(ushort, uchar)
ADD_SIMD(short, uchar)
ADD_SIMD(float, uchar)
ADD_SIMD(short, short)
ADD_SIMD(ushort, short)
ADD_SIMD(uchar, short)
ADD_SIMD(float, short)
ADD_SIMD(ushort, ushort)
ADD_SIMD(uchar, ushort)
ADD_SIMD(short, ushort)
ADD_SIMD(float, ushort)
ADD_SIMD(uchar, float)
ADD_SIMD(ushort, float)
ADD_SIMD(short, float)
ADD_SIMD(float, float)

#undef ADD_SIMD

} // namespace fluid
} // namespace gapi
} // namespace cv
Expand Down
Loading