Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ struct ReorderImplementationManager : public ImplementationManager {
return false;

// onednn doesn't support paddings
if (!is_supported_pad(input_layout) || !is_supported_pad(output_layout))
if (!is_supported_pad_for_reorder(input_layout) || !is_supported_pad_for_reorder(output_layout))
return false;

// Native impl works faster for this type of reorder
Expand All @@ -90,6 +90,20 @@ struct ReorderImplementationManager : public ImplementationManager {

return true;
}

static bool is_supported_pad_for_reorder(const layout& layout) {
// check to support the batch/spatial pad for onednn.
if (!is_supported_pad(layout))
return false;

// Check feature pad
const auto& pad = layout.data_padding;
bool no_feature_padding = true;
no_feature_padding &= (pad._lower_size[1] == 0);
no_feature_padding &= (pad._upper_size[1] == 0);

return no_feature_padding;
Comment on lines +101 to +105
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
bool no_feature_padding = true;
no_feature_padding &= (pad._lower_size[1] == 0);
no_feature_padding &= (pad._upper_size[1] == 0);
return no_feature_padding;
return (pad._lower_size[1] == 0) && (pad._upper_size[1] == 0);

Can be refactored?

}
};

} // namespace onednn
Expand Down
Loading