未验证 提交 865b6548 编写于 作者: D Difer 提交者: GitHub

[CodeStyle][CINN] fix cinn codestyle cmake-format (#54967)

* fix cinn codestyle cmake-format

* remove a blank cmakelist

* restore deleted file

* restore deleted file

---------
Co-authored-by: NSigureMo <sigure.qaq@gmail.com>
上级 24b2cc8d
...@@ -145,13 +145,16 @@ function(cinn_nv_binary TARGET_NAME) ...@@ -145,13 +145,16 @@ function(cinn_nv_binary TARGET_NAME)
endfunction(cinn_nv_binary) endfunction(cinn_nv_binary)
function(cinn_nv_test TARGET_NAME) function(cinn_nv_test TARGET_NAME)
if(WITH_GPU AND WITH_TESTING AND CINN_ONLY) if(WITH_GPU
AND WITH_TESTING
AND CINN_ONLY)
set(options SERIAL) set(options SERIAL)
set(oneValueArgs "") set(oneValueArgs "")
set(multiValueArgs SRCS DEPS ARGS) set(multiValueArgs SRCS DEPS ARGS)
cmake_parse_arguments(cinn_nv_test "${options}" "${oneValueArgs}" cmake_parse_arguments(cinn_nv_test "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN}) "${multiValueArgs}" ${ARGN})
cuda_add_executable(${TARGET_NAME} ${cinn_nv_test_SRCS} OPTIONS "-std=c++${CMAKE_CUDA_STANDARD}") cuda_add_executable(${TARGET_NAME} ${cinn_nv_test_SRCS} OPTIONS
"-std=c++${CMAKE_CUDA_STANDARD}")
get_property(os_dependency_modules GLOBAL PROPERTY OS_DEPENDENCY_MODULES) get_property(os_dependency_modules GLOBAL PROPERTY OS_DEPENDENCY_MODULES)
target_link_libraries( target_link_libraries(
${TARGET_NAME} ${TARGET_NAME}
......
if (WITH_TESTING) if(WITH_TESTING)
cinn_cc_library(cinn_gtest_main SRCS gtest_main.cc DEPS gtest gflags) cinn_cc_library(cinn_gtest_main SRCS gtest_main.cc DEPS gtest gflags)
endif() endif()
...@@ -18,6 +18,7 @@ endif() ...@@ -18,6 +18,7 @@ endif()
add_subdirectory(frontend) add_subdirectory(frontend)
# Download a model # Download a model
download_and_uncompress("${DOWNLOAD_MODEL_DIR}" "${PADDLE_RESOURCE_URL}" "lite_naive_model.tar.gz") download_and_uncompress("${DOWNLOAD_MODEL_DIR}" "${PADDLE_RESOURCE_URL}"
"lite_naive_model.tar.gz")
core_gather_headers() core_gather_headers()
...@@ -9,7 +9,8 @@ add_subdirectory(task) ...@@ -9,7 +9,8 @@ add_subdirectory(task)
add_subdirectory(task_scheduler) add_subdirectory(task_scheduler)
add_subdirectory(tests) add_subdirectory(tests)
cinn_proto_library(auto_schedule_proto SRCS auto_schedule.proto DEPS schedule_desc_proto) cinn_proto_library(auto_schedule_proto SRCS auto_schedule.proto DEPS
schedule_desc_proto)
core_gather_headers() core_gather_headers()
...@@ -18,5 +19,7 @@ gather_srcs(cinnapi_src SRCS auto_tuner.cc) ...@@ -18,5 +19,7 @@ gather_srcs(cinnapi_src SRCS auto_tuner.cc)
#cinn_cc_test(test_auto_tuner SRCS auto_tuner_test.cc DEPS cinncore) #cinn_cc_test(test_auto_tuner SRCS auto_tuner_test.cc DEPS cinncore)
foreach(header ${auto_schedule_proto_HDRS}) foreach(header ${auto_schedule_proto_HDRS})
set(core_proto_includes "${core_proto_includes};${header}" CACHE INTERNAL "") set(core_proto_includes
"${core_proto_includes};${header}"
CACHE INTERNAL "")
endforeach() endforeach()
core_gather_headers() core_gather_headers()
gather_srcs(cinnapi_src SRCS xgb_cost_model.cc expr_cost_model.cc feature.cc feature_extractor.cc) gather_srcs(cinnapi_src SRCS xgb_cost_model.cc expr_cost_model.cc feature.cc
feature_extractor.cc)
cinn_cc_test(test_xgb_cost_model SRCS xgb_cost_model_test.cc DEPS cinncore) cinn_cc_test(test_xgb_cost_model SRCS xgb_cost_model_test.cc DEPS cinncore)
cinn_cc_test(test_feature_extractor SRCS feature_extractor_test.cc DEPS cinncore) cinn_cc_test(test_feature_extractor SRCS feature_extractor_test.cc DEPS
cinncore)
cinn_cc_test(test_feature SRCS feature_test.cc DEPS cinncore) cinn_cc_test(test_feature SRCS feature_test.cc DEPS cinncore)
...@@ -3,4 +3,5 @@ core_gather_headers() ...@@ -3,4 +3,5 @@ core_gather_headers()
gather_srcs(cinnapi_src SRCS database.cc jsonfile_database.cc) gather_srcs(cinnapi_src SRCS database.cc jsonfile_database.cc)
cinn_cc_test(test_database SRCS database_test.cc DEPS cinncore) cinn_cc_test(test_database SRCS database_test.cc DEPS cinncore)
cinn_cc_test(test_jsonfile_database SRCS jsonfile_database_test.cc DEPS cinncore) cinn_cc_test(test_jsonfile_database SRCS jsonfile_database_test.cc DEPS
cinncore)
core_gather_headers() core_gather_headers()
gather_srcs(cinnapi_src SRCS schedule_measurer.cc simple_builder.cc simple_runner.cc) gather_srcs(cinnapi_src SRCS schedule_measurer.cc simple_builder.cc
simple_runner.cc)
cinn_cc_test(test_simple_runner SRCS simple_runner_test.cc DEPS cinncore) cinn_cc_test(test_simple_runner SRCS simple_runner_test.cc DEPS cinncore)
cinn_cc_test(test_measurer SRCS measurer_test.cc DEPS cinncore) cinn_cc_test(test_measurer SRCS measurer_test.cc DEPS cinncore)
core_gather_headers() core_gather_headers()
gather_srcs(cinnapi_src SRCS gather_srcs(cinnapi_src SRCS cooperative_process.cc)
cooperative_process.cc
)
if (WITH_CUDA) if(WITH_CUDA)
cinn_nv_test(test_cooperative_process SRCS cooperative_process_test.cc DEPS cinncore auto_gen_rule_test_helper test_program_builder) cinn_nv_test(
test_cooperative_process
SRCS
cooperative_process_test.cc
DEPS
cinncore
auto_gen_rule_test_helper
test_program_builder)
endif() endif()
...@@ -2,12 +2,8 @@ add_subdirectory(auto_gen_rule) ...@@ -2,12 +2,8 @@ add_subdirectory(auto_gen_rule)
core_gather_headers() core_gather_headers()
gather_srcs(cinnapi_src SRCS gather_srcs(cinnapi_src SRCS search_space.cc search_state.cc block_sampler.cc
search_space.cc rule_sampler.cc)
search_state.cc
block_sampler.cc
rule_sampler.cc
)
cinn_cc_test(test_search_space SRCS search_space_test.cc DEPS cinncore) cinn_cc_test(test_search_space SRCS search_space_test.cc DEPS cinncore)
cinn_cc_test(test_search_state SRCS search_state_test.cc DEPS cinncore) cinn_cc_test(test_search_state SRCS search_state_test.cc DEPS cinncore)
......
core_gather_headers() core_gather_headers()
gather_srcs(cinnapi_src SRCS gather_srcs(
auto_gen_rule.cc cinnapi_src
auto_inline.cc SRCS
auto_unroll.cc auto_gen_rule.cc
multi_level_tiling.cc auto_inline.cc
skip_rule.cc auto_unroll.cc
auto_bind.cc multi_level_tiling.cc
) skip_rule.cc
auto_bind.cc)
if (WITH_TESTING) if(WITH_TESTING)
cinn_cc_library(auto_gen_rule_test_helper SRCS test_helper.cc DEPS glog gtest cinncore) cinn_cc_library(
auto_gen_rule_test_helper
SRCS
test_helper.cc
DEPS
glog
gtest
cinncore)
endif() endif()
if (WITH_CUDA) if(WITH_CUDA)
cinn_nv_test(test_mix_rules SRCS mix_rules_test.cc DEPS cinncore auto_gen_rule_test_helper test_program_builder) cinn_nv_test(
cinn_nv_test(test_auto_bind SRCS auto_bind_test.cc DEPS cinncore auto_gen_rule_test_helper test_program_builder) test_mix_rules
cinn_nv_test(test_multi_level_tiling SRCS multi_level_tiling_test.cc DEPS cinncore auto_gen_rule_test_helper test_program_builder) SRCS
mix_rules_test.cc
DEPS
cinncore
auto_gen_rule_test_helper
test_program_builder)
cinn_nv_test(
test_auto_bind
SRCS
auto_bind_test.cc
DEPS
cinncore
auto_gen_rule_test_helper
test_program_builder)
cinn_nv_test(
test_multi_level_tiling
SRCS
multi_level_tiling_test.cc
DEPS
cinncore
auto_gen_rule_test_helper
test_program_builder)
endif() endif()
#cinn_cc_test(test_auto_inline SRCS auto_inline_test.cc DEPS cinncore auto_gen_rule_test_helper) #cinn_cc_test(test_auto_inline SRCS auto_inline_test.cc DEPS cinncore auto_gen_rule_test_helper)
......
...@@ -4,4 +4,5 @@ core_gather_headers() ...@@ -4,4 +4,5 @@ core_gather_headers()
gather_srcs(cinnapi_src SRCS evolutionary_search.cc) gather_srcs(cinnapi_src SRCS evolutionary_search.cc)
cinn_cc_test(test_evolutionary_search SRCS evolutionary_search_test.cc DEPS cinncore test_program_builder) cinn_cc_test(test_evolutionary_search SRCS evolutionary_search_test.cc DEPS
cinncore test_program_builder)
core_gather_headers() core_gather_headers()
gather_srcs(cinnapi_src SRCS gather_srcs(cinnapi_src SRCS mutate_rule.cc mutate_tile_size.cc)
mutate_rule.cc
mutate_tile_size.cc
)
cinn_cc_test(test_mutate_tile_size SRCS mutate_tile_size_test.cc DEPS cinncore) cinn_cc_test(test_mutate_tile_size SRCS mutate_tile_size_test.cc DEPS cinncore)
core_gather_headers() core_gather_headers()
gather_srcs(cinnapi_src SRCS gather_srcs(cinnapi_src SRCS task_creator.cc task_optimizer.cc tune_task.cc)
task_creator.cc
task_optimizer.cc
tune_task.cc
)
gather_srcs(cinnapi_src SRCS task_creator.cc task_optimizer.cc) gather_srcs(cinnapi_src SRCS task_creator.cc task_optimizer.cc)
cinn_cc_test(test_task_creator SRCS task_creator_test.cc DEPS cinncore) cinn_cc_test(test_task_creator SRCS task_creator_test.cc DEPS cinncore)
......
core_gather_headers() core_gather_headers()
gather_srcs(cinnapi_src SRCS task_scheduler.cc round_robin.cc efficiency_priority.cc) gather_srcs(cinnapi_src SRCS task_scheduler.cc round_robin.cc
efficiency_priority.cc)
cinn_cc_test(test_task_scheduler SRCS task_scheduler_test.cc DEPS cinncore) cinn_cc_test(test_task_scheduler SRCS task_scheduler_test.cc DEPS cinncore)
if (WITH_CUDA AND (NOT WITH_CUDNN)) if(WITH_CUDA AND (NOT WITH_CUDNN))
cinn_cc_test(test_performance_comparison cinn_cc_test(
ARGS "--resnet50_model_dir=${THIRD_PARTY_PATH}/ResNet50" test_performance_comparison
SRCS performance_comparison_test.cc DEPS cinncore test_program_builder) ARGS
"--resnet50_model_dir=${THIRD_PARTY_PATH}/ResNet50"
SRCS
performance_comparison_test.cc
DEPS
cinncore
test_program_builder)
endif() endif()
core_gather_headers() core_gather_headers()
gather_srcs(cinnapi_src SRCS gather_srcs(
outputs.cc cinnapi_src
codegen_c.cc SRCS
codegen_c_x86.cc outputs.cc
codegen_cuda_host.cc codegen_c.cc
extern_func_emitter.cc codegen_c_x86.cc
extern_func_emitter_builtin.cc codegen_cuda_host.cc
function_prototype.cc extern_func_emitter.cc
extern_func_protos.cc extern_func_emitter_builtin.cc
extern_func_jit_register.cc function_prototype.cc
modular.cc extern_func_protos.cc
compiler.cc extern_func_jit_register.cc
) modular.cc
compiler.cc)
if (WITH_CUDA) if(WITH_CUDA)
add_subdirectory(nvrtc) add_subdirectory(nvrtc)
list(APPEND srcs cuda_util.cc codegen_cuda_dev.cc codegen_cuda_util.cc) list(APPEND srcs cuda_util.cc codegen_cuda_dev.cc codegen_cuda_util.cc)
endif() endif()
if (WITH_OPENMP) if(WITH_OPENMP)
cinn_cc_library(__x86_source_fake_lib SRCS _x86_builtin_source.cc) cinn_cc_library(__x86_source_fake_lib SRCS _x86_builtin_source.cc)
endif() endif()
add_subdirectory(llvm) add_subdirectory(llvm)
if(WITH_CUDA)
if (WITH_CUDA) cinn_nv_test(test_raw_cuda_code SRCS raw_cuda_code_test.cu DEPS cinncore)
cinn_nv_test(test_raw_cuda_code SRCS raw_cuda_code_test.cu DEPS cinncore)
endif() endif()
cinn_cc_test(test_codegen_c SRCS codegen_c_test.cc DEPS cinncore ARGS ${global_test_args}) cinn_cc_test(
cinn_cc_test(test_codegen_c_x86 SRCS codegen_c_x86_test.cc DEPS cinncore ARGS ${global_test_args}) test_codegen_c
SRCS
codegen_c_test.cc
DEPS
cinncore
ARGS
${global_test_args})
cinn_cc_test(
test_codegen_c_x86
SRCS
codegen_c_x86_test.cc
DEPS
cinncore
ARGS
${global_test_args})
cinn_cc_test(test_generated1 SRCS generated_module1.cc DEPS cinn_runtime) cinn_cc_test(test_generated1 SRCS generated_module1.cc DEPS cinn_runtime)
add_run_test_dependency(test_generated1 test_codegen_c) add_run_test_dependency(test_generated1 test_codegen_c)
cinn_cc_test(test_ir_schedule SRCS ir_schedule_test.cc DEPS cinncore) cinn_cc_test(test_ir_schedule SRCS ir_schedule_test.cc DEPS cinncore)
include_directories(${CMAKE_SOURCE_DIR}/paddle/cinn/runtime) include_directories(${CMAKE_SOURCE_DIR}/paddle/cinn/runtime)
if (TARGET test_generated1) if(TARGET test_generated1)
add_dependencies(test_generated1 test_codegen_c) add_dependencies(test_generated1 test_codegen_c)
endif() endif()
if (WITH_CUDA) if(WITH_CUDA)
cinn_nv_test(test_codegen_cuda_generate SRCS codegen_cuda_generate_test.cc DEPS cinncore) cinn_nv_test(test_codegen_cuda_generate SRCS codegen_cuda_generate_test.cc
DEPS cinncore)
cinn_nv_test(test_codegen_debug SRCS codegen_debug_test.cc DEPS cinncore) cinn_nv_test(test_codegen_debug SRCS codegen_debug_test.cc DEPS cinncore)
if (WITH_TESTING) if(WITH_TESTING)
cinn_nv_test(generated1_cuda SRCS generated1.cu DEPS cinncore) cinn_nv_test(generated1_cuda SRCS generated1.cu DEPS cinncore)
add_run_test_dependency(generated1_cuda test_codegen_cuda_generate) add_run_test_dependency(generated1_cuda test_codegen_cuda_generate)
endif() endif()
...@@ -53,15 +68,20 @@ else() ...@@ -53,15 +68,20 @@ else()
cinn_cc_test(test_compiler SRCS compiler_test.cc DEPS cinncore) cinn_cc_test(test_compiler SRCS compiler_test.cc DEPS cinncore)
endif() endif()
foreach(cpp ${srcs}) foreach(cpp ${srcs})
set(cinnapi_src set(cinnapi_src
"${cinnapi_src};paddle/cinn/backends/${cpp}" "${cinnapi_src};paddle/cinn/backends/${cpp}"
CACHE INTERNAL "") CACHE INTERNAL "")
endforeach() endforeach()
file(GLOB includes LIST_DIRECTORIES false RELATIVE ${CMAKE_SOURCE_DIR} *.h) file(
GLOB includes
LIST_DIRECTORIES false
RELATIVE ${CMAKE_SOURCE_DIR}
*.h)
foreach(header ${includes}) foreach(header ${includes})
set(core_includes "${core_includes};${header}" CACHE INTERNAL "") set(core_includes
"${core_includes};${header}"
CACHE INTERNAL "")
endforeach() endforeach()
...@@ -4,25 +4,31 @@ add_definitions(${LLVM_DEFINITIONS}) ...@@ -4,25 +4,31 @@ add_definitions(${LLVM_DEFINITIONS})
add_custom_command( add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/paddle/cinn/backends/llvm/cinn_runtime_llvm_ir.h OUTPUT ${CMAKE_BINARY_DIR}/paddle/cinn/backends/llvm/cinn_runtime_llvm_ir.h
COMMAND ${LLVM_PATH}/bin/clang++ -mavx2 -std=c++11 -masm=intel -S -emit-llvm -O3 ${PROJECT_SOURCE_DIR}/paddle/cinn/runtime/cinn_runtime.cc -I${PROJECT_SOURCE_DIR} -o ${CMAKE_BINARY_DIR}/paddle/cinn/runtime/cinn_runtime.ll COMMAND
COMMAND ${PYTHON_EXECUTABLE} generate_runtime_llvm_ir.py ${CMAKE_BINARY_DIR}/paddle/cinn/runtime/cinn_runtime.ll ${CMAKE_BINARY_DIR}/paddle/cinn/backends/llvm/cinn_runtime_llvm_ir.h ${LLVM_PATH}/bin/llvm-config ${LLVM_PATH}/bin/clang++ -mavx2 -std=c++11 -masm=intel -S -emit-llvm -O3
${PROJECT_SOURCE_DIR}/paddle/cinn/runtime/cinn_runtime.cc
-I${PROJECT_SOURCE_DIR} -o
${CMAKE_BINARY_DIR}/paddle/cinn/runtime/cinn_runtime.ll
COMMAND
${PYTHON_EXECUTABLE} generate_runtime_llvm_ir.py
${CMAKE_BINARY_DIR}/paddle/cinn/runtime/cinn_runtime.ll
${CMAKE_BINARY_DIR}/paddle/cinn/backends/llvm/cinn_runtime_llvm_ir.h
${LLVM_PATH}/bin/llvm-config
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/paddle/cinn/backends/llvm WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/paddle/cinn/backends/llvm
DEPENDS ${PROJECT_SOURCE_DIR}/paddle/cinn/runtime/cinn_runtime.cc ${PROJECT_SOURCE_DIR}/paddle/cinn/runtime/cinn_runtime.h DEPENDS ${PROJECT_SOURCE_DIR}/paddle/cinn/runtime/cinn_runtime.cc
) ${PROJECT_SOURCE_DIR}/paddle/cinn/runtime/cinn_runtime.h)
add_custom_target(GEN_LLVM_RUNTIME_IR_HEADER ALL add_custom_target(
DEPENDS ${CMAKE_BINARY_DIR}/paddle/cinn/backends/llvm/cinn_runtime_llvm_ir.h GEN_LLVM_RUNTIME_IR_HEADER ALL
) DEPENDS ${CMAKE_BINARY_DIR}/paddle/cinn/backends/llvm/cinn_runtime_llvm_ir.h)
set(srcs set(srcs
llvm_util.cc llvm_util.cc
runtime_symbol_registry.cc runtime_symbol_registry.cc
codegen_llvm.cc codegen_llvm.cc
codegen_x86.cc codegen_x86.cc
simple_jit.cc simple_jit.cc
execution_engine.cc execution_engine.cc
llvm_optimizer.cc llvm_optimizer.cc)
)
cinn_cc_test(test_codegen_llvm SRCS codegen_llvm_test.cc DEPS cinncore) cinn_cc_test(test_codegen_llvm SRCS codegen_llvm_test.cc DEPS cinncore)
#cinn_cc_test(test_execution_engine SRCS execution_engine_test.cc DEPS cinncore) #cinn_cc_test(test_execution_engine SRCS execution_engine_test.cc DEPS cinncore)
...@@ -30,12 +36,18 @@ cinn_cc_test(test_codegen_x86 SRCS codegen_x86_test.cc DEPS cinncore) ...@@ -30,12 +36,18 @@ cinn_cc_test(test_codegen_x86 SRCS codegen_x86_test.cc DEPS cinncore)
foreach(cpp ${srcs}) foreach(cpp ${srcs})
set(cinnapi_src set(cinnapi_src
"${cinnapi_src};paddle/cinn/backends/llvm/${cpp}" "${cinnapi_src};paddle/cinn/backends/llvm/${cpp}"
CACHE INTERNAL "") CACHE INTERNAL "")
endforeach() endforeach()
file(GLOB includes LIST_DIRECTORIES false RELATIVE ${CMAKE_SOURCE_DIR} *.h) file(
GLOB includes
LIST_DIRECTORIES false
RELATIVE ${CMAKE_SOURCE_DIR}
*.h)
foreach(header ${includes}) foreach(header ${includes})
set(core_includes "${core_includes};${header}" CACHE INTERNAL "") set(core_includes
"${core_includes};${header}"
CACHE INTERNAL "")
endforeach() endforeach()
core_gather_headers() core_gather_headers()
gather_srcs(cinnapi_src SRCS gather_srcs(cinnapi_src SRCS header_generator.cc nvrtc_util.cc)
header_generator.cc
nvrtc_util.cc
)
cinn_nv_test(test_nvrtc_util SRCS nvrtc_util_test.cc DEPS cinncore) cinn_nv_test(test_nvrtc_util SRCS nvrtc_util_test.cc DEPS cinncore)
core_gather_headers() core_gather_headers()
gather_srcs(cinnapi_src SRCS gather_srcs(
shared.cc cinnapi_src
cinn_value.cc SRCS
type.cc shared.cc
target.cc cinn_value.cc
object.cc type.cc
debug_manager.cc target.cc
info_registry.cc object.cc
graph_utils.cc debug_manager.cc
context.cc info_registry.cc
axis.cc graph_utils.cc
ir_util.cc context.cc
test_helper.cc axis.cc
# cuda_test_helper.cc ir_util.cc
arithmatic.cc test_helper.cc
cas.cc # cuda_test_helper.cc
union_find.cc arithmatic.cc
python_interpreter_guard.cc cas.cc
) union_find.cc
python_interpreter_guard.cc)
message(STATUS "srcs: ${cinnapi_src}") message(STATUS "srcs: ${cinnapi_src}")
cinn_cc_test(test_cinn_value SRCS cinn_value_test.cc DEPS cinncore) cinn_cc_test(test_cinn_value SRCS cinn_value_test.cc DEPS cinncore)
cinn_cc_test(test_shared SRCS shared_test.cc DEPS cinncore) cinn_cc_test(test_shared SRCS shared_test.cc DEPS cinncore)
...@@ -30,7 +31,9 @@ cinn_cc_test(test_cas SRCS cas_test.cc DEPS cinncore) ...@@ -30,7 +31,9 @@ cinn_cc_test(test_cas SRCS cas_test.cc DEPS cinncore)
cinn_cc_test(test_type SRCS type_test.cc DEPS cinncore) cinn_cc_test(test_type SRCS type_test.cc DEPS cinncore)
cinn_cc_test(test_axis SRCS axis_test.cc DEPS cinncore) cinn_cc_test(test_axis SRCS axis_test.cc DEPS cinncore)
cinn_cc_test(test_fp16_bf16_host SRCS float16_bfloat16_host_test.cc DEPS gtest glog) cinn_cc_test(test_fp16_bf16_host SRCS float16_bfloat16_host_test.cc DEPS gtest
if (WITH_CUDA) glog)
cinn_nv_test(test_fp16_bf16_cuda SRCS float16_bfloat16_cuda_test.cu DEPS gtest glog) if(WITH_CUDA)
cinn_nv_test(test_fp16_bf16_cuda SRCS float16_bfloat16_cuda_test.cu DEPS
gtest glog)
endif() endif()
core_gather_headers() core_gather_headers()
gather_srcs(cinnapi_src SRCS gather_srcs(
cinnapi_src
SRCS
computation.cc computation.cc
syntax.cc syntax.cc
paddle_model_to_program.cc paddle_model_to_program.cc
...@@ -11,22 +13,37 @@ gather_srcs(cinnapi_src SRCS ...@@ -11,22 +13,37 @@ gather_srcs(cinnapi_src SRCS
optimize.cc) optimize.cc)
if(NOT WITH_CUDA) if(NOT WITH_CUDA)
cinn_cc_test(test_frontend_syntax cinn_cc_test(
ARGS "--model_dir=${THIRD_PARTY_PATH}/naive_mul_model" test_frontend_syntax
SRCS syntax_test.cc DEPS cinncore) ARGS
"--model_dir=${THIRD_PARTY_PATH}/naive_mul_model"
SRCS
syntax_test.cc
DEPS
cinncore)
# cinn_cc_test(test_frontend_interpreter # cinn_cc_test(test_frontend_interpreter
# ARGS --model_dir=${THIRD_PARTY_PATH}/naive_mul_model # ARGS --model_dir=${THIRD_PARTY_PATH}/naive_mul_model
# SRCS interpreter_test.cc DEPS cinncore) # SRCS interpreter_test.cc DEPS cinncore)
else() else()
cinn_nv_test(test_frontend_syntax cinn_nv_test(
ARGS "--model_dir=${THIRD_PARTY_PATH}/naive_mul_model" test_frontend_syntax
SRCS syntax_test.cc DEPS cinncore) ARGS
"--model_dir=${THIRD_PARTY_PATH}/naive_mul_model"
SRCS
syntax_test.cc
DEPS
cinncore)
cinn_nv_test(test_frontend_interpreter cinn_nv_test(
ARGS --model_dir=${THIRD_PARTY_PATH}/naive_mul_model test_frontend_interpreter
SRCS interpreter_test.cc DEPS cinncore) ARGS
--model_dir=${THIRD_PARTY_PATH}/naive_mul_model
SRCS
interpreter_test.cc
DEPS
cinncore)
endif() endif()
#cinn_cc_test(test_paddle_model_convertor #cinn_cc_test(test_paddle_model_convertor
...@@ -38,12 +55,13 @@ endif() ...@@ -38,12 +55,13 @@ endif()
# SRCS computation_test.cc DEPS cinncore) # SRCS computation_test.cc DEPS cinncore)
cinn_cc_test(test_net_builder SRCS net_builder_test.cc DEPS cinncore) cinn_cc_test(test_net_builder SRCS net_builder_test.cc DEPS cinncore)
cinn_cc_test(test_decomposer_registry cinn_cc_test(test_decomposer_registry SRCS decomposer_registry_test.cc DEPS
SRCS decomposer_registry_test.cc DEPS cinncore) cinncore)
add_subdirectory(paddle) add_subdirectory(paddle)
add_subdirectory(decomposer) add_subdirectory(decomposer)
add_subdirectory(op_mappers) add_subdirectory(op_mappers)
add_subdirectory(pass) add_subdirectory(pass)
cinn_cc_test(test_op_mapper_registry SRCS op_mapper_registry_test.cc DEPS cinncore) cinn_cc_test(test_op_mapper_registry SRCS op_mapper_registry_test.cc DEPS
cinncore)
core_gather_headers() core_gather_headers()
gather_srcs(cinnapi_src SRCS gather_srcs(
activation.cc cinnapi_src
elementwise.cc SRCS
broadcast.cc activation.cc
batch_norm.cc elementwise.cc
top_k.cc broadcast.cc
) batch_norm.cc
top_k.cc)
cinn_cc_library(decomposer_test_helper SRCS test_helper.cc DEPS cinncore) cinn_cc_library(decomposer_test_helper SRCS test_helper.cc DEPS cinncore)
if (WITH_CUDA) if(WITH_CUDA)
cinn_cc_test(test_activation_decomposer SRCS activation_test.cc DEPS cinncore decomposer_test_helper) cinn_cc_test(test_activation_decomposer SRCS activation_test.cc DEPS cinncore
cinn_cc_test(test_elementwise_decomposer SRCS elementwise_test.cc DEPS cinncore decomposer_test_helper) decomposer_test_helper)
cinn_cc_test(test_broadcast_decomposer SRCS broadcast_test.cc DEPS cinncore decomposer_test_helper) cinn_cc_test(test_elementwise_decomposer SRCS elementwise_test.cc DEPS
cinn_cc_test(test_batch_norm_decomposer SRCS batch_norm_test.cc DEPS cinncore decomposer_test_helper) cinncore decomposer_test_helper)
cinn_cc_test(test_top_k_decomposer SRCS top_k_test.cc DEPS cinncore decomposer_test_helper) cinn_cc_test(test_broadcast_decomposer SRCS broadcast_test.cc DEPS cinncore
decomposer_test_helper)
cinn_cc_test(test_batch_norm_decomposer SRCS batch_norm_test.cc DEPS cinncore
decomposer_test_helper)
cinn_cc_test(test_top_k_decomposer SRCS top_k_test.cc DEPS cinncore
decomposer_test_helper)
endif() endif()
core_gather_headers() core_gather_headers()
file(GLOB paddle_op_mapper_srcs LIST_DIRECTORIES false RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cc) file(
GLOB paddle_op_mapper_srcs
LIST_DIRECTORIES false
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
*.cc)
gather_srcs(cinnapi_src SRCS ${paddle_op_mapper_srcs}) gather_srcs(cinnapi_src SRCS ${paddle_op_mapper_srcs})
core_gather_headers() core_gather_headers()
file(GLOB paddlescience_op_mapper_srcs LIST_DIRECTORIES false RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cc) file(
GLOB paddlescience_op_mapper_srcs
LIST_DIRECTORIES false
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
*.cc)
gather_srcs(cinnapi_src SRCS ${paddlescience_op_mapper_srcs}) gather_srcs(cinnapi_src SRCS ${paddlescience_op_mapper_srcs})
...@@ -3,24 +3,37 @@ cinn_proto_library(cinn_framework_proto SRCS framework.proto) ...@@ -3,24 +3,37 @@ cinn_proto_library(cinn_framework_proto SRCS framework.proto)
add_subdirectory(cpp) add_subdirectory(cpp)
add_subdirectory(pb) add_subdirectory(pb)
set(srcs set(srcs model_parser.cc compatible_pb.cc)
model_parser.cc
compatible_pb.cc
)
cinn_cc_test(test_model_parser SRCS model_parser_test.cc DEPS cinncore cinn_cc_test(
ARGS --model_dir=${THIRD_PARTY_PATH}/model/lite_naive_model) test_model_parser
SRCS
model_parser_test.cc
DEPS
cinncore
ARGS
--model_dir=${THIRD_PARTY_PATH}/model/lite_naive_model)
foreach(cpp ${srcs}) foreach(cpp ${srcs})
set(cinnapi_src "${cinnapi_src};paddle/cinn/frontend/paddle/${cpp}" CACHE INTERNAL "") set(cinnapi_src
"${cinnapi_src};paddle/cinn/frontend/paddle/${cpp}"
CACHE INTERNAL "")
endforeach() endforeach()
file(GLOB includes LIST_DIRECTORIES false RELATIVE ${CMAKE_SOURCE_DIR} *.h) file(
GLOB includes
LIST_DIRECTORIES false
RELATIVE ${CMAKE_SOURCE_DIR}
*.h)
foreach(header ${includes}) foreach(header ${includes})
set(core_includes "${core_includes};${header}" CACHE INTERNAL "") set(core_includes
"${core_includes};${header}"
CACHE INTERNAL "")
endforeach() endforeach()
foreach(header ${cinn_framework_proto_HDRS}) foreach(header ${cinn_framework_proto_HDRS})
set(core_proto_includes "${core_proto_includes};${header}" CACHE INTERNAL "") set(core_proto_includes
"${core_proto_includes};${header}"
CACHE INTERNAL "")
endforeach() endforeach()
set(srcs set(srcs var_desc.cc op_desc.cc block_desc.cc program_desc.cc)
var_desc.cc
op_desc.cc
block_desc.cc
program_desc.cc
)
foreach(cpp ${srcs}) foreach(cpp ${srcs})
set(cinnapi_src set(cinnapi_src
"${cinnapi_src};paddle/cinn/frontend/paddle/cpp/${cpp}" "${cinnapi_src};paddle/cinn/frontend/paddle/cpp/${cpp}"
CACHE INTERNAL "") CACHE INTERNAL "")
endforeach() endforeach()
file(GLOB includes LIST_DIRECTORIES false RELATIVE ${CMAKE_SOURCE_DIR} *.h) file(
GLOB includes
LIST_DIRECTORIES false
RELATIVE ${CMAKE_SOURCE_DIR}
*.h)
foreach(header ${includes}) foreach(header ${includes})
set(core_includes "${core_includes};${header}" CACHE INTERNAL "") set(core_includes
"${core_includes};${header}"
CACHE INTERNAL "")
endforeach() endforeach()
set(srcs set(srcs var_desc.cc op_desc.cc block_desc.cc program_desc.cc)
var_desc.cc
op_desc.cc
block_desc.cc
program_desc.cc
)
foreach(cpp ${srcs}) foreach(cpp ${srcs})
set(cinnapi_src "${cinnapi_src};paddle/cinn/frontend/paddle/pb/${cpp}" CACHE INTERNAL "") set(cinnapi_src
"${cinnapi_src};paddle/cinn/frontend/paddle/pb/${cpp}"
CACHE INTERNAL "")
endforeach() endforeach()
file(GLOB includes LIST_DIRECTORIES false RELATIVE ${CMAKE_SOURCE_DIR} *.h) file(
GLOB includes
LIST_DIRECTORIES false
RELATIVE ${CMAKE_SOURCE_DIR}
*.h)
foreach(header ${includes}) foreach(header ${includes})
set(core_includes "${core_includes};${header}" CACHE INTERNAL "") set(core_includes
"${core_includes};${header}"
CACHE INTERNAL "")
endforeach() endforeach()
core_gather_headers() core_gather_headers()
gather_srcs(cinnapi_src SRCS gather_srcs(
decomposer.cc cinnapi_src
dead_code_eliminate.cc SRCS
remove_identity.cc decomposer.cc
transpose_collapsing.cc dead_code_eliminate.cc
transpose_folding_input.cc remove_identity.cc
transpose_folding_output.cc transpose_collapsing.cc
gemm_rewriter.cc transpose_folding_input.cc
fill_constant_rewriter.cc transpose_folding_output.cc
fill_constant_folding.cc gemm_rewriter.cc
cast_collapsing.cc fill_constant_rewriter.cc
auto_cast.cc fill_constant_folding.cc
expand_zero_dim_pass.cc cast_collapsing.cc
auto_broadcast.cc auto_cast.cc
) expand_zero_dim_pass.cc
auto_broadcast.cc)
if (WITH_CUDA) if(WITH_CUDA)
cinn_cc_test(test_decomposer_pass SRCS decomposer_test.cc DEPS cinncore) cinn_cc_test(test_decomposer_pass SRCS decomposer_test.cc DEPS cinncore)
cinn_cc_test(test_dead_code_eliminate_pass SRCS dead_code_eliminate_test.cc DEPS cinncore) cinn_cc_test(test_dead_code_eliminate_pass SRCS dead_code_eliminate_test.cc
cinn_cc_test(test_remove_identity_pass SRCS remove_identity_test.cc DEPS cinncore) DEPS cinncore)
cinn_cc_test(test_fill_constant_rewriter_pass SRCS fill_constant_rewriter_test.cc DEPS cinncore) cinn_cc_test(test_remove_identity_pass SRCS remove_identity_test.cc DEPS
cinn_cc_test(test_fill_constant_folding_pass SRCS fill_constant_folding_test.cc DEPS cinncore) cinncore)
cinn_cc_test(test_program_topoerror SRCS program_topoerror_test.cc DEPS cinncore) cinn_cc_test(test_fill_constant_rewriter_pass SRCS
fill_constant_rewriter_test.cc DEPS cinncore)
cinn_cc_test(test_fill_constant_folding_pass SRCS
fill_constant_folding_test.cc DEPS cinncore)
cinn_cc_test(test_program_topoerror SRCS program_topoerror_test.cc DEPS
cinncore)
endif() endif()
if (WITH_CUDNN) if(WITH_CUDNN)
cinn_cc_test(test_gemm_rewriter_pass SRCS gemm_rewriter_test.cc DEPS cinncore) cinn_cc_test(test_gemm_rewriter_pass SRCS gemm_rewriter_test.cc DEPS cinncore)
cinn_cc_test(test_transpose_folding_input_pass SRCS transpose_folding_input_test.cc DEPS cinncore) cinn_cc_test(test_transpose_folding_input_pass SRCS
cinn_cc_test(test_transpose_folding_output_pass SRCS transpose_folding_output_test.cc DEPS cinncore) transpose_folding_input_test.cc DEPS cinncore)
cinn_cc_test(test_transpose_scale_folding SRCS transpose_scale_folding_test.cc DEPS cinncore) cinn_cc_test(test_transpose_folding_output_pass SRCS
transpose_folding_output_test.cc DEPS cinncore)
cinn_cc_test(test_transpose_scale_folding SRCS
transpose_scale_folding_test.cc DEPS cinncore)
endif() endif()
cinn_cc_test(test_transpose_collapsing SRCS transpose_collapsing_test.cc DEPS cinncore) cinn_cc_test(test_transpose_collapsing SRCS transpose_collapsing_test.cc DEPS
cinncore)
cinn_cc_test(test_cast_collapsing SRCS cast_collapsing_test.cc DEPS cinncore) cinn_cc_test(test_cast_collapsing SRCS cast_collapsing_test.cc DEPS cinncore)
cinn_cc_test(test_auto_cast SRCS auto_cast_test.cc DEPS cinncore) cinn_cc_test(test_auto_cast SRCS auto_cast_test.cc DEPS cinncore)
cinn_cc_test(test_expand_zero_dim_pass SRCS expand_zero_dim_pass_test.cc DEPS cinncore) cinn_cc_test(test_expand_zero_dim_pass SRCS expand_zero_dim_pass_test.cc DEPS
cinncore)
core_gather_headers() core_gather_headers()
gather_srcs(cinnapi_src SRCS gather_srcs(
tensor.cc cinnapi_src
scope.cc SRCS
variable.cc tensor.cc
buffer.cc scope.cc
memory.cc variable.cc
instruction.cc buffer.cc
parallel_compiler.cc memory.cc
graph_compiler.cc instruction.cc
graph.cc parallel_compiler.cc
node.cc graph_compiler.cc
pass.cc graph.cc
op_strategy.cc node.cc
op_lowering.cc pass.cc
op_lowering_util.cc op_strategy.cc
accuracy_checker.cc op_lowering.cc
visualize_helper.cc op_lowering_util.cc
) accuracy_checker.cc
visualize_helper.cc)
if(WITH_CUDA) if(WITH_CUDA)
cinn_nv_test(test_hlir_framework_buffer SRCS buffer_test.cc DEPS cinncore) cinn_nv_test(test_hlir_framework_buffer SRCS buffer_test.cc DEPS cinncore)
cinn_cc_test(test_hlir_framework_accuracy_checker SRCS accuracy_checker_test.cc DEPS cinncore) cinn_cc_test(test_hlir_framework_accuracy_checker SRCS
cinn_cc_test(test_hlir_framework_parallel_compiler SRCS parallel_compiler_test.cc DEPS cinncore) accuracy_checker_test.cc DEPS cinncore)
cinn_cc_test(test_hlir_framework_parallel_compiler SRCS
parallel_compiler_test.cc DEPS cinncore)
else() else()
cinn_cc_test(test_hlir_framework_buffer SRCS buffer_test.cc DEPS cinncore) cinn_cc_test(test_hlir_framework_buffer SRCS buffer_test.cc DEPS cinncore)
endif() endif()
if(WITH_CUDA)
if (WITH_CUDA) cinn_cc_test(test_hlir_framework_op_lowering SRCS op_lowering_test.cc DEPS
cinn_cc_test(test_hlir_framework_op_lowering SRCS op_lowering_test.cc DEPS cinncore decomposer_test_helper) cinncore decomposer_test_helper)
endif() endif()
cinn_cc_test(test_hlir_framework_tensor SRCS tensor_test.cc DEPS cinncore) cinn_cc_test(test_hlir_framework_tensor SRCS tensor_test.cc DEPS cinncore)
cinn_cc_test(test_hlir_framework_scope SRCS scope_test.cc DEPS cinncore) cinn_cc_test(test_hlir_framework_scope SRCS scope_test.cc DEPS cinncore)
cinn_cc_test(test_hlir_framework_instruction SRCS instruction_test.cc DEPS cinncore) cinn_cc_test(test_hlir_framework_instruction SRCS instruction_test.cc DEPS
cinncore)
cinn_cc_test(test_hlir_framework_op SRCS op_test.cc DEPS cinncore) cinn_cc_test(test_hlir_framework_op SRCS op_test.cc DEPS cinncore)
cinn_cc_test(test_hlir_framework_print_graph_pass SRCS print_graph_pass_test.cc DEPS cinncore) cinn_cc_test(test_hlir_framework_print_graph_pass SRCS print_graph_pass_test.cc
DEPS cinncore)
cinn_cc_test(test_hlir_framework_graph SRCS graph_test.cc DEPS cinncore) cinn_cc_test(test_hlir_framework_graph SRCS graph_test.cc DEPS cinncore)
#cinn_cc_test(test_hlir_framework_graph_compiler SRCS graph_compiler_test.cc DEPS cinncore) #cinn_cc_test(test_hlir_framework_graph_compiler SRCS graph_compiler_test.cc DEPS cinncore)
# Empty file. Adding this line to avoid conflict between end-of-file-fixer and cmake-format.
...@@ -2,22 +2,24 @@ add_subdirectory(contrib) ...@@ -2,22 +2,24 @@ add_subdirectory(contrib)
core_gather_headers() core_gather_headers()
gather_srcs(cinnapi_src SRCS gather_srcs(
nn.cc cinnapi_src
broadcast.cc SRCS
transform.cc nn.cc
elementwise.cc broadcast.cc
reduction.cc transform.cc
op_util.cc elementwise.cc
custom_call.cc reduction.cc
external_api_registry.cc op_util.cc
) custom_call.cc
external_api_registry.cc)
cinn_cc_test(test_cinn_op_broadcast SRCS op_broadcast_test.cc DEPS cinncore) cinn_cc_test(test_cinn_op_broadcast SRCS op_broadcast_test.cc DEPS cinncore)
cinn_cc_test(test_cinn_op_nn SRCS op_nn_test.cc DEPS cinncore) cinn_cc_test(test_cinn_op_nn SRCS op_nn_test.cc DEPS cinncore)
cinn_cc_test(test_cinn_op_transform SRCS transform_test.cc DEPS cinncore) cinn_cc_test(test_cinn_op_transform SRCS transform_test.cc DEPS cinncore)
cinn_cc_test(test_external_api_registry SRCS external_api_registry_test.cc DEPS cinncore) cinn_cc_test(test_external_api_registry SRCS external_api_registry_test.cc DEPS
cinncore)
if (WITH_CUDA) if(WITH_CUDA)
cinn_cc_test(test_cinn_op_reduction SRCS reduction_test.cc DEPS cinncore) cinn_cc_test(test_cinn_op_reduction SRCS reduction_test.cc DEPS cinncore)
endif() endif()
core_gather_headers() core_gather_headers()
gather_srcs(cinnapi_src SRCS gather_srcs(
gather_nd.cc cinnapi_src
sort.cc SRCS
argmin.cc gather_nd.cc
argmax.cc sort.cc
repeat.cc argmin.cc
lookup_table.cc argmax.cc
one_hot.cc repeat.cc
reciprocal.cc lookup_table.cc
gaussian_random.cc one_hot.cc
uniform_random.cc reciprocal.cc
cholesky.cc gaussian_random.cc
triangular_solve.cc uniform_random.cc
bitcast_convert.cc cholesky.cc
randint.cc triangular_solve.cc
resize.cc bitcast_convert.cc
assert_true.cc randint.cc
) resize.cc
assert_true.cc)
cinn_cc_test(test_gather_nd SRCS gather_nd_test.cc DEPS cinncore) cinn_cc_test(test_gather_nd SRCS gather_nd_test.cc DEPS cinncore)
cinn_cc_test(test_sort SRCS sort_test.cc DEPS cinncore) cinn_cc_test(test_sort SRCS sort_test.cc DEPS cinncore)
......
core_gather_headers() core_gather_headers()
gather_srcs(
gather_srcs(cinnapi_src SRCS cinnapi_src
infershape.cc SRCS
opfusion.cc infershape.cc
alterlayout.cc opfusion.cc
const_propagate.cc alterlayout.cc
op_fusion_pass.cc const_propagate.cc
fusion_merge_pass.cc op_fusion_pass.cc
dot_merger.cc fusion_merge_pass.cc
check_fusion_accuracy_pass.cc dot_merger.cc
custom_call_pass.cc check_fusion_accuracy_pass.cc
common_subexpression_elimination.cc custom_call_pass.cc
constant_folding_pass.cc common_subexpression_elimination.cc
dce_pass.cc constant_folding_pass.cc
dense_merge_pass.cc dce_pass.cc
reduce_split_pass.cc dense_merge_pass.cc
single_group_optimize_pass.cc reduce_split_pass.cc
constant_folding_pass_util.cc single_group_optimize_pass.cc
) constant_folding_pass_util.cc)
#cinn_cc_test(test_opfusion SRCS opfusion_test.cc DEPS cinncore) #cinn_cc_test(test_opfusion SRCS opfusion_test.cc DEPS cinncore)
if (WITH_CUDA) if(WITH_CUDA)
cinn_cc_test(test_primitive_ops SRCS test_primitive_ops.cc DEPS cinncore) cinn_cc_test(test_primitive_ops SRCS test_primitive_ops.cc DEPS cinncore)
cinn_cc_test(test_const_propagate SRCS const_propagate_test.cc DEPS cinncore) cinn_cc_test(test_const_propagate SRCS const_propagate_test.cc DEPS cinncore)
cinn_cc_test(test_dot_merger_pass SRCS dot_merger_test.cc DEPS cinncore) cinn_cc_test(test_dot_merger_pass SRCS dot_merger_test.cc DEPS cinncore)
# TODO(thisjiang): move when test bug in x86 is fixed # TODO(thisjiang): move when test bug in x86 is fixed
cinn_cc_test(test_check_fusion_accuracy_pass SRCS check_fusion_accuracy_pass_test.cc DEPS cinncore decomposer_test_helper) cinn_cc_test(
cinn_cc_test(test_dense_merge_pass SRCS dense_merge_pass_test.cc DEPS cinncore) test_check_fusion_accuracy_pass SRCS check_fusion_accuracy_pass_test.cc
cinn_cc_test(test_reduce_split_pass SRCS reduce_split_pass_test.cc DEPS cinncore) DEPS cinncore decomposer_test_helper)
cinn_cc_test(test_dense_merge_pass SRCS dense_merge_pass_test.cc DEPS
cinncore)
cinn_cc_test(test_reduce_split_pass SRCS reduce_split_pass_test.cc DEPS
cinncore)
endif() endif()
cinn_cc_test(test_op_fusion_pass SRCS op_fusion_pass_test.cc DEPS cinncore decomposer_test_helper) cinn_cc_test(test_op_fusion_pass SRCS op_fusion_pass_test.cc DEPS cinncore
cinn_cc_test(test_fusion_merge_pass SRCS fusion_merge_pass_test.cc DEPS cinncore decomposer_test_helper) decomposer_test_helper)
if (NOT WITH_CUDA) cinn_cc_test(test_fusion_merge_pass SRCS fusion_merge_pass_test.cc DEPS
#cinn_cc_test(test_alterlayout SRCS alterlayout_test.cc DEPS cinncore) cinncore decomposer_test_helper)
if(NOT WITH_CUDA)
#cinn_cc_test(test_alterlayout SRCS alterlayout_test.cc DEPS cinncore)
endif() endif()
cinn_cc_test(test_dot_merger SRCS test_dot_merger.cc DEPS cinncore) cinn_cc_test(test_dot_merger SRCS test_dot_merger.cc DEPS cinncore)
cinn_cc_test(test_dce_pass SRCS dce_pass_test.cc DEPS cinncore) cinn_cc_test(test_dce_pass SRCS dce_pass_test.cc DEPS cinncore)
cinn_cc_test(test_common_subexpression_elimination SRCS common_subexpression_elimination_test.cc DEPS cinncore) cinn_cc_test(test_common_subexpression_elimination SRCS
cinn_cc_test(test_constant_folding_pass SRCS constant_folding_pass_test.cc DEPS cinncore) common_subexpression_elimination_test.cc DEPS cinncore)
cinn_cc_test(test_constant_folding_pass SRCS constant_folding_pass_test.cc DEPS
cinncore)
...@@ -2,18 +2,19 @@ cinn_proto_library(param_proto SRCS schedule_param.proto) ...@@ -2,18 +2,19 @@ cinn_proto_library(param_proto SRCS schedule_param.proto)
core_gather_headers() core_gather_headers()
gather_srcs(cinnapi_src SRCS gather_srcs(
broadcast.cc cinnapi_src
elementwise.cc SRCS
nn.cc broadcast.cc
nn_util.cc elementwise.cc
reduction.cc nn.cc
load_x86_params.cc nn_util.cc
schedule.cc reduction.cc
ir_schedule_pe.cc load_x86_params.cc
transform.cc schedule.cc
vision.cc ir_schedule_pe.cc
) transform.cc
vision.cc)
cinn_cc_test(test_cinn_pe_elementwise SRCS pe_elementwise_test.cc DEPS cinncore) cinn_cc_test(test_cinn_pe_elementwise SRCS pe_elementwise_test.cc DEPS cinncore)
cinn_cc_test(test_cinn_pe_broadcast SRCS pe_broadcast_test.cc DEPS cinncore) cinn_cc_test(test_cinn_pe_broadcast SRCS pe_broadcast_test.cc DEPS cinncore)
...@@ -21,5 +22,7 @@ cinn_cc_test(test_cinn_pe_transform SRCS pe_transform_test.cc DEPS cinncore) ...@@ -21,5 +22,7 @@ cinn_cc_test(test_cinn_pe_transform SRCS pe_transform_test.cc DEPS cinncore)
cinn_cc_test(test_load_params SRCS load_params_test.cc DEPS cinncore) cinn_cc_test(test_load_params SRCS load_params_test.cc DEPS cinncore)
foreach(header ${param_proto_HDRS}) foreach(header ${param_proto_HDRS})
set(core_proto_includes "${core_proto_includes};${header}" CACHE INTERNAL "") set(core_proto_includes
"${core_proto_includes};${header}"
CACHE INTERNAL "")
endforeach() endforeach()
...@@ -2,37 +2,45 @@ cinn_proto_library(schedule_desc_proto SRCS schedule_desc.proto) ...@@ -2,37 +2,45 @@ cinn_proto_library(schedule_desc_proto SRCS schedule_desc.proto)
core_gather_headers() core_gather_headers()
gather_srcs(cinnapi_src SRCS gather_srcs(
ir.cc cinnapi_src
ir_base.cc SRCS
ir_schedule.cc ir.cc
ir_schedule_util.cc ir_base.cc
ir_visitor.cc ir_schedule.cc
ir_printer.cc ir_schedule_util.cc
ir_mutator.cc ir_visitor.cc
function_definition.cc ir_printer.cc
lowered_func.cc ir_mutator.cc
ir_operators.cc function_definition.cc
ir_verify.cc lowered_func.cc
buffer.cc ir_operators.cc
function_base.cc ir_verify.cc
operation.cc buffer.cc
collect_ir_nodes.cc function_base.cc
registry.cc operation.cc
tensor.cc collect_ir_nodes.cc
module.cc registry.cc
intrinsic_ops.cc tensor.cc
layout.cc module.cc
schedule_desc.cc intrinsic_ops.cc
ir_compare.cc layout.cc
) schedule_desc.cc
ir_compare.cc)
# cinn_cc_test(test_ir SRCS ir_test.cc DEPS core) # cinn_cc_test(test_ir SRCS ir_test.cc DEPS core)
# cinn_cc_test(test_ir_printer SRCS ir_printer_test.cc DEPS core) # cinn_cc_test(test_ir_printer SRCS ir_printer_test.cc DEPS core)
# cinn_cc_test(test_ir_operators SRCS ir_operators_test.cc DEPS core) # cinn_cc_test(test_ir_operators SRCS ir_operators_test.cc DEPS core)
cinn_cc_test(test_collect_ir_nodes SRCS collect_ir_nodes_test.cc DEPS cinncore) cinn_cc_test(test_collect_ir_nodes SRCS collect_ir_nodes_test.cc DEPS cinncore)
# cinn_cc_test(test_tensor SRCS tensor_test.cc DEPS core) # cinn_cc_test(test_tensor SRCS tensor_test.cc DEPS core)
cinn_cc_test(test_buffer SRCS buffer_test.cc DEPS cinncore ARGS ${global_test_args}) cinn_cc_test(
test_buffer
SRCS
buffer_test.cc
DEPS
cinncore
ARGS
${global_test_args})
cinn_cc_test(test_tensor SRCS tensor_test.cc DEPS cinncore) cinn_cc_test(test_tensor SRCS tensor_test.cc DEPS cinncore)
cinn_cc_test(test_intrinsic_ops SRCS intrinsic_ops_test.cc DEPS cinncore) cinn_cc_test(test_intrinsic_ops SRCS intrinsic_ops_test.cc DEPS cinncore)
cinn_cc_test(test_ir_verify SRCS ir_verify_test.cc DEPS cinncore) cinn_cc_test(test_ir_verify SRCS ir_verify_test.cc DEPS cinncore)
...@@ -40,5 +48,7 @@ cinn_cc_test(test_schedule_desc SRCS schedule_desc_test.cc DEPS cinncore) ...@@ -40,5 +48,7 @@ cinn_cc_test(test_schedule_desc SRCS schedule_desc_test.cc DEPS cinncore)
cinn_cc_test(test_ir_compare SRCS ir_compare_test.cc DEPS cinncore) cinn_cc_test(test_ir_compare SRCS ir_compare_test.cc DEPS cinncore)
foreach(header ${schedule_desc_proto_HDRS}) foreach(header ${schedule_desc_proto_HDRS})
set(core_proto_includes "${core_proto_includes};${header}" CACHE INTERNAL "") set(core_proto_includes
"${core_proto_includes};${header}"
CACHE INTERNAL "")
endforeach() endforeach()
core_gather_headers() core_gather_headers()
gather_srcs(cinnapi_src SRCS gather_srcs(
buffer.cc cinnapi_src
compute.cc SRCS
placeholder.cc buffer.cc
lower.cc compute.cc
builtin.cc placeholder.cc
lower_impl.cc lower.cc
packed_func.cc builtin.cc
) lower_impl.cc
packed_func.cc)
cinn_cc_test(test_compute SRCS compute_test.cc DEPS cinncore) cinn_cc_test(test_compute SRCS compute_test.cc DEPS cinncore)
cinn_cc_test(test_placeholder SRCS placeholder_test.cc DEPS cinncore) cinn_cc_test(test_placeholder SRCS placeholder_test.cc DEPS cinncore)
......
core_gather_headers() core_gather_headers()
gather_srcs(cinnapi_src SRCS gather_srcs(
remove_nested_block.cc cinnapi_src
replace_call_with_expr.cc SRCS
ir_copy.cc remove_nested_block.cc
ir_replace.cc replace_call_with_expr.cc
replace_var_with_expr.cc ir_copy.cc
tensor_write_tell.cc ir_replace.cc
ir_simplify.cc replace_var_with_expr.cc
optimize.cc tensor_write_tell.cc
vectorize_loops.cc ir_simplify.cc
unroll_loops.cc optimize.cc
transform_polyfor_to_for.cc vectorize_loops.cc
eliminate_broadcast_in_forloop.cc unroll_loops.cc
fold_cinn_call_arguments.cc transform_polyfor_to_for.cc
call_arg_list_to_pod_value.cc eliminate_broadcast_in_forloop.cc
insert_debug_log_callee.cc fold_cinn_call_arguments.cc
lower_function_call_bind_vars.cc call_arg_list_to_pod_value.cc
extern_call_process.cc insert_debug_log_callee.cc
map_extern_call.cc lower_function_call_bind_vars.cc
compute_inline_expand.cc extern_call_process.cc
buffer_assign.cc map_extern_call.cc
replace_const_param_to_integer.cc compute_inline_expand.cc
cast_simplify.cc buffer_assign.cc
if_simplify.cc replace_const_param_to_integer.cc
lower_intrin.cc cast_simplify.cc
cast_bool_to_int8.cc if_simplify.cc
collect_undefined_vars.cc lower_intrin.cc
var_mod_simplify.cc cast_bool_to_int8.cc
remove_schedule_block.cc collect_undefined_vars.cc
) var_mod_simplify.cc
remove_schedule_block.cc)
if (WITH_CUDA) if(WITH_CUDA)
gather_srcs(cinnapi_src SRCS transform_gpu_forloop.cc) gather_srcs(cinnapi_src SRCS transform_gpu_forloop.cc)
endif() endif()
cinn_cc_test(test_remove_nested_block SRCS remove_nested_block_test.cc DEPS
cinn_cc_test(test_remove_nested_block SRCS remove_nested_block_test.cc DEPS cinncore) cinncore)
cinn_cc_test(test_ir_copy SRCS ir_copy_test.cc DEPS cinncore) cinn_cc_test(test_ir_copy SRCS ir_copy_test.cc DEPS cinncore)
cinn_cc_test(test_ir_simplify SRCS ir_simplify_test.cc DEPS cinncore) cinn_cc_test(test_ir_simplify SRCS ir_simplify_test.cc DEPS cinncore)
cinn_cc_test(test_replace_call_with_expr SRCS replace_call_with_expr_test.cc DEPS cinncore) cinn_cc_test(test_replace_call_with_expr SRCS replace_call_with_expr_test.cc
cinn_cc_test(test_vectorize_loops SRCS vectorize_loops_test.cc DEPS cinncore ARGS ${global_test_args}) DEPS cinncore)
cinn_cc_test(test_transform_polyfor_to_for SRCS transform_polyfor_to_for_test.cc DEPS cinncore ARGS ${global_test_args}) cinn_cc_test(
test_vectorize_loops
SRCS
vectorize_loops_test.cc
DEPS
cinncore
ARGS
${global_test_args})
cinn_cc_test(
test_transform_polyfor_to_for
SRCS
transform_polyfor_to_for_test.cc
DEPS
cinncore
ARGS
${global_test_args})
cinn_cc_test(test_optimize SRCS optimize_test.cc DEPS cinncore) cinn_cc_test(test_optimize SRCS optimize_test.cc DEPS cinncore)
cinn_cc_test(test_cache_read_write_replace SRCS cache_read_write_replace_test.cc DEPS cinncore) cinn_cc_test(test_cache_read_write_replace SRCS
cache_read_write_replace_test.cc DEPS cinncore)
cinn_cc_test(test_cast_simplify SRCS cast_simplify_test.cc DEPS cinncore) cinn_cc_test(test_cast_simplify SRCS cast_simplify_test.cc DEPS cinncore)
cinn_cc_test(test_if_simplify SRCS if_simplify_test.cc DEPS cinncore) cinn_cc_test(test_if_simplify SRCS if_simplify_test.cc DEPS cinncore)
cinn_cc_test(test_remove_schedule_block SRCS remove_schedule_block_test.cc DEPS cinncore) cinn_cc_test(test_remove_schedule_block SRCS remove_schedule_block_test.cc DEPS
cinncore)
cinn_cc_test(test_unroll_loops SRCS unroll_loops_test.cc DEPS cinncore) cinn_cc_test(test_unroll_loops SRCS unroll_loops_test.cc DEPS cinncore)
core_gather_headers() core_gather_headers()
gather_srcs(cinnapi_src SRCS gather_srcs(
dim.cc cinnapi_src
domain.cc SRCS
domain_add_unit_loop_mutator.cc dim.cc
map.cc domain.cc
stage.cc domain_add_unit_loop_mutator.cc
isl_utils.cc map.cc
schedule.cc stage.cc
naive_scheduler.cc isl_utils.cc
poly_scheduler.cc schedule.cc
ast_gen.cc naive_scheduler.cc
graph.cc poly_scheduler.cc
compute_at_transform.cc ast_gen.cc
) graph.cc
compute_at_transform.cc)
# cinn_cc_test(test_graph SRCS graph_test.cc DEPS core) # cinn_cc_test(test_graph SRCS graph_test.cc DEPS core)
cinn_cc_test(test_schedule SRCS schedule_test.cc DEPS cinncore) cinn_cc_test(test_schedule SRCS schedule_test.cc DEPS cinncore)
# cinn_cc_test(test_poly_scheduler SRCS poly_scheduler_test.cc DEPS core) # cinn_cc_test(test_poly_scheduler SRCS poly_scheduler_test.cc DEPS core)
cinn_cc_test(test_stage SRCS stage_test.cc DEPS cinncore) cinn_cc_test(test_stage SRCS stage_test.cc DEPS cinncore)
cinn_cc_test(test_compute_at_transform SRCS compute_at_transform_test.cc DEPS cinncore) cinn_cc_test(test_compute_at_transform SRCS compute_at_transform_test.cc DEPS
cinncore)
cinn_cc_test(test_ast_gen SRCS ast_gen_test.cc DEPS cinncore) cinn_cc_test(test_ast_gen SRCS ast_gen_test.cc DEPS cinncore)
cinn_cc_test(test_isl_utils SRCS isl_utils_test.cc DEPS cinncore) cinn_cc_test(test_isl_utils SRCS isl_utils_test.cc DEPS cinncore)
set(srcs runtime.cc common.cc lang.cc ir.cc poly.cc backends.cc bind.cc optim.cc pe.cc frontend.cc framework.cc utils.cc) set(srcs
runtime.cc
common.cc
lang.cc
ir.cc
poly.cc
backends.cc
bind.cc
optim.cc
pe.cc
frontend.cc
framework.cc
utils.cc)
if (WITH_CUDA) if(WITH_CUDA)
message(STATUS "Compile core_api with CUDA support") message(STATUS "Compile core_api with CUDA support")
cinn_nv_library(core_api SHARED cinn_nv_library(
SRCS ${srcs} core_api
DEPS cinncore_static cinn_runtime pybind) SHARED
SRCS
${srcs}
DEPS
cinncore_static
cinn_runtime
pybind)
message("cuda_nvrtc: ${CUDA_NVRTC}") message("cuda_nvrtc: ${CUDA_NVRTC}")
target_link_libraries(core_api ${CUDA_NVRTC_LIB} ${CUDA_LIBRARIES} cuda cudnn) target_link_libraries(core_api ${CUDA_NVRTC_LIB} ${CUDA_LIBRARIES} cuda cudnn)
if (NVTX_FOUND) if(NVTX_FOUND)
target_link_libraries(core_api ${CUDA_NVTX_LIB}) target_link_libraries(core_api ${CUDA_NVTX_LIB})
endif() endif()
else() else()
message(STATUS "Compile core_api without CUDA support") message(STATUS "Compile core_api without CUDA support")
cinn_cc_library(core_api SHARED cinn_cc_library(
SRCS ${srcs} core_api
DEPS cinncore_static cinn_runtime pybind ${llvm_libs}) SHARED
SRCS
${srcs}
DEPS
cinncore_static
cinn_runtime
pybind
${llvm_libs})
endif() endif()
target_link_libraries(core_api ${MKLML_LIB} isl ginac) target_link_libraries(core_api ${MKLML_LIB} isl ginac)
if (USE_OPENMP STREQUAL "gnu") if(USE_OPENMP STREQUAL "gnu")
target_link_libraries(core_api ${OpenMP_CXX_LIBRARIES}) target_link_libraries(core_api ${OpenMP_CXX_LIBRARIES})
message(STATUS "OpenMP lib: ${OpenMP_CXX_LIBRARIES}") message(STATUS "OpenMP lib: ${OpenMP_CXX_LIBRARIES}")
elseif(USE_OPENMP STREQUAL "intel") elseif(USE_OPENMP STREQUAL "intel")
...@@ -26,4 +51,4 @@ elseif(USE_OPENMP STREQUAL "intel") ...@@ -26,4 +51,4 @@ elseif(USE_OPENMP STREQUAL "intel")
message(STATUS "OpenMP lib: ${MKLML_IOMP_LIB}") message(STATUS "OpenMP lib: ${MKLML_IOMP_LIB}")
endif() endif()
SET_TARGET_PROPERTIES(core_api PROPERTIES PREFIX "") set_target_properties(core_api PROPERTIES PREFIX "")
core_gather_headers() core_gather_headers()
gather_srcs(cinnapi_src SRCS gather_srcs(
cinnapi_src
SRCS
flags.cc flags.cc
intrinsic.cc intrinsic.cc
cinn_runtime.cc cinn_runtime.cc
intrinsic_types.cc intrinsic_types.cc
custom_function.cc custom_function.cc)
)
cinn_cc_library(cinn_runtime SRCS cinn_runtime.cc buffer.cc cinn_cc_library(
#cinn_x86_device_impl.cc cinn_runtime SRCS cinn_runtime.cc buffer.cc #cinn_x86_device_impl.cc
) )
cinn_cc_test(test_cinn_runtime SRCS cinn_runtime_test.cc DEPS cinn_runtime) cinn_cc_test(test_cinn_runtime SRCS cinn_runtime_test.cc DEPS cinn_runtime)
cinn_cc_test(test_custom_function SRCS custom_function_test.cc DEPS cinncore) cinn_cc_test(test_custom_function SRCS custom_function_test.cc DEPS cinncore)
if (WITH_OPENMP) if(WITH_OPENMP)
cinn_cc_library(tiny_runtime STATIC SRCS tiny_runtime.cc) cinn_cc_library(tiny_runtime STATIC SRCS tiny_runtime.cc)
endif() endif()
add_subdirectory(cuda) add_subdirectory(cuda)
......
core_gather_headers() core_gather_headers()
gather_srcs(cinnapi_src SRCS host_intrinsics.cc thread_backend.cc)
gather_srcs(cinnapi_src SRCS if(WITH_MKL_CBLAS)
host_intrinsics.cc
thread_backend.cc)
if (WITH_MKL_CBLAS)
gather_srcs(cinnapi_src SRCS mkl_math.cc cblas.cc) gather_srcs(cinnapi_src SRCS mkl_math.cc cblas.cc)
if (WITH_MKLDNN) if(WITH_MKLDNN)
gather_srcs(cinnapi_src SRCS mkldnn_math.cc) gather_srcs(cinnapi_src SRCS mkldnn_math.cc)
endif() endif()
endif() endif()
cinn_cc_test(test_host_intrinsics SRCS host_intrinsics_test.cc DEPS cinncore) cinn_cc_test(test_host_intrinsics SRCS host_intrinsics_test.cc DEPS cinncore)
if (WITH_MKL_CBLAS) if(WITH_MKL_CBLAS)
if (NOT WITH_CUDA) if(NOT WITH_CUDA)
cinn_cc_test(test_mkl_math SRCS mkl_math_test.cc mkl_math.cc DEPS cinncore) cinn_cc_test(test_mkl_math SRCS mkl_math_test.cc mkl_math.cc DEPS cinncore)
endif() endif()
if (WITH_MKLDNN) if(WITH_MKLDNN)
cinn_cc_test(test_mkldnn_math SRCS mkldnn_math_test.cc mkldnn_math.cc DEPS cinncore) cinn_cc_test(test_mkldnn_math SRCS mkldnn_math_test.cc mkldnn_math.cc DEPS
endif () cinncore)
endif()
endif() endif()
if (NOT WITH_CUDA) if(NOT WITH_CUDA)
return() return()
endif () endif()
core_gather_headers() core_gather_headers()
gather_srcs(
gather_srcs(cinnapi_src SRCS cinnapi_src
cuda_module.cc SRCS
cuda_util.cc cuda_module.cc
cuda_intrinsics.cc cuda_util.cc
cuda_intrinsics_reduce.cc cuda_intrinsics.cc
cuda_instrinsics_float16.cc cuda_intrinsics_reduce.cc
cuda_instrinsics_bfloat16.cc cuda_instrinsics_float16.cc
) cuda_instrinsics_bfloat16.cc)
cinn_nv_test(test_cuda_module SRCS cuda_module_test.cc DEPS cinncore) cinn_nv_test(test_cuda_module SRCS cuda_module_test.cc DEPS cinncore)
cinn_nv_library(cuda_runtime SRCS cinn_cuda_runtime_source.cuh) cinn_nv_library(cuda_runtime SRCS cinn_cuda_runtime_source.cuh)
core_gather_headers() core_gather_headers()
gather_srcs(
gather_srcs(cinnapi_src SRCS cinnapi_src
SRCS
dot_lang.cc dot_lang.cc
error.cc error.cc
functional.cc functional.cc
...@@ -13,11 +14,18 @@ gather_srcs(cinnapi_src SRCS ...@@ -13,11 +14,18 @@ gather_srcs(cinnapi_src SRCS
event.cc event.cc
multi_threading.cc multi_threading.cc
data_util.cc data_util.cc
random_engine.cc random_engine.cc)
)
cinn_cc_test(test_string SRCS string_test.cc DEPS cinncore) cinn_cc_test(test_string SRCS string_test.cc DEPS cinncore)
cinn_cc_test(test_sized_multi_set SRCS sized_multi_set_test.cc DEPS cinncore) cinn_cc_test(test_sized_multi_set SRCS sized_multi_set_test.cc DEPS cinncore)
cinn_cc_test(test_multi_threading SRCS multi_threading_test.cc DEPS cinncore) cinn_cc_test(test_multi_threading SRCS multi_threading_test.cc DEPS cinncore)
cinn_cc_test(test_functional SRCS string.cc functional.cc functional_test.cc DEPS absl Threads::Threads) cinn_cc_test(
test_functional
SRCS
string.cc
functional.cc
functional_test.cc
DEPS
absl
Threads::Threads)
cinn_cc_test(test_profiler SRCS profiler_test.cc DEPS cinncore) cinn_cc_test(test_profiler SRCS profiler_test.cc DEPS cinncore)
cinn_cc_library(test_program_builder SRCS program_builder.cc DEPS cinncore) cinn_cc_library(test_program_builder SRCS program_builder.cc DEPS cinncore)
if (WITH_TESTING) if(WITH_TESTING)
include_directories(${CMAKE_SOURCE_DIR}/paddle/cinn/runtime) include_directories(${CMAKE_SOURCE_DIR}/paddle/cinn/runtime)
add_subdirectory(benchmark) add_subdirectory(benchmark)
cinn_cc_test(test01_elementwise_add_main SRCS test01_elementwise_add_main.cc DEPS cinncore cinn_cc_test(
ARGS ${global_test_args} test01_elementwise_add_main
) SRCS
cinn_cc_test(test01_elementwise_add_case SRCS test01_elementwise_add_case.cc DEPS cinncore) test01_elementwise_add_main.cc
add_run_test_dependency(test01_elementwise_add_case test01_elementwise_add_main) DEPS
cinncore
ARGS
${global_test_args})
cinn_cc_test(test01_elementwise_add_case SRCS test01_elementwise_add_case.cc
DEPS cinncore)
add_run_test_dependency(test01_elementwise_add_case
test01_elementwise_add_main)
cinn_cc_test(test02_matmul_main SRCS test02_matmul_main.cc DEPS cinncore ARGS ${global_test_args}) cinn_cc_test(
test02_matmul_main
SRCS
test02_matmul_main.cc
DEPS
cinncore
ARGS
${global_test_args})
cinn_cc_test(test02_matmul_case SRCS test02_matmul_case.cc DEPS cinncore) cinn_cc_test(test02_matmul_case SRCS test02_matmul_case.cc DEPS cinncore)
target_compile_options(test02_matmul_case PRIVATE "-O3") target_compile_options(test02_matmul_case PRIVATE "-O3")
add_run_test_dependency(test02_matmul_case test02_matmul_main) add_run_test_dependency(test02_matmul_case test02_matmul_main)
cinn_cc_test(test03_conv_main SRCS test03_convolution_main.cc DEPS cinncore ARGS ${global_test_args}) cinn_cc_test(
test03_conv_main
SRCS
test03_convolution_main.cc
DEPS
cinncore
ARGS
${global_test_args})
cinn_cc_test(test03_conv_case SRCS test03_convolution_case.cc DEPS cinncore) cinn_cc_test(test03_conv_case SRCS test03_convolution_case.cc DEPS cinncore)
target_compile_options(test03_conv_case PRIVATE "-O3") target_compile_options(test03_conv_case PRIVATE "-O3")
add_run_test_dependency(test03_conv_case test03_conv_main) add_run_test_dependency(test03_conv_case test03_conv_main)
......
include_directories(${CMAKE_SOURCE_DIR}/paddle/cinn/runtime) include_directories(${CMAKE_SOURCE_DIR}/paddle/cinn/runtime)
set(srcs test_utils.cc test_matmul.cc test_elementwise.cc test_all_ops_default.cc) set(srcs test_utils.cc test_matmul.cc test_elementwise.cc
test_all_ops_default.cc)
#cinn_cc_test(test_bk_matmul SRCS test_matmul.cc test_utils.cc DEPS cinncore ARGS ${global_test_args}) #cinn_cc_test(test_bk_matmul SRCS test_matmul.cc test_utils.cc DEPS cinncore ARGS ${global_test_args})
#target_compile_options(test_bk_matmul PRIVATE "-O3") #target_compile_options(test_bk_matmul PRIVATE "-O3")
cinn_cc_test(test_bk_elementwise SRCS test_elementwise.cc test_utils.cc DEPS cinncore ARGS ${global_test_args}) cinn_cc_test(
test_bk_elementwise
SRCS
test_elementwise.cc
test_utils.cc
DEPS
cinncore
ARGS
${global_test_args})
target_compile_options(test_bk_elementwise PRIVATE "-O3") target_compile_options(test_bk_elementwise PRIVATE "-O3")
#cinn_cc_test(test_all_ops_default SRCS test_all_ops_default.cc test_utils.cc DEPS cinncore ARGS ${global_test_args}) #cinn_cc_test(test_all_ops_default SRCS test_all_ops_default.cc test_utils.cc DEPS cinncore ARGS ${global_test_args})
......
...@@ -18,7 +18,7 @@ if(WITH_TESTING) ...@@ -18,7 +18,7 @@ if(WITH_TESTING)
"RUN_TYPE=CINN") "RUN_TYPE=CINN")
set(CINN_RUN_ENVIRONMENT set(CINN_RUN_ENVIRONMENT
"OMP_NUM_THREADS=1;runtime_include_dir=${CINN_INCLUDE_DIR}/paddle/cinn/runtime/cuda/" "OMP_NUM_THREADS=1;runtime_include_dir=${CINN_INCLUDE_DIR}/paddle/cinn/runtime/cuda/"
) )
# cc_test_old( # cc_test_old(
# cinn_launch_op_test # cinn_launch_op_test
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册