[PyTorch] typeid: ensmallen scalarTypeItemSizes (#50165)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/50165

There are currently 17 types, so this used to stretch across 3 cache lines and now it fits in one. All the types in question seem to be way under 255 bytes in size anyway.
ghstack-source-id: 119485090

Test Plan: CI, profiled internal benchmarks

Reviewed By: smessmer

Differential Revision: D25813574

fbshipit-source-id: c342d4f12a7b035503e1483b8301f68d98f3c503
This commit is contained in:
Scott Wolchok 2021-01-07 13:50:06 -08:00 committed by Facebook GitHub Bot
parent 0495180f6e
commit 160b4be60a

View File

@ -309,7 +309,7 @@ class _Uninitialized final {};
// //
// item sizes for TypeMeta::itemsize() fast path // item sizes for TypeMeta::itemsize() fast path
static constexpr size_t scalarTypeItemSizes[NumScalarTypes] = { static constexpr uint8_t scalarTypeItemSizes[NumScalarTypes] = {
#define SCALAR_TYPE_SIZE(T, name) sizeof(T), #define SCALAR_TYPE_SIZE(T, name) sizeof(T),
AT_FORALL_SCALAR_TYPES_WITH_COMPLEX_AND_QINTS(SCALAR_TYPE_SIZE) AT_FORALL_SCALAR_TYPES_WITH_COMPLEX_AND_QINTS(SCALAR_TYPE_SIZE)
#undef SCALAR_TYPE_SIZE #undef SCALAR_TYPE_SIZE