Commit 27426b7b authored by Robert Maynard's avatar Robert Maynard

Fix warnings found with clang-8 inside the OpenMP device adapter.

parent cec9af64
......@@ -160,7 +160,7 @@ struct CopyIfHelper
void Initialize(vtkm::Id numValues, vtkm::Id valueSize)
{
this->NumValues = numValues;
this->NumThreads = omp_get_num_threads();
this->NumThreads = static_cast<vtkm::Id>(omp_get_num_threads());
this->ValueSize = valueSize;
// Evenly distribute pages across the threads. We manually chunk the
......@@ -168,7 +168,7 @@ struct CopyIfHelper
ComputeChunkSize(
this->NumValues, this->NumThreads, 8, valueSize, this->NumChunks, this->ChunkSize);
this->EndIds.resize(this->NumChunks);
this->EndIds.resize(static_cast<std::size_t>(this->NumChunks));
}
template <typename InIterT, typename StencilIterT, typename OutIterT, typename PredicateT>
......@@ -190,7 +190,7 @@ struct CopyIfHelper
}
}
this->EndIds[chunk] = outPos;
this->EndIds[static_cast<std::size_t>(chunk)] = outPos;
}
template <typename OutIterT>
......@@ -200,7 +200,7 @@ struct CopyIfHelper
for (vtkm::Id i = 1; i < this->NumChunks; ++i)
{
vtkm::Id chunkStart = std::min(i * this->ChunkSize, this->NumValues);
vtkm::Id chunkEnd = this->EndIds[i];
vtkm::Id chunkEnd = this->EndIds[static_cast<std::size_t>(i)];
vtkm::Id numValuesToCopy = chunkEnd - chunkStart;
if (numValuesToCopy > 0 && chunkStart != endPos)
{
......@@ -308,7 +308,7 @@ struct ReduceHelper
accum = f(accum, data[i]);
}
threadData[tid] = accum;
threadData[static_cast<std::size_t>(tid)] = accum;
}
} // end parallel
......@@ -565,11 +565,11 @@ private:
this->NumValues, numThreads, chunksPerThread, sizeof(ValueType), numChunks, this->LeafSize);
// Compute an upper-bound of the number of nodes in the tree:
size_t numNodes = numChunks;
std::size_t numNodes = static_cast<std::size_t>(numChunks);
while (numChunks > 1)
{
numChunks = (numChunks + 1) / 2;
numNodes += numChunks;
numNodes += static_cast<std::size_t>(numChunks);
}
this->Nodes.resize(numNodes);
this->NextNode = 0;
......
......@@ -160,11 +160,11 @@ private:
numVals, numThreads, chunksPerThread, sizeof(ValueType), numChunks, this->LeafSize);
// Compute an upper-bound of the number of nodes in the tree:
size_t numNodes = numChunks;
std::size_t numNodes = static_cast<std::size_t>(numChunks);
while (numChunks > 1)
{
numChunks = (numChunks + 1) / 2;
numNodes += numChunks;
numNodes += static_cast<std::size_t>(numChunks);
}
this->Nodes.resize(numNodes);
this->NextNode = 0;
......
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