Commit 9f64c56d authored by Allison Vacanti's avatar Allison Vacanti

Prevent FPE in BenchmarkCopySpeed.

UInt64(mean(samples)) may equal zero.
parent 87e25dc7
......@@ -122,8 +122,8 @@ void BenchmarkValueType()
try
{
bench.GatherSamples(functor);
vtkm::UInt64 speed = size / static_cast<vtkm::UInt64>(stats::Mean(bench.GetSamples()));
speedStr = HumanSize(speed) + std::string("/s");
vtkm::Float64 speed = static_cast<Float64>(size) / stats::Mean(bench.GetSamples());
speedStr = HumanSize(static_cast<UInt64>(speed)) + std::string("/s");
}
catch (vtkm::cont::ErrorBadAllocation&)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment