cleanup and prevent windows macros from stepping on everything

This commit is contained in:
Andrew Cassidy 2022-05-23 00:21:33 -07:00
parent bf35983b2d
commit 345344eef3
3 changed files with 19 additions and 20 deletions

View File

@ -71,6 +71,10 @@ if (CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
set(PROJECT_WARNINGS ${CLANG_WARNINGS})
endif ()
if (MSCV)
target_compile_options(_quicktex 'WINDOWS_LEAN_AND_MEAN') # prevent windows macros from stepping on everything
endif()
message("RELEASE FLAGS=${CMAKE_CXX_FLAGS}")
message("DEBUG FLAGS=${CMAKE_CXX_FLAGS_DEBUG}")

View File

@ -67,11 +67,11 @@ build-frontend = "build"
test-command = "pytest {project}/tests --verbose"
test-extras = ["tests"]
test-skip = "*-macosx_arm64 *-macosx_universal2:arm64" # skip testing on arm macOS because CIBW doesnt support it
environment = { QUICKTEX_SIMD_MODE = "SSE4" } # SSE4 has a 99% market share and was released under the Bush administration
[tool.cibuildwheel.macos]
archs = ["x86_64", "universal2"] # build fat binaries, or x86-64 for python 3.7
skip = ["cp{38,39,31*}-macosx_x86_64"] # skip x86-only builds where fat binaries are supported
environment = { QUICKTEX_HWY_MODE = "SSE4" } # SSE4 has a 99% market share and was released under the Bush administration
[tool.cibuildwheel.windows]
archs = ["auto64"] # arm64 windows builds not yet supported
@ -80,7 +80,6 @@ archs = ["auto64"] # arm64 windows builds not yet supported
skip = ["cp37-musllinux*", "*musllinux_aarch64*"] # skip targets without available Pillow wheels
manylinux-x86_64-image = "manylinux2014"
manylinux-aarch64-image = "manylinux2014"
environment = { QUICKTEX_HWY_MODE = "SSE4" } # SSE4 has a 99% market share and was released under the Bush administration
[tool.black]
line-length = 120 # 80-column is stupid

View File

@ -62,25 +62,21 @@ template <typename T> constexpr auto make_arrays() {
return arrays;
}
template <typename T, size_t N> long int sumArray(std::array<T, N> const &arg) {
return std::accumulate(arg.begin(), arg.end(), (long)0);
}
#define UTEST_WHADD(TYPE) \
UTEST(simd, whadd_##TYPE) { \
for (auto arr : make_arrays<TYPE>()) { \
auto v = xsimd::load_unaligned(&arr[0]); \
auto vsum = simd::whadd(v); \
auto ssum = sumArray(arr); \
ASSERT_EQ(vsum, ssum); \
} \
#define UTEST_WHADD(TYPE) \
UTEST(simd, whadd_##TYPE) { \
for (auto arr : make_arrays<TYPE>()) { \
auto v = xsimd::load_unaligned(&arr[0]); \
auto vsum = simd::whadd(v); \
auto ssum = std::accumulate(arr.begin(), arr.end(), static_cast<next_size_t<TYPE>>(0)); \
ASSERT_EQ(vsum, ssum); \
} \
}
UTEST_WHADD(int8_t);
UTEST_WHADD(uint8_t);
UTEST_WHADD(int16_t);
UTEST_WHADD(uint16_t);
UTEST_WHADD(int32_t);
UTEST_WHADD(uint32_t);
UTEST_WHADD(int8_t)
UTEST_WHADD(uint8_t)
UTEST_WHADD(int16_t)
UTEST_WHADD(uint16_t)
UTEST_WHADD(int32_t)
UTEST_WHADD(uint32_t)
} // namespace quicktex::tests