[Cherry-pick] Fix a bug in ReadData, ReadDataBc and ReadDataReduce when NX != 1 (#3… #36616
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR types
Bug fixes
PR changes
APIS
Describe
问题描述:
在进行2D数据读取时,线程数据访问起始位置设置成 threadIdx.x * NX, 对于带stride的读取方式,正确的线程数据起始位置应该为 threadIdx.x; 原始情况会出现数据访存越界的情况,如下图所示:
出错的场景: 当使用大Kernel Primitive API 中的 2D 数据读取时, 只要将NX 设置成大于 1的数就会报错。
出错case: 当前实现并未涉及 NX > 1 的case