2023-04-20 19:34:39 -04:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
static bool avx = __builtin_cpu_supports("avx");
|
|
|
|
static bool avx2 = __builtin_cpu_supports("avx2");
|
|
|
|
static bool fma = __builtin_cpu_supports("fma");
|
|
|
|
static bool sse3 = __builtin_cpu_supports("sse3");
|
|
|
|
static std::string s;
|
2023-04-21 07:36:05 -04:00
|
|
|
s = "gpt4all hardware test results:\n";
|
2023-04-21 23:23:57 -04:00
|
|
|
s += " AVX = " + std::to_string(avx) + "\n";
|
2023-04-21 07:36:05 -04:00
|
|
|
s += " AVX2 = " + std::to_string(avx2) + "\n";
|
2023-04-21 23:23:57 -04:00
|
|
|
s += " FMA = " + std::to_string(fma) + "\n";
|
2023-04-21 07:36:05 -04:00
|
|
|
s += " SSE3 = " + std::to_string(sse3) + "\n";
|
|
|
|
fprintf(stderr, "%s", s.c_str());
|
|
|
|
fprintf(stderr, "your hardware supports the \"");
|
|
|
|
fflush(stderr);
|
|
|
|
if (avx2)
|
|
|
|
printf("full");
|
|
|
|
else if (avx && fma)
|
|
|
|
printf("avx_only");
|
|
|
|
else
|
|
|
|
printf("bare_minimum");
|
2023-04-20 19:34:39 -04:00
|
|
|
fflush(stdout);
|
2023-04-21 07:36:05 -04:00
|
|
|
fprintf(stderr, "\" version of gpt4all.\n");
|
|
|
|
fflush(stderr);
|
2023-04-20 19:34:39 -04:00
|
|
|
return 0;
|
|
|
|
}
|