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.
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
【第三方库离线编译】add submodule pocketfft and xbyak #54344
【第三方库离线编译】add submodule pocketfft and xbyak #54344
Changes from 2 commits
53478c5
642e3a0
bf0d829
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?为什么要copy目录??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
因为现存代码里有对
extern_pocketfft
目录的引用:Paddle/paddle/phi/kernels/funcs/fft.cc
Lines 21 to 27 in c15e53d
为了保留外部代码的一致性,所以需要复制一份到
${THIRD_PARTY}/pocketfft/src/extern_pocketfft
,并且将${THIRD_PARTY}/pocketfft/src
作为include_directories
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果不复制的话,就需要将
${PADDLE_SOURCE_DIR}/third_party
作为include_directories
了,我觉得暴露这个目录不太优雅。一个可选的思路的将保留 extern_pocketfft 这个目录,但是仅复制需要的
"extern_pocketfft/pocketfft_hdronly.h"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include "extern_pocketfft/pocketfft_hdronly.h" 改为 #include "pocketfft_hdronly.h" 应该也可以吧,然后include_directories(SOURCE_DIR)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
复制也是一种方法,但是系统本身有一份再进行复制是不是冗余操作?这样暴露不太优雅?指的是?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是这样的,参考
pybind
的引用,我是倾向于#include "<third_part_name>/<header_filename>"
这种形式。之所以之前没有改成
#include "pocketfft_hdronly.h"
,是因为感觉不能直观看出是第三方库。pybind
那边的目录结构是pybind/include/pybind11/xxx.h
,所以能够直接将${SOURCE_DIR}/include
作为include
目录;不优雅指的是,不同于
pybind
,pocketfft
目录是展开的,如果想保留<库名>/<头文件名>
的方式,就可能导致${PADDLE_SOURCE_DIR}/third_party
目录暴露,担心后续可能会出现include
冲突的情况,"${PADDLE_SOURCE_DIR}/third_party/xxx"
和其他位置的xxx
冲突;如果修改
INCLUDE_DIR
到SOURCE_DIR
,会导致在#include
的时候看不到库名。出于这个考虑,所以直接复制了整个目录到原来的
extern_pocketfft
,来保证外部引用的一致。There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以,那就复制吧,的确,肉眼第一时间看出来某个第三方库的头文件是比较好的。good job