forked from pytorch/FBGEMM
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move avx2 masks to MaskAvx2.h and reuse (pytorch#141)
Summary: Pull Request resolved: pytorch#141 Refactor to dedup mask arrays for avx2 Reviewed By: jianyuh Differential Revision: D17916885 fbshipit-source-id: f3d48f16411a45307b44484fe39b472a08dd6c62
- Loading branch information
1 parent
266b453
commit f40e2d0
Showing
6 changed files
with
75 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* All rights reserved. | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
#pragma once | ||
|
||
namespace fbgemm { | ||
|
||
namespace internal { | ||
|
||
// A constant array to initialize an AVX2 register to be used as a 32-bit | ||
// granularity mask. | ||
// clang-format off | ||
alignas(64) static const int avx2_ps_or_epi32_masks[8][8] = { | ||
// NOTE: clang-format wants to use a different formatting but the current | ||
// formatting should be easier to read. | ||
{ 0, 0, 0, 0, 0, 0, 0, 0, }, | ||
{ -1, 0, 0, 0, 0, 0, 0, 0, }, | ||
{ -1, -1, 0, 0, 0, 0, 0, 0, }, | ||
{ -1, -1, -1, 0, 0, 0, 0, 0, }, | ||
{ -1, -1, -1, -1, 0, 0, 0, 0, }, | ||
{ -1, -1, -1, -1, -1, 0, 0, 0, }, | ||
{ -1, -1, -1, -1, -1, -1, 0, 0, }, | ||
{ -1, -1, -1, -1, -1, -1, -1, 0, }, | ||
}; | ||
// clang-format on | ||
|
||
} // namespace internal | ||
|
||
} // namespace fbgemm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters