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

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

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