Skip to content

Commit

Permalink
[PyTorch] typeid: ensmallen scalarTypeItemSizes (#50165)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #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
  • Loading branch information
swolchok authored and facebook-github-bot committed Jan 7, 2021
1 parent 0495180 commit 160b4be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion c10/util/typeid.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ class _Uninitialized final {};
//

// 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),
AT_FORALL_SCALAR_TYPES_WITH_COMPLEX_AND_QINTS(SCALAR_TYPE_SIZE)
#undef SCALAR_TYPE_SIZE
Expand Down

0 comments on commit 160b4be

Please sign in to comment.