diff options
author | Jianyu Huang <jianyuhuang@fb.com> | 2019-07-01 22:08:42 +0300 |
---|---|---|
committer | Facebook Github Bot <facebook-github-bot@users.noreply.github.com> | 2019-07-01 22:19:39 +0300 |
commit | b0cf97df8e2f368d8e0c1d2e9e1cacbd7638f79d (patch) | |
tree | 428f4e0350d3e3030592372b51a4b149ec5bfe17 | |
parent | 61928df38bece4c1c16b98296355450f13ca0afe (diff) |
Refactor the code and avoid the duplication (#102)
Summary:
Pull Request resolved: https://github.com/pytorch/FBGEMM/pull/102
The Avx512 and Avx2 branches can be merged.
Reviewed By: dskhudia
Differential Revision: D16068952
fbshipit-source-id: b39beb32e80dc168d0c17db9dff8a67bb0fe976f
-rw-r--r-- | src/PackMatrix.cc | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/PackMatrix.cc b/src/PackMatrix.cc index c9a68a6..33227fb 100644 --- a/src/PackMatrix.cc +++ b/src/PackMatrix.cc @@ -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 { |