Skip to content

Commit d690012

Browse files
committed
gpu: fixup direct copy
1 parent 8f07777 commit d690012

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/gpu/generic/direct_copy.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ struct direct_copy_t : public primitive_t {
121121
|| (l_stride == r_stride && l.first > r.first);
122122
};
123123
std::sort(blocks.begin() + offset, blocks.end(), cmp);
124-
if (offset > 0 && blocks[offset].first == blocks[offset - 1].first
124+
if (offset > 0 && blocks.size() > offset
125+
&& blocks[offset].first == blocks[offset - 1].first
125126
&& blocking.strides[blocks[offset].first] == stride) {
126127
blocks[offset - 1].second *= blocks[offset].second;
127128
stride *= blocks[offset].second;

0 commit comments

Comments
 (0)