From 445fff24dcbdce6c4b98b5631bc6c34831276fca Mon Sep 17 00:00:00 2001 From: peizhilin Date: Fri, 23 Nov 2018 14:40:04 +0800 Subject: [PATCH] add the bigobj option to NVCC compile fix code style --- cmake/cuda.cmake | 4 ++-- paddle/fluid/operators/beam_search_op_test.cc | 4 ++-- paddle/fluid/platform/stream_callback_manager.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmake/cuda.cmake b/cmake/cuda.cmake index 964d5fd45b..4c7e0fd3f6 100644 --- a/cmake/cuda.cmake +++ b/cmake/cuda.cmake @@ -200,9 +200,9 @@ elseif(CMAKE_BUILD_TYPE STREQUAL "MinSizeRel") endif() else(NOT WIN32) if(CMAKE_BUILD_TYPE STREQUAL "Debug") - list(APPEND CUDA_NVCC_FLAGS "-g -G") + list(APPEND CUDA_NVCC_FLAGS "-g -G --compiler-options;/bigobj") elseif(CMAKE_BUILD_TYPE STREQUAL "Release") - list(APPEND CUDA_NVCC_FLAGS "-O3 -DNDEBUG") + list(APPEND CUDA_NVCC_FLAGS "-O3 -DNDEBUG --compiler-options;/bigobj") else() message(FATAL "Windows only support Release or Debug build now. Please set visual studio build type to Release/Debug, x64 build.") endif() diff --git a/paddle/fluid/operators/beam_search_op_test.cc b/paddle/fluid/operators/beam_search_op_test.cc index 6e283866ff..40b46781da 100644 --- a/paddle/fluid/operators/beam_search_op_test.cc +++ b/paddle/fluid/operators/beam_search_op_test.cc @@ -45,8 +45,8 @@ void CreateInput(LoDTensor* ids, LoDTensor* scores) { auto* ids_data = ids->mutable_data(place); auto* scores_data = scores->mutable_data(place); vector _ids({4, 2, 5, 2, 1, 3, 3, 5, 2, 8, 2, 1}); - vector _scores({0.5f, 0.3f, 0.2f, 0.6f, 0.3f, 0.1f, - 0.9f, 0.5f, 0.1f, 0.7f, 0.5f, 0.1f}); + vector _scores( + {0.5f, 0.3f, 0.2f, 0.6f, 0.3f, 0.1f, 0.9f, 0.5f, 0.1f, 0.7f, 0.5f, 0.1f}); for (int i = 0; i < 12; i++) { ids_data[i] = _ids[i]; diff --git a/paddle/fluid/platform/stream_callback_manager.h b/paddle/fluid/platform/stream_callback_manager.h index 8dcfc4e748..ed8734c98c 100644 --- a/paddle/fluid/platform/stream_callback_manager.h +++ b/paddle/fluid/platform/stream_callback_manager.h @@ -14,11 +14,11 @@ #pragma once +#include #include #include #include #include -#include #include "paddle/fluid/platform/enforce.h" namespace paddle { -- GitLab