Skip to content

Commit

Permalink
fix: Make unit.core.exe compile with MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
Tradias committed Nov 29, 2022
1 parent 034c6e0 commit ecf8488
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,14 @@ jobs:
cmake --build . --target unit.arch.exe --config ${{ matrix.cfg.mode }} --parallel 2
cmake --build . --target unit.meta.exe --config ${{ matrix.cfg.mode }} --parallel 2
cmake --build . --target unit.internals.exe --config ${{ matrix.cfg.mode }} --parallel 2
cmake --build . --target unit.core.exe --config ${{ matrix.cfg.mode }} --parallel 2
- name: Running Tests
run: |
cd build
ctest -C ${{ matrix.cfg.mode }} --output-on-failure -R ^unit.arch.*.exe
ctest -C ${{ matrix.cfg.mode }} --output-on-failure -R ^unit.meta.*.exe
ctest -C ${{ matrix.cfg.mode }} --output-on-failure -R ^unit.internals.*.exe
ctest -C ${{ matrix.cfg.mode }} --output-on-failure -R ^unit.core.*.exe
avx512:
runs-on: [self-hosted, avx512]
Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ endif()
## =================================================================================================
if( EVE_BUILD_TEST )
include(config/dependencies)
include(CTest)
include(target/add_parent_target)
include(config/compiler)
include(config/types)
Expand Down
7 changes: 5 additions & 2 deletions test/unit/module/core/constants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
#include "test.hpp"

#include <eve/module/core.hpp>
#include <eve/module/math/regular/exp2.hpp>

#include <limits>

TTS_CASE_TPL("Check basic constants behavior", eve::test::simd::ieee_reals)
<typename T>(tts::type<T>)
Expand All @@ -23,7 +26,7 @@ TTS_CASE_TPL("Check basic constants behavior", eve::test::simd::ieee_reals)

if constexpr( eve::floating_value<T> )
{
TTS_IEEE_EQUAL(eve::allbits(as<T>()), T(0.0 / 0.0));
TTS_IEEE_EQUAL(eve::allbits(as<T>()), T(std::numeric_limits<double>::quiet_NaN()));
TTS_EQUAL(eve::mzero(as<T>()), T(-0));
TTS_EQUAL(eve::half(as<T>()), T(0.5));
TTS_EQUAL(eve::mhalf(as<T>()), T(-0.5));
Expand All @@ -40,7 +43,7 @@ TTS_CASE_TPL("Check ieee754 constants", eve::test::simd::ieee_reals)
using ilt_t = eve::as_integer_t<elt_t>;
using i_t = eve::as_integer_t<T, signed>;
TTS_EQUAL(eve::bitincrement(as<T>()), T(eve::bit_cast(eve::one(as<ilt_t>()), as<elt_t>())));
TTS_IEEE_EQUAL(eve::nan(as<T>()), T(0.0 / 0.0));
TTS_IEEE_EQUAL(eve::nan(as<T>()), T(std::numeric_limits<double>::quiet_NaN()));
TTS_EQUAL(eve::signmask(as<T>()),
T(eve::bit_cast(eve::one(as<ilt_t>()) << (sizeof(ilt_t) * 8 - 1), as<elt_t>())));
TTS_EQUAL(eve::mindenormal(as<T>()), eve::bitincrement(as<T>()));
Expand Down
1 change: 1 addition & 0 deletions test/unit/module/core/frexp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "test.hpp"

#include <eve/module/core.hpp>
#include <eve/module/math/constant/minlog2denormal.hpp>

#include <cmath>
#include <tuple>
Expand Down
2 changes: 1 addition & 1 deletion test/unit/module/core/hi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ TTS_CASE_WITH("Check behavior of hi(wide) on unsigned integral ",
{
using v_t = eve::element_type_t<T>;
using d_t = eve::detail::downgrade_t<v_t>;
constexpr int s = sizeof(v_t) * 4;
static constexpr int s = sizeof(v_t) * 4;
if constexpr( s == 4 )
{
TTS_EQUAL(eve::hi(a0), map([&](auto e) -> v_t { return d_t(eve::shr(e, s)); }, a0));
Expand Down
2 changes: 1 addition & 1 deletion test/unit/module/core/lo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ TTS_CASE_WITH("Check behavior of lo(wide) on unsigned integral ",
{
using v_t = eve::element_type_t<T>;
using d_t = eve::detail::downgrade_t<v_t>;
constexpr int s = sizeof(v_t) * 4;
static constexpr int s = sizeof(v_t) * 4;
if constexpr( s == 4 )
{
TTS_EQUAL(eve::lo(a0),
Expand Down
2 changes: 1 addition & 1 deletion test/unit/module/core/scan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include <eve/module/core.hpp>

#include <algorithm>
#include <numeric>
#include <array>

template<typename T, typename Op>
Expand Down

0 comments on commit ecf8488

Please sign in to comment.