diff --git a/vtkm/cont/internal/ArrayPortalFromIterators.h b/vtkm/cont/internal/ArrayPortalFromIterators.h index ba98f7849..79262f02d 100644 --- a/vtkm/cont/internal/ArrayPortalFromIterators.h +++ b/vtkm/cont/internal/ArrayPortalFromIterators.h @@ -172,15 +172,6 @@ public: VTKM_EXEC_CONT ValueType Get(vtkm::Id index) const { return *this->IteratorAt(index); } - VTKM_SUPPRESS_EXEC_WARNINGS - 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 VTKM_EXEC_CONT IteratorT GetIteratorBegin() const { return this->BeginIterator; } diff --git a/vtkm/cont/internal/testing/UnitTestArrayPortalFromIterators.cxx b/vtkm/cont/internal/testing/UnitTestArrayPortalFromIterators.cxx index af8561c16..5f320cc9e 100644 --- a/vtkm/cont/internal/testing/UnitTestArrayPortalFromIterators.cxx +++ b/vtkm/cont/internal/testing/UnitTestArrayPortalFromIterators.cxx @@ -73,6 +73,19 @@ struct TemplatedTests ::vtkm::cont::internal::ArrayPortalFromIterators const_portal( array, array + ARRAY_SIZE); + using PortalType = decltype(portal); + using PortalConstType = decltype(const_portal); + + std::cout << "Check that PortalSupports* results are valid:" << std::endl; + VTKM_TEST_ASSERT(vtkm::internal::PortalSupportsSets::value, + "Writable portals should support Set operations"); + VTKM_TEST_ASSERT(vtkm::internal::PortalSupportsGets::value, + "Writable portals should support Get operations"); + VTKM_TEST_ASSERT(!vtkm::internal::PortalSupportsSets::value, + "Read-only portals should not allow Set operations"); + VTKM_TEST_ASSERT(vtkm::internal::PortalSupportsGets::value, + "Read-only portals should support Get operations"); + std::cout << " Check that ArrayPortalToIterators is not doing indirection." << std::endl; // If you get a compile error here about mismatched types, it might be // that ArrayPortalToIterators is not properly overloaded to return the