Skip to content

Commit 41eb55d

Browse files
committed
check the feature padding at onednn reorder.
1 parent 0e86232 commit 41eb55d

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/plugins/intel_gpu/src/graph/impls/onednn/reorder_onednn.hpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ struct ReorderImplementationManager : public ImplementationManager {
6565
return false;
6666

6767
// onednn doesn't support paddings
68-
if (!is_supported_pad(input_layout) || !is_supported_pad(output_layout))
68+
if (!is_supported_pad_for_reorder(input_layout) || !is_supported_pad_for_reorder(output_layout))
6969
return false;
7070

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

9191
return true;
9292
}
93+
94+
static bool is_supported_pad_for_reorder(const layout& layout) {
95+
// check to support the batch/spatial pad for onednn.
96+
if (!is_supported_pad(layout))
97+
return false;
98+
99+
// Check feature pad
100+
const auto& pad = layout.data_padding;
101+
bool no_feature_padding = true;
102+
no_feature_padding &= (pad._lower_size[1] == 0);
103+
no_feature_padding &= (pad._upper_size[1] == 0);
104+
105+
return no_feature_padding;
106+
}
93107
};
94108

95109
} // namespace onednn

0 commit comments

Comments
 (0)