77#include " VecSim/spaces/IP_space.h"
88#include " VecSim/spaces/IP/IP.h"
99#if defined(__x86_64__)
10- #include " VecSim/spaces/IP/IP_AVX512 .h"
11- #include " VecSim/spaces/IP/IP_AVX .h"
12- #include " VecSim/spaces/IP/IP_SSE .h"
10+ #include " VecSim/spaces/functions/AVX512 .h"
11+ #include " VecSim/spaces/functions/AVX .h"
12+ #include " VecSim/spaces/functions/SSE .h"
1313#endif
1414
15- #include " VecSim/spaces/implementation_chooser.h"
16-
1715namespace spaces {
1816dist_func_t <float > IP_FP32_GetDistFunc (size_t dim, const Arch_Optimization arch_opt,
1917 unsigned char *alignment) {
@@ -32,22 +30,22 @@ dist_func_t<float> IP_FP32_GetDistFunc(size_t dim, const Arch_Optimization arch_
3230
3331 switch (arch_opt) {
3432 case ARCH_OPT_AVX512_F:
35- #ifdef __AVX512F__
36- CHOOSE_IMPLEMENTATION ( ret_dist_func, dim, 16 , FP32_InnerProductSIMD16_AVX512 );
33+ #ifdef OPT_AVX512F
34+ ret_dist_func = Choose_FP32_IP_implementation_AVX512 (dim );
3735 if (dim % 16 == 0 ) // no point in aligning if we have an offsetting residual
3836 *alignment = 16 * sizeof (float ); // handles 16 floats
3937 break ;
4038#endif
4139 case ARCH_OPT_AVX:
42- #ifdef __AVX__
43- CHOOSE_IMPLEMENTATION ( ret_dist_func, dim, 16 , FP32_InnerProductSIMD16_AVX );
40+ #ifdef OPT_AVX
41+ ret_dist_func = Choose_FP32_IP_implementation_AVX (dim );
4442 if (dim % 8 == 0 ) // no point in aligning if we have an offsetting residual
4543 *alignment = 8 * sizeof (float ); // handles 8 floats
4644 break ;
4745#endif
4846 case ARCH_OPT_SSE:
49- #ifdef __SSE__
50- CHOOSE_IMPLEMENTATION ( ret_dist_func, dim, 16 , FP32_InnerProductSIMD16_SSE );
47+ #ifdef OPT_SSE
48+ ret_dist_func = Choose_FP32_IP_implementation_SSE (dim );
5149 if (dim % 4 == 0 ) // no point in aligning if we have an offsetting residual
5250 *alignment = 4 * sizeof (float ); // handles 4 floats
5351 break ;
@@ -77,22 +75,22 @@ dist_func_t<double> IP_FP64_GetDistFunc(size_t dim, const Arch_Optimization arch
7775
7876 switch (arch_opt) {
7977 case ARCH_OPT_AVX512_F:
80- #ifdef __AVX512F__
81- CHOOSE_IMPLEMENTATION ( ret_dist_func, dim, 8 , FP64_InnerProductSIMD8_AVX512 );
78+ #ifdef OPT_AVX512F
79+ ret_dist_func = Choose_FP64_IP_implementation_AVX512 (dim );
8280 if (dim % 8 == 0 ) // no point in aligning if we have an offsetting residual
8381 *alignment = 8 * sizeof (double ); // handles 8 doubles
8482 break ;
8583#endif
8684 case ARCH_OPT_AVX:
87- #ifdef __AVX__
88- CHOOSE_IMPLEMENTATION ( ret_dist_func, dim, 8 , FP64_InnerProductSIMD8_AVX );
85+ #ifdef OPT_AVX
86+ ret_dist_func = Choose_FP64_IP_implementation_AVX (dim );
8987 if (dim % 4 == 0 ) // no point in aligning if we have an offsetting residual
9088 *alignment = 4 * sizeof (double ); // handles 4 doubles
9189 break ;
9290#endif
9391 case ARCH_OPT_SSE:
94- #ifdef __SSE__
95- CHOOSE_IMPLEMENTATION ( ret_dist_func, dim, 8 , FP64_InnerProductSIMD8_SSE );
92+ #ifdef OPT_SSE
93+ ret_dist_func = Choose_FP64_IP_implementation_SSE (dim );
9694 if (dim % 2 == 0 ) // no point in aligning if we have an offsetting residual
9795 *alignment = 2 * sizeof (double ); // handles 2 doubles
9896 break ;
@@ -106,5 +104,3 @@ dist_func_t<double> IP_FP64_GetDistFunc(size_t dim, const Arch_Optimization arch
106104}
107105
108106} // namespace spaces
109-
110- #include " VecSim/spaces/implementation_chooser_cleanup.h"
0 commit comments