pytorch/c10/core/alignment.h
PyTorch MergeBot a22b92d8ba Revert "Enable thp(transparent huge pages) for buffer sizes >=2MB (#95963)"
This reverts commit 3bb16a0842.

Reverted https://github.com/pytorch/pytorch/pull/95963 on behalf of https://github.com/izaitsevfb due to Breaks internal android builds: unused function c10_compute_alignment  [-Werror,-Wunused-function]
2023-03-14 02:15:08 +00:00

18 lines
331 B
C++

#pragma once
#include <cstddef>
namespace c10 {
#ifdef C10_MOBILE
// Use 16-byte alignment on mobile
// - ARM NEON AArch32 and AArch64
// - x86[-64] < AVX
constexpr size_t gAlignment = 16;
#else
// Use 64-byte alignment should be enough for computation up to AVX512.
constexpr size_t gAlignment = 64;
#endif
} // namespace c10