Skip to content

Commit b9f470a

Browse files
committed
Fix msvc build warnings
There are some msvc build warnings in current xsimd code. It may block adoption of xsimd by some projects (e.g., apache arrow) if they treat compiler warnings as errors. As xsimd is header only, there's no way to build xsimd separately to suppress the warnings. Fixing build warnings is also good for project quality.
1 parent aa54369 commit b9f470a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

include/xsimd/config/xsimd_config.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,34 +211,42 @@
211211
#ifdef _MSC_VER
212212

213213
#if XSIMD_WITH_AVX512
214+
#undef XSIMD_WITH_AVX2
214215
#define XSIMD_WITH_AVX2 1
215216
#endif
216217

217218
#if XSIMD_WITH_AVX2
219+
#undef XSIMD_WITH_AVX
218220
#define XSIMD_WITH_AVX 1
219221
#endif
220222

221223
#if XSIMD_WITH_AVX
224+
#undef XSIMD_WITH_SSE4_2
222225
#define XSIMD_WITH_SSE4_2 1
223226
#endif
224227

225228
#if !defined(__clang__) && (defined(_M_X64) || (defined(_M_IX86_FP) && _M_IX86_FP >= 2))
229+
#undef XSIMD_WITH_SSE4_2
226230
#define XSIMD_WITH_SSE4_2 1
227231
#endif
228232

229233
#if XSIMD_WITH_SSE4_2
234+
#undef XSIMD_WITH_SSE4_1
230235
#define XSIMD_WITH_SSE4_1 1
231236
#endif
232237

233238
#if XSIMD_WITH_SSE4_1
239+
#undef XSIMD_WITH_SSSE3
234240
#define XSIMD_WITH_SSSE3 1
235241
#endif
236242

237243
#if XSIMD_WITH_SSSE3
244+
#undef XSIMD_WITH_SSE3
238245
#define XSIMD_WITH_SSE3 1
239246
#endif
240247

241248
#if XSIMD_WITH_SSE3
249+
#undef XSIMD_WITH_SSE2
242250
#define XSIMD_WITH_SSE2 1
243251
#endif
244252

test/test_select.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class select_test : public testing::Test
5757
detail::store_batch(out, res, i);
5858
}
5959
size_t diff = detail::get_nb_diff(res, expected);
60-
EXPECT_EQ(diff, 0) << print_function_name("pow");
60+
EXPECT_EQ(diff, 0) << print_function_name("select_dynamic");
6161
}
6262
struct pattern
6363
{
@@ -83,7 +83,7 @@ class select_test : public testing::Test
8383
detail::store_batch(out, res, i);
8484
}
8585
size_t diff = detail::get_nb_diff(res, expected);
86-
EXPECT_EQ(diff, 0) << print_function_name("pow");
86+
EXPECT_EQ(diff, 0) << print_function_name("select_static");
8787
}
8888
};
8989

0 commit comments

Comments
 (0)