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

[OpenCL]add greater_than cast pass and add greater_than opencl kernel and add abs opencl kernel #6595

Merged
merged 8 commits into from
Aug 10, 2021

Conversation

daming5432
Copy link
Collaborator

No description provided.

@paddle-bot-old
Copy link

paddle-bot-old bot commented Aug 2, 2021

Thanks for your contribution!

@@ -0,0 +1,34 @@
/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Copy link
Collaborator

Choose a reason for hiding this comment

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

2021

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

已改

(CL_DTYPE)(input_y),
(CL_DTYPE)(input_y));
CL_DTYPE4 in_x = READ_IMG_TYPE(CL_DTYPE_CHAR, input_x, SAMPLER, (int2)(x, y));
int4 out_tmp = isgreater(in_x, in_y);
Copy link
Collaborator

Choose a reason for hiding this comment

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

opencl标准(如下),如果严格检测,是否会有编译报错?保险期间,可以加个宏?

int4 isgreater (float4 x, float4 y)
short4 isgreater (half4 x, half4 y)
#ifdef CL_DTYPE_half
short4 out_tmp = isgreater(in_x, in_y);
#else
int4 out_tmp = isgreater(in_x, in_y);
#endif

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

已改

@@ -0,0 +1,32 @@
// Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
Copy link
Collaborator

Choose a reason for hiding this comment

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

2021

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

已改


void GreaterThanCastFuser::BuildPattern() {
// create nodes
// fc
Copy link
Collaborator

Choose a reason for hiding this comment

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

// fc
注释删除

->assert_is_op_input("cast", "X")
->AsIntermediate();

// prelu
Copy link
Collaborator

Choose a reason for hiding this comment

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

注释删除,其他注释也检查下吧

@@ -0,0 +1,38 @@
// Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
Copy link
Collaborator

Choose a reason for hiding this comment

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

2021

#ifdef LITE_WITH_PROFILE
void SetProfileRuntimeKernelInfo(paddle::lite::profile::OpCharacter* ch) {
ch->kernel_func_name = kernel_func_name_;
ch->cl_event =
Copy link
Collaborator

Choose a reason for hiding this comment

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

加上global_work_size吧,参考conv中的SetProfileRuntimeKernelInfo函数

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

已修改

Copy link
Collaborator

@zhaoyang-star zhaoyang-star left a comment

Choose a reason for hiding this comment

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

several comments

@daming5432 daming5432 changed the title [OpenCL]add greater_than cast pass and add greater_than opencl kernel [OpenCL]add greater_than cast pass and add greater_than opencl kernel and add abs opencl kernel Aug 3, 2021
zhaoyang-star
zhaoyang-star previously approved these changes Aug 4, 2021
Copy link
Collaborator

@zhaoyang-star zhaoyang-star left a comment

Choose a reason for hiding this comment

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

LGTM

zhaoyang-star
zhaoyang-star previously approved these changes Aug 5, 2021
Copy link
Collaborator

@zhaoyang-star zhaoyang-star left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@zhaoyang-star zhaoyang-star left a comment

Choose a reason for hiding this comment

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

LGTM

@daming5432 daming5432 merged commit 4cc9c9d into PaddlePaddle:develop Aug 10, 2021
@daming5432 daming5432 deleted the speed_up_radius3 branch August 10, 2021 02:57
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