提交 490482ae 编写于 作者: Y Yu Yang 提交者: zchen0211

Do not invoke GPU method when use_gpu=false

上级 1b2374ad
...@@ -18,6 +18,7 @@ limitations under the License. */ ...@@ -18,6 +18,7 @@ limitations under the License. */
#include <cmath> #include <cmath>
#include <functional> #include <functional>
#include <limits> #include <limits>
#include <memory>
#include "NeuralNetwork.h" #include "NeuralNetwork.h"
#include "paddle/gserver/layers/AgentLayer.h" #include "paddle/gserver/layers/AgentLayer.h"
#include "paddle/utils/Flags.h" #include "paddle/utils/Flags.h"
...@@ -429,7 +430,11 @@ void RecurrentGradientMachine::reorganizeInput(PassType passType) { ...@@ -429,7 +430,11 @@ void RecurrentGradientMachine::reorganizeInput(PassType passType) {
} }
{ {
AsyncGpuBlock asyncGpuBlock; std::unique_ptr<AsyncGpuBlock> asyncBlock;
if (useGpu_) {
asyncBlock.reset(new AsyncGpuBlock());
}
// inFrameLine select rows in real layer one time // inFrameLine select rows in real layer one time
for (size_t i = 0; i < inFrameLines_.size(); i++) { for (size_t i = 0; i < inFrameLines_.size(); i++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册