Commit 9a4f0247 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

bug fix

parent 32cb03a0
...@@ -2079,7 +2079,7 @@ template<typename T> arr<char> alloc_tmp(const shape_t &shape, ...@@ -2079,7 +2079,7 @@ template<typename T> arr<char> alloc_tmp(const shape_t &shape,
for (size_t i=0; i<ndim; ++i) for (size_t i=0; i<ndim; ++i)
fullsize*=shape[i]; fullsize*=shape[i];
auto othersize = fullsize/axsize; auto othersize = fullsize/axsize;
auto tmpsize = axsize*((othersize>VTYPE<T>::vlen) ? VTYPE<T>::vlen : 1); auto tmpsize = axsize*((othersize>=VTYPE<T>::vlen) ? VTYPE<T>::vlen : 1);
return arr<char>(tmpsize*elemsize); return arr<char>(tmpsize*elemsize);
} }
template<typename T> arr<char> alloc_tmp(const shape_t &shape, template<typename T> arr<char> alloc_tmp(const shape_t &shape,
...@@ -2094,7 +2094,7 @@ template<typename T> arr<char> alloc_tmp(const shape_t &shape, ...@@ -2094,7 +2094,7 @@ template<typename T> arr<char> alloc_tmp(const shape_t &shape,
{ {
auto axsize = shape[axes[i]]; auto axsize = shape[axes[i]];
auto othersize = fullsize/axsize; auto othersize = fullsize/axsize;
tmpsize = max(tmpsize, axsize*((othersize>VTYPE<T>::vlen) ? VTYPE<T>::vlen : 1)); tmpsize = max(tmpsize, axsize*((othersize>=VTYPE<T>::vlen) ? VTYPE<T>::vlen : 1));
} }
return arr<char>(tmpsize*elemsize); return arr<char>(tmpsize*elemsize);
} }
......
Markdown is supported
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