Skip to content

Commit

Permalink
*fix bug(mingw, Test.cpp).
Browse files Browse the repository at this point in the history
  • Loading branch information
ermig1979 committed Jun 29, 2023
1 parent 05260e2 commit 5c3c0e8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Simd/SimdAvx512bwDescrIntCdu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ namespace Simd

typedef void (*UnpackDataBx16xN_Ptr)(const uint8_t* const* src, size_t offset, uint8_t* dst);

template<int bits> UnpackDataBx16xN_Ptr GetUnpackDataBx16xN(int tail)
template<int bits> UnpackDataBx16xN_Ptr GetUnpackDataBx16xN(size_t tail)
{
switch (tail / 8)
{
Expand Down
8 changes: 5 additions & 3 deletions src/Test/Test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@
#include "Test/TestLog.h"
#include "Test/TestString.h"

#if defined(_WIN32)
#if defined(_MSC_VER)
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <windows.h>
#endif

Expand Down Expand Up @@ -555,7 +557,7 @@ namespace Test
private:
static bool RunGroup(const Group & group)
{
#if defined(_WIN32)
#if defined(_MSC_VER)
__try
{
return group.autoTest();
Expand All @@ -570,7 +572,7 @@ namespace Test
#endif
}

#if defined(_WIN32)
#if defined(_MSC_VER)
static void PrintErrorMessage(int code)
{
String desc;
Expand Down
9 changes: 6 additions & 3 deletions src/Test/TestPerformance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
#include "Test/TestHtml.h"

#if defined(_MSC_VER)
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <windows.h>
#elif defined(__GNUC__)
#include <sys/time.h>
Expand Down Expand Up @@ -295,7 +297,7 @@ namespace Test
AddToFunction(src, dst.avx512vnni, enable.avx512vnni);
if (desc.find("Simd::Avx512bf16::") != std::string::npos)
AddToFunction(src, dst.avx512bf16, enable.avx512bf16);
if (desc.find("Simd::Amx::") != std::string::npos)
if (desc.find("Simd::AmxBf16::") != std::string::npos)
AddToFunction(src, dst.amx, enable.amx);
if (desc.find("Simd::Vmx::") != std::string::npos)
AddToFunction(src, dst.vmx, enable.vmx);
Expand Down Expand Up @@ -444,8 +446,8 @@ namespace Test
info << "Execution time: " + GetCurrentDateTimeString();
info << ". Test threads: " << threads;
info << ". Simd version: " << SimdVersion() << ".";
#if defined(__linux__)
String cpu = "Unknown", mem = "Unknown";
#if defined(__linux__)
::FILE* c = ::popen("lscpu | grep 'Model name:' | sed -r 's/Model name:\\s{1,}//g'", "r");
if (c)
{
Expand All @@ -464,6 +466,7 @@ namespace Test
mem = mem.substr(0, mem.find('\n'));
::pclose(m);
}
#endif
info << std::endl;
info << "CPU: " << cpu;
info << "; Sockets: " << SimdCpuInfo(SimdCpuInfoSockets);
Expand All @@ -485,7 +488,7 @@ namespace Test
info << (SimdCpuInfo(SimdCpuInfoVsx) ? " VSX" : "");
info << (SimdCpuInfo(SimdCpuInfoNeon) ? " NEON" : "");
info << ".";
#endif

return info.str();
}

Expand Down

0 comments on commit 5c3c0e8

Please sign in to comment.