Commit 82c7747b authored by Sujin Philip's avatar Sujin Philip
Browse files

Fix some warnings in Accelerators/Vtkm

parent a2b0b7f3
......@@ -64,14 +64,10 @@ typename ConnectivityVTKAOS<Device>::IndicesType
ConnectivityVTKAOS<Device>::GetIndices(vtkm::Id index) const
{
vtkm::Id offset = this->IndexOffsets.Get(index);
vtkm::IdComponent length = this->Connectivity.Get(offset);
auto length = static_cast<vtkm::IdComponent>(this->Connectivity.Get(offset));
return IndicesType(this->Connectivity, length, offset + 1);
}
//------------------------------------------------------------------------------
template <typename Device>
ConnectivityVTKSingleType<Device>::ConnectivityVTKSingleType()
......
......@@ -38,7 +38,7 @@ void ProcessFields(vtkDataSet *input, vtkm::cont::DataSet &dataset,
if ((fields & tovtkm::FieldsFlag::Points) != tovtkm::FieldsFlag::None)
{
vtkPointData* pd = input->GetPointData();
for (vtkIdType i = 0; i < pd->GetNumberOfArrays(); i++)
for (int i = 0; i < pd->GetNumberOfArrays(); i++)
{
vtkDataArray* array = pd->GetArray(i);
if (array == nullptr)
......@@ -55,7 +55,7 @@ void ProcessFields(vtkDataSet *input, vtkm::cont::DataSet &dataset,
if ((fields & tovtkm::FieldsFlag::Cells) != tovtkm::FieldsFlag::None)
{
vtkCellData* cd = input->GetCellData();
for (vtkIdType i = 0; i < cd->GetNumberOfArrays(); i++)
for (int i = 0; i < cd->GetNumberOfArrays(); i++)
{
vtkDataArray* array = cd->GetArray(i);
if (array == nullptr)
......
......@@ -244,7 +244,7 @@ struct CellInfoCopyWorklet : public vtkm::worklet::WorkletMapPointToCell
this->ConnArray->SetValue(index++, numPointsPerCell);
for (vtkIdType j = 0; j < numPointsPerCell; ++j)
{
this->ConnArray->SetValue(index++, indices[j]);
this->ConnArray->SetValue(index++, indices[static_cast<vtkm::IdComponent>(j)]);
}
// only update member variable once per iteration to improve locality
......@@ -279,7 +279,8 @@ struct CellConnCopyWorklet : public vtkm::worklet::WorkletMapPointToCell
this->ConnArray->SetValue(index++, numPointsPerCell);
for (vtkIdType j = 0; j < numPointsPerCell; ++j)
{
this->ConnArray->SetValue(index++, static_cast<vtkm::Id>(indices[j]));
this->ConnArray->SetValue(
index++, static_cast<vtkm::Id>(indices[static_cast<vtkm::IdComponent>(j)]));
}
// only update member variable once per iteration to improve locality
*this->ConnIndex += 1 + numPointsPerCell;
......
......@@ -41,12 +41,13 @@ vtkm::cont::DataSet Convert(vtkImageData *input, FieldsFlag fields)
input->GetDimensions(vdims);
vtkm::Vec<vtkm::FloatDefault, 3> origin(
(static_cast<double>(extent[0]) * vspacing[0]) + vorigin[0],
(static_cast<double>(extent[2]) * vspacing[1]) + vorigin[1],
(static_cast<double>(extent[4]) * vspacing[2]) + vorigin[2]);
vtkm::Vec<vtkm::FloatDefault, 3> spacing(vspacing[0],
vspacing[1],
vspacing[2]);
static_cast<vtkm::FloatDefault>((static_cast<double>(extent[0]) * vspacing[0]) + vorigin[0]),
static_cast<vtkm::FloatDefault>((static_cast<double>(extent[2]) * vspacing[1]) + vorigin[1]),
static_cast<vtkm::FloatDefault>((static_cast<double>(extent[4]) * vspacing[2]) + vorigin[2]));
vtkm::Vec<vtkm::FloatDefault, 3> spacing(
static_cast<vtkm::FloatDefault>(vspacing[0]),
static_cast<vtkm::FloatDefault>(vspacing[1]),
static_cast<vtkm::FloatDefault>(vspacing[2]));
vtkm::Id3 dims(vdims[0], vdims[1], vdims[2]);
vtkm::cont::DataSet dataset =
......
......@@ -62,7 +62,8 @@ void ImplicitFunctionConverter::Set(vtkImplicitFunction *function)
cylinder->GetAxis(axis);
radius = cylinder->GetRadius();
auto c = new vtkm::Cylinder(MakeFVec3(center), MakeFVec3(axis), radius);
auto c = new vtkm::Cylinder(
MakeFVec3(center), MakeFVec3(axis), static_cast<vtkm::FloatDefault>(radius));
this->OutFunction.Reset(c, true, vtkmInputFilterPolicy::DeviceAdapterList());
}
else if ((plane = vtkPlane::SafeDownCast(function)))
......@@ -80,8 +81,8 @@ void ImplicitFunctionConverter::Set(vtkImplicitFunction *function)
sphere->GetCenter(center);
radius = sphere->GetRadius();
auto s = new vtkm::Sphere(MakeFVec3(center),
static_cast<vtkm::FloatDefault>(radius));
auto s = new vtkm::Sphere(
MakeFVec3(center), static_cast<vtkm::FloatDefault>(radius));
this->OutFunction.Reset(s, true, vtkmInputFilterPolicy::DeviceAdapterList());
}
else
......@@ -124,7 +125,7 @@ const vtkm::cont::ImplicitFunctionHandle& ImplicitFunctionConverter::Get() const
auto c = static_cast<vtkm::Cylinder*>(this->OutFunction.Get());
c->SetCenter(MakeFVec3(center));
c->SetAxis(MakeFVec3(axis));
c->SetRadius(radius);
c->SetRadius(static_cast<vtkm::FloatDefault>(radius));
}
else if ((plane = vtkPlane::SafeDownCast(this->InFunction)))
{
......
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