CPU check updates

* Fixes overload resolution error on macos
* Fixes avx looping index error
This commit is contained in:
Kevin Boyd
2021-07-12 10:22:26 -07:00
parent eab7812039
commit 9d920f58c3
5 changed files with 12 additions and 11 deletions

6
avx.cc
View File

@@ -102,7 +102,7 @@ std::string Avx::Avx256(int rounds) {
x[2] = _mm256_mul_pd(minus_four, a[2]);
x[3] = _mm256_mul_pd(minus_four, a[3]);
}
for (int k = 1; k < 4; k++) {
for (int k = 0; k < 4; k++) {
for (int i = 0; i < 4; i++) {
if (gross_x[k][i] != gross_x[k][0]) {
return "avx256 pd";
@@ -140,7 +140,7 @@ std::string Avx::Avx256FMA(int rounds) {
x[2] = _mm256_mul_pd(minus_four, a[2]);
x[3] = _mm256_mul_pd(minus_four, a[3]);
}
for (int k = 1; k < 4; k++) {
for (int k = 0; k < 4; k++) {
for (int i = 0; i < 4; i++) {
if (gross_x[k][i] != gross_x[k][0]) {
return "avx256 pd";
@@ -182,7 +182,7 @@ std::string Avx::Avx512(int rounds) {
x[3] = _mm512_mul_pd(minus_four, a[3]);
}
for (int k = 1; k < 4; k++) {
for (int k = 0; k < 4; k++) {
for (int i = 0; i < 7; i++) {
if (gross_x[k][i] != gross_x[k][0]) {
return "avx512 pd";

View File

@@ -444,8 +444,9 @@ Worker::Choices Worker::MakeChoices(BufferSet *b) {
Json("hash", c.hasher->Name()), ", ",
Json("copy", MalignBuffer::ToString(c.copy_method)), ", ",
Json("memset", c.use_repstos ? "rep;sto" : "memset"), ", ",
JsonBool("madvise", c.madvise), ", ", Json("size", c.buf_size), ", ",
Json("pid", pid_), ", ", Json("round", round_), ", ", c.hole.ToString());
JsonBool("madvise", c.madvise), ", ",
Json("size", static_cast<uint64_t>(c.buf_size)), ", ", Json("pid", pid_),
", ", Json("round", round_), ", ", c.hole.ToString());
return c;
}

View File

@@ -235,8 +235,8 @@ std::string MalignBuffer::Syndrome(const MalignBuffer &that) const {
std::string MalignBuffer::CorruptionSyndrome(const MalignBuffer &that) const {
std::stringstream s;
if (size() != that.size()) {
s << Json("unequalSizeThis", size()) << ", "
<< Json("unequalSizeThat", that.size());
s << Json("unequalSizeThis", static_cast<uint64_t>(size())) << ", "
<< Json("unequalSizeThat", static_cast<uint64_t>(that.size()));
return s.str();
}
bool failed_memcmp = memcmp(data(), that.data(), that.size());

View File

@@ -28,8 +28,8 @@ class MalignBuffer {
public:
struct PunchedHole {
std::string ToString() const;
size_t start = 0;
size_t length = 0;
uint64_t start = 0;
uint64_t length = 0;
unsigned char v = 0x53;
};

View File

@@ -72,8 +72,8 @@ absl::Status Silkscreen::CheckMySlots(int tid, uint64_t round) const {
const char v = *data(k);
if (v == expected) continue;
error_count++;
last_error = absl::StrCat(Json("position", k), ", ", Json("is", v), ", ",
Json("expected", expected));
last_error = absl::StrCat(Json("position", static_cast<uint64_t>(k)), ", ",
Json("is", v), ", ", Json("expected", expected));
}
if (slot_count(tid) != slots_read) {
last_error = absl::StrCat(Json("read", slots_read), ", ",