未验证 提交 70eade79 编写于 作者: W winter-wang 提交者: GitHub

[IR] rectify the new ir folder (#54124)

上级 abbc3392
......@@ -3,12 +3,12 @@ set(PYTHON_TESTS_DIR
CACHE INTERNAL "python tests directory")
add_subdirectory(utils)
add_subdirectory(ir)
add_subdirectory(scripts)
add_subdirectory(testing)
add_subdirectory(phi)
add_subdirectory(fluid)
add_subdirectory(ir)
add_subdirectory(pass)
# NOTE(zhiqiu): The changes of cc tests
......
......@@ -14,7 +14,7 @@
#pragma once
#include "paddle/ir/op_base.h"
#include "paddle/ir/core/op_base.h"
namespace paddle {
namespace dialect {
......
......@@ -29,7 +29,7 @@ H_FILE_TEMPLATE = """#ifdef GET_OP_LIST
{op_declare}
#else
#include "paddle/ir/op_base.h"
#include "paddle/ir/core/op_base.h"
{input}
#endif
......@@ -67,9 +67,9 @@ OP_GET_OUTPUT_TEMPLATE = """ ir::OpResult {output_name}() {{ return operation()
CC_FILE_TEMPLATE = """#include "{h_file}"
#include "paddle/fluid/dialect/pd_type.h"
#include "paddle/fluid/dialect/pd_attribute.h"
#include "paddle/ir/builtin_attribute.h"
#include "paddle/ir/builtin_type.h"
#include "paddle/ir/ir_context.h"
#include "paddle/ir/core/builtin_attribute.h"
#include "paddle/ir/core/builtin_type.h"
#include "paddle/ir/core/ir_context.h"
#include "paddle/phi/core/enforce.h"
{input}
......
......@@ -15,7 +15,7 @@
#pragma once
#include "paddle/fluid/dialect/pd_attribute_storage.h"
#include "paddle/ir/attribute.h"
#include "paddle/ir/core/attribute.h"
namespace paddle {
namespace dialect {
......
......@@ -14,8 +14,8 @@
#pragma once
#include "paddle/ir/attribute.h"
#include "paddle/ir/utils.h"
#include "paddle/ir/core/attribute.h"
#include "paddle/ir/core/utils.h"
#include "paddle/phi/common/data_type.h"
#include "paddle/phi/common/int_array.h"
#include "paddle/phi/common/layout.h"
......
......@@ -23,7 +23,7 @@
#include "paddle/fluid/dialect/utils.h"
#include "paddle/fluid/framework/convert_utils.h"
#include "paddle/fluid/framework/data_type.h"
#include "paddle/ir/dialect_interface.h"
#include "paddle/ir/core/dialect_interface.h"
#include "paddle/phi/core/dense_tensor.h"
namespace paddle {
......
......@@ -15,8 +15,8 @@
#pragma once
#include "paddle/fluid/framework/variable.h"
#include "paddle/ir/dialect.h"
#include "paddle/ir/parameter.h"
#include "paddle/ir/core/dialect.h"
#include "paddle/ir/core/parameter.h"
namespace paddle {
namespace dialect {
......
......@@ -15,7 +15,7 @@
#pragma once
#include "paddle/fluid/dialect/pd_type_storage.h"
#include "paddle/ir/type.h"
#include "paddle/ir/core/type.h"
namespace paddle {
namespace dialect {
......
......@@ -16,8 +16,8 @@
#include <type_traits>
#include "paddle/ir/type.h"
#include "paddle/ir/utils.h"
#include "paddle/ir/core/type.h"
#include "paddle/ir/core/utils.h"
namespace std {
///
......
......@@ -17,7 +17,7 @@
#include "paddle/fluid/dialect/pd_type_storage.h"
#include "paddle/fluid/framework/convert_utils.h"
#include "paddle/fluid/framework/data_type.h"
#include "paddle/ir/builtin_type.h"
#include "paddle/ir/core/builtin_type.h"
#include "paddle/phi/core/dense_tensor.h"
namespace paddle {
......
......@@ -25,10 +25,10 @@
#include "paddle/fluid/translator/op_compat_info.h"
#include "paddle/fluid/translator/program_translator.h"
#include "paddle/fluid/translator/type_translator.h"
#include "paddle/ir/builtin_op.h"
#include "paddle/ir/builtin_type.h"
#include "paddle/ir/ir_context.h"
#include "paddle/ir/value.h"
#include "paddle/ir/core/builtin_op.h"
#include "paddle/ir/core/builtin_type.h"
#include "paddle/ir/core/ir_context.h"
#include "paddle/ir/core/value.h"
#include "paddle/phi/core/enforce.h"
namespace paddle {
......
......@@ -21,10 +21,10 @@
#include "paddle/fluid/framework/op_desc.h"
#include "paddle/fluid/framework/var_desc.h"
#include "paddle/fluid/translator/program_translator.h"
#include "paddle/ir/ir_context.h"
#include "paddle/ir/operation.h"
#include "paddle/ir/program.h"
#include "paddle/ir/value.h"
#include "paddle/ir/core/ir_context.h"
#include "paddle/ir/core/operation.h"
#include "paddle/ir/core/program.h"
#include "paddle/ir/core/value.h"
namespace paddle {
namespace translator {
......
......@@ -21,10 +21,10 @@
#include "paddle/fluid/framework/program_desc.h"
#include "paddle/fluid/translator/op_translator.h"
#include "paddle/fluid/translator/type_translator.h"
#include "paddle/ir/attribute.h"
#include "paddle/ir/builtin_op.h"
#include "paddle/ir/builtin_type.h"
#include "paddle/ir/operation.h"
#include "paddle/ir/core/attribute.h"
#include "paddle/ir/core/builtin_op.h"
#include "paddle/ir/core/builtin_type.h"
#include "paddle/ir/core/operation.h"
#include "paddle/phi/core/enforce.h"
namespace paddle {
......
......@@ -20,9 +20,9 @@
#include <vector>
#include "paddle/fluid/framework/program_desc.h"
#include "paddle/ir/ir_context.h"
#include "paddle/ir/program.h"
#include "paddle/ir/value.h"
#include "paddle/ir/core/ir_context.h"
#include "paddle/ir/core/program.h"
#include "paddle/ir/core/value.h"
namespace paddle {
namespace translator {
......
......@@ -19,7 +19,7 @@
#include "paddle/fluid/dialect/pd_dialect.h"
#include "paddle/fluid/framework/program_desc.h"
#include "paddle/fluid/translator/program_translator.h"
#include "paddle/ir/program.h"
#include "paddle/ir/core/program.h"
namespace paddle {
......
......@@ -18,7 +18,7 @@
#include "paddle/fluid/dialect/pd_dialect.h"
#include "paddle/fluid/framework/program_desc.h"
#include "paddle/ir/program.h"
#include "paddle/ir/core/program.h"
namespace paddle {
......
......@@ -17,7 +17,7 @@
#include "paddle/fluid/dialect/pd_type.h"
#include "paddle/fluid/dialect/pd_type_storage.h"
#include "paddle/fluid/framework/framework.pb.h"
#include "paddle/ir/builtin_type.h"
#include "paddle/ir/core/builtin_type.h"
namespace paddle {
namespace translator {
......
......@@ -20,9 +20,9 @@
#include "paddle/fluid/framework/op_desc.h"
#include "paddle/fluid/framework/var_desc.h"
#include "paddle/fluid/translator/program_translator.h"
#include "paddle/ir/builtin_type.h"
#include "paddle/ir/dialect.h"
#include "paddle/ir/ir_context.h"
#include "paddle/ir/core/builtin_type.h"
#include "paddle/ir/core/dialect.h"
#include "paddle/ir/core/ir_context.h"
namespace paddle {
namespace translator {
......
......@@ -2,9 +2,4 @@ if(NOT WITH_NEWIR)
return()
endif()
set(NEWIR_SOURCE_DIR "${PADDLE_SOURCE_DIR}/paddle/ir")
set(NEWIR_BINARY_DIR "${PADDLE_BINARY_DIR}/paddle/ir")
file(GLOB IR_SRCS "*.cc")
cc_library(new_ir SRCS ${IR_SRCS})
add_subdirectory(core)
set(NEWIR_SOURCE_DIR "${PADDLE_SOURCE_DIR}/paddle/ir")
set(NEWIR_BINARY_DIR "${PADDLE_BINARY_DIR}/paddle/ir")
file(GLOB IR_SRCS "*.cc")
cc_library(new_ir SRCS ${IR_SRCS})
......@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/ir/attribute.h"
#include "paddle/ir/dialect.h"
#include "paddle/ir/core/attribute.h"
#include "paddle/ir/core/dialect.h"
namespace ir {
IrContext *Attribute::ir_context() const { return dialect().ir_context(); }
......
......@@ -14,8 +14,8 @@
#pragma once
#include "paddle/ir/attribute_base.h"
#include "paddle/ir/cast_utils.h"
#include "paddle/ir/core/attribute_base.h"
#include "paddle/ir/core/cast_utils.h"
namespace ir {
///
......
......@@ -14,9 +14,9 @@
#pragma once
#include "paddle/ir/ir_context.h"
#include "paddle/ir/storage_manager.h"
#include "paddle/ir/type_id.h"
#include "paddle/ir/core/ir_context.h"
#include "paddle/ir/core/storage_manager.h"
#include "paddle/ir/core/type_id.h"
namespace ir {
class Dialect;
......
......@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/ir/block.h"
#include "paddle/ir/core/block.h"
namespace ir {
Block::~Block() { clear(); }
......
......@@ -15,7 +15,7 @@
#pragma once
#include <list>
#include "paddle/ir/operation.h"
#include "paddle/ir/core/operation.h"
namespace ir {
class Block {
......
......@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/ir/builder.h"
#include "paddle/ir/core/builder.h"
namespace ir {
Operation *Builder::insert(Operation *op) {
......
......@@ -16,9 +16,9 @@
#include <list>
#include "paddle/ir/block.h"
#include "paddle/ir/operation.h"
#include "paddle/ir/program.h"
#include "paddle/ir/core/block.h"
#include "paddle/ir/core/operation.h"
#include "paddle/ir/core/program.h"
namespace ir {
///
......
......@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/ir/builtin_attribute.h"
#include "paddle/ir/core/builtin_attribute.h"
namespace ir {
std::string StrAttribute::data() const { return storage()->GetAsKey(); }
......
......@@ -14,9 +14,9 @@
#pragma once
#include "paddle/ir/attribute.h"
#include "paddle/ir/builtin_attribute_storage.h"
#include "paddle/ir/utils.h"
#include "paddle/ir/core/attribute.h"
#include "paddle/ir/core/builtin_attribute_storage.h"
#include "paddle/ir/core/utils.h"
namespace ir {
class StrAttribute : public Attribute {
......
......@@ -18,8 +18,8 @@
#include <map>
#include <type_traits>
#include "paddle/ir/attribute.h"
#include "paddle/ir/utils.h"
#include "paddle/ir/core/attribute.h"
#include "paddle/ir/core/utils.h"
namespace ir {
......
......@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/ir/builtin_dialect.h"
#include "paddle/ir/builtin_attribute.h"
#include "paddle/ir/builtin_op.h"
#include "paddle/ir/builtin_type.h"
#include "paddle/ir/core/builtin_dialect.h"
#include "paddle/ir/core/builtin_attribute.h"
#include "paddle/ir/core/builtin_op.h"
#include "paddle/ir/core/builtin_type.h"
namespace ir {
BuiltinDialect::BuiltinDialect(ir::IrContext *context)
......
......@@ -14,7 +14,7 @@
#pragma once
#include "paddle/ir/dialect.h"
#include "paddle/ir/core/dialect.h"
namespace ir {
///
......
......@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/ir/builtin_op.h"
#include "paddle/ir/core/builtin_op.h"
#include "paddle/ir/builtin_attribute.h"
#include "paddle/ir/builtin_type.h"
#include "paddle/ir/core/builtin_attribute.h"
#include "paddle/ir/core/builtin_type.h"
#include "paddle/phi/core/enforce.h"
namespace ir {
......
......@@ -14,7 +14,7 @@
#pragma once
#include "paddle/ir/op_base.h"
#include "paddle/ir/core/op_base.h"
namespace ir {
///
......
......@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/ir/builtin_type.h"
#include "paddle/ir/core/builtin_type.h"
namespace ir {
std::vector<Type> VectorType::data() const { return storage()->GetAsKey(); }
......
......@@ -14,8 +14,8 @@
#pragma once
#include "paddle/ir/builtin_type_storage.h"
#include "paddle/ir/type.h"
#include "paddle/ir/core/builtin_type_storage.h"
#include "paddle/ir/core/type.h"
namespace ir {
///
......
......@@ -14,8 +14,8 @@
#pragma once
#include "paddle/ir/type.h"
#include "paddle/ir/utils.h"
#include "paddle/ir/core/type.h"
#include "paddle/ir/core/utils.h"
namespace ir {
struct VectorTypeStorage : public TypeStorage {
......
......@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/ir/dialect.h"
#include "paddle/ir/core/dialect.h"
namespace ir {
Dialect::Dialect(std::string name, ir::IrContext *context, ir::TypeId id)
......
......@@ -16,11 +16,11 @@
#include <ostream>
#include "paddle/ir/attribute_base.h"
#include "paddle/ir/dialect_interface.h"
#include "paddle/ir/ir_context.h"
#include "paddle/ir/op_base.h"
#include "paddle/ir/type_base.h"
#include "paddle/ir/core/attribute_base.h"
#include "paddle/ir/core/dialect_interface.h"
#include "paddle/ir/core/ir_context.h"
#include "paddle/ir/core/op_base.h"
#include "paddle/ir/core/type_base.h"
namespace ir {
class DialectInterface;
......
......@@ -14,7 +14,7 @@
#pragma once
#include "paddle/ir/type_id.h"
#include "paddle/ir/core/type_id.h"
namespace ir {
class Dialect;
......
......@@ -12,17 +12,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/ir/ir_context.h"
#include "paddle/ir/core/ir_context.h"
#include <unordered_map>
#include "paddle/ir/attribute_base.h"
#include "paddle/ir/builtin_dialect.h"
#include "paddle/ir/builtin_type.h"
#include "paddle/ir/dialect.h"
#include "paddle/ir/op_info_impl.h"
#include "paddle/ir/spin_lock.h"
#include "paddle/ir/type_base.h"
#include "paddle/ir/core/attribute_base.h"
#include "paddle/ir/core/builtin_dialect.h"
#include "paddle/ir/core/builtin_type.h"
#include "paddle/ir/core/dialect.h"
#include "paddle/ir/core/op_info_impl.h"
#include "paddle/ir/core/spin_lock.h"
#include "paddle/ir/core/type_base.h"
namespace ir {
// The implementation class of the IrContext class, cache registered
......
......@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/ir/op_base.h"
#include "paddle/ir/core/op_base.h"
namespace ir {
InterfaceValue::~InterfaceValue() {
if (model_) free(model_);
......
......@@ -15,8 +15,8 @@
#pragma once
#include <type_traits>
#include "paddle/ir/operation.h"
#include "paddle/ir/utils.h"
#include "paddle/ir/core/operation.h"
#include "paddle/ir/core/utils.h"
namespace ir {
......
......@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/ir/op_info.h"
#include "paddle/ir/dialect.h"
#include "paddle/ir/ir_context.h"
#include "paddle/ir/op_info_impl.h"
#include "paddle/ir/core/op_info.h"
#include "paddle/ir/core/dialect.h"
#include "paddle/ir/core/ir_context.h"
#include "paddle/ir/core/op_info_impl.h"
namespace ir {
bool OpInfo::HasTrait(TypeId trait_id) const {
......
......@@ -15,7 +15,7 @@
#pragma once
#include <functional>
#include <unordered_map>
#include "paddle/ir/type_id.h"
#include "paddle/ir/core/type_id.h"
namespace ir {
class OpInfoImpl;
......
......@@ -19,9 +19,9 @@
#include <string>
#include <utility>
#include "paddle/ir/builtin_attribute.h"
#include "paddle/ir/op_base.h"
#include "paddle/ir/type.h"
#include "paddle/ir/core/builtin_attribute.h"
#include "paddle/ir/core/op_base.h"
#include "paddle/ir/core/type.h"
namespace ir {
class Dialect;
......
......@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/ir/operation.h"
#include "paddle/ir/dialect.h"
#include "paddle/ir/program.h"
#include "paddle/ir/utils.h"
#include "paddle/ir/core/operation.h"
#include "paddle/ir/core/dialect.h"
#include "paddle/ir/core/program.h"
#include "paddle/ir/core/utils.h"
namespace ir {
Operation *Operation::create(const OperationArgument &argument) {
......
......@@ -15,10 +15,11 @@
#pragma once
#include <iostream>
#include "paddle/ir/op_info.h"
#include "paddle/ir/operation_utils.h"
#include "paddle/ir/type.h"
#include "paddle/ir/value_impl.h"
#include <vector>
#include "paddle/ir/core/op_info.h"
#include "paddle/ir/core/operation_utils.h"
#include "paddle/ir/core/type.h"
#include "paddle/ir/core/value_impl.h"
namespace ir {
class OpBase;
......@@ -104,13 +105,13 @@ class alignas(8) Operation final {
AttributeMap attribute_;
ir::OpInfo op_info_;
OpInfo op_info_;
uint32_t num_results_ = 0;
uint32_t num_operands_ = 0;
ir::Program *parent_program_{nullptr};
Program *parent_program_{nullptr};
};
} // namespace ir
......@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/ir/operation_utils.h"
#include "paddle/ir/core/operation_utils.h"
namespace ir {
OperationArgument::OperationArgument(IrContext* ir_context, std::string name) {
......
......@@ -14,10 +14,10 @@
#pragma once
#include "paddle/ir/builtin_attribute.h"
#include "paddle/ir/op_info.h"
#include "paddle/ir/type.h"
#include "paddle/ir/value_impl.h"
#include "paddle/ir/core/builtin_attribute.h"
#include "paddle/ir/core/op_info.h"
#include "paddle/ir/core/type.h"
#include "paddle/ir/core/value_impl.h"
namespace ir {
......
......@@ -14,7 +14,7 @@
#pragma once
#include "paddle/ir/type.h"
#include "paddle/ir/core/type.h"
namespace ir {
///
......
......@@ -17,12 +17,12 @@
#include <string>
#include <unordered_map>
#include "paddle/ir/builtin_attribute.h"
#include "paddle/ir/builtin_type.h"
#include "paddle/ir/dialect.h"
#include "paddle/ir/operation.h"
#include "paddle/ir/program.h"
#include "paddle/ir/value.h"
#include "paddle/ir/core/builtin_attribute.h"
#include "paddle/ir/core/builtin_type.h"
#include "paddle/ir/core/dialect.h"
#include "paddle/ir/core/operation.h"
#include "paddle/ir/core/program.h"
#include "paddle/ir/core/value.h"
namespace ir {
......
......@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/ir/program.h"
#include "paddle/ir/ir_context.h"
#include "paddle/ir/core/program.h"
#include "paddle/ir/core/ir_context.h"
namespace ir {
Program::~Program() = default;
......
......@@ -17,10 +17,10 @@
#include <list>
#include <unordered_map>
#include "paddle/ir/block.h"
#include "paddle/ir/builtin_attribute.h"
#include "paddle/ir/operation.h"
#include "paddle/ir/parameter.h"
#include "paddle/ir/core/block.h"
#include "paddle/ir/core/builtin_attribute.h"
#include "paddle/ir/core/operation.h"
#include "paddle/ir/core/parameter.h"
namespace ir {
///
......
......@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/ir/storage_manager.h"
#include "paddle/ir/core/storage_manager.h"
#include <memory>
#include <unordered_map>
......
......@@ -18,8 +18,8 @@
#include <type_traits>
#include <unordered_map>
#include "paddle/ir/spin_lock.h"
#include "paddle/ir/type_id.h"
#include "paddle/ir/core/spin_lock.h"
#include "paddle/ir/core/type_id.h"
namespace ir {
///
......
......@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/ir/type.h"
#include "paddle/ir/dialect.h"
#include "paddle/ir/core/type.h"
#include "paddle/ir/core/dialect.h"
namespace ir {
IrContext* Type::ir_context() const { return dialect().ir_context(); }
......
......@@ -16,8 +16,8 @@
#include <ostream>
#include "paddle/ir/cast_utils.h"
#include "paddle/ir/type_base.h"
#include "paddle/ir/core/cast_utils.h"
#include "paddle/ir/core/type_base.h"
namespace ir {
///
......
......@@ -14,9 +14,9 @@
#pragma once
#include "paddle/ir/ir_context.h"
#include "paddle/ir/storage_manager.h"
#include "paddle/ir/type_id.h"
#include "paddle/ir/core/ir_context.h"
#include "paddle/ir/core/storage_manager.h"
#include "paddle/ir/core/type_id.h"
namespace ir {
class Dialect;
......
......@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/ir/utils.h"
#include "paddle/ir/core/utils.h"
namespace ir {
std::size_t hash_combine(std::size_t lhs, std::size_t rhs) {
......
......@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/ir/value.h"
#include "paddle/ir/value_impl.h"
#include "paddle/ir/core/value.h"
#include "paddle/ir/core/value_impl.h"
namespace ir {
// Operand
......
......@@ -14,8 +14,8 @@
#pragma once
#include "paddle/ir/cast_utils.h"
#include "paddle/ir/type.h"
#include "paddle/ir/core/cast_utils.h"
#include "paddle/ir/core/type.h"
namespace ir {
class Operation;
......
......@@ -14,7 +14,7 @@
#pragma once
#include "paddle/ir/value.h"
#include "paddle/ir/core/value.h"
namespace ir {
static const uint32_t OUTLINE_OP_RESULT_INDEX = 6;
......
......@@ -13,8 +13,8 @@
// limitations under the License.
#include "paddle/pass/pass.h"
#include "paddle/ir/ir_context.h"
#include "paddle/ir/operation.h"
#include "paddle/ir/core/ir_context.h"
#include "paddle/ir/core/operation.h"
#include "paddle/pass/pass_adaptor.h"
#include "paddle/pass/pass_manager.h"
......
if(WITH_NEWIR)
cc_test_old(type_test SRCS type_test.cc DEPS new_ir gtest)
cc_test_old(ir_attribute_test SRCS ir_attribute_test.cc DEPS new_ir gtest)
cc_test_old(ir_value_test SRCS ir_value_test.cc DEPS new_ir gtest)
cc_test_old(ir_op_test SRCS ir_op_test.cc DEPS new_ir gtest)
cc_test_old(
ir_program_test
SRCS
ir_program_test.cc
DEPS
new_ir
pd_dialect
phi
gtest)
file(
DOWNLOAD
https://paddle-ci.gz.bcebos.com/ir_translator_test/restnet50_main.prog
${CMAKE_CURRENT_BINARY_DIR}/restnet50_main.prog
EXPECTED_MD5 b64c0ad3c96d99fc37d12094623ce1ad)
cc_test_old(
program_translator_test
SRCS
program_translator_test.cc
DEPS
program_translator
gtest
new_ir
pd_dialect)
if(NOT WITH_NEWIR)
return()
endif()
add_subdirectory(core)
cc_test_old(type_test SRCS type_test.cc DEPS new_ir gtest)
cc_test_old(ir_attribute_test SRCS ir_attribute_test.cc DEPS new_ir gtest)
cc_test_old(ir_value_test SRCS ir_value_test.cc DEPS new_ir gtest)
cc_test_old(ir_op_test SRCS ir_op_test.cc DEPS new_ir gtest)
cc_test_old(
ir_program_test
SRCS
ir_program_test.cc
DEPS
new_ir
pd_dialect
phi
gtest)
file(
DOWNLOAD
https://paddle-ci.gz.bcebos.com/ir_translator_test/restnet50_main.prog
${CMAKE_CURRENT_BINARY_DIR}/restnet50_main.prog
EXPECTED_MD5 b64c0ad3c96d99fc37d12094623ce1ad)
cc_test_old(
program_translator_test
SRCS
program_translator_test.cc
DEPS
program_translator
gtest
new_ir
pd_dialect)
......@@ -15,12 +15,12 @@
#include <gtest/gtest.h>
#include <map>
#include "paddle/ir/attribute.h"
#include "paddle/ir/attribute_base.h"
#include "paddle/ir/builtin_attribute.h"
#include "paddle/ir/builtin_dialect.h"
#include "paddle/ir/dialect.h"
#include "paddle/ir/ir_context.h"
#include "paddle/ir/core/attribute.h"
#include "paddle/ir/core/attribute_base.h"
#include "paddle/ir/core/builtin_attribute.h"
#include "paddle/ir/core/builtin_dialect.h"
#include "paddle/ir/core/dialect.h"
#include "paddle/ir/core/ir_context.h"
TEST(attribute_test, attribute_base) {
class AttributeA {};
......
......@@ -14,12 +14,12 @@
#include <gtest/gtest.h>
#include "paddle/ir/builder.h"
#include "paddle/ir/builtin_attribute.h"
#include "paddle/ir/builtin_type.h"
#include "paddle/ir/dialect.h"
#include "paddle/ir/ir_context.h"
#include "paddle/ir/op_base.h"
#include "paddle/ir/core/builder.h"
#include "paddle/ir/core/builtin_attribute.h"
#include "paddle/ir/core/builtin_type.h"
#include "paddle/ir/core/dialect.h"
#include "paddle/ir/core/ir_context.h"
#include "paddle/ir/core/op_base.h"
/// \brief Define built-in Trait, derived from OpTraitBase.
class ReadOnlyTrait : public ir::OpTraitBase<ReadOnlyTrait> {
......
......@@ -17,12 +17,12 @@
#include "paddle/fluid/dialect/pd_dialect.h"
#include "paddle/fluid/dialect/pd_type.h"
#include "paddle/fluid/dialect/utils.h"
#include "paddle/ir/builtin_attribute.h"
#include "paddle/ir/builtin_dialect.h"
#include "paddle/ir/builtin_op.h"
#include "paddle/ir/ir_context.h"
#include "paddle/ir/program.h"
#include "paddle/ir/utils.h"
#include "paddle/ir/core/builtin_attribute.h"
#include "paddle/ir/core/builtin_dialect.h"
#include "paddle/ir/core/builtin_op.h"
#include "paddle/ir/core/ir_context.h"
#include "paddle/ir/core/program.h"
#include "paddle/ir/core/utils.h"
#include "paddle/phi/core/meta_tensor.h"
#include "paddle/phi/infermeta/binary.h"
#include "paddle/phi/kernels/elementwise_add_kernel.h"
......
......@@ -14,11 +14,11 @@
#include <gtest/gtest.h>
#include "paddle/ir/attribute.h"
#include "paddle/ir/builtin_attribute.h"
#include "paddle/ir/builtin_type.h"
#include "paddle/ir/ir_context.h"
#include "paddle/ir/operation.h"
#include "paddle/ir/core/attribute.h"
#include "paddle/ir/core/builtin_attribute.h"
#include "paddle/ir/core/builtin_type.h"
#include "paddle/ir/core/ir_context.h"
#include "paddle/ir/core/operation.h"
// This unittest is used to test the construction interfaces of value class and
// operation. The constructed test scenario is: a = OP1(); b = OP2(); c = OP3(a,
......
......@@ -23,10 +23,10 @@
#include "paddle/fluid/framework/operator.h"
#include "paddle/fluid/framework/program_desc.h"
#include "paddle/fluid/translator/translate.h"
#include "paddle/ir/builtin_dialect.h"
#include "paddle/ir/dialect.h"
#include "paddle/ir/ir_context.h"
#include "paddle/ir/program.h"
#include "paddle/ir/core/builtin_dialect.h"
#include "paddle/ir/core/dialect.h"
#include "paddle/ir/core/ir_context.h"
#include "paddle/ir/core/program.h"
using PaddleDialect = paddle::dialect::PaddleDialect;
using ProgramDesc = paddle::framework::ProgramDesc;
......
......@@ -15,13 +15,13 @@
#include <gtest/gtest.h>
#include <unordered_map>
#include "paddle/ir/builtin_dialect.h"
#include "paddle/ir/builtin_type.h"
#include "paddle/ir/dialect.h"
#include "paddle/ir/ir_context.h"
#include "paddle/ir/type.h"
#include "paddle/ir/type_base.h"
#include "paddle/ir/utils.h"
#include "paddle/ir/core/builtin_dialect.h"
#include "paddle/ir/core/builtin_type.h"
#include "paddle/ir/core/dialect.h"
#include "paddle/ir/core/ir_context.h"
#include "paddle/ir/core/type.h"
#include "paddle/ir/core/type_base.h"
#include "paddle/ir/core/utils.h"
TEST(type_test, type_id) {
// Define two empty classes, just for testing.
......
......@@ -18,11 +18,11 @@
#include "glog/logging.h"
#include "paddle/ir/builtin_type.h"
#include "paddle/ir/dialect.h"
#include "paddle/ir/ir_context.h"
#include "paddle/ir/op_base.h"
#include "paddle/ir/operation.h"
#include "paddle/ir/core/builtin_type.h"
#include "paddle/ir/core/dialect.h"
#include "paddle/ir/core/ir_context.h"
#include "paddle/ir/core/op_base.h"
#include "paddle/ir/core/operation.h"
#include "paddle/pass/pass.h"
#include "paddle/pass/pass_manager.h"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册