diff --git a/cmake/flags.cmake b/cmake/flags.cmake index 3dffacdacbdb18a2f3fbc670234022dddf360e06..d11094e90fcbf6af71bb35379bd2aef80b3e0e99 100644 --- a/cmake/flags.cmake +++ b/cmake/flags.cmake @@ -160,7 +160,7 @@ if(UNIX AND NOT APPLE) set(LINUX TRUE) endif(UNIX AND NOT APPLE) -set(GPU_COMMON_FLAGS -std=c++11 ${GPU_COMMON_FLAGS}) +set(GPU_COMMON_FLAGS /std:c++14 ${GPU_COMMON_FLAGS}) foreach(flag ${COMMON_FLAGS}) safe_set_cflag(CMAKE_C_FLAGS ${flag}) safe_set_cxxflag(CMAKE_CXX_FLAGS ${flag}) diff --git a/paddle/fluid/inference/api/helper.h b/paddle/fluid/inference/api/helper.h index 4b64c2dc25213b8d6a3af3c35005b86e3b0c68b4..1c28428a8f6e7bb548c4218189c2d251941784b3 100644 --- a/paddle/fluid/inference/api/helper.h +++ b/paddle/fluid/inference/api/helper.h @@ -15,6 +15,7 @@ #pragma once #include +#include #include #include #include @@ -25,8 +26,8 @@ namespace paddle { namespace inference { - -static void split(const std::string &str, char sep, std::vector *pieces) { +static void split(const std::string &str, char sep, + std::vector *pieces) { pieces->clear(); if (str.empty()) { return; diff --git a/paddle/fluid/operators/cum_op.h b/paddle/fluid/operators/cum_op.h index 999fdcff90784ed089cd620a4f0a908f196bcdda..51227b4907663ebbd1f1ba5ad7c9242e99dfc43d 100644 --- a/paddle/fluid/operators/cum_op.h +++ b/paddle/fluid/operators/cum_op.h @@ -85,14 +85,17 @@ class CumKernel : public framework::OpKernel { template void ComputeImp(Device d, const Dim& dims, X x, Out out, int axis, bool reverse, bool exclusive) const { + Functor func(); if (!reverse) { - out.reshape(dims).device(d) = Functor()(x.reshape(dims), axis, exclusive); + out.reshape(dims).device(d) = + func.apply(x.reshape(dims), axis, exclusive); } else { std::array rev; rev.fill(false); rev[axis] = reverse; out.reshape(dims).device(d) = - Functor()(x.reshape(dims).reverse(rev), axis, exclusive).reverse(rev); + func.apply(x.reshape(dims).reverse(rev), axis, exclusive) + .reverse(rev); } } }; @@ -101,8 +104,7 @@ template struct CumsumFunctor { using ELEMENT_TYPE = T; template - const typename X::TensorScanSumOp operator()(X x, int axis, - bool exclusive) const { + const typename X::TensorScanSumOp apply(X x, int axis, bool exclusive) const { return x.cumsum(axis, exclusive); } };