Commit 9c8675a7 authored by fabianw's avatar fabianw
Browse files

fixed associativity bug

parent 27200d8d
......@@ -132,10 +132,10 @@ private:
m_Ny = Ny;
m_Nz = Nz;
const int alignedElements = _ALIGN_/sizeof(T);
m_XS = alignedElements * (XS - (alignedElements-1))/alignedElements;
m_XE = alignedElements * (XE + (alignedElements-1))/alignedElements;
m_Xpitch = (m_Nx+m_XE) - m_XS;
m_Npitched = static_cast<size_t>(m_Xpitch) * (m_Ny+YE-YS) * (m_Nz+ZE-ZS);
m_XS = alignedElements * ((XS - (alignedElements-1))/alignedElements);
m_XE = alignedElements * ((XE + (alignedElements-1))/alignedElements);
m_Xpitch = m_Nx+m_XE-m_XS;
m_Npitched = static_cast<size_t>(m_Xpitch) * static_cast<size_t>(m_Ny+YE-YS) * static_cast<size_t>(m_Nz+ZE-ZS);
void* pmem;
if (posix_memalign(&pmem, _ALIGN_, m_Npitched*sizeof(T)))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment