Adding static strides to tensor
Closed this issue · 0 comments
amitsingh19975 commented
static_stride
is way to create stride for static_extents at compile time and has similar apis as current implementation basic_strides
ex:
static_stride<static_extents<4,1,2,3,4>,first_order>
creates the stride withcolumn major
arrangementstatic_stride<static_extents<4,1,2,3,4>,last_order>
creates the stride withrow major
arrangement
function Members (Public)
at
returns the element at given posrank
andsize
returns the number of extentsproduct
returns the product of every extentsstride
returns the stride of a give posoperator()
overloaded and gives the stride for indices provided
function Members (Private)
access
helper function for getting strides for given indices
For more info on layout click on the url https://eli.thegreenplace.net/2015/memory-layout-of-multi-dimensional-arrays