-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[BugFix][OpenCL] Fix concat image impl when axis is not 1. test=develop #4241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没其他问题。LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
656cb45
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…op (PaddlePaddle#4241) * [BugFix][OpenCL] Fix concat image impl when concat axis is not 1 * fix code when axis == 1. test=develop * fix illegal access when print debug info. test=develop * fix typo
…op (PaddlePaddle#4241) * [BugFix][OpenCL] Fix concat image impl when concat axis is not 1 * fix code when axis == 1. test=develop * fix illegal access when print debug info. test=develop * fix typo
…op (PaddlePaddle#4241) * [BugFix][OpenCL] Fix concat image impl when concat axis is not 1 * fix code when axis == 1. test=develop * fix illegal access when print debug info. test=develop * fix typo
【问题1】当 concat 的 axis 不为 1 时,opencl concat image 实现计算错误。
【原因】在成员函数
PrepareForRun
中定义了一个临时变量axis_
(该临时变量与类的成员变量axis_
重名),在PrepareForRun
中对临时变量的赋值并不会传递到成员函数Run
中,因此在Run
中读取的axis_
值恒为默认值。【解决方法】删除成员函数
PrepareForRun
中对axis_
的定义,改为直接对成员变量axis_
赋值。【问题2】当 concat 的 axis 为 -1 时,opencl concat image 实现计算错误且有内存越界现象。
【原因】当 axis==-1时,需要对其进行转换。
【解决方法】将 axis 置为 output 的最后一个 axis。
【其他】修改了输出debug信息时存在的内存越界访问。