Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some missing cases for binconv method #52

Merged
merged 2 commits into from
Aug 23, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions dabnn/layers/BinConv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,13 @@ BinConv::Method BinConv::method() const {
return Method::DIRECT_CONV;
} else if (gemm_compatible()) {
return Method::BGEMM;
} else {
} else if (input_mat->elem_c == 64) {
return Method::BCONV_NAIVE;
} else {
return Method::BGEMM_NAIVE;
}
} else {
if (weight_mat->c == 1) {
if (input_mat->elem_c == 64) {
return Method::BCONV_NAIVE;
} else {
return Method::BGEMM_NAIVE;
Expand Down Expand Up @@ -128,11 +130,11 @@ bool BinConv::gemm_compatible() const {
#ifdef __aarch64__
return true;
#else
// If weight_mat->c == 1 (weight_mat has 64 channels), we use bconv_64
// If input_mat->elem_c == 1 (weight_mat has 64 channels), we use bconv_64
// in aarch64 for the fastest speed, however, bconv_64 is not implemented
// in armv7
// TODO: Implement bconv_64 for armv7
return weight_mat->c != 1;
return input_mat->elem_c != 64;
#endif
#else
return false;
Expand Down