|
1 | 1 | /*
|
2 |
| - * Copyright (C) 2020 Linux Studio Plugins Project <https://lsp-plug.in/> |
3 |
| - * (C) 2020 Vladimir Sadovnikov <[email protected]> |
| 2 | + * Copyright (C) 2024 Linux Studio Plugins Project <https://lsp-plug.in/> |
| 3 | + * (C) 2024 Vladimir Sadovnikov <[email protected]> |
4 | 4 | *
|
5 | 5 | * This file is part of lsp-dsp-lib
|
6 |
| - * Created on: 31 мар. 2020 г. |
| 6 | + * Created on: 11 дек. 2024 г. |
7 | 7 | *
|
8 | 8 | * lsp-dsp-lib is free software: you can redistribute it and/or modify
|
9 | 9 | * it under the terms of the GNU Lesser General Public License as published by
|
|
25 | 25 | #include <lsp-plug.in/test-fw/helpers.h>
|
26 | 26 | #include <lsp-plug.in/test-fw/ptest.h>
|
27 | 27 |
|
28 |
| -#define MIN_RANK 8 |
| 28 | +#define MIN_RANK 5 |
29 | 29 | #define MAX_RANK 16
|
30 | 30 |
|
31 | 31 | namespace lsp
|
32 | 32 | {
|
33 | 33 | namespace generic
|
34 | 34 | {
|
35 |
| - float h_dotp(const float *a, const float *b, size_t count); |
36 |
| - float h_sqr_dotp(const float *a, const float *b, size_t count); |
37 | 35 | float h_abs_dotp(const float *a, const float *b, size_t count);
|
38 | 36 | }
|
39 | 37 |
|
40 | 38 | IF_ARCH_X86(
|
41 | 39 | namespace sse
|
42 | 40 | {
|
43 |
| - float h_dotp(const float *a, const float *b, size_t count); |
44 |
| - float h_sqr_dotp(const float *a, const float *b, size_t count); |
45 | 41 | float h_abs_dotp(const float *a, const float *b, size_t count);
|
46 | 42 | }
|
47 | 43 |
|
48 | 44 | namespace avx
|
49 | 45 | {
|
50 |
| - float h_dotp(const float *a, const float *b, size_t count); |
51 |
| - float h_sqr_dotp(const float *a, const float *b, size_t count); |
| 46 | + float h_abs_dotp(const float *a, const float *b, size_t count); |
| 47 | + } |
| 48 | + |
| 49 | + namespace avx512 |
| 50 | + { |
52 | 51 | float h_abs_dotp(const float *a, const float *b, size_t count);
|
53 | 52 | }
|
54 | 53 | )
|
55 | 54 |
|
56 | 55 | IF_ARCH_ARM(
|
57 | 56 | namespace neon_d32
|
58 | 57 | {
|
59 |
| - float h_dotp(const float *a, const float *b, size_t count); |
60 |
| - float h_sqr_dotp(const float *a, const float *b, size_t count); |
61 | 58 | float h_abs_dotp(const float *a, const float *b, size_t count);
|
62 | 59 | }
|
63 | 60 | )
|
64 | 61 |
|
65 | 62 | IF_ARCH_AARCH64(
|
66 | 63 | namespace asimd
|
67 | 64 | {
|
68 |
| - float h_dotp(const float *a, const float *b, size_t count); |
69 |
| - float h_sqr_dotp(const float *a, const float *b, size_t count); |
70 | 65 | float h_abs_dotp(const float *a, const float *b, size_t count);
|
71 | 66 | }
|
72 | 67 | )
|
73 | 68 |
|
74 | 69 | typedef float (* h_dotp_t)(const float *a, const float *b, size_t count);
|
75 | 70 | }
|
76 | 71 |
|
77 |
| -PTEST_BEGIN("dsp.hmath", hdotp, 5, 10000) |
| 72 | +PTEST_BEGIN("dsp.hmath", h_abs_dotp, 5, 5000) |
78 | 73 |
|
79 | 74 | void call(const char *label, float *a, float *b, size_t count, h_dotp_t func)
|
80 | 75 | {
|
@@ -106,26 +101,13 @@ PTEST_BEGIN("dsp.hmath", hdotp, 5, 10000)
|
106 | 101 | {
|
107 | 102 | size_t count = 1 << i;
|
108 | 103 |
|
109 |
| - CALL(generic::h_dotp); |
110 |
| - IF_ARCH_X86(CALL(sse::h_dotp)); |
111 |
| - IF_ARCH_X86(CALL(avx::h_dotp)); |
112 |
| - IF_ARCH_ARM(CALL(neon_d32::h_dotp)); |
113 |
| - IF_ARCH_AARCH64(CALL(asimd::h_dotp)); |
114 |
| - PTEST_SEPARATOR; |
115 |
| - |
116 |
| - CALL(generic::h_sqr_dotp); |
117 |
| - IF_ARCH_X86(CALL(sse::h_sqr_dotp)); |
118 |
| - IF_ARCH_X86(CALL(avx::h_sqr_dotp)); |
119 |
| - IF_ARCH_ARM(CALL(neon_d32::h_sqr_dotp)); |
120 |
| - IF_ARCH_AARCH64(CALL(asimd::h_sqr_dotp)); |
121 |
| - PTEST_SEPARATOR; |
122 |
| - |
123 | 104 | CALL(generic::h_abs_dotp);
|
124 | 105 | IF_ARCH_X86(CALL(sse::h_abs_dotp));
|
125 | 106 | IF_ARCH_X86(CALL(avx::h_abs_dotp));
|
| 107 | + IF_ARCH_X86(CALL(avx512::h_abs_dotp)); |
126 | 108 | IF_ARCH_ARM(CALL(neon_d32::h_abs_dotp));
|
127 | 109 | IF_ARCH_AARCH64(CALL(asimd::h_abs_dotp));
|
128 |
| - PTEST_SEPARATOR2; |
| 110 | + PTEST_SEPARATOR; |
129 | 111 | }
|
130 | 112 |
|
131 | 113 | free_aligned(data);
|
|
0 commit comments