Remove bracket operator use from discretization tools
Created by: rppawlo
Kokkos implemented a nasty hack to support bracket operator use in Intrepid. Long term we need to eliminate the use of bracket operator from all discretization tools that use Kokkos. Phalanx has acceptance tests that check this behavior for calling Intrepid. Below is the email discussion with Carter:
Would be easy to implement but dangerous to use.
A subview or any kind of non-contiguous view cannot be linearly indexed and will have silent errors when doing so.
In DynRankView:
operator[]( int i ) const { return data()[i]; }
On 4/6/16, 2:03 PM, "Pawlowski, Roger P" rppawlo@sandia.gov wrote:
Hi Nathan,
It seems that the bracket operator on the DynRankView only works for a rank 1 array. The use case we have with Intrepid is that if I allocate a view with rank greater than 1:
DynRankView a(10,2);
Then the bracket operator should give me access to all twenty entries in the array (e.g. a[19] should work). For the DynRankView in Phalanx, I just carried around a second member internally that the bracket operator implementation used:
m_field_oned_view = array_oned_type(m_field_data7.ptr_on_device(),m_field_data7.size(),PHX::ge tSacadoSize(m_field_data7));
Can we get something similar to this in the kokkos DynRankView? Long term I we would like to eliminate bracket operator, but that will take quite a bit of refactoring in intrepid.
Roger