Skip to content

Commit

Permalink
Release 1.0.25
Browse files Browse the repository at this point in the history
* Implemented AVX-512 optimized minimum and maximum search functions.
* Implemented AVX-512 optimized direct convolution function.
* Updated build scripts.
* Updated module versions in dependencies.
  • Loading branch information
sadko4u committed Aug 2, 2024
2 parents a60a256 + 2c194cd commit 48c6e31
Show file tree
Hide file tree
Showing 27 changed files with 1,373 additions and 34 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
* RECENT CHANGES
*******************************************************************************

=== 1.0.25 ===
* Implemented AVX-512 optimized minimum and maximum search functions.
* Implemented AVX-512 optimized direct convolution function.
* Updated build scripts.
* Updated module versions in dependencies.

=== 1.0.24 ===
* Fixed build for x86 Clang.

Expand Down
2 changes: 1 addition & 1 deletion include/lsp-plug.in/dsp/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
// Define version of headers
#define LSP_DSP_LIB_MAJOR 1
#define LSP_DSP_LIB_MINOR 0
#define LSP_DSP_LIB_MICRO 24
#define LSP_DSP_LIB_MICRO 25

#if defined(__WINDOWS__) || defined(__WIN32__) || defined(__WIN64__) || defined(_WIN64) || defined(_WIN32) || defined(__WINNT) || defined(__WINNT__)
#define LSP_DSP_LIB_EXPORT_MODIFIER __declspec(dllexport)
Expand Down
283 changes: 283 additions & 0 deletions include/private/dsp/arch/x86/avx512/convolution.h

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions include/private/dsp/arch/x86/avx512/search.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (C) 2024 Linux Studio Plugins Project <https://lsp-plug.in/>
* (C) 2024 Vladimir Sadovnikov <[email protected]>
*
* This file is part of lsp-dsp-lib
* Created on: 29 июл. 2024 г.
*
* lsp-dsp-lib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* lsp-dsp-lib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with lsp-dsp-lib. If not, see <https://www.gnu.org/licenses/>.
*/

#ifndef PRIVATE_DSP_ARCH_X86_AVX512_SEARCH_H_
#define PRIVATE_DSP_ARCH_X86_AVX512_SEARCH_H_

#include <lsp-plug.in/dsp/common/types.h>

#include <private/dsp/arch/x86/avx512/search/minmax.h>
#include <private/dsp/arch/x86/avx512/search/iminmax.h>

#endif /* PRIVATE_DSP_ARCH_X86_AVX512_SEARCH_H_ */
384 changes: 384 additions & 0 deletions include/private/dsp/arch/x86/avx512/search/iminmax.h

Large diffs are not rendered by default.

499 changes: 499 additions & 0 deletions include/private/dsp/arch/x86/avx512/search/minmax.h

Large diffs are not rendered by default.

13 changes: 9 additions & 4 deletions make/modules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,15 @@ $(ALL_SRC_MODULES) $(ALL_HDR_MODULES):
$(GIT) -C "$($(@)_PATH)" reset --hard
$(GIT) -C "$($(@)_PATH)" fetch origin --force --prune --prune-tags
$(GIT) -C "$($(@)_PATH)" fetch origin 'refs/tags/*:refs/tags/*' --force
$(GIT) -c advice.detachedHead=false -C "$($(@)_PATH)" checkout -B "$($(@)_BRANCH)" "origin/$($(@)_BRANCH)" || \
$(GIT) -c advice.detachedHead=false -C "$($(@)_PATH)" checkout "refs/tags/$($(@)_BRANCH)" || \
$(GIT) -c advice.detachedHead=false -C "$($(@)_PATH)" checkout -B "$($(@)_NAME)-$($(@)_BRANCH)" "origin/$($(@)_NAME)-$($(@)_BRANCH)" || \
$(GIT) -c advice.detachedHead=false -C "$($(@)_PATH)" checkout "refs/tags/$($(@)_NAME)-$($(@)_BRANCH)"
if $(GIT) -C "$($(@)_PATH)" rev-parse -q --verify "origin/$($(@)_BRANCH)" >/dev/null; then \
$(GIT) -c advice.detachedHead=false -C "$($(@)_PATH)" checkout -B "$($(@)_BRANCH)" "origin/$($(@)_BRANCH)" >/dev/null; \
elif $(GIT) -C "$($(@)_PATH)" rev-parse -q --verify "refs/tags/$($(@)_BRANCH)" >/dev/null; then \
$(GIT) -c advice.detachedHead=false -C "$($(@)_PATH)" checkout "refs/tags/$($(@)_BRANCH)"; \
elif $(GIT) -C "$($(@)_PATH)" rev-parse -q --verify "origin/$($(@)_NAME)-$($(@)_BRANCH)" >/dev/null; then \
$(GIT) -c advice.detachedHead=false -C "$($(@)_PATH)" checkout -B "$($(@)_NAME)-$($(@)_BRANCH)" "origin/$($(@)_NAME)-$($(@)_BRANCH)"; \
else \
$(GIT) -c advice.detachedHead=false -C "$($(@)_PATH)" checkout "refs/tags/$($(@)_NAME)-$($(@)_BRANCH)"; \
fi

fetch: $(SRC_MODULES) $(HDR_MODULES)

Expand Down
12 changes: 6 additions & 6 deletions make/system.mk
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#
# Copyright (C) 2024 Linux Studio Plugins Project <https://lsp-plug.in/>
# (C) 2024 Vladimir Sadovnikov <[email protected]>
# Copyright (C) 2020 Linux Studio Plugins Project <https://lsp-plug.in/>
# (C) 2020 Vladimir Sadovnikov <[email protected]>
#
# This file is part of lsp-dsp-lib
# This file is part of lsp-plugins
#
# lsp-dsp-lib is free software: you can redistribute it and/or modify
# lsp-plugins is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# lsp-dsp-lib is distributed in the hope that it will be useful,
# lsp-plugins is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with lsp-dsp-lib. If not, see <https://www.gnu.org/licenses/>.
# along with lsp-plugins. If not, see <https://www.gnu.org/licenses/>.
#

# Detect operating system
Expand Down
4 changes: 2 additions & 2 deletions modules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
#

# Variables that describe dependencies
LSP_COMMON_LIB_VERSION := 1.0.36
LSP_COMMON_LIB_VERSION := 1.0.37
LSP_COMMON_LIB_NAME := lsp-common-lib
LSP_COMMON_LIB_TYPE := src
LSP_COMMON_LIB_URL_RO := https://github.com/lsp-plugins/$(LSP_COMMON_LIB_NAME).git
LSP_COMMON_LIB_URL_RW := [email protected]:lsp-plugins/$(LSP_COMMON_LIB_NAME).git

LSP_TEST_FW_VERSION := 1.0.25
LSP_TEST_FW_VERSION := 1.0.26
LSP_TEST_FW_NAME := lsp-test-fw
LSP_TEST_FW_TYPE := src
LSP_TEST_FW_URL_RO := https://github.com/lsp-plugins/$(LSP_TEST_FW_NAME).git
Expand Down
2 changes: 1 addition & 1 deletion project.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ ARTIFACT_ID = LSP_DSP_LIB
ARTIFACT_NAME = lsp-dsp-lib
ARTIFACT_DESC = DSP library for digital signal processing
ARTIFACT_HEADERS = lsp-plug.in
ARTIFACT_VERSION = 1.0.24
ARTIFACT_VERSION = 1.0.25
18 changes: 18 additions & 0 deletions src/main/x86/avx512.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@

#define PRIVATE_DSP_ARCH_X86_AVX512_IMPL
#include <private/dsp/arch/x86/avx512/complex.h>
#include <private/dsp/arch/x86/avx512/convolution.h>
#include <private/dsp/arch/x86/avx512/copy.h>
#include <private/dsp/arch/x86/avx512/dynamics.h>
#include <private/dsp/arch/x86/avx512/float.h>
#include <private/dsp/arch/x86/avx512/graphics/axis.h>
#include <private/dsp/arch/x86/avx512/msmatrix.h>
#include <private/dsp/arch/x86/avx512/pcomplex.h>
#include <private/dsp/arch/x86/avx512/pmath.h>
#include <private/dsp/arch/x86/avx512/search.h>

#include <private/dsp/arch/x86/avx512/correlation.h>
#undef PRIVATE_DSP_ARCH_X86_AVX512_IMPL
Expand Down Expand Up @@ -259,13 +261,29 @@
CEXPORT1(vl, pcomplex_r2c_div2);
CEXPORT1(vl, pcomplex_c2r);

CEXPORT1(vl, min);
CEXPORT1(vl, max);
CEXPORT1(vl, minmax);
CEXPORT1(vl, abs_min);
CEXPORT1(vl, abs_max);
CEXPORT1(vl, abs_minmax);

CEXPORT1(vl, min_index);
CEXPORT1(vl, max_index);
CEXPORT1(vl, minmax_index);
CEXPORT1(vl, abs_min_index);
CEXPORT1(vl, abs_max_index);
CEXPORT1(vl, abs_minmax_index);

CEXPORT1(vl, lr_to_ms);
CEXPORT1(vl, lr_to_mid);
CEXPORT1(vl, lr_to_side);
CEXPORT1(vl, ms_to_lr);
CEXPORT1(vl, ms_to_left);
CEXPORT1(vl, ms_to_right);

CEXPORT1(vl, convolve);

CEXPORT1(vl, axis_apply_lin1);

CEXPORT1(vl, compressor_x2_gain);
Expand Down
11 changes: 9 additions & 2 deletions src/test/ptest/convolve.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2020 Linux Studio Plugins Project <https://lsp-plug.in/>
* (C) 2020 Vladimir Sadovnikov <[email protected]>
* Copyright (C) 2024 Linux Studio Plugins Project <https://lsp-plug.in/>
* (C) 2024 Vladimir Sadovnikov <[email protected]>
*
* This file is part of lsp-dsp-lib
* Created on: 31 мар. 2020 г.
Expand Down Expand Up @@ -46,6 +46,11 @@ namespace lsp
void convolve(float *dst, const float *src, const float *conv, size_t length, size_t count);
void convolve_fma3(float *dst, const float *src, const float *conv, size_t length, size_t count);
}

namespace avx512
{
void convolve(float *dst, const float *src, const float *conv, size_t length, size_t count);
}
)

IF_ARCH_ARM(
Expand Down Expand Up @@ -133,6 +138,7 @@ PTEST_BEGIN("dsp", convolve, 5, 1000)
IF_ARCH_X86(CALL((1 << j), (1 << i), sse::convolve));
IF_ARCH_X86(CALL((1 << j), (1 << i), avx::convolve));
IF_ARCH_X86(CALL((1 << j), (1 << i), avx::convolve_fma3));
IF_ARCH_X86(CALL((1 << j), (1 << i), avx512::convolve));
IF_ARCH_ARM(CALL((1 << j), (1 << i), neon_d32::convolve));
IF_ARCH_AARCH64(CALL((1 << j), (1 << i), asimd::convolve));

Expand All @@ -145,6 +151,7 @@ PTEST_BEGIN("dsp", convolve, 5, 1000)
IF_ARCH_X86(CALL((1 << MAX_RANK) - 1, (1 << MAX_RANK) - 1, sse::convolve));
IF_ARCH_X86(CALL((1 << MAX_RANK) - 1, (1 << MAX_RANK) - 1, avx::convolve));
IF_ARCH_X86(CALL((1 << MAX_RANK) - 1, (1 << MAX_RANK) - 1, avx::convolve_fma3));
IF_ARCH_X86(CALL((1 << MAX_RANK) - 1, (1 << MAX_RANK) - 1, avx512::convolve));
IF_ARCH_ARM(CALL((1 << MAX_RANK) - 1, (1 << MAX_RANK) - 1, neon_d32::convolve));
IF_ARCH_AARCH64(CALL((1 << MAX_RANK) - 1, (1 << MAX_RANK) - 1, asimd::convolve));

Expand Down
6 changes: 6 additions & 0 deletions src/test/ptest/search/abs_max_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ namespace lsp
{
size_t abs_max_index(const float *src, size_t count);
}

namespace avx512
{
size_t abs_max_index(const float *src, size_t count);
}
)

IF_ARCH_ARM(
Expand Down Expand Up @@ -101,6 +106,7 @@ PTEST_BEGIN("dsp.search", abs_max_index, 5, 1000)
CALL(generic::abs_max_index);
IF_ARCH_X86(CALL(sse2::abs_max_index));
IF_ARCH_X86(CALL(avx2::abs_max_index));
IF_ARCH_X86(CALL(avx512::abs_max_index));
IF_ARCH_ARM(CALL(neon_d32::abs_max_index));
IF_ARCH_AARCH64(CALL(asimd::abs_max_index));
PTEST_SEPARATOR;
Expand Down
6 changes: 6 additions & 0 deletions src/test/ptest/search/abs_min_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ namespace lsp
{
size_t abs_min_index(const float *src, size_t count);
}

namespace avx512
{
size_t abs_min_index(const float *src, size_t count);
}
)

IF_ARCH_ARM(
Expand Down Expand Up @@ -101,6 +106,7 @@ PTEST_BEGIN("dsp.search", abs_min_index, 5, 1000)
CALL(generic::abs_min_index);
IF_ARCH_X86(CALL(sse2::abs_min_index));
IF_ARCH_X86(CALL(avx2::abs_min_index));
IF_ARCH_X86(CALL(avx512::abs_min_index));
IF_ARCH_ARM(CALL(neon_d32::abs_min_index));
IF_ARCH_AARCH64(CALL(asimd::abs_min_index));
PTEST_SEPARATOR;
Expand Down
6 changes: 6 additions & 0 deletions src/test/ptest/search/abs_minmax_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ namespace lsp
{
void abs_minmax_index(const float *src, size_t count, size_t *min, size_t *max);
}

namespace avx512
{
void abs_minmax_index(const float *src, size_t count, size_t *min, size_t *max);
}
)

IF_ARCH_ARM(
Expand Down Expand Up @@ -101,6 +106,7 @@ PTEST_BEGIN("dsp.search", abs_minmax_index, 5, 1000)
CALL(generic::abs_minmax_index);
IF_ARCH_X86(CALL(sse2::abs_minmax_index));
IF_ARCH_X86(CALL(avx2::abs_minmax_index));
IF_ARCH_X86(CALL(avx512::abs_minmax_index));
IF_ARCH_ARM(CALL(neon_d32::abs_minmax_index));
IF_ARCH_AARCH64(CALL(asimd::abs_minmax_index));
PTEST_SEPARATOR;
Expand Down
6 changes: 6 additions & 0 deletions src/test/ptest/search/max_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ namespace lsp
{
size_t max_index(const float *src, size_t count);
}

namespace avx512
{
size_t max_index(const float *src, size_t count);
}
)

IF_ARCH_ARM(
Expand Down Expand Up @@ -101,6 +106,7 @@ PTEST_BEGIN("dsp.search", max_index, 5, 1000)
CALL(generic::max_index);
IF_ARCH_X86(CALL(sse2::max_index));
IF_ARCH_X86(CALL(avx2::max_index));
IF_ARCH_X86(CALL(avx512::max_index));
IF_ARCH_ARM(CALL(neon_d32::max_index));
IF_ARCH_AARCH64(CALL(asimd::max_index));
PTEST_SEPARATOR;
Expand Down
6 changes: 6 additions & 0 deletions src/test/ptest/search/min_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ namespace lsp
{
size_t min_index(const float *src, size_t count);
}

namespace avx512
{
size_t min_index(const float *src, size_t count);
}
)

IF_ARCH_ARM(
Expand Down Expand Up @@ -101,6 +106,7 @@ PTEST_BEGIN("dsp.search", min_index, 5, 1000)
CALL(generic::min_index);
IF_ARCH_X86(CALL(sse2::min_index));
IF_ARCH_X86(CALL(avx2::min_index));
IF_ARCH_X86(CALL(avx512::min_index));
IF_ARCH_ARM(CALL(neon_d32::min_index));
IF_ARCH_AARCH64(CALL(asimd::min_index));
PTEST_SEPARATOR;
Expand Down
21 changes: 19 additions & 2 deletions src/test/ptest/search/minmax.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2020 Linux Studio Plugins Project <https://lsp-plug.in/>
* (C) 2020 Vladimir Sadovnikov <[email protected]>
* Copyright (C) 2024 Linux Studio Plugins Project <https://lsp-plug.in/>
* (C) 2024 Vladimir Sadovnikov <[email protected]>
*
* This file is part of lsp-dsp-lib
* Created on: 31 мар. 2020 г.
Expand Down Expand Up @@ -62,6 +62,17 @@ namespace lsp
float abs_max(const float *src, size_t count);
void abs_minmax(const float *src, size_t count, float *min, float *max);
}

namespace avx512
{
float min(const float *src, size_t count);
float max(const float *src, size_t count);
void minmax(const float *src, size_t count, float *min, float *max);

float abs_min(const float *src, size_t count);
float abs_max(const float *src, size_t count);
void abs_minmax(const float *src, size_t count, float *min, float *max);
}
)

IF_ARCH_ARM(
Expand Down Expand Up @@ -147,12 +158,14 @@ PTEST_BEGIN("dsp.search", minmax, 5, 1000)
CALL(generic::min);
IF_ARCH_X86(CALL(sse::min));
IF_ARCH_X86(CALL(avx::min));
IF_ARCH_X86(CALL(avx512::min));
IF_ARCH_ARM(CALL(neon_d32::min));
IF_ARCH_AARCH64(CALL(asimd::min));

CALL(generic::abs_min);
IF_ARCH_X86(CALL(sse::abs_min));
IF_ARCH_X86(CALL(avx::abs_min));
IF_ARCH_X86(CALL(avx512::abs_min));
IF_ARCH_ARM(CALL(neon_d32::abs_min));
IF_ARCH_AARCH64(CALL(asimd::abs_min));
PTEST_SEPARATOR;
Expand All @@ -161,12 +174,14 @@ PTEST_BEGIN("dsp.search", minmax, 5, 1000)
CALL(generic::max);
IF_ARCH_X86(CALL(sse::max));
IF_ARCH_X86(CALL(avx::max));
IF_ARCH_X86(CALL(avx512::max));
IF_ARCH_ARM(CALL(neon_d32::max));
IF_ARCH_AARCH64(CALL(asimd::max));

CALL(generic::abs_max);
IF_ARCH_X86(CALL(sse::abs_max));
IF_ARCH_X86(CALL(avx::abs_max));
IF_ARCH_X86(CALL(avx512::abs_max));
IF_ARCH_ARM(CALL(neon_d32::abs_max));
IF_ARCH_AARCH64(CALL(asimd::abs_max));
PTEST_SEPARATOR;
Expand All @@ -175,12 +190,14 @@ PTEST_BEGIN("dsp.search", minmax, 5, 1000)
CALL(generic::minmax);
IF_ARCH_X86(CALL(sse::minmax));
IF_ARCH_X86(CALL(avx::minmax));
IF_ARCH_X86(CALL(avx512::minmax));
IF_ARCH_ARM(CALL(neon_d32::minmax));
IF_ARCH_AARCH64(CALL(asimd::minmax));

CALL(generic::abs_minmax);
IF_ARCH_X86(CALL(sse::abs_minmax));
IF_ARCH_X86(CALL(avx::abs_minmax));
IF_ARCH_X86(CALL(avx512::abs_minmax));
IF_ARCH_ARM(CALL(neon_d32::abs_minmax));
IF_ARCH_AARCH64(CALL(asimd::abs_minmax));
PTEST_SEPARATOR2;
Expand Down
6 changes: 6 additions & 0 deletions src/test/ptest/search/minmax_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ namespace lsp
{
void minmax_index(const float *src, size_t count, size_t *min, size_t *max);
}

namespace avx512
{
void minmax_index(const float *src, size_t count, size_t *min, size_t *max);
}
)

IF_ARCH_ARM(
Expand Down Expand Up @@ -102,6 +107,7 @@ PTEST_BEGIN("dsp.search", minmax_index, 5, 1000)
CALL(generic::minmax_index);
IF_ARCH_X86(CALL(sse2::minmax_index));
IF_ARCH_X86(CALL(avx2::minmax_index));
IF_ARCH_X86(CALL(avx512::minmax_index));
IF_ARCH_ARM(CALL(neon_d32::minmax_index));
IF_ARCH_AARCH64(CALL(asimd::minmax_index));
PTEST_SEPARATOR;
Expand Down
Loading

0 comments on commit 48c6e31

Please sign in to comment.