-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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 cmake function for kernels #38311
Merged
chenwhql
merged 10 commits into
PaddlePaddle:develop
from
chenwhql:pten/add_cmake_function
Dec 22, 2021
Merged
[PTen] Add cmake function for kernels #38311
chenwhql
merged 10 commits into
PaddlePaddle:develop
from
chenwhql:pten/add_cmake_function
Dec 22, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thanks for your contribution! |
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# call kernel_declare need to make sure the target of input is exists |
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.
后续pr 中可以删除注释中的 is
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.
ok, thx
MingMingShangTian
approved these changes
Dec 22, 2021
zyfncg
approved these changes
Dec 22, 2021
zmxdream
pushed a commit
to zmxdream/Paddle
that referenced
this pull request
Dec 25, 2021
* add pten kernel cmake * add pten kernel cmake function * fix compile error * add enforce include for full kernel * fix compile failed * change cuda to gpu * fix cmake function error
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Function optimization
PR changes
Others
Describe
[PTen] Add cmake function for kernels
添加cmake函数register_kernels,类似原先的register_operators,扫描目录下所有kernel实现,根据文件名创建编译target,同时解析kernel注册代码,在公共头文件中添加kernel符号导出的声明,要求kernel按如下形式组织:
***_kernel.h
,有其他kernel复用当前kernel时,需在相应.cc/cu中include复用kernel的头文件cpu/***_kernel.cc
此PR合入后,无特殊情况,不需要额外添加cmake条目与kernel declare声明,暂时如果依赖关系比较特殊的话,还需要手动声明一下,例如
kernel_library(flatten_kernel DEPS ${FLATTEN_DEPS})
TODO:自动根据头文件include关系,自动生成kernel复用时的编译依赖关系