2076 if (_Base_shape->
_Get_rank() == _Rank) {
2080 std::vector<unsigned int> _New_view_extent(_Base_shape->
_Get_rank());
2081 std::vector<unsigned int> _New_view_offset(_Base_shape->
_Get_rank());
2082 unsigned int _I = 0, _J = 0;
2083 while (_I < _Base_shape->_Get_rank())
2094 if (_J == (_Rank - 1))
2097 unsigned int elemSize = _Element_size *
sizeof(
int);
2099 size_t sectionLSDOriginInBytes = _Section_origin[_J];
2100 sectionLSDOriginInBytes *= elemSize;
2102 size_t sectionLSDExtentInBytes = _Section_extent[_J];
2103 sectionLSDExtentInBytes *= elemSize;
2107 if (((sectionLSDOriginInBytes % bufElemSize) != 0) ||
2108 ((sectionLSDExtentInBytes % bufElemSize) != 0))
2110 throw runtime_exception(
"The array_view section origin and/or extent is incompatible with the underlying buffer", E_FAIL);
2116 _New_view_offset[_I] = _Base_shape->
_Get_view_offset()[_I] +
static_cast<unsigned int>(sectionLSDOriginInBytes / bufElemSize);
2119 _New_view_extent[_I] =
static_cast<unsigned int>(sectionLSDExtentInBytes / bufElemSize);
2123 _New_view_extent[_I] = _Section_extent[_J];
2124 _New_view_offset[_I] = _Base_shape->
_Get_view_offset()[_I] + _Section_origin[_J];
2138 _New_view_offset.data(),
2139 _New_view_extent.data(),
size_t _Get_master_buffer_elem_size() const
Definition: amprt.h:3310
const unsigned int * _Get_base_extent() const
Definition: amprt.h:1677
const unsigned int * _Get_view_offset() const
Definition: amprt.h:1682
_CRTIMP _In_opt_z_ const wchar_t _In_opt_z_ const wchar_t unsigned int
Definition: crtdefs.h:642
static _AMPIMP _Ret_ _View_shape *__cdecl _Create_view_shape(unsigned int _Rank, unsigned int _Linear_offset, const unsigned int *_Base_extent, const unsigned int *_View_offset, const unsigned int *_View_extent, const bool *_Projection_info=NULL)
const bool * _Get_projection_info() const
Definition: amprt.h:1691
#define NULL
Definition: crtdbg.h:30
#define UINT_MAX
Definition: limits.h:41
const unsigned int * _Get_view_extent() const
Definition: amprt.h:1686
#define _ASSERTE(expr)
Definition: crtdbg.h:216
unsigned int _Get_linear_offset() const
Definition: amprt.h:1672
_Ret_ _View_shape * _Get_buffer_view_shape(const _Buffer_descriptor &_Descriptor)
Definition: amprt.h:3463
_Ret_ _Ubiquitous_buffer * _Get_buffer_ptr() const __CPU_ONLY
Definition: amprt.h:497
unsigned int _Get_rank() const
Definition: amprt.h:1667