-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
【CMake opt No.12】rm some DEPS of test/cpp/pir/core/CMakeLists.txt
#60161
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
test/cpp/pir/core/CMakeLists.txt
Outdated
paddle_test( | ||
ir_op_test | ||
SRCS | ||
ir_op_test.cc | ||
DEPS | ||
pir | ||
test_dialect | ||
op_dialect_vjp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`ir_op_test.cc` 需要 `test_dialect`
2023-12-19 22:58:08 ir_op_test.cc:
(.text._ZN3pir7Builder5BuildIN4test40SameOperandsAndResultElementTypeTraitOp3EJNS_8OpResultES4_RNS_15DenseTensorTypeES6_EEET_DpOT0_[_ZN3pir7Builder5BuildIN4test40SameOperandsAndResultElementTypeTraitOp3EJNS_8OpResultES4_RNS_15DenseTensorTypeES6_EEET_DpOT0_]+0x19d):
undefined reference to `test::SameOperandsAndResultElementTypeTraitOp3::Build(pir::Builder&, pir::OperationArgument&, pir::Value, pir::Value, pir::Type, pir::Type)'
SameOperandsAndResultElementTypeTraitOp3
定义的位置在 test/cpp/pir/tools/test_op.cc
cc_library(
test_dialect
SRCS test_dialect.cc test_op.cc test_trait.cc test_interface.cc
DEPS pir gtest)
test/cpp/pir/core/CMakeLists.txt
@@ -131,8 +129,7 @@ cc_test_old( | |||
gtest | |||
pir) | |||
|
|||
paddle_test(block_argument_test SRCS block_argument_test.cc DEPS test_dialect | |||
pir) | |||
paddle_test(block_argument_test SRCS block_argument_test.cc) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`block_argument_test` 需要 `test_dialect`
2023-12-19 23:02:37 block_argument_test.cc:
(.text._ZNSt17_Function_handlerIFPN3pir7DialectEvEZNS0_9IrContext20GetOrRegisterDialectIN4test11TestDialectEEEPT_vEUlvE_E9_M_invokeERKSt9_Any_data[_ZNSt17_Function_handlerIFPN3pir7DialectEvEZNS0_9IrContext20GetOrRegisterDialectIN4test11TestDialectEEEPT_vEUlvE_E9_M_invokeERKSt9_Any_data]+0x1f):
undefined reference to `test::TestDialect::TestDialect(pir::IrContext*)'
test/cpp/pir/core/CMakeLists.txt
Outdated
paddle_test( | ||
ir_op_test | ||
SRCS | ||
ir_op_test.cc | ||
DEPS | ||
pir | ||
test_dialect | ||
op_dialect_vjp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
windows 下 `ir_op_test` 需要 `op_dialect_vjp`
2023-12-20 00:10:25 ir_op_test.cc.obj :
error LNK2019: unresolved external symbol "public: __cdecl paddle::dialect::OperatorDialect::OperatorDialect(class pir::IrContext *)" (??0OperatorDialect@dialect@paddle@@QEAA@PEAVIrContext@pir@@@Z) referenced in function "private: virtual class pir::Dialect * __cdecl std::_Func_impl_no_alloc,class pir::Dialect *>::_Do_call(void)" (?_Do_call@?$_Func_impl_no_alloc@V@@PEAVDialect@pir@@$$V@std@@EEAAPEAVDialect@pir@@XZ)
在 op_dialect.cc
文件中创建
set(op_dialect_vjp_srcs
${CMAKE_CURRENT_SOURCE_DIR}/operator/ir/manual_op_decomp.cc
${CMAKE_CURRENT_SOURCE_DIR}/operator/ir/manual_op_vjp.cc
${CMAKE_CURRENT_SOURCE_DIR}/operator/ir/op_dialect.cc
${op_decomp_source_file}
${op_vjp_source_file}
${PADDLE_SOURCE_DIR}/paddle/fluid/primitive/base/decomp_trans.cc)
set(op_dialect_vjp_deps primitive_vjp_experimental op_dialect)
cc_library(
op_dialect_vjp
SRCS ${op_dialect_vjp_srcs}
DEPS ${op_dialect_vjp_deps})
@@ -1,16 +1,9 @@ | |||
paddle_test(type_test SRCS type_test.cc DEPS pir op_dialect_vjp) | |||
paddle_test(ir_attribute_test SRCS ir_attribute_test.cc DEPS pir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`ir_attribute_test` 需要 `pir`
2023-12-20 01:01:24 ir_attribute_test.cc.obj :
error LNK2001: unresolved external symbol
"public: virtual void __cdecl pir::Dialect::PrintOperation(class pir::Operation *,class pir::IrPrinter &)const "
(?PrintOperation@Dialect@pir@@UEBAXPEAVOperation@2@AEAVIrPrinter@2@@Z)
由于 pir
的 paddle/pir/CMakeLists.txt
中
file(GLOB_RECURSE PIR_CPP_SOURCES "*.cc")
包含改目录下所有 cc 文件
pir | ||
test_dialect | ||
op_dialect_vjp) | ||
paddle_test(ir_region_test SRCS ir_region_test.cc DEPS pir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`ir_region_test` 需要 `pir`
2023-12-20 01:01:24 ir_region_test.cc.obj :
error LNK2019: unresolved external symbol "public: class pir::OpInfo __cdecl pir::IrContext::GetRegisteredOpInfo(class std::basic_string,class std::allocator > const &)" (?GetRegisteredOpInfo@IrContext@pir@@QEAA?AVOpInfo@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "private: virtual void __cdecl region_erase_op_test_Test::TestBody(void)" (?TestBody@region_erase_op_test_Test@@EEAAXXZ)
由于 pir
的 paddle/pir/CMakeLists.txt
中
file(GLOB_RECURSE PIR_CPP_SOURCES "*.cc")
包含改目录下所有 cc 文件
test_dialect | ||
op_dialect_vjp) | ||
paddle_test(ir_region_test SRCS ir_region_test.cc DEPS pir) | ||
paddle_test(ir_builder_test SRCS ir_builder_test.cc DEPS pir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`ir_builder_test` 需要 `pir`
2023-12-20 01:01:24 ir_builder_test.cc.obj :
error LNK2019: unresolved external symbol "public: __cdecl pir::IrContext::IrContext(void)" (??0IrContext@pir@@QEAA@XZ) referenced in function "private: virtual void __cdecl builder_test_type_api_Test::TestBody(void)" (?TestBody@builder_test_type_api_Test@@EEAAXXZ)
由于 pir
的 paddle/pir/CMakeLists.txt
中
file(GLOB_RECURSE PIR_CPP_SOURCES "*.cc")
包含改目录下所有 cc 文件
@@ -1,16 +1,9 @@ | |||
paddle_test(type_test SRCS type_test.cc DEPS pir op_dialect_vjp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`type_test` 需要 `pir`
2023-12-20 01:01:24 type_test.cc.obj :
error LNK2019: unresolved external symbol "public: class pir::Dialect * __cdecl pir::IrContext::GetRegisteredDialect(class std::basic_string,class std::allocator > const &)" (?GetRegisteredDialect@IrContext@pir@@QEAAPEAVDialect@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "private: virtual void __cdecl type_test_custom_type_dialect_Test::TestBody(void)" (?TestBody@type_test_custom_type_dialect_Test@@EEAAXXZ)
由于 pir
的 paddle/pir/CMakeLists.txt
中
file(GLOB_RECURSE PIR_CPP_SOURCES "*.cc")
包含改目录下所有 cc 文件
`type_test` 需要 `op_dialect_vjp`
2023-12-20 02:22:00 type_test.cc.obj :
error LNK2019: unresolved external symbol "public: unsigned __int64 const & __cdecl paddle::dialect::SelectedRowsType::offset(void)const " (?offset@SelectedRowsType@dialect@paddle@@QEBAAEB_KXZ) referenced in function "private: virtual void __cdecl type_test_pd_op_dialect_Test::TestBody(void)" (?TestBody@type_test_pd_op_dialect_Test@@EEAAXXZ)
在 op_dialect.cc 文件中创建
set(op_dialect_vjp_srcs
${CMAKE_CURRENT_SOURCE_DIR}/operator/ir/manual_op_decomp.cc
${CMAKE_CURRENT_SOURCE_DIR}/operator/ir/manual_op_vjp.cc
${CMAKE_CURRENT_SOURCE_DIR}/operator/ir/op_dialect.cc
${op_decomp_source_file}
${op_vjp_source_file}
${PADDLE_SOURCE_DIR}/paddle/fluid/primitive/base/decomp_trans.cc)
set(op_dialect_vjp_deps primitive_vjp_experimental op_dialect)
cc_library(
op_dialect_vjp
SRCS ${op_dialect_vjp_srcs}
DEPS ${op_dialect_vjp_deps})
@@ -1,16 +1,9 @@ | |||
paddle_test(type_test SRCS type_test.cc DEPS pir op_dialect_vjp) | |||
paddle_test(ir_attribute_test SRCS ir_attribute_test.cc DEPS pir) | |||
paddle_test(ir_value_test SRCS ir_value_test.cc DEPS pir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`ir_value_test` 需要 `pir`
2023-12-20 01:01:24 ir_value_test.cc.obj :
error LNK2019: unresolved external symbol "public: static class pir::IrContext * __cdecl pir::IrContext::Instance(void)" (?Instance@IrContext@pir@@SAPEAV12@XZ) referenced in function "private: virtual void __cdecl value_test_value_test_Test::TestBody(void)" (?TestBody@value_test_value_test_Test@@EEAAXXZ)
由于 pir
的 paddle/pir/CMakeLists.txt
中
file(GLOB_RECURSE PIR_CPP_SOURCES "*.cc")
包含改目录下所有 cc 文件
…addlePaddle#60161) * rm DEPS * add pir to ir_op_test * - pir && + test_dialect * add op_dialect_vjp to ir_op_test * add pir 2 ir_* * add op_dialect_vjp 2 type_test
PR types
Others
PR changes
Others
Description