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

[CustomOp] fix paddle marco condition error in dtype header #32239

Conversation

chenwhql
Copy link
Contributor

@chenwhql chenwhql commented Apr 13, 2021

PR types

Bug fixes

PR changes

Others

Describe

底层数据类型的几个头文件 complex64.h, complex128.h, float16.h 会暴露给用户用于自定义op的编译

  • 自定义op接入训练时,由extension模块确定是否要带PADDLE_WITH_CUDA等内部宏定义
  • 自定义op接入预测时,cmake文件是由用户维护的,实际使用时遇到了预测编译没有声明PADDLE_WITH_CUDA宏,导致几个dtype头文件中没有引入thrust头文件,从而编译失败,错误如图

image

后由用户在cmake文件中新增PADDLE_WITH_CUDA宏的声明后解决

这里无论用户是否加PADDLE_WITH_CUDA的宏,在编译时都不应该失败,complex头文件中的宏控制条件不够严格,这个PR修复一下

@paddle-bot-old
Copy link

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

@chenwhql chenwhql changed the title [CustomOp] Remove paddle marco define in dtype header [CustomOp] fix paddle marco condition error in dtype header Apr 14, 2021
@chenwhql chenwhql force-pushed the extension/fix_compile_failed_in_infer_custom_op branch from 0696e44 to eed8e08 Compare April 14, 2021 06:34
@MingMingShangTian
Copy link
Contributor

LGTM

Copy link
Contributor

@qili93 qili93 left a comment

Choose a reason for hiding this comment

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

LGTM

@chenwhql chenwhql merged commit 7b9fcac into PaddlePaddle:develop Apr 14, 2021
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.

3 participants