Corrects ignorable warnings with msvc and cuda enabled.

These constant value warnings are ignorable as we are trying
to throw an assert.
This commit is contained in:
Robert Maynard 2017-02-02 10:04:35 -05:00
parent 799277e515
commit 9148bea396
4 changed files with 17 additions and 5 deletions

@ -68,7 +68,9 @@ public:
void Set(vtkm::Id vtkmNotUsed(index),
const ValueType &vtkmNotUsed(value)) const
{
#if !(defined(VTKM_MSVC) && defined(VTKM_CUDA))
VTKM_ASSERT(false && "Cannot write to read-only implicit array.");
#endif
}
typedef vtkm::cont::internal::IteratorFromArrayPortal<

@ -93,7 +93,9 @@ public:
void Set(vtkm::Id vtkmNotUsed(index),
const ValueType &vtkmNotUsed(value)) const
{
#if !(defined(VTKM_MSVC) && defined(VTKM_CUDA))
VTKM_ASSERT(false && "Cannot write to read-only transform array. (No inverse transform given.)");
#endif
}
VTKM_SUPPRESS_EXEC_WARNINGS

@ -185,7 +185,9 @@ public:
VTKM_EXEC_CONT
void Set(vtkm::Id vtkmNotUsed(index), const ValueType& vtkmNotUsed(value)) const
{
#if ! (defined(VTKM_MSVC) && defined(VTKM_CUDA))
VTKM_ASSERT(false && "Attempted to write to constant array.");
#endif
}
VTKM_SUPPRESS_EXEC_WARNINGS

@ -337,18 +337,24 @@ public:
ValueType Get(vtkm::Id index) const {
return vtkm::exec::cuda::internal::load_through_texture<ValueType>::get( this->BeginIterator + index );
}
__device__
void Set(vtkm::Id vtkmNotUsed(index), ValueType vtkmNotUsed(value)) const {
}
#else
__host__
ValueType Get(vtkm::Id vtkmNotUsed(index) ) const {
return ValueType();
}
__host__
void Set(vtkm::Id vtkmNotUsed(index), ValueType vtkmNotUsed(value)) const {
#if ! (defined(VTKM_MSVC) && defined(VTKM_CUDA))
VTKM_ASSERT(true && "Cannot set to const array.");
#endif
__host__ __device__
void Set(vtkm::Id vtkmNotUsed(index), ValueType vtkmNotUsed(value)) const {
VTKM_ASSERT("Cannot set to const array.");
}
#endif
VTKM_EXEC_CONT
IteratorType GetIteratorBegin() const { return this->BeginIterator; }