-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,13 @@ | ||
| 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) | ||
| add_subdirectory(test) | ||
| cc_test(ddim_test SRCS ddim/ddim_test.cc DEPS ddim) | ||
| cc_test(place_test SRCS place/place_test.cc DEPS place) | ||
|
|
||
| if(WITH_GPU) | ||
| nv_test(cuda_test SRCS cuda_test/cuda_test.cu) | ||
| nv_test(dim_test SRCS ddim/dim_test.cu DEPS ddim) | ||
| endif() | ||
|
|
||
| endif() | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #include "paddle/majel/ddim.h" | ||
| #include "paddle/majel/ddim/ddim.h" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.,
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree that current CMake rule in Paddle majel with This is my personal understanding, I'm not sure whether it is right ...
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it. I'm going to close this PR. |
||
|
|
||
| namespace majel { | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #include "paddle/majel/place.h" | ||
| #include "paddle/majel/place/place.h" | ||
|
|
||
| namespace majel { | ||
|
|
||
|
|
||
This file was deleted.
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.
@gangliao
WITH_TESTING和WITH_GPU等判断是不是可以放在cc_test和nv_test的定义里面,这样CMakeLists.txt看起来会更简洁一些。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.
I created a new issue #2259 to record @Xreki 's suggestion.