Skip to content

Change PADDLE_ONLY_CPU to PADDLE_WITH_GPU#4584

Merged
wangkuiyi merged 1 commit intoPaddlePaddle:developfrom
reyoung:feature/change_macro_paddle_no_gpu
Oct 4, 2017
Merged

Change PADDLE_ONLY_CPU to PADDLE_WITH_GPU#4584
wangkuiyi merged 1 commit intoPaddlePaddle:developfrom
reyoung:feature/change_macro_paddle_no_gpu

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'`
@reyoung reyoung requested review from QiJune and wangkuiyi October 3, 2017 23:49
@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

2 participants