Skip to content

Conversation

@wanghuancoder
Copy link
Contributor

PR Category

Execute Infrastructure

PR Types

Bug fixes

Description

改善ForRange,不需要size_t时不用,提升性能。需要使用时需要先提升threadid.x的类型,否则会越界。

Pcard-67164

@paddle-bot
Copy link

paddle-bot bot commented Apr 16, 2025

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

}

template <typename Function>
__global__ static void ForRangeElemwiseOpBig(Function func, size_t limit) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ForRangeElemwiseOpLargeSize

if (grid_size == 1) {
ForRangeElemwiseOpGridIsOne<<<1, block_size, 0, dev_ctx_.stream()>>>(
func);
} else if (limit_ > std::numeric_limits<unsigned int>::max()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个是不是要跟int的最大值来比较

@wanghuancoder wanghuancoder merged commit 00f0fe8 into PaddlePaddle:develop Apr 17, 2025
35 of 37 checks passed
YqGe585 pushed a commit to YqGe585/Paddle that referenced this pull request May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants