mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-08 13:23:51 +00:00
Correct warnings found after disabling all warning when CUDA is enabled.
This commit is contained in:
parent
8808b41fbd
commit
0d45c5cff2
@ -249,7 +249,6 @@ public:
|
||||
|
||||
static void TestAddPoints()
|
||||
{
|
||||
vtkm::Range initalRange{ 0, 1.0 };
|
||||
vtkm::Range range{ -20, 20.0 };
|
||||
auto rgbspace = vtkm::cont::ColorSpace::RGB;
|
||||
|
||||
|
@ -115,20 +115,22 @@ vtkm::cont::DataSet CreateDataSetArr(bool useSeparatedCoords,
|
||||
vtkm::cont::DataSet dataSet;
|
||||
vtkm::cont::DataSetFieldAdd dsf;
|
||||
vtkm::cont::DataSetBuilderExplicit dsb;
|
||||
float f = 0.0f;
|
||||
if (useSeparatedCoords)
|
||||
{
|
||||
std::vector<T> xvals(numPoints), yvals(numPoints), zvals(numPoints);
|
||||
std::vector<T> varP(numPoints), varC(numCells);
|
||||
for (std::size_t i = 0; i < numPoints; i++)
|
||||
for (std::size_t i = 0; i < numPoints; i++, f++)
|
||||
{
|
||||
xvals[i] = coords[i * 3 + 0];
|
||||
yvals[i] = coords[i * 3 + 1];
|
||||
zvals[i] = coords[i * 3 + 2];
|
||||
varP[i] = static_cast<T>(i * 1.1f);
|
||||
varP[i] = static_cast<T>(f * 1.1f);
|
||||
}
|
||||
for (std::size_t i = 0; i < numCells; i++)
|
||||
f = 0.0f;
|
||||
for (std::size_t i = 0; i < numCells; i++, f++)
|
||||
{
|
||||
varC[i] = static_cast<T>(i * 1.1f);
|
||||
varC[i] = static_cast<T>(f * 1.1f);
|
||||
}
|
||||
vtkm::cont::ArrayHandle<T> X, Y, Z, P, C;
|
||||
DFA::Copy(vtkm::cont::make_ArrayHandle(xvals), X);
|
||||
@ -146,16 +148,17 @@ vtkm::cont::DataSet CreateDataSetArr(bool useSeparatedCoords,
|
||||
{
|
||||
std::vector<vtkm::Vec<T, 3>> tmp(numPoints);
|
||||
std::vector<vtkm::Vec<T, 1>> varP(numPoints), varC(numCells);
|
||||
for (std::size_t i = 0; i < numPoints; i++)
|
||||
for (std::size_t i = 0; i < numPoints; i++, f++)
|
||||
{
|
||||
tmp[i][0] = coords[i * 3 + 0];
|
||||
tmp[i][1] = coords[i * 3 + 1];
|
||||
tmp[i][2] = coords[i * 3 + 2];
|
||||
varP[i][0] = static_cast<T>(i * 1.1f);
|
||||
varP[i][0] = static_cast<T>(f * 1.1f);
|
||||
}
|
||||
for (std::size_t i = 0; i < numCells; i++)
|
||||
f = 0.0f;
|
||||
for (std::size_t i = 0; i < numCells; i++, f++)
|
||||
{
|
||||
varC[i][0] = static_cast<T>(i * 1.1f);
|
||||
varC[i][0] = static_cast<T>(f * 1.1f);
|
||||
}
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<T, 3>> pts;
|
||||
DFA::Copy(vtkm::cont::make_ArrayHandle(tmp), pts);
|
||||
@ -181,19 +184,21 @@ vtkm::cont::DataSet CreateDataSetVec(bool useSeparatedCoords,
|
||||
vtkm::cont::DataSetFieldAdd dsf;
|
||||
vtkm::cont::DataSetBuilderExplicit dsb;
|
||||
|
||||
float f = 0.0f;
|
||||
if (useSeparatedCoords)
|
||||
{
|
||||
std::vector<T> X(numPoints), Y(numPoints), Z(numPoints), varP(numPoints), varC(numCells);
|
||||
for (std::size_t i = 0; i < numPoints; i++)
|
||||
for (std::size_t i = 0; i < numPoints; i++, f++)
|
||||
{
|
||||
X[i] = coords[i * 3 + 0];
|
||||
Y[i] = coords[i * 3 + 1];
|
||||
Z[i] = coords[i * 3 + 2];
|
||||
varP[i] = static_cast<T>(i * 1.1f);
|
||||
varP[i] = static_cast<T>(f * 1.1f);
|
||||
}
|
||||
for (std::size_t i = 0; i < numCells; i++)
|
||||
f = 0.0f;
|
||||
for (std::size_t i = 0; i < numCells; i++, f++)
|
||||
{
|
||||
varC[i] = static_cast<T>(i * 1.1f);
|
||||
varC[i] = static_cast<T>(f * 1.1f);
|
||||
}
|
||||
dataSet = dsb.Create(
|
||||
X, Y, Z, createVec(numCells, shape), createVec(numCells, indices), createVec(numConn, conn));
|
||||
@ -205,16 +210,17 @@ vtkm::cont::DataSet CreateDataSetVec(bool useSeparatedCoords,
|
||||
{
|
||||
std::vector<vtkm::Vec<T, 3>> pts(numPoints);
|
||||
std::vector<vtkm::Vec<T, 1>> varP(numPoints), varC(numCells);
|
||||
for (std::size_t i = 0; i < numPoints; i++)
|
||||
for (std::size_t i = 0; i < numPoints; i++, f++)
|
||||
{
|
||||
pts[i][0] = coords[i * 3 + 0];
|
||||
pts[i][1] = coords[i * 3 + 1];
|
||||
pts[i][2] = coords[i * 3 + 2];
|
||||
varP[i][0] = static_cast<T>(i * 1.1f);
|
||||
varP[i][0] = static_cast<T>(f * 1.1f);
|
||||
}
|
||||
for (std::size_t i = 0; i < numCells; i++)
|
||||
f = 0.0f;
|
||||
for (std::size_t i = 0; i < numCells; i++, f++)
|
||||
{
|
||||
varC[i][0] = static_cast<T>(i * 1.1f);
|
||||
varC[i][0] = static_cast<T>(f * 1.1f);
|
||||
}
|
||||
dataSet = dsb.Create(
|
||||
pts, createVec(numCells, shape), createVec(numCells, indices), createVec(numConn, conn));
|
||||
|
@ -368,7 +368,7 @@ void ColorTableBase::FindColors(double value,
|
||||
rgb1 = this->NaNColor;
|
||||
rgb2 = this->NaNColor;
|
||||
}
|
||||
else if (this->ColorSize == 0.0f)
|
||||
else if (this->ColorSize == 0)
|
||||
{ //If we have no entires use the below range value
|
||||
rgb1 = this->BelowRangeColor;
|
||||
rgb2 = this->BelowRangeColor;
|
||||
@ -425,7 +425,7 @@ float ColorTableBase::MapThroughOpacitySpace(double value) const
|
||||
{ //If we are trying to find the opacity of NaN use a constant of 1.0
|
||||
return 1.0f;
|
||||
}
|
||||
else if (this->OpacitySize == 0.0f)
|
||||
else if (this->OpacitySize == 0)
|
||||
{ //no opacity control functions so use a constant of 1.0
|
||||
return 1.0f;
|
||||
}
|
||||
|
@ -394,7 +394,7 @@ public:
|
||||
return false;
|
||||
vtkm::Id3 idx000, idx001, idx010, idx011, idx100, idx101, idx110, idx111;
|
||||
|
||||
vtkm::Vec<vtkm::Id, 3> cellPos;
|
||||
vtkm::Vec<vtkm::Id, 3> cellPos = dims;
|
||||
vtkm::Id index;
|
||||
/*Get floor X location*/
|
||||
for (index = 0; index < dims[0] - 1; index++)
|
||||
|
@ -92,7 +92,7 @@ public:
|
||||
FieldType,
|
||||
DeviceAdapterTag>;
|
||||
|
||||
ParticleAdvectionWorklet() {}
|
||||
VTKM_EXEC_CONT ParticleAdvectionWorklet() {}
|
||||
|
||||
template <typename PointStorage, typename FieldStorage>
|
||||
void Run(const IntegratorType& it,
|
||||
@ -148,7 +148,7 @@ public:
|
||||
FieldType,
|
||||
DeviceAdapterTag>;
|
||||
|
||||
StreamlineWorklet() {}
|
||||
VTKM_EXEC_CONT StreamlineWorklet() {}
|
||||
|
||||
template <typename PointStorage, typename FieldStorage>
|
||||
void Run(const IntegratorType& it,
|
||||
|
@ -58,7 +58,7 @@ public:
|
||||
template <typename T>
|
||||
VTKM_EXEC void operator()(const T& rank, const T& pointCountInSeg, T& flag) const
|
||||
{
|
||||
if (rank >= pointCountInSeg / 2.0f)
|
||||
if (static_cast<float>(rank) >= static_cast<float>(pointCountInSeg) / 2.0f)
|
||||
flag = 1; //right subtree
|
||||
else
|
||||
flag = 0; //left subtree
|
||||
|
Loading…
Reference in New Issue
Block a user