Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/FBGEMM.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJongsoo Park <jongsoo@fb.com>2019-02-20 19:50:37 +0300
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>2019-02-20 19:59:51 +0300
commit9ebc998c2bf0da81ab7afa1478df395d79429cf8 (patch)
treec664731e03c05f239f28bc3eb6a8010b65696f93 /include/fbgemm/Fbgemm.h
parenta5f1f5308130f21b376f5368e87eb74b071493fa (diff)
optimize PackAWithIm2Col for symmetric b quant
Summary: Add additional option b_symmetric and skip row offset computation if it's true Reviewed By: jianyuh Differential Revision: D14119128 fbshipit-source-id: fa079347562b7f75727b3a1414e9bdda3f9c65dd
Diffstat (limited to 'include/fbgemm/Fbgemm.h')
-rw-r--r--include/fbgemm/Fbgemm.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/include/fbgemm/Fbgemm.h b/include/fbgemm/Fbgemm.h
index 2ac10f7..4f3c92e 100644
--- a/include/fbgemm/Fbgemm.h
+++ b/include/fbgemm/Fbgemm.h
@@ -524,13 +524,15 @@ class FBGEMM_API PackAWithIm2Col
* buffer and owns it. Otherwise, this class doesn't own
* the buffer. The buffer will be populated when pack
* function is called.
+ * @params b_symmetric if true we skip row offset computation
*/
PackAWithIm2Col(
const conv_param_t<SPATIAL_DIM>& conv_param,
const T* sdata,
inpType* pmat = nullptr,
- std::int32_t zero_pt = 0,
- std::int32_t* row_offset = nullptr);
+ std::int32_t a_zero_pt = 0,
+ std::int32_t* row_offset = nullptr,
+ bool b_symmetric = false);
/**
* Activation matrices are not constant so cannot amortize the cost of
@@ -578,9 +580,9 @@ class FBGEMM_API PackAWithIm2Col
private:
const conv_param_t<SPATIAL_DIM> conv_p_;
const T* sdata_;
- std::int32_t zero_pt_;
- std::int32_t* row_offset_;
- bool rowOffsetAllocatedHere;
+ std::int32_t a_zero_pt_;
+ std::int32_t* row_offset_{nullptr};
+ bool rowOffsetAllocatedHere{false};
std::int32_t row_interleave_B_;
};