Skip to content

xxx.h, xxx.{cc,cu}, xxx_test.{cc,cu} in the same directory #2251

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

Closed
wants to merge 3 commits into from

Conversation

JiayiFeng
Copy link
Collaborator

fix #2209

@JiayiFeng JiayiFeng requested review from a user, gangliao and QiJune May 24, 2017 08:57
cc_library(place SRCS place.cc)
cc_library(ddim SRCS ddim.cc)
cc_library(place SRCS place/place.cc)
cc_library(ddim SRCS ddim/ddim.cc)

if(WITH_TESTING)
Copy link
Contributor

Choose a reason for hiding this comment

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

@gangliao WITH_TESTINGWITH_GPU等判断是不是可以放在cc_testnv_test的定义里面,这样CMakeLists.txt看起来会更简洁一些。

Copy link
Collaborator

Choose a reason for hiding this comment

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

I created a new issue #2259 to record @Xreki 's suggestion.

cc_library(place SRCS place.cc)
cc_library(ddim SRCS ddim.cc)
cc_library(place SRCS place/place.cc)
cc_library(ddim SRCS ddim/ddim.cc)

if(WITH_TESTING)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I created a new issue #2259 to record @Xreki 's suggestion.

@@ -1,4 +1,4 @@
#include "paddle/majel/ddim.h"
#include "paddle/majel/ddim/ddim.h"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I tend to think that we don't need to move each C++ module into a directory. In C++, a module is defined by a .cc file, optionally with interface declaration in a .h file. We can describe a C++ module by a CMake rule, e.g., cc_library(ddim SRCS ddim.cc). So it seems overkilling to move each C++ module into a directory.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree that current CMake rule in Paddle majel with cc_library() and cc_test() has made module describing quite clearly, therefore simple module like ddim and place is not necessery to moved into a directory. However, if a module is really complicated, we should still gather related files up in a subdirectory.

This is my personal understanding, I'm not sure whether it is right ...

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you are right for the complicated case, e.g., paddle/parameter. For this case, let's move ddim back to paddle/majel.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Got it. I'm going to close this PR.

@JiayiFeng JiayiFeng closed this May 26, 2017
@JiayiFeng JiayiFeng deleted the dev branch May 26, 2017 02:26
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.

xxx.h, xxx.{cc,cu}, xxx_test.{cc,cu} in the same directory
3 participants