We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
void Mat::create(int _w, int _h, int _c, size_t _elemsize, Allocator* _allocator) { if (dims == 3 && w == _w && h == _h && c == _c && elemsize == _elemsize && elempack == 1 && allocator == _allocator) return; release(); elemsize = _elemsize; elempack = 1; allocator = _allocator; dims = 3; w = _w; h = _h; d = 1; c = _c; cstep = alignSize((size_t)w * h * elemsize, 16) / elemsize; size_t totalsize = alignSize(total() * elemsize, 4); if (totalsize > 0) { if (allocator) data = allocator->fastMalloc(totalsize + (int)sizeof(*refcount)); else data = fastMalloc(totalsize + (int)sizeof(*refcount)); } if (data) { refcount = (int*)(((unsigned char*)data) + totalsize); *refcount = 1; } }
各位大佬,请教下在ncnn创建mat的时候,alignSize对16字节和对4字节的对齐有什么特别的考虑吗?没理解为什么是16字节对齐,后面又变成4字节对齐。
alignSize
cstep = alignSize((size_t)w * h * elemsize, 16) / elemsize; size_t totalsize = alignSize(total() * elemsize, 4);
The text was updated successfully, but these errors were encountered:
No branches or pull requests
detail | 详细描述 | 詳細な説明
各位大佬,请教下在ncnn创建mat的时候,
alignSize
对16字节和对4字节的对齐有什么特别的考虑吗?没理解为什么是16字节对齐,后面又变成4字节对齐。The text was updated successfully, but these errors were encountered: