From e030741df982b480636c0ceb44b06236e89cc05b Mon Sep 17 00:00:00 2001
From: tensor-tang <tangjian03@baidu.com>
Date: Thu, 7 Jun 2018 19:16:10 +0800
Subject: [PATCH] fix gpu fraction

---
 paddle/contrib/inference/demo/simple_on_word2vec.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/paddle/contrib/inference/demo/simple_on_word2vec.cc b/paddle/contrib/inference/demo/simple_on_word2vec.cc
index 9c36aa44ec7..192a6414260 100644
--- a/paddle/contrib/inference/demo/simple_on_word2vec.cc
+++ b/paddle/contrib/inference/demo/simple_on_word2vec.cc
@@ -72,6 +72,8 @@ void MainThreads(int num_threads, bool use_gpu) {
   NativeConfig config;
   config.model_dir = FLAGS_dirname + "word2vec.inference.model";
   config.use_gpu = use_gpu;
+  config.fraction_of_gpu_memory = 0.15;
+  config.device = 0;
   auto main_predictor =
       CreatePaddlePredictor<NativeConfig, PaddleEngineKind::kNative>(config);
 
-- 
GitLab