diff --git a/cmake/external/protobuf.cmake b/cmake/external/protobuf.cmake index 6f9078c8eeecd2f74541b478313169af2c19a554..5903edebae825f70c986ad6021d9584f0225d372 100755 --- a/cmake/external/protobuf.cmake +++ b/cmake/external/protobuf.cmake @@ -268,8 +268,6 @@ function(build_protobuf TARGET_NAME BUILD_FOR_HOST) DOWNLOAD_DIR ${PROTOBUF_SOURCE_DIR} DOWNLOAD_COMMAND rm -rf arm_protobuf.tar.gz && wget --no-check-certificate ${ARM_PROTOBUF_URL} && tar zxvf arm_protobuf.tar.gz - #DOWNLOAD_COMMAND cp /home/wangbin44/Paddle/build/arm_protobuf.tar.gz . - # && tar zxvf arm_protobuf.tar.gz UPDATE_COMMAND "" CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${PROTOBUF_INSTALL_DIR} -DCMAKE_BUILD_TYPE:STRING=${THIRD_PARTY_BUILD_TYPE} diff --git a/cmake/external/xxhash.cmake b/cmake/external/xxhash.cmake index 6e685bbde402e8db05d6ec52cbca2a82133a8823..648a060f9b7e80734d838460c461b4851e1fb3c4 100644 --- a/cmake/external/xxhash.cmake +++ b/cmake/external/xxhash.cmake @@ -97,5 +97,4 @@ endif() add_library(xxhash STATIC IMPORTED GLOBAL) set_property(TARGET xxhash PROPERTY IMPORTED_LOCATION ${XXHASH_LIBRARIES}) -include_directories(${XXHASH_INCLUDE_DIR}) add_dependencies(xxhash extern_xxhash) diff --git a/paddle/fluid/eager/pylayer/py_layer_node.h b/paddle/fluid/eager/pylayer/py_layer_node.h index f1166c362e147b3d53ef7c5ef536d4d30da5e4d8..18c48b62c4f5242be88dc30171ab401ee2a76185 100644 --- a/paddle/fluid/eager/pylayer/py_layer_node.h +++ b/paddle/fluid/eager/pylayer/py_layer_node.h @@ -45,7 +45,7 @@ class GradNodePyLayer : public GradNodeBase { void ClearTensorWrappers() override { VLOG(6) << "Do nothing here now"; } - std::string name() { + std::string name() override { return "GradNodePyLayer_" + std::string(Py_TYPE(ctx_)->tp_name); } diff --git a/paddle/fluid/inference/capi_exp/CMakeLists.txt b/paddle/fluid/inference/capi_exp/CMakeLists.txt index 089a766b91cfe4aa498f1822d5c97aef64957ad9..26d76c280bd6bada7c3363fb61b1a684c1359265 100644 --- a/paddle/fluid/inference/capi_exp/CMakeLists.txt +++ b/paddle/fluid/inference/capi_exp/CMakeLists.txt @@ -31,6 +31,18 @@ cc_library( DEPS paddle_inference) set_target_properties(paddle_inference_c_shared PROPERTIES OUTPUT_NAME paddle_inference_c) + +if(APPLE) + target_link_libraries( + paddle_inference_c_shared + xxhash + utf8proc + cryptopp + protobuf + gflags + cblas) +endif() + if(WIN32) target_link_libraries(paddle_inference_c_shared shlwapi.lib) endif() diff --git a/paddle/fluid/operators/abs_op.cc b/paddle/fluid/operators/abs_op.cc index 465637f3ed63e773d37abb8e04a142cd8be7fa83..9a2a75a642ab7465e16f102564916deceff23670 100644 --- a/paddle/fluid/operators/abs_op.cc +++ b/paddle/fluid/operators/abs_op.cc @@ -154,7 +154,7 @@ class AbsDoubleGradOp : public framework::OperatorWithKernel { framework::OpKernelType GetKernelTypeForVar( const std::string& var_name, const framework::Tensor& tensor, - const framework::OpKernelType& expected_kernel_type) const { + const framework::OpKernelType& expected_kernel_type) const override { return framework::OpKernelType( framework::TransToProtoVarType(tensor.dtype()), tensor.place(), diff --git a/paddle/fluid/operators/activation_op.cc b/paddle/fluid/operators/activation_op.cc index 1337533f3bbfe67e53fd9ce9ef6f6204bd8cfef2..29e5e9c0acef4ad3dc9abfbea9847b2507e0eade 100644 --- a/paddle/fluid/operators/activation_op.cc +++ b/paddle/fluid/operators/activation_op.cc @@ -125,7 +125,7 @@ class ActivationOp : public framework::OperatorWithKernel { framework::OpKernelType GetKernelTypeForVar( const std::string& var_name, const Tensor& tensor, - const framework::OpKernelType& expected_kernel_type) const { + const framework::OpKernelType& expected_kernel_type) const override { #ifdef PADDLE_WITH_MKLDNN // When activation is first oneDNN op (there was some non oneDNN op // previously) diff --git a/paddle/fluid/operators/cross_entropy_op.cc b/paddle/fluid/operators/cross_entropy_op.cc index 0d98f5b75e4fb961b2a70ded655a42ccc5b03c14..a02bf699b32dd5806776e40c39f0637a05206968 100644 --- a/paddle/fluid/operators/cross_entropy_op.cc +++ b/paddle/fluid/operators/cross_entropy_op.cc @@ -142,7 +142,7 @@ class CrossEntropyGradientOpBase : public framework::OperatorWithKernel { public: using framework::OperatorWithKernel::OperatorWithKernel; - void InferShape(framework::InferShapeContext* ctx) const { + void InferShape(framework::InferShapeContext* ctx) const override { OP_INOUT_CHECK( ctx->HasInput("Label"), "Input", "Label", "CrossEntropyGradientOpBase"); OP_INOUT_CHECK(ctx->HasInput(framework::GradVarName("Y")), diff --git a/paddle/fluid/operators/dequantize_abs_max_op.cc b/paddle/fluid/operators/dequantize_abs_max_op.cc index 64807329a4043a97c4f4dd43466916e0b87ee745..ff4bb5f53341bdd25d1d883c02d85e1b824b8724 100644 --- a/paddle/fluid/operators/dequantize_abs_max_op.cc +++ b/paddle/fluid/operators/dequantize_abs_max_op.cc @@ -69,7 +69,7 @@ class DequantizeMaxAbsOp : public framework::OperatorWithKernel { } framework::OpKernelType GetExpectedKernelType( - const framework::ExecutionContext& ctx) const { + const framework::ExecutionContext& ctx) const override { auto data_type = OperatorWithKernel::IndicateVarDataType(ctx, "X"); auto type = framework::OpKernelType(data_type, ctx.device_context()); return type; diff --git a/paddle/fluid/operators/dequantize_log_op.cc b/paddle/fluid/operators/dequantize_log_op.cc index c80c050b14afd75881a8a8c424291dd3d1d207cc..b3c1770493c9c6dbbc630a5221c7839efaffbd3e 100644 --- a/paddle/fluid/operators/dequantize_log_op.cc +++ b/paddle/fluid/operators/dequantize_log_op.cc @@ -76,7 +76,7 @@ class DequantizeLogOp : public framework::OperatorWithKernel { } framework::OpKernelType GetExpectedKernelType( - const framework::ExecutionContext& ctx) const { + const framework::ExecutionContext& ctx) const override { auto data_type = OperatorWithKernel::IndicateVarDataType(ctx, "X"); auto type = framework::OpKernelType(data_type, ctx.device_context()); return type; diff --git a/paddle/fluid/operators/kron_op.cc b/paddle/fluid/operators/kron_op.cc index cede00d5b01ec1a04476677096ced552d1ee077e..5f7606265e4e799873994fbe7f4213e3a21fa3ba 100644 --- a/paddle/fluid/operators/kron_op.cc +++ b/paddle/fluid/operators/kron_op.cc @@ -39,7 +39,7 @@ class KronOp : public framework::OperatorWithKernel { framework::OpKernelType GetKernelTypeForVar( const std::string& var_name, const framework::Tensor& tensor, - const framework::OpKernelType& expected_kernel_type) const { + const framework::OpKernelType& expected_kernel_type) const override { if (framework::IsComplexType(expected_kernel_type.data_type_)) { // only promote inputs’s types when contains complex input return framework::OpKernelType( @@ -121,7 +121,7 @@ class KronGradOp : public framework::OperatorWithKernel { framework::OpKernelType GetKernelTypeForVar( const std::string& var_name, const framework::Tensor& tensor, - const framework::OpKernelType& expected_kernel_type) const { + const framework::OpKernelType& expected_kernel_type) const override { if (framework::IsComplexType(expected_kernel_type.data_type_)) { // only promote inputs’s types when contains complex input return framework::OpKernelType( diff --git a/paddle/fluid/operators/matmul_op.cc b/paddle/fluid/operators/matmul_op.cc index a31c218307b9c195d00b66e0197a22b8328e082b..a49ceb42559c5cf86ae467787525e637300b52a4 100644 --- a/paddle/fluid/operators/matmul_op.cc +++ b/paddle/fluid/operators/matmul_op.cc @@ -714,7 +714,7 @@ class MatMulOp : public framework::OperatorWithKernel { framework::OpKernelType GetKernelTypeForVar( const std::string &var_name, const framework::Tensor &tensor, - const framework::OpKernelType &expected_kernel_type) const { + const framework::OpKernelType &expected_kernel_type) const override { if (framework::IsComplexType(expected_kernel_type.data_type_)) { // only promote inputs’s types when contains complex input return framework::OpKernelType( diff --git a/paddle/fluid/operators/matmul_v2_op.cc b/paddle/fluid/operators/matmul_v2_op.cc index 8f233d7650dafa203bbf3df462662bb6dd260677..b1483c3fd6e557d64a078b5a129571943ac26b7e 100644 --- a/paddle/fluid/operators/matmul_v2_op.cc +++ b/paddle/fluid/operators/matmul_v2_op.cc @@ -150,7 +150,7 @@ class MatMulV2Op : public framework::OperatorWithKernel { framework::OpKernelType GetKernelTypeForVar( const std::string& var_name, const framework::Tensor& tensor, - const framework::OpKernelType& expected_kernel_type) const { + const framework::OpKernelType& expected_kernel_type) const override { if (framework::IsComplexType(expected_kernel_type.data_type_)) { // only promote inputs’s types when contains complex input return framework::OpKernelType( @@ -225,7 +225,7 @@ class MatMulV2OpGrad : public framework::OperatorWithKernel { framework::OpKernelType GetKernelTypeForVar( const std::string& var_name, const framework::Tensor& tensor, - const framework::OpKernelType& expected_kernel_type) const { + const framework::OpKernelType& expected_kernel_type) const override { if (framework::IsComplexType(expected_kernel_type.data_type_)) { // only promote inputs’s types when contains complex input return framework::OpKernelType( diff --git a/paddle/fluid/operators/pad3d_op.cc b/paddle/fluid/operators/pad3d_op.cc index 301c21b2fcdcf38c4acd404929d841a9163311fd..02d2eab181bcf8329b0d89ef67e91d409047f732 100644 --- a/paddle/fluid/operators/pad3d_op.cc +++ b/paddle/fluid/operators/pad3d_op.cc @@ -54,7 +54,7 @@ class Pad3dOp : public framework::OperatorWithKernel { framework::OpKernelType GetKernelTypeForVar( const std::string& var_name, const Tensor& tensor, - const framework::OpKernelType& expected_kernel_type) const { + const framework::OpKernelType& expected_kernel_type) const override { #ifdef PADDLE_WITH_MKLDNN if ((expected_kernel_type.data_layout_ == framework::DataLayout::kMKLDNN) && (tensor.layout() != framework::DataLayout::kMKLDNN)) { diff --git a/paddle/fluid/operators/prelu_op.cc b/paddle/fluid/operators/prelu_op.cc index df58a2abe87b533310d11feb6dfd87dda21066ca..f7abaf648ebcfd195921bc015a9c6b770045b166 100644 --- a/paddle/fluid/operators/prelu_op.cc +++ b/paddle/fluid/operators/prelu_op.cc @@ -71,7 +71,7 @@ class PReluOp : public framework::OperatorWithKernel { framework::OpKernelType GetKernelTypeForVar( const std::string &var_name, const Tensor &tensor, - const framework::OpKernelType &expected_kernel_type) const { + const framework::OpKernelType &expected_kernel_type) const override { return innerGetKernelTypeForVar(tensor, expected_kernel_type); } }; @@ -150,7 +150,7 @@ class PReluGradOp : public framework::OperatorWithKernel { framework::OpKernelType GetKernelTypeForVar( const std::string &var_name, const Tensor &tensor, - const framework::OpKernelType &expected_kernel_type) const { + const framework::OpKernelType &expected_kernel_type) const override { return innerGetKernelTypeForVar(tensor, expected_kernel_type); } }; diff --git a/paddle/phi/core/string_tensor.h b/paddle/phi/core/string_tensor.h index 0391099faab71b5166bd5e1396ff65d11f9cf77e..80d6b69aa6c663fd0a212a37f312005fd55e7f35 100644 --- a/paddle/phi/core/string_tensor.h +++ b/paddle/phi/core/string_tensor.h @@ -123,7 +123,7 @@ class StringTensor : public TensorBase, } void* AllocateFrom(Allocator* allocator, DataType dtype, - size_t requested_size = 0); + size_t requested_size = 0) override; dtype::pstring* mutable_data(const phi::Place& place, size_t requested_size = 0); diff --git a/paddle/phi/core/tensor_array.h b/paddle/phi/core/tensor_array.h index ade33099eee312c80f9adceb1c1c0ed2bede0f7f..6d834a9375a26ebec24a9195858ab36dd585127f 100644 --- a/paddle/phi/core/tensor_array.h +++ b/paddle/phi/core/tensor_array.h @@ -83,7 +83,7 @@ class TensorArray : public TensorBase, /// \return Void pointer void* AllocateFrom(Allocator* allocator, DataType dtype, - size_t requested_size = 0); + size_t requested_size = 0) override; bool empty() const { return tensors_.empty(); }