Skip to content

Commit

Permalink
Fix MSVC warning
Browse files Browse the repository at this point in the history
  • Loading branch information
kimwalisch committed Feb 11, 2024
1 parent 148009f commit 262fe48
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/app/StressTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ void stressTest(const CmdOptions& opts)
threads = std::thread::hardware_concurrency();

threads = std::max(1, threads);
int threadIdPadding = std::to_string(threads).size();
int threadIdPadding = (int) std::to_string(threads).size();
std::mutex mutex;

// Each thread executes 1 task
Expand Down Expand Up @@ -162,11 +162,11 @@ void stressTest(const CmdOptions& opts)
}
else
{
// The primesieve::iterator::generate_next_primes() method
// is vectorized using AVX512 on x64 CPUs.
primesieve::iterator it(threadStart, threadStop);
it.generate_next_primes();

// The primesieve::iterator::generate_next_primes() method is
// vectorized using AVX512 on x64 CPUs.
for (; it.primes_[it.size_ - 1] <= threadStop; it.generate_next_primes())
count += it.size_ - it.i_;
for (; it.primes_[it.i_] <= threadStop; it.i_++)
Expand All @@ -188,6 +188,8 @@ void stressTest(const CmdOptions& opts)
}
else
{
// We don't wait here. Keeping the CPU buys is more
// important then printing status output.
std::unique_lock<std::mutex> lock(mutex, std::try_to_lock);

if (lock.owns_lock())
Expand Down

0 comments on commit 262fe48

Please sign in to comment.