Skip to content

Commit 97a001f

Browse files
committed
Merge branch 'windows/build' into windows/online
test=develop
2 parents a89ed69 + b2f8d41 commit 97a001f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

paddle/fluid/platform/gpu_info.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,16 @@ limitations under the License. */
1919
#include "gflags/gflags.h"
2020
#include "paddle/fluid/platform/enforce.h"
2121

22+
#ifndef _WIN32
23+
const float fraction_of_gpu_memory_to_use = 0.92f;
24+
#else
2225
// fraction_of_gpu_memory_to_use cannot be too high on windows,
2326
// since the win32 graphic sub-system can occupy some GPU memory
2427
// which may lead to insufficient memory left for paddle
25-
DEFINE_double(fraction_of_gpu_memory_to_use, 0.5,
28+
const float fraction_of_gpu_memory_to_use = 0.5f;
29+
#endif
30+
31+
DEFINE_double(fraction_of_gpu_memory_to_use, fraction_of_gpu_memory_to_use,
2632
"Allocate a trunk of gpu memory that is this fraction of the "
2733
"total gpu memory size. Future memory usage will be allocated "
2834
"from the trunk. If the trunk doesn't have enough gpu memory, "

0 commit comments

Comments
 (0)