Define cc_xxx and nv_xxx to simplify cmake#2174
Define cc_xxx and nv_xxx to simplify cmake#2174wangkuiyi merged 6 commits intoPaddlePaddle:developfrom
Conversation
| } | ||
|
|
||
| __global__ void vecAdd (float* d_A, float* d_B, float* d_C, int n) { | ||
| __global__ void vecAdd(float *d_A, float *d_B, float *d_C, int n) { |
There was a problem hiding this comment.
It seems that clang-format can work correctly on cuda source code.
There was a problem hiding this comment.
@wangkuiyi Shall we also format paddle's CUDA files?
There was a problem hiding this comment.
Sounds great! Let's do it!
| else() | ||
| cuda_add_library(${TARGET_NAME} STATIC ${nv_library_SRCS}) | ||
| endif() | ||
| add_dependencies(${TARGET_NAME} ${nv_library_DEPS} ${external_project_dependencies}) |
There was a problem hiding this comment.
I tried to grep for "external_project_dependencies", but I cannot find it anywhere in *.cmake and CMakeLists.txt files. I Googled it, but cannot find it in CMake's document. Where was this variable defined?
| else() | ||
| cuda_add_library(${TARGET_NAME} STATIC ${nv_library_SRCS}) | ||
| endif() | ||
| add_dependencies(${TARGET_NAME} ${nv_library_DEPS} ${external_project_dependencies}) |
There was a problem hiding this comment.
Does this line, and similar lines in other functions, mean that every library and test depends on all external projects? I am a little afraid that this could be too heavy?
| function(cc_library TARGET_NAME) | ||
| set(options OPTIONAL) | ||
| set(oneValueArgs "") | ||
| set(multiValueArgs SRCS DEPS) |
There was a problem hiding this comment.
Just be curious: I noticed that these three lines
set(options OPTIONAL)
set(oneValueArgs "")
set(multiValueArgs SRCS DEPS)
appear in all these functions. Can we move them out of these functions as we write global variables? -- I know global variables are not a good idea; I am just curious.
You can verify this feature.
gois different, it's better to create a new pull request