Decrease usage of GetVecSize for optimizing host computation efficiency #50353
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
Function optimization
PR changes
APIs
Describe
特点 : 用指针的地址做『或』操作得到结果地址,再用结果地址去做
phi::GetVectorizedSize()
等价于std::min(phi::GetVectorizedSize<T>(x_ptr), phi::GetVectorizedSize<T>(y_ptr))
,两者返回的'VecSize'结果相同,而前者减少了GetVectorizedSize
的调用规模.PS:由于我的linux环境被不小心更改了github-id,导致我的前两个commit 提交id 错误,请忽略.