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

Change PADDLE_ONLY_CPU to PADDLE_WITH_GPU #4584

Merged

Conversation

reyoung
Copy link
Collaborator

@reyoung reyoung commented Oct 3, 2017

Fixes #4588

By shell command

sed -i 's#ifdef PADDLE_ONLY_CPU#ifndef PADDLE_WITH_GPU#g' `find ./paddle/ -name '*.h' -o -name '*.cc' -o -name '*.cpp' -o -name '*.c'`
sed -i 's#ifndef PADDLE_ONLY_CPU#ifdef PADDLE_WITH_GPU#g' `find ./paddle/ -name '*.h' -o -name '*.cc' -o -name '*.cpp' -o -name '*.c'`

@wangkuiyi
Copy link
Collaborator

wangkuiyi commented Oct 4, 2017

Thanks for this PR! @reyoung

I am afraid that this sed trick has not fixed all uses of PADDLE_ONLY_CPU, because when I search for PADDLE_ONLY_CPU on Github:

https://github.com/PaddlePaddle/Paddle/search?utf8=%E2%9C%93&q=PADDLE_ONLY_CPU&type=

I see 82 C++ files, 2 CUDA files, and 1 C files, which sum up to 85 source files.

However, this PR changes 84 files in total, including the configure.cmake file.

@wangkuiyi
Copy link
Collaborator

wangkuiyi commented Oct 4, 2017

I see. @reyoung you might forgot to update the two .cu files:

https://github.com/PaddlePaddle/Paddle/search?l=Cuda&q=PADDLE_ONLY_CPU&type=&utf8=%E2%9C%93

In above command line,

-name '*.h' -o -name '*.cc' -o -name '*.cpp' -o -name '*.c'

we need to add

-name '*.h' -o -name '*.cc' -o -name '*.cpp' -o -name '*.c' -name '*.cu'

@reyoung
Copy link
Collaborator Author

reyoung commented Oct 4, 2017

we need to add '*.cu'

Yes. I will add that soon.

@reyoung reyoung force-pushed the feature/change_macro_paddle_no_gpu branch from 882fc4e to 84500f9 Compare October 4, 2017 18:25
By shell command

```bash
sed -i 's#ifdef PADDLE_ONLY_CPU#ifndef PADDLE_WITH_GPU#g' `find ./paddle/ -name '*.h' -o -name '*.cc' -o -name '*.cpp' -o -name '*.c' -o -name '*.cu'`
sed -i 's#ifndef PADDLE_ONLY_CPU#ifdef PADDLE_WITH_GPU#g' `find ./paddle/ -name '*.h' -o -name '*.cc' -o -name '*.cpp' -o -name '*.c' -o -name '*.cu'`
```
@wangkuiyi wangkuiyi merged commit e79d2f1 into PaddlePaddle:develop Oct 4, 2017
@reyoung reyoung deleted the feature/change_macro_paddle_no_gpu branch October 12, 2017 19:48
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.

2 participants