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

[Refactor] Add a class Callable to unify Kernel and Function #2338

Merged
merged 12 commits into from
May 18, 2021

Conversation

xumingkuan
Copy link
Contributor

@xumingkuan xumingkuan commented May 13, 2021

Related issue = #2193

A continuation of #2306.

This PR unifies the common fields of Kernel and Function into Callable, including Program *program;, std::unique_ptr<IRNode> ir;, std::vector<Arg> args;, std::vector<Ret> rets;.

So this PR changes Program &Kernel::program into Program *, which is a part of the somewhat large change set.

This PR also changes current_function_or_kernel introduced in #2306 to current_callable, unifies CurrentFunctionGuard and CurrentKernelGuard to CurrentCallableGuard, adds Callable::get_name(), and renames KernelTemplateMapper to TaichiCallableTemplateMapper.

BTW, I found that program.h is included in so many files that modifying it causes a long build time, similar to ir.h...

[Click here for the format server]


@xumingkuan xumingkuan marked this pull request as ready for review May 17, 2021 07:21
@xumingkuan xumingkuan requested a review from k-ye May 17, 2021 07:26
@xumingkuan xumingkuan added the large changeset The PR contains a large changeset and reviewing may take times label May 17, 2021
Copy link
Member

@k-ye k-ye left a comment

Choose a reason for hiding this comment

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

LGTM thanks!

taichi/program/callable.h Outdated Show resolved Hide resolved
@xumingkuan xumingkuan merged commit aabd87c into taichi-dev:master May 18, 2021
@xumingkuan xumingkuan mentioned this pull request May 20, 2021
@xumingkuan xumingkuan deleted the callable branch June 8, 2021 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
large changeset The PR contains a large changeset and reviewing may take times
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants