Commit efbc8d68 authored by Dave Pugmire's avatar Dave Pugmire

Change compiler flags and undo conversions.

parent d38849e2
......@@ -119,8 +119,12 @@ elseif(VTKM_COMPILER_IS_ICC)
target_compile_options(vtkm_developer_flags INTERFACE $<$<COMPILE_LANGUAGE:CXX>:-wd1478 -wd13379>)
elseif(VTKM_COMPILER_IS_GNU OR VTKM_COMPILER_IS_CLANG)
set(cxx_flags -Wall -Wcast-align -Wconversion -Wchar-subscripts -Wextra -Wpointer-arith -Wformat -Wformat-security -Wshadow -Wunused-parameter -fno-common)
set(cxx_flags -Wall -Wcast-align -Wchar-subscripts -Wextra -Wpointer-arith -Wformat -Wformat-security -Wshadow -Wunused-parameter -fno-common)
if (VTKM_COMPILER_IS_GNU)
list(APPEND cxx_flags -Wfloat-conversion)
elseif (VTKM_COMPILER_IS_CLANG)
list(APPEND cxx_flags -Wconversion)
endif()
set(cuda_flags -Xcompiler=-Wall,-Wno-unknown-pragmas,-Wno-unused-local-typedefs,-Wno-unused-local-typedefs,-Wno-unused-function,-Wcast-align,-Wconversion,-Wchar-subscripts,-Wpointer-arith,-Wformat,-Wformat-security,-Wshadow,-Wunused-parameter,-fno-common)
#GCC 5, 6 don't properly handle strict-overflow suppression through pragma's.
......
......@@ -42,7 +42,7 @@ struct TestKernelInOut : public vtkm::exec::FunctorBase
{
using ValueType = typename PortalType::ValueType;
ValueType inValue = this->Portal.Get(index);
this->Portal.Set(index, static_cast<ValueType>(inValue + inValue));
this->Portal.Set(index, inValue + inValue);
}
};
......@@ -76,7 +76,7 @@ struct TryArrayInOutType
"Portal has wrong number of values.");
for (vtkm::Id index = 0; index < ARRAY_SIZE; index++)
{
T expectedValue = static_cast<T>(TestValue(index, T()) + TestValue(index, T()));
T expectedValue = TestValue(index, T()) + TestValue(index, T());
T retrievedValue = portal.Get(index);
VTKM_TEST_ASSERT(test_equal(expectedValue, retrievedValue),
"Functor did not modify in place.");
......
......@@ -88,7 +88,7 @@ struct TestInOutKernel : public vtkm::exec::FunctorBase
this->RaiseError("In/Out whole array has wrong size.");
}
using ValueType = typename PortalType::ValueType;
this->Portal.Set(index, static_cast<ValueType>(this->Portal.Get(index) + ValueType(OFFSET)));
this->Portal.Set(index, this->Portal.Get(index) + ValueType(OFFSET));
}
};
......@@ -156,7 +156,7 @@ struct TryWholeArrayType
VTKM_TEST_ASSERT(array.GetNumberOfValues() == ARRAY_SIZE, "Array size wrong?");
for (vtkm::Id index = 0; index < ARRAY_SIZE; index++)
{
T expectedValue = static_cast<T>(TestValue(index, T()) + T(OFFSET));
T expectedValue = TestValue(index, T()) + T(OFFSET);
T retrievedValue = array.GetPortalConstControl().Get(index);
VTKM_TEST_ASSERT(test_equal(expectedValue, retrievedValue),
"In/Out array not set correctly.");
......
......@@ -90,7 +90,7 @@ struct InPlacePermutationFunctor : vtkm::exec::FunctorBase
using T = typename PermutedPortalType::ValueType;
T value = this->PermutedPortal.Get(index);
value = static_cast<T>(value + T(1000));
value = value + T(1000);
this->PermutedPortal.Set(index, value);
}
......@@ -117,7 +117,7 @@ VTKM_CONT void CheckInPlaceResult(PortalType portal)
if (permutedIndex % 2 == 0)
{
// This index was part of the permuted array; has a value changed
T expectedValue = static_cast<T>(TestValue(permutedIndex, T()) + T(1000));
T expectedValue = TestValue(permutedIndex, T()) + T(1000);
T retrievedValue = portal.Get(permutedIndex);
VTKM_TEST_ASSERT(test_equal(expectedValue, retrievedValue), "Permuted set unexpected value.");
}
......
......@@ -41,7 +41,7 @@ public:
{
this->RaiseError("Got wrong input value.");
}
out = static_cast<T>(in - T(100));
out = in - T(100);
if (!test_equal(inout, TestValue(workIndex, T()) + T(100)))
{
this->RaiseError("Got wrong in-out value.");
......@@ -49,7 +49,7 @@ public:
// We return the new value of inout. Since _3 is both an arg and return,
// this tests that the return value is set after updating the arg values.
return static_cast<T>(inout - T(100));
return inout - T(100);
}
template <typename T1, typename T2, typename T3>
......@@ -75,7 +75,7 @@ struct DoStaticTestWorklet
for (vtkm::Id index = 0; index < ARRAY_SIZE; index++)
{
inputArray[index] = static_cast<T>(TestValue(index, T()) + T(100));
inputArray[index] = TestValue(index, T()) + T(100);
}
vtkm::cont::ArrayHandle<T> inputHandle = vtkm::cont::make_ArrayHandle(inputArray, ARRAY_SIZE);
......@@ -123,7 +123,7 @@ struct DoVariantTestWorklet
for (vtkm::Id index = 0; index < ARRAY_SIZE; index++)
{
inputArray[index] = static_cast<T>(TestValue(index, T()) + T(100));
inputArray[index] = TestValue(index, T()) + T(100);
}
vtkm::cont::ArrayHandle<T> inputHandle = vtkm::cont::make_ArrayHandle(inputArray, ARRAY_SIZE);
......
......@@ -46,7 +46,7 @@ struct TestExecObjectWorklet
{
this->RaiseError("Got wrong input value.");
}
out = static_cast<T>(execIn.Get(index) - T(100));
out = execIn.Get(index) - T(100);
execOut.Set(index, out);
}
};
......@@ -68,7 +68,7 @@ struct DoTestWorklet
for (vtkm::Id index = 0; index < ARRAY_SIZE; index++)
{
inputArray[index] = static_cast<T>(TestValue(index, T()) + T(100));
inputArray[index] = TestValue(index, T()) + T(100);
}
vtkm::cont::ArrayHandleIndex counting(ARRAY_SIZE);
......
......@@ -76,7 +76,7 @@ struct DoTestWholeArrayWorklet
for (vtkm::Id index = 0; index < ARRAY_SIZE; index++)
{
inArray[index] = TestValue(index, T());
inOutArray[index] = static_cast<T>(TestValue(index, T()) + T(100));
inOutArray[index] = TestValue(index, T()) + T(100);
}
vtkm::cont::ArrayHandle<T> inHandle = vtkm::cont::make_ArrayHandle(inArray, ARRAY_SIZE);
......
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