1945 unsigned int elemSize = _Element_size *
sizeof(
int);
1950 baseLSDExtentInBytes *= elemSize;
1953 viewLSDOffsetInBytes *= elemSize;
1956 viewLSDExtentInBytes *= elemSize;
1960 if (((linearOffsetInBytes % bufElemSize) != 0) ||
1961 ((baseLSDExtentInBytes % bufElemSize) != 0) ||
1962 ((viewLSDOffsetInBytes % bufElemSize) != 0) ||
1963 ((viewLSDExtentInBytes % bufElemSize) != 0))
1965 throw runtime_exception(
"The array_view base extent, view offset and/or view extent is incompatible with the underlying buffer", E_FAIL);
1971 unsigned int linearOffset =
static_cast<unsigned int>(linearOffsetInBytes / bufElemSize);
1973 unsigned int baseExtent[_Rank];
1974 unsigned int viewOffset[_Rank];
1975 unsigned int viewExtent[_Rank];
1976 #pragma warning( push )
1977 #pragma warning( disable : 6294 )
1978 #pragma warning( disable : 6201 ) // Index '-1' is out of valid index range '0' to '0' for possibly stack allocated buffer 'baseExtent'.
1979 for (
int i = 0;
i < _Rank - 1; ++
i) {
1984 #pragma warning( pop )
1989 baseExtent[_Rank - 1] =
static_cast<unsigned int>(baseLSDExtentInBytes / bufElemSize);
1992 viewOffset[_Rank - 1] =
static_cast<unsigned int>(viewLSDOffsetInBytes / bufElemSize);
1995 viewExtent[_Rank - 1] =
static_cast<unsigned int>(viewLSDExtentInBytes / bufElemSize);
size_t _Get_master_buffer_elem_size() const
Definition: amprt.h:3236
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)
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:2003
#define UINT_MAX
Definition: limits.h:36
int i[4]
Definition: dvec.h:68
#define _ASSERTE(expr)
Definition: crtdbg.h:707
int _Base_linear_offset() const __GPU
Definition: amp.h:1571
Concurrency::extent< _Rank > _M_view_extent
Definition: amp.h:1672
char int *typedef int(__CRTDECL *_CRT_REPORT_HOOKW)(int
Definition: crtdbg.h:45
Concurrency::extent< _Rank > _M_array_extent
Definition: amp.h:1668
_Ret_ _Ubiquitous_buffer * _Get_buffer_ptr() const __CPU_ONLY
Definition: amprt.h:503
Concurrency::index< _Rank > _M_view_offset
Definition: amp.h:1670