From 285b22ce5b76105861faaea2d9464d74d39e2996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Tue, 30 Jan 2024 22:28:11 +0800 Subject: [PATCH 1/6] Update CMakeLists.txt --- test/cpp/fluid/controlflow/CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/cpp/fluid/controlflow/CMakeLists.txt b/test/cpp/fluid/controlflow/CMakeLists.txt index b7c2a696c2fa83..53a1472c0a84a2 100644 --- a/test/cpp/fluid/controlflow/CMakeLists.txt +++ b/test/cpp/fluid/controlflow/CMakeLists.txt @@ -1,4 +1,3 @@ -cc_test( +paddle_test( conditional_block_op_test - SRCS conditional_block_op_test.cc - DEPS conditional_block_op executor) + SRCS conditional_block_op_test.cc) From 9e38e1aa203954e329e5fb7b61559e1e481ae3e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Wed, 31 Jan 2024 19:23:22 +0800 Subject: [PATCH 2/6] Update CMakeLists.txt --- test/cpp/fluid/controlflow/CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/cpp/fluid/controlflow/CMakeLists.txt b/test/cpp/fluid/controlflow/CMakeLists.txt index 53a1472c0a84a2..c01ed45c381780 100644 --- a/test/cpp/fluid/controlflow/CMakeLists.txt +++ b/test/cpp/fluid/controlflow/CMakeLists.txt @@ -1,3 +1 @@ -paddle_test( - conditional_block_op_test - SRCS conditional_block_op_test.cc) +paddle_test(conditional_block_op_test SRCS conditional_block_op_test.cc) From 4ba7e68ad01756f8a200bcd131beb8842f9087dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Wed, 31 Jan 2024 23:35:10 +0800 Subject: [PATCH 3/6] Update tensor_array.h --- paddle/phi/core/tensor_array.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/paddle/phi/core/tensor_array.h b/paddle/phi/core/tensor_array.h index dbd3ae06d222c0..69995c016ac33a 100644 --- a/paddle/phi/core/tensor_array.h +++ b/paddle/phi/core/tensor_array.h @@ -55,42 +55,42 @@ class TensorArray : public TensorBase, static const char* name() { return "TensorArray"; } /// \brief This overrided function is not used in TensorArray. - int64_t numel() const override; + TEST_API int64_t numel() const override; /// \brief This overrided function is not used in TensorArray. - const DDim& dims() const override; + TEST_API const DDim& dims() const override; /// \brief This overrided function is not used in TensorArray. - const Place& place() const override; + TEST_API const Place& place() const override; - DataType dtype() const override; + TEST_API DataType dtype() const override; #ifndef PADDLE_WITH_CUSTOM_KERNEL void set_type(const DataType dtype); #endif - DataLayout layout() const override; + TEST_API DataLayout layout() const override; #ifndef PADDLE_WITH_CUSTOM_KERNEL void set_layout(const DataLayout layout); #endif /// \brief This overrided function is not used in TensorArray. - bool valid() const override; + TEST_API bool valid() const override; /// \brief Test whether the tensor's storage in TensorArray is allocated. /// return Whether all tensors in TensorArray is allocated. - bool initialized() const override; + TEST_API bool initialized() const override; /// \brief Clear all tensors in TensorArray. void clear() { tensors_.clear(); } /// \brief Allocate memory with requested size for all tensors from allocator. /// \return Void pointer - void* AllocateFrom(Allocator* allocator, - DataType dtype, - size_t requested_size = 0, - bool fake_alloc = false) override; + TEST_API void* AllocateFrom(Allocator* allocator, + DataType dtype, + size_t requested_size = 0, + bool fake_alloc = false) override; bool empty() const { return tensors_.empty(); } @@ -105,7 +105,7 @@ class TensorArray : public TensorBase, void reserve(size_t n) { tensors_.reserve(n); } /// \brief Add the tensor to the end of TensorArray - void push_back(const DenseTensor& tensor); + TEST_API void push_back(const DenseTensor& tensor); void emplace_back(); From 7f445b71be002f4fe3b6eda297cd7d54c812e1f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Thu, 1 Feb 2024 23:12:42 +0800 Subject: [PATCH 4/6] Update conditional_block_op_test.cc --- test/cpp/fluid/controlflow/conditional_block_op_test.cc | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/cpp/fluid/controlflow/conditional_block_op_test.cc b/test/cpp/fluid/controlflow/conditional_block_op_test.cc index a4575f258d72e3..a02ae043ac1f0d 100644 --- a/test/cpp/fluid/controlflow/conditional_block_op_test.cc +++ b/test/cpp/fluid/controlflow/conditional_block_op_test.cc @@ -18,9 +18,6 @@ limitations under the License. */ #include "paddle/fluid/framework/op_registry.h" #include "paddle/fluid/framework/scope.h" -USE_NO_KERNEL_OP(conditional_block); -USE_NO_KERNEL_OP(conditional_block_grad); - using LoDTensorArray = paddle::framework::LoDTensorArray; using Scope = paddle::framework::Scope; using Variable = paddle::framework::Variable; From bee484c57f5a5ac8e944f284eabe19eb728607a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Fri, 2 Feb 2024 18:22:19 +0800 Subject: [PATCH 5/6] Update CMakeLists.txt --- test/cpp/fluid/controlflow/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/cpp/fluid/controlflow/CMakeLists.txt b/test/cpp/fluid/controlflow/CMakeLists.txt index c01ed45c381780..99fa4ffc674a72 100644 --- a/test/cpp/fluid/controlflow/CMakeLists.txt +++ b/test/cpp/fluid/controlflow/CMakeLists.txt @@ -1 +1,7 @@ paddle_test(conditional_block_op_test SRCS conditional_block_op_test.cc) + +if(WITH_ONNXRUNTIME AND WIN32) + # Copy onnxruntime for some c++ test in Windows, since the test will + # be build only in CI, so suppose the generator in Windows is Ninja. + copy_onnx(conditional_block_op_test) +endif() From 1c885b04f699919394d605d5457bee35e5aeb76b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Fri, 2 Feb 2024 23:27:29 +0800 Subject: [PATCH 6/6] Update CMakeLists.txt --- test/cpp/fluid/controlflow/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/cpp/fluid/controlflow/CMakeLists.txt b/test/cpp/fluid/controlflow/CMakeLists.txt index 99fa4ffc674a72..df8dbe080bc884 100644 --- a/test/cpp/fluid/controlflow/CMakeLists.txt +++ b/test/cpp/fluid/controlflow/CMakeLists.txt @@ -1,7 +1,7 @@ paddle_test(conditional_block_op_test SRCS conditional_block_op_test.cc) if(WITH_ONNXRUNTIME AND WIN32) - # Copy onnxruntime for some c++ test in Windows, since the test will - # be build only in CI, so suppose the generator in Windows is Ninja. - copy_onnx(conditional_block_op_test) + # Copy onnxruntime for some c++ test in Windows, since the test will + # be build only in CI, so suppose the generator in Windows is Ninja. + copy_onnx(conditional_block_op_test) endif()