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:
authorProtonu Basu <protonu@fb.com>2019-05-16 19:12:35 +0300
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>2019-05-16 19:16:33 +0300
commitd8f740de7689a449d58a8c9cb13b49c7998fde63 (patch)
treeb4ebd51728559e815e5d574561a0a871e4794b94
parent1b143035440a2f744318cf3df2a64172ff0be3b0 (diff)
fixing compiler warnings for uninitialized MR, NCB, KCB
Summary: fixing compiler warnings for uninitialized MR, NCB, KCB Reviewed By: dskhudia Differential Revision: D15362047 fbshipit-source-id: 57428f0610c8c12f9ff1f07fe8e472e5ff56bc82
-rw-r--r--src/Fbgemm.cc85
1 files changed, 41 insertions, 44 deletions
diff --git a/src/Fbgemm.cc b/src/Fbgemm.cc
index 523f556..0f2f6fb 100644
--- a/src/Fbgemm.cc
+++ b/src/Fbgemm.cc
@@ -44,53 +44,51 @@ void fbgemmPacked(
typename packingBMatrix::accType>::value,
"Accumulation type of both matrices should be the same");
- int MCB, KCB;
+ // Run time CPU detection
+ if (!cpuinfo_initialize()) {
+ throw std::runtime_error("Failed to initialize cpuinfo!");
+ }
+ if ((!fbgemmHasAvx512Support() && !fbgemmHasAvx2Support())) {
+ assert(0 && "unknown architecure");
+ }
+
+ int MCB;
+ int KCB;
int MR;
- // Run time CPU detection
- if (cpuinfo_initialize()) {
- if (blocking_params) {
- if (fbgemmHasAvx512Support() || fbgemmHasAvx2Support()) {
- MCB = blocking_params->MCB;
- KCB = blocking_params->KCB;
- MR = blocking_params->MR;
- }
+ if (blocking_params) {
+ MCB = blocking_params->MCB;
+ KCB = blocking_params->KCB;
+ MR = blocking_params->MR;
+
+ } else {
+ if (fbgemmHasAvx512Support()) {
+ MCB = PackingTraits<
+ typename packingAMatrix::inpType,
+ typename packingAMatrix::accType,
+ inst_set_t::avx512>::MCB;
+ KCB = PackingTraits<
+ typename packingAMatrix::inpType,
+ typename packingAMatrix::accType,
+ inst_set_t::avx512>::KCB;
+ MR = PackingTraits<
+ typename packingAMatrix::inpType,
+ typename packingAMatrix::accType,
+ inst_set_t::avx512>::MR;
} else {
- if (fbgemmHasAvx512Support()) {
- MCB = PackingTraits<
- typename packingAMatrix::inpType,
- typename packingAMatrix::accType,
- inst_set_t::avx512>::MCB;
- KCB = PackingTraits<
- typename packingAMatrix::inpType,
- typename packingAMatrix::accType,
- inst_set_t::avx512>::KCB;
- MR = PackingTraits<
- typename packingAMatrix::inpType,
- typename packingAMatrix::accType,
- inst_set_t::avx512>::MR;
- } else if (fbgemmHasAvx2Support()) {
- MCB = PackingTraits<
- typename packingAMatrix::inpType,
- typename packingAMatrix::accType,
- inst_set_t::avx2>::MCB;
- KCB = PackingTraits<
- typename packingAMatrix::inpType,
- typename packingAMatrix::accType,
- inst_set_t::avx2>::KCB;
- MR = PackingTraits<
- typename packingAMatrix::inpType,
- typename packingAMatrix::accType,
- inst_set_t::avx2>::MR;
-
- } else {
- // TODO: Have default slower path
- assert(0 && "unsupported architecture");
- return;
- }
+ MCB = PackingTraits<
+ typename packingAMatrix::inpType,
+ typename packingAMatrix::accType,
+ inst_set_t::avx2>::MCB;
+ KCB = PackingTraits<
+ typename packingAMatrix::inpType,
+ typename packingAMatrix::accType,
+ inst_set_t::avx2>::KCB;
+ MR = PackingTraits<
+ typename packingAMatrix::inpType,
+ typename packingAMatrix::accType,
+ inst_set_t::avx2>::MR;
}
- } else {
- throw std::runtime_error("Failed to initialize cpuinfo!");
}
if (!packB.isPrePacked()) {
@@ -516,5 +514,4 @@ template void fbgemmPacked(
int num_threads,
const BlockingFactors* blocking_params);
-
} // namespace fbgemm