Skip to content

Commit 82d553e

Browse files
authored
[GPU] Fix oob in bfyx reorder for BMG (#28216)
### Details: - Fix OOB in reorder_data_b_fs_yx_fsv16_fsv32_to_bfyx - railed in next units tests with -58 memory errors
1 parent e2ac535 commit 82d553e

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/plugins/intel_gpu/src/kernel_selector/cl_kernels/reorder_data_b_fs_yx_fsv16_fsv32_to_bfyx.cl

+13-4
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,7 @@ KERNEL (reorder_data_b_fs_yx_fsv16_fsv32_to_bfyx)(
6666

6767

6868
#if (TILE_SIZE == DEFAULT_TILE_SIZE)
69-
// read
70-
INPUTVTYPE read_data = AS_INPUTVTYPE(_sub_group_block_read8((const __global uint*)(input) + input_idx_tile));
71-
72-
// write
69+
// write index
7370
const uint output_idx = OUTPUT_GET_TILED_INDEX(OUTPUT_TILED_ORDER);
7471

7572
if (F_NO_REMAINDER_CONDITION
@@ -79,13 +76,25 @@ KERNEL (reorder_data_b_fs_yx_fsv16_fsv32_to_bfyx)(
7976
) {
8077
#ifdef X_REMAINDER_SIZE
8178
if (X_REMAINDER_CONDITION) {
79+
// read
80+
INPUTVTYPE read_data;
81+
for (int j = 0; j < X_REMAINDER_SIZE; ++j) {
82+
read_data[j] = AS_INPUT0_TYPE(_sub_group_block_read((const __global uint*)(input) + input_idx_tile + j * DEFAULT_STRIDE));
83+
}
84+
// write
8285
for (int i = 0 ; i < X_REMAINDER_SIZE; i++) {
8386
output[output_idx + i] = TO_OUTPUT_TYPE(read_data[i]);
8487
}
8588
} else {
89+
// read
90+
INPUTVTYPE read_data = AS_INPUTVTYPE(_sub_group_block_read8((const __global uint*)(input) + input_idx_tile));
91+
// write
8692
VSTORE(TO_OUTPUTVTYPE(read_data), 0, output + output_idx);
8793
}
8894
#else
95+
// read
96+
INPUTVTYPE read_data = AS_INPUTVTYPE(_sub_group_block_read8((const __global uint*)(input) + input_idx_tile));
97+
// write
8998
VSTORE(TO_OUTPUTVTYPE(read_data), 0, output + output_idx);
9099
#endif
91100
}

0 commit comments

Comments
 (0)