Skip to content
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

[Pten] add cuda implement of cast kernel #37610

Merged

Conversation

MingMingShangTian
Copy link
Contributor

PR types

New features

PR changes

Others

Describe

Add cuda implement of cast kernel

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@MingMingShangTian MingMingShangTian changed the title add cuda implement of cast kernel [Pten] add cuda implement of cast kernel Nov 29, 2021
using CUDAContext = paddle::platform::CUDADeviceContext;

template <typename InT, typename OutT, int VecSize>
__global__ void VecCastCUDAKernel(const InT* in, const int64_t N, OutT* out) {
Copy link
Contributor

Choose a reason for hiding this comment

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

不建议copy代码过来,麻烦确保只有一份代码维护,否则原实现优化后,这里没更新,又会有问题

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好的,后续我再重提PR修复一下

@MingMingShangTian MingMingShangTian merged commit 9956763 into PaddlePaddle:develop Nov 29, 2021
@MingMingShangTian MingMingShangTian deleted the cuda_cast_kernel branch November 29, 2021 07:06
Zjq9409 pushed a commit to Zjq9409/Paddle that referenced this pull request Dec 10, 2021
* add cuda implement of cast kernel

* remove bfloat16 when defined paddle_with_hip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants