Author: Wen-Heng (Jack) Chung Date: 2020-06-05T22:18:19-05:00 New Revision: 125143fddbefacd6f10e70fcd2f1db52ddaaeb16
URL: https://github.com/llvm/llvm-project/commit/125143fddbefacd6f10e70fcd2f1db52ddaaeb16 DIFF: https://github.com/llvm/llvm-project/commit/125143fddbefacd6f10e70fcd2f1db52ddaaeb16.diff LOG: Initial commit of MIOpen dialect. Added: mlir/include/mlir/Dialect/MIOpenOps/CMakeLists.txt mlir/include/mlir/Dialect/MIOpenOps/MIOpenOps.h mlir/lib/Dialect/MIOpenOps/CMakeLists.txt mlir/lib/Dialect/MIOpenOps/DialectRegistration.cpp mlir/lib/Dialect/MIOpenOps/MIOpenOps.cpp Modified: mlir/include/mlir/Dialect/CMakeLists.txt mlir/lib/Dialect/CMakeLists.txt Removed: ################################################################################ diff --git a/mlir/include/mlir/Dialect/CMakeLists.txt b/mlir/include/mlir/Dialect/CMakeLists.txt index f0a24de73b27..d7b725168ecc 100644 --- a/mlir/include/mlir/Dialect/CMakeLists.txt +++ b/mlir/include/mlir/Dialect/CMakeLists.txt @@ -3,6 +3,8 @@ add_subdirectory(AVX512) add_subdirectory(GPU) add_subdirectory(Linalg) add_subdirectory(LLVMIR) +add_subdirectory(LoopOps) +add_subdirectory(MIOpenOps) add_subdirectory(OpenMP) add_subdirectory(Quant) add_subdirectory(SCF) diff --git a/mlir/include/mlir/Dialect/MIOpenOps/CMakeLists.txt b/mlir/include/mlir/Dialect/MIOpenOps/CMakeLists.txt new file mode 100644 index 000000000000..53d8018c9cff --- /dev/null +++ b/mlir/include/mlir/Dialect/MIOpenOps/CMakeLists.txt @@ -0,0 +1 @@ +add_mlir_dialect(MIOpenOps MIOpenOps) diff --git a/mlir/include/mlir/Dialect/MIOpenOps/MIOpenOps.h b/mlir/include/mlir/Dialect/MIOpenOps/MIOpenOps.h new file mode 100644 index 000000000000..e0c36c23a854 --- /dev/null +++ b/mlir/include/mlir/Dialect/MIOpenOps/MIOpenOps.h @@ -0,0 +1,36 @@ +//===- MIOpenOps.h - MIOpen MLIR Operations ---------------------*- C++ -*-===// +// +// Part of the MLIR Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// +// This file defines MIOpen memref operations. +// +//===----------------------------------------------------------------------===// + +#ifndef MLIR_MIOPENOPS_OPS_H_ +#define MLIR_MIOPENOPS_OPS_H_ + +#include "mlir/IR/Attributes.h" +#include "mlir/IR/Builders.h" +#include "mlir/IR/Dialect.h" +#include "mlir/IR/OpDefinition.h" +#include "mlir/Transforms/LoopLikeInterface.h" + +namespace mlir { +namespace miopen { + +class MIOpenOpsDialect : public Dialect { +public: + MIOpenOpsDialect(MLIRContext *context); + static StringRef getDialectNamespace() { return "miopen"; } +}; + +//#define GET_OP_CLASSES +//#include "mlir/Dialect/MIOpenOps/MIOpenOps.h.inc" + +} // end namespace miopen +} // end namespace mlir +#endif // MLIR_MIOPENOPS_OPS_H_ diff --git a/mlir/lib/Dialect/CMakeLists.txt b/mlir/lib/Dialect/CMakeLists.txt index b309454c504e..f4141bc534c9 100644 --- a/mlir/lib/Dialect/CMakeLists.txt +++ b/mlir/lib/Dialect/CMakeLists.txt @@ -3,6 +3,8 @@ add_subdirectory(AVX512) add_subdirectory(GPU) add_subdirectory(Linalg) add_subdirectory(LLVMIR) +add_subdirectory(LoopOps) +add_subdirectory(MIOpenOps) add_subdirectory(OpenMP) add_subdirectory(Quant) add_subdirectory(SCF) diff --git a/mlir/lib/Dialect/MIOpenOps/CMakeLists.txt b/mlir/lib/Dialect/MIOpenOps/CMakeLists.txt new file mode 100644 index 000000000000..474196162792 --- /dev/null +++ b/mlir/lib/Dialect/MIOpenOps/CMakeLists.txt @@ -0,0 +1,9 @@ +file(GLOB globbed *.c *.cpp) +add_llvm_library(MLIRMIOpenOps + ${globbed} + + ADDITIONAL_HEADER_DIRS + ${MLIR_MAIN_INCLUDE_DIR}/mlir/MIOpenOps + ) +add_dependencies(MLIRMIOpenOps MLIRStandardOps LLVMSupport) +target_link_libraries(MLIRMIOpenOps LLVMSupport) diff --git a/mlir/lib/Dialect/MIOpenOps/DialectRegistration.cpp b/mlir/lib/Dialect/MIOpenOps/DialectRegistration.cpp new file mode 100644 index 000000000000..4e00e6902383 --- /dev/null +++ b/mlir/lib/Dialect/MIOpenOps/DialectRegistration.cpp @@ -0,0 +1,13 @@ +//===- DialectRegistration.cpp - Register MIOpen dialect ------------------===// +// +// Part of the MLIR Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "mlir/Dialect/MIOpenOps/MIOpenOps.h" +using namespace mlir; + +// Static initialization for MIOpen dialect registration. +static DialectRegistration<miopen::MIOpenOpsDialect> MIOpenOps; diff --git a/mlir/lib/Dialect/MIOpenOps/MIOpenOps.cpp b/mlir/lib/Dialect/MIOpenOps/MIOpenOps.cpp new file mode 100644 index 000000000000..ced4d25e866f --- /dev/null +++ b/mlir/lib/Dialect/MIOpenOps/MIOpenOps.cpp @@ -0,0 +1,52 @@ +//===- MIOpenOps.cpp - MIOpen MLIR Operations -----------------------------===// +// +// Part of the MLIR Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "mlir/Dialect/MIOpenOps/MIOpenOps.h" +#include "mlir/Dialect/StandardOps/Ops.h" +#include "mlir/IR/Builders.h" +#include "mlir/IR/Function.h" +#include "mlir/IR/Matchers.h" +#include "mlir/IR/Module.h" +#include "mlir/IR/OpImplementation.h" +#include "mlir/IR/PatternMatch.h" +#include "mlir/IR/StandardTypes.h" +#include "mlir/IR/Value.h" +#include "mlir/Support/MathExtras.h" +#include "mlir/Support/STLExtras.h" +#include "mlir/Transforms/SideEffectsInterface.h" + +using namespace mlir; +using namespace mlir::miopen; + +//===----------------------------------------------------------------------===// +// MIOpenOpsDialect Interfaces +//===----------------------------------------------------------------------===// +namespace { + +} // namespace + +//===----------------------------------------------------------------------===// +// MIOpenOpsDialect +//===----------------------------------------------------------------------===// + +MIOpenOpsDialect::MIOpenOpsDialect(MLIRContext *context) + : Dialect(getDialectNamespace(), context) { +// addOperations< +//#define GET_OP_LIST +//#include "mlir/Dialect/MIOpenOps/MIOpenOps.cpp.inc" +// >(); + + //addInterfaces<LoopSideEffectsInterface>(); +} + +//===----------------------------------------------------------------------===// +// TableGen'd op method definitions +//===----------------------------------------------------------------------===// + +//#define GET_OP_CLASSES +//#include "mlir/Dialect/MIOpenOps/MIOpenOps.cpp.inc" _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits