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] Rearrange taichi/common and taichi/util. taichi/core is removed. #979

Merged
merged 3 commits into from
May 15, 2020

Conversation

yuanming-hu
Copy link
Member

@yuanming-hu yuanming-hu commented May 14, 2020

Not sure it makes sense or not, but when I try to include a file in one of the three folders, I often forget which folder to use. The three folds are essentially doing the same thing...

[Click here for the format server]

@yuanming-hu yuanming-hu requested review from k-ye and archibate and removed request for k-ye May 14, 2020 02:54
@archibate
Copy link
Collaborator

Great but I personally think util is not that usage, it's about image_io.h etc., maybe bit.h is ok, but commit_hash.h is not ok, it's not a util at all.

@k-ye
Copy link
Member

k-ye commented May 14, 2020

Yeah, I also feel that common means some base components that are widely used by the repo, whereas utils are some non-core helpers..? At a minimum, since core only contains .cpp, is it possible to put these cpps to each of their corresponding header's directory?

@yuanming-hu
Copy link
Member Author

Thanks for the inputs! How about this:

  • core has only cpp files, so let's split this folder into common and util (as suggested by @k-ye)
  • Merge core/interface (empty cpp) and core/interfaces
  • Rename common/util.h -> common/core.h
  • Move common/bit.h (thanks to @archibate), common/testing (not sure about this one, but this is only used in C++ tests) to util
    • Remaining files in common would be dict (which will be removed later since it's no longer used frequently), interface.h, serialization.h, common/meta, task.h, util.h(will be renamed to core.h)

@archibate
Copy link
Collaborator

archibate commented May 14, 2020

Ack :)

Rename common/util.h -> common/core.h

but could you remove functions like split_string, starts_with, etc. to util/string_utils.h? We want only the core compoment left in core.h.

@yuanming-hu
Copy link
Member Author

Ack :)

Rename common/util.h -> common/core.h

but could you remove functions like split_string, starts_with, etc. to util/string_utils.h? We want only the core compoment left in core.h.

Sounds good. I would do that in a later PR so that this one has only file movements.

@yuanming-hu yuanming-hu changed the title [refactor] Merge taichi/core and taichi/common into taichi/util [refactor] Rearrange taichi/common and taichi/util. taichi/core is removed. May 14, 2020
Copy link
Collaborator

@archibate archibate left a comment

Choose a reason for hiding this comment

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

LGTM, thx!

Comment on lines +17 to -18
#include "taichi/common/core.h"
#include "taichi/math/math.h"
#include "util.h"
Copy link
Collaborator

Choose a reason for hiding this comment

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

dict? Move this file to util?

Copy link
Member Author

Choose a reason for hiding this comment

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

As mentioned above dict will be removed later.

Comment on lines 264 to +267
// Meta-programming
//******************************************************************************

#include "meta.h"
#include "taichi/util/meta.h"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Good, don't forget to remove these stuff.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks. As mentioned above these will be done in a later PR so that this one has only file movements.

@yuanming-hu yuanming-hu merged commit 7381e56 into taichi-dev:master May 15, 2020
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