Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【paddle_test No.26】replace cc_test with paddle_test #61375

Merged
merged 19 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion paddle/fluid/framework/variable_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace framework {

class Variable;

void InitializeVariable(Variable* var, proto::VarType::Type var_type);
TEST_API void InitializeVariable(Variable* var, proto::VarType::Type var_type);
void CopyVariable(const Variable& src_var, Variable* dst_var);

} // end namespace framework
Expand Down
9 changes: 5 additions & 4 deletions paddle/fluid/platform/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ limitations under the License. */
#include <stdlib.h>

#include "paddle/phi/backends/dynload/port.h"
#include "paddle/utils/test_macros.h"

#ifdef _WIN32
static unsigned sleep(unsigned seconds) {
Expand All @@ -34,16 +35,16 @@ class Timer {
// Reset() will be called during initialization
// all timing variables will be set 0 in Reset()
Timer() { Reset(); }
void Reset();
void Start();
void Pause();
TEST_API void Reset();
TEST_API void Start();
TEST_API void Pause();
// Resume will get current system time
void Resume();
int Count();
// return elapsed time in us
double ElapsedUS();
// return elapsed time in ms
double ElapsedMS();
TEST_API double ElapsedMS();
// return elapsed time in sec
double ElapsedSec();

Expand Down
15 changes: 1 addition & 14 deletions test/cpp/fluid/benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
cc_test(
op_tester
SRCS op_tester.cc
DEPS timer
framework_proto
proto_desc
lod_tensor
op_registry
device_context
scope
${GLOB_OP_LIB}
${GLOB_OPERATOR_DEPS}
phi
common)
paddle_test(op_tester SRCS op_tester.cc DEPS common)

if(WITH_ONNXRUNTIME AND WIN32)
# Copy onnxruntime for some c++ test in Windows, since the test will
Expand Down
1 change: 0 additions & 1 deletion test/cpp/fluid/benchmark/op_tester.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ limitations under the License. */
#include "paddle/fluid/platform/init.h"
#include "paddle/fluid/platform/profiler.h"
#include "paddle/fluid/platform/timer.h"
#include "paddle/fluid/pybind/pybind.h"

// phi
#include "paddle/phi/kernels/declarations.h"
Expand Down
2 changes: 0 additions & 2 deletions test/cpp/new_executor/standalone_executor_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ USE_OP_ITSELF(sgd);
USE_OP_ITSELF(squared_l2_norm);
USE_OP_ITSELF(memcpy_h2d);
USE_OP_ITSELF(memcpy_d2h);
USE_OP_ITSELF(fetch_v2);

PD_DECLARE_KERNEL(full, GPU, ALL_LAYOUT);
PD_DECLARE_KERNEL(uniform_raw, GPU, ALL_LAYOUT);
Expand All @@ -75,7 +74,6 @@ PD_DECLARE_KERNEL(concat_grad, GPU, ALL_LAYOUT);
PD_DECLARE_KERNEL(matmul, GPU, ALL_LAYOUT);
PD_DECLARE_KERNEL(add_raw, KPS, ALL_LAYOUT);
PD_DECLARE_KERNEL(add, KPS, ALL_LAYOUT);
PD_DECLARE_KERNEL(add, CPU, ALL_LAYOUT);
PD_DECLARE_KERNEL(multiply, KPS, ALL_LAYOUT);
PD_DECLARE_KERNEL(multiply_grad, GPU, ALL_LAYOUT);
PD_DECLARE_KERNEL(divide, KPS, ALL_LAYOUT);
Expand Down