[Fix] fix phi extension header error when compiling custom device #60842
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
Bug fixes
PR changes
Others
Description
修复 #57785 引入的 extension.h 的头文件问题
文件栈如下,kernels.h 是由Paddle自动生成,会自动引入所有 paddle/phi/include/ 目录下的kernel头文件
copysign_kernel.h 中引入了 elementwise_base.h,这里代码有对
set_lod
这样定义在 dense_tensor_impl.inl 中而不是 dense_tensor.h 中的定义进行引用,外部调用 extension.h 头文件就会引发找不到set_lod
定义的错误,因此 elementwise_base.h 这样头文件的引入需要放在kernel.cc/kernel.cu文件中,不可以放到 kernel.h的头文件中。后续为了避免此类情况,增加一个 header_test 的测试
Pcard-77889