Skip to content

Commit

Permalink
Refactor the code and avoid the duplication (pytorch#102)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: pytorch#102

The Avx512 and Avx2 branches can be merged.

Reviewed By: dskhudia

Differential Revision: D16068952

fbshipit-source-id: b39beb32e80dc168d0c17db9dff8a67bb0fe976f
  • Loading branch information
jianyuh authored and facebook-github-bot committed Jul 1, 2019
1 parent 61928df commit b0cf97d
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/PackMatrix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,7 @@ int PackMatrix<PT, inpType, accType>::packedBufferSize(
}
}

if (fbgemmHasAvx512Support()) {
if (isA()) {
return MCB * KCB;
} else {
int rowBlock = KCB;
int colBlock = NCB;
return (((rows + rowBlock - 1) / rowBlock) * rowBlock) *
(((cols + colBlock - 1) / colBlock) * colBlock);
}
} else if (fbgemmHasAvx2Support()) {
if (fbgemmHasAvx512Support() || fbgemmHasAvx2Support()) {
if (isA()) {
return MCB * KCB;
} else {
Expand Down

0 comments on commit b0cf97d

Please sign in to comment.