提交 75681c0a 编写于 作者: D dzhwinter

switch to 9.2

上级 5c2637eb
...@@ -169,9 +169,9 @@ set(CUDA_PROPAGATE_HOST_FLAGS OFF) ...@@ -169,9 +169,9 @@ set(CUDA_PROPAGATE_HOST_FLAGS OFF)
# Release/Debug flags set by cmake. Such as -O3 -g -DNDEBUG etc. # Release/Debug flags set by cmake. Such as -O3 -g -DNDEBUG etc.
# So, don't set these flags here. # So, don't set these flags here.
#list(APPEND CUDA_NVCC_FLAGS "-std=c++14")
if (NOT WIN32) # windows msvc2015 support c++11 natively. if (NOT WIN32) # windows msvc2015 support c++11 natively.
# -std=c++11 -fPIC not recoginize by msvc, -Xcompiler will be added by cmake. # -std=c++11 -fPIC not recoginize by msvc, -Xcompiler will be added by cmake.
list(APPEND CUDA_NVCC_FLAGS "-std=c++11")
list(APPEND CUDA_NVCC_FLAGS "-Xcompiler -fPIC") list(APPEND CUDA_NVCC_FLAGS "-Xcompiler -fPIC")
endif(NOT WIN32) endif(NOT WIN32)
......
...@@ -136,7 +136,7 @@ else(NOT WIN32) ...@@ -136,7 +136,7 @@ else(NOT WIN32)
set(COMMON_FLAGS set(COMMON_FLAGS
"/w") #disable all warnings "/w") #disable all warnings
set(GPU_COMMON_FLAGS set(GPU_COMMON_FLAGS
/w) #disable all warnings -w) #disable all warnings
endif(NOT WIN32) endif(NOT WIN32)
...@@ -160,7 +160,7 @@ if(UNIX AND NOT APPLE) ...@@ -160,7 +160,7 @@ if(UNIX AND NOT APPLE)
set(LINUX TRUE) set(LINUX TRUE)
endif(UNIX AND NOT APPLE) endif(UNIX AND NOT APPLE)
set(GPU_COMMON_FLAGS -std=c++11 ${GPU_COMMON_FLAGS})
foreach(flag ${COMMON_FLAGS}) foreach(flag ${COMMON_FLAGS})
safe_set_cflag(CMAKE_C_FLAGS ${flag}) safe_set_cflag(CMAKE_C_FLAGS ${flag})
safe_set_cxxflag(CMAKE_CXX_FLAGS ${flag}) safe_set_cxxflag(CMAKE_CXX_FLAGS ${flag})
......
...@@ -17,6 +17,7 @@ limitations under the License. */ ...@@ -17,6 +17,7 @@ limitations under the License. */
#define GLOG_NO_ABBREVIATED_SEVERITIES #define GLOG_NO_ABBREVIATED_SEVERITIES
#include "paddle/fluid/framework/tensor.h" #include "paddle/fluid/framework/tensor.h"
#include <math_constants.h>
#include "unsupported/Eigen/CXX11/Tensor" #include "unsupported/Eigen/CXX11/Tensor"
namespace paddle { namespace paddle {
......
...@@ -18,7 +18,7 @@ namespace paddle { ...@@ -18,7 +18,7 @@ namespace paddle {
namespace framework { namespace framework {
namespace ir { namespace ir {
constexpr char Node::kControlDepVarName[]; char Node::kControlDepVarName[];
int Node::count_ = 0; int Node::count_ = 0;
} // namespace ir } // namespace ir
} // namespace framework } // namespace framework
......
...@@ -23,6 +23,10 @@ limitations under the License. */ ...@@ -23,6 +23,10 @@ limitations under the License. */
#include <unordered_map> #include <unordered_map>
#include <unordered_set> #include <unordered_set>
#if defined(_WIN32)
#define GLOG_NO_ABBREVIATED_SEVERITIES // msvc conflict logging with windows.h
#endif
#include "glog/logging.h" // For VLOG() #include "glog/logging.h" // For VLOG()
#include "paddle/fluid/framework/attribute.h" #include "paddle/fluid/framework/attribute.h"
#include "paddle/fluid/framework/details/op_registry.h" #include "paddle/fluid/framework/details/op_registry.h"
......
...@@ -20,6 +20,10 @@ limitations under the License. */ ...@@ -20,6 +20,10 @@ limitations under the License. */
#include <typeindex> #include <typeindex>
#include <vector> #include <vector>
#if defined(_WIN32)
#define GLOG_NO_ABBREVIATED_SEVERITIES // msvc conflict logging with windows.h
#endif
#include "paddle/fluid/framework/data_layout.h" #include "paddle/fluid/framework/data_layout.h"
#include "paddle/fluid/framework/ddim.h" #include "paddle/fluid/framework/ddim.h"
#include "paddle/fluid/memory/memory.h" #include "paddle/fluid/memory/memory.h"
......
...@@ -57,8 +57,8 @@ void TensorToVector(const Tensor& src, const platform::DeviceContext& ctx, ...@@ -57,8 +57,8 @@ void TensorToVector(const Tensor& src, const platform::DeviceContext& ctx,
template <typename T> template <typename T>
void TesnorToVector(const Tensor& src, std::vector<T>* dst); void TesnorToVector(const Tensor& src, std::vector<T>* dst);
// bool TensorContainsNAN(const framework::Tensor& tensor); bool TensorContainsNAN(const framework::Tensor& tensor);
// bool TensorContainsInf(const framework::Tensor& tensor); bool TensorContainsInf(const framework::Tensor& tensor);
void TensorToStream(std::ostream& os, const Tensor& tensor, void TensorToStream(std::ostream& os, const Tensor& tensor,
const platform::DeviceContext& dev_ctx); const platform::DeviceContext& dev_ctx);
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#pragma once #pragma once
#include <sys/time.h>
#include <algorithm> #include <algorithm>
#include <numeric> #include <numeric>
#include <sstream> #include <sstream>
......
...@@ -14,6 +14,7 @@ limitations under the License. */ ...@@ -14,6 +14,7 @@ limitations under the License. */
#pragma once #pragma once
#include <algorithm> #include <algorithm>
#include "paddle/fluid/framework/op_registry.h" #include "paddle/fluid/framework/op_registry.h"
namespace paddle { namespace paddle {
......
...@@ -54,17 +54,12 @@ class CastOpKernel : public framework::OpKernel<InT> { ...@@ -54,17 +54,12 @@ class CastOpKernel : public framework::OpKernel<InT> {
void Compute(const framework::ExecutionContext& context) const override { void Compute(const framework::ExecutionContext& context) const override {
auto* in = context.Input<framework::Tensor>("X"); auto* in = context.Input<framework::Tensor>("X");
auto* out = context.Output<framework::Tensor>("Out"); auto* out = context.Output<framework::Tensor>("Out");
#if !defined(_MSC_VER)
framework::VisitDataType( framework::VisitDataType(
static_cast<framework::proto::VarType::Type>( static_cast<framework::proto::VarType::Type>(
context.Attr<int>("out_dtype")), context.Attr<int>("out_dtype")),
CastOpFunctor<DeviceContext, InT>( CastOpFunctor<DeviceContext, InT>(
in, out, context.template device_context<DeviceContext>())); in, out, context.template device_context<DeviceContext>()));
#else
auto type = static_cast<framework::proto::VarType::Type>(
context.Attr<int>("out_dtype"));
trans
#endif // msvc
} }
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册