Skip to content

Commit a53ee94

Browse files
authored
[test]mv fluid op cinn to test/cpp/fluid/cinn (#53443)
1 parent ef6e8d0 commit a53ee94

File tree

8 files changed

+52
-52
lines changed

8 files changed

+52
-52
lines changed

paddle/fluid/operators/cinn/CMakeLists.txt

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -29,53 +29,3 @@ set(CINN_OP_DEPS
2929
cinn_launch_context
3030
transform_type)
3131
register_operators(DEPS ${CINN_OP_DEPS})
32-
33-
if(WITH_TESTING)
34-
cc_test_old(
35-
cinn_launch_context_test
36-
SRCS
37-
cinn_launch_context_test.cc
38-
DEPS
39-
ddim
40-
lod_tensor
41-
scope
42-
proto_desc
43-
graph
44-
cinn_launch_context
45-
cinn_instruction_run_op
46-
cinn)
47-
target_link_libraries(cinn_launch_context_test ${PYTHON_LIBRARIES})
48-
set_tests_properties(cinn_launch_context_test PROPERTIES LABELS
49-
"RUN_TYPE=CINN")
50-
51-
set(CINN_RUN_ENVIRONMENT
52-
"OMP_NUM_THREADS=1;runtime_include_dir=${PADDLE_BINARY_DIR}/third_party/CINN/src/external_cinn/cinn/runtime/cuda"
53-
)
54-
# cc_test_old(
55-
# cinn_launch_op_test
56-
# SRCS
57-
# cinn_launch_op_test.cc
58-
# DEPS
59-
# cinn_compiler
60-
# cinn_launch_op
61-
# cinn_instruction_run_op
62-
# elementwise_add_op
63-
# gflags)
64-
# set_tests_properties(
65-
# cinn_launch_op_test PROPERTIES LABELS "RUN_TYPE=CINN" ENVIRONMENT
66-
# "${CINN_RUN_ENVIRONMENT}")
67-
68-
cc_test_old(
69-
cinn_instruction_run_op_test
70-
SRCS
71-
cinn_instruction_run_op_test.cc
72-
DEPS
73-
cinn_compiler
74-
cinn_launch_op
75-
cinn_instruction_run_op
76-
elementwise_add_op)
77-
target_link_libraries(cinn_instruction_run_op_test ${PYTHON_LIBRARIES})
78-
set_tests_properties(
79-
cinn_instruction_run_op_test PROPERTIES LABELS "RUN_TYPE=CINN" ENVIRONMENT
80-
"${CINN_RUN_ENVIRONMENT}")
81-
endif()

test/cpp/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ add_subdirectory(imperative)
66
add_subdirectory(ir)
77
add_subdirectory(inference)
88
add_subdirectory(eager)
9+
add_subdirectory(fluid)

test/cpp/fluid/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
if(WITH_CINN)
2+
add_subdirectory(cinn)
3+
endif()

test/cpp/fluid/cinn/CMakeLists.txt

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
cc_test_old(
2+
cinn_launch_context_test
3+
SRCS
4+
cinn_launch_context_test.cc
5+
DEPS
6+
ddim
7+
lod_tensor
8+
scope
9+
proto_desc
10+
graph
11+
cinn_launch_context
12+
cinn_instruction_run_op
13+
cinn)
14+
target_link_libraries(cinn_launch_context_test ${PYTHON_LIBRARIES})
15+
set_tests_properties(cinn_launch_context_test PROPERTIES LABELS "RUN_TYPE=CINN")
16+
17+
set(CINN_RUN_ENVIRONMENT
18+
"OMP_NUM_THREADS=1;runtime_include_dir=${PADDLE_BINARY_DIR}/third_party/CINN/src/external_cinn/cinn/runtime/cuda"
19+
)
20+
# cc_test_old(
21+
# cinn_launch_op_test
22+
# SRCS
23+
# cinn_launch_op_test.cc
24+
# DEPS
25+
# cinn_compiler
26+
# cinn_launch_op
27+
# cinn_instruction_run_op
28+
# elementwise_add_op
29+
# gflags)
30+
# set_tests_properties(
31+
# cinn_launch_op_test PROPERTIES LABELS "RUN_TYPE=CINN" ENVIRONMENT
32+
# "${CINN_RUN_ENVIRONMENT}")
33+
34+
cc_test_old(
35+
cinn_instruction_run_op_test
36+
SRCS
37+
cinn_instruction_run_op_test.cc
38+
DEPS
39+
cinn_compiler
40+
cinn_launch_op
41+
cinn_instruction_run_op
42+
elementwise_add_op)
43+
target_link_libraries(cinn_instruction_run_op_test ${PYTHON_LIBRARIES})
44+
set_tests_properties(
45+
cinn_instruction_run_op_test PROPERTIES LABELS "RUN_TYPE=CINN" ENVIRONMENT
46+
"${CINN_RUN_ENVIRONMENT}")

paddle/fluid/operators/cinn/cinn_instruction_run_op_test.cc renamed to test/cpp/fluid/cinn/cinn_instruction_run_op_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ limitations under the License. */
2020
#include "paddle/fluid/framework/op_registry.h"
2121
#include "paddle/fluid/framework/paddle2cinn/cinn_compiler.h"
2222
#include "paddle/fluid/framework/scope.h"
23-
#include "paddle/fluid/operators/cinn/test_helper.h"
2423
#include "paddle/fluid/platform/cpu_helper.h"
2524
#include "paddle/fluid/platform/enforce.h"
2625
#include "paddle/fluid/platform/init.h"
2726
#include "paddle/phi/core/kernel_registry.h"
27+
#include "test/cpp/fluid/cinn/test_helper.h"
2828

2929
USE_OP_ITSELF(cinn_launch);
3030
USE_OP_ITSELF(cinn_instruction_run);

paddle/fluid/operators/cinn/cinn_launch_op_test.cc renamed to test/cpp/fluid/cinn/cinn_launch_op_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ limitations under the License. */
2424
#include "paddle/fluid/framework/op_registry.h"
2525
#include "paddle/fluid/framework/paddle2cinn/cinn_compiler.h"
2626
#include "paddle/fluid/framework/scope.h"
27-
#include "paddle/fluid/operators/cinn/test_helper.h"
2827
#include "paddle/fluid/platform/cpu_helper.h"
2928
#include "paddle/fluid/platform/init.h"
3029
#include "paddle/phi/core/ddim.h"
3130
#include "paddle/phi/core/flags.h"
3231
#include "paddle/phi/core/kernel_registry.h"
32+
#include "test/cpp/fluid/cinn/test_helper.h"
3333

3434
USE_OP_ITSELF(cinn_launch);
3535
USE_OP_ITSELF(cinn_instruction_run);
File renamed without changes.

0 commit comments

Comments
 (0)