forked from llvm/torch-mlir
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ac302ea
commit d3b6e17
Showing
18 changed files
with
181 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
BasedOnStyle: LLVM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.vscode | ||
|
||
build | ||
build-mlir | ||
install-mlir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
# Empty file | ||
add_subdirectory(Dialect) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
add_subdirectory(Numpy) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
add_mlir_dialect(NumpyOps numpy) | ||
add_mlir_doc(NumpyDialect -gen-dialect-doc NumpyDialect Numpy/) | ||
add_mlir_doc(NumpyOps -gen-op-doc NumpyOps Numpy/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
//===- NumpyDialect.h - Core numpy dialect ----------------------*- C++ -*-===// | ||
// | ||
// This file is licensed 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 | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef NPCOMP_DIALECT_NUMPY_NUMPY_DIALECT_H | ||
#define NPCOMP_DIALECT_NUMPY_NUMPY_DIALECT_H | ||
|
||
#include "mlir/IR/Dialect.h" | ||
|
||
namespace mlir { | ||
namespace npcomp { | ||
namespace NUMPY { | ||
|
||
#include "npcomp/Dialect/Numpy/NumpyOpsDialect.h.inc" | ||
|
||
} // namespace NUMPY | ||
} // namespace npcomp | ||
} // namespace mlir | ||
|
||
#endif // NPCOMP_DIALECT_NUMPY_NUMPY_DIALECT_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
//===- NumpyDialect.td - Core numpy dialect ----------------*- tablegen -*-===// | ||
// | ||
// This file is licensed 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 | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef NPCOMP_DIALECT_NUMPY_NUMPY_DIALECT | ||
#define NPCOMP_DIALECT_NUMPY_NUMPY_DIALECT | ||
|
||
include "mlir/IR/OpBase.td" | ||
|
||
def Numpy_Dialect : Dialect { | ||
let name = "numpy"; | ||
let summary = "Core numpy dialect"; | ||
let description = [{ | ||
Dialect of types and core numpy ops and abstractions. | ||
}]; | ||
let cppNamespace = "NUMPY"; | ||
} | ||
|
||
class Numpy_Op<string mnemonic, list<OpTrait> traits = []> : | ||
Op<Numpy_Dialect, mnemonic, traits>; | ||
|
||
#endif // NPCOMP_DIALECT_NUMPY_NUMPY_DIALECT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//===- NumpyOps.h - Core numpy dialect ops ----------------------*- C++ -*-===// | ||
// | ||
// This file is licensed 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 | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef NPCOMP_DIALECT_NUMPY_NUMPY_OPS_H | ||
#define NPCOMP_DIALECT_NUMPY_NUMPY_OPS_H | ||
|
||
#include "mlir/IR/Dialect.h" | ||
#include "mlir/IR/OpDefinition.h" | ||
#include "mlir/Interfaces/SideEffects.h" | ||
|
||
namespace mlir { | ||
namespace npcomp { | ||
namespace NUMPY { | ||
|
||
#define GET_OP_CLASSES | ||
#include "npcomp/Dialect/Numpy/NumpyOps.h.inc" | ||
|
||
} // namespace NUMPY | ||
} // namespace npcomp | ||
} // namespace mlir | ||
|
||
#endif // NPCOMP_DIALECT_NUMPY_NUMPY_OPS_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
//===- NumpyOps.td - Core numpy dialect ops ----------------*- tablegen -*-===// | ||
// | ||
// This file is licensed 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 | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef NPCOMP_DIALECT_NUMPY_NUMPY_OPS | ||
#define NPCOMP_DIALECT_NUMPY_NUMPY_OPS | ||
|
||
include "NumpyDialect.td" | ||
include "mlir/Interfaces/SideEffects.td" | ||
|
||
def Numpy_FooOp : Numpy_Op<"foo", [NoSideEffect, | ||
SameOperandsAndResultType]> { | ||
let summary = "Temp op"; | ||
let description = [{ | ||
Temp op | ||
}]; | ||
|
||
let arguments = (ins I32:$input); | ||
let results = (outs I32:$res); | ||
|
||
let assemblyFormat = [{ | ||
$input attr-dict `:` type($input) | ||
}]; | ||
} | ||
|
||
#endif // NPCOMP_DIALECT_NUMPY_NUMPY_OPS |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1 @@ | ||
add_llvm_tool(npcomp-dummy-runner | ||
dummy-runner.cpp | ||
) | ||
|
||
target_link_libraries(npcomp-dummy-runner PRIVATE | ||
LLVMSupport | ||
) | ||
add_subdirectory(Dialect) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
add_subdirectory(Numpy) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
add_mlir_dialect_library(NPCOMPNumpyDialect | ||
NumpyDialect.cpp | ||
NumpyOps.cpp | ||
|
||
ADDITIONAL_HEADER_DIRS | ||
${PROJECT_SOURCE_DIR}/include/npcomp/Dialect/Numpy | ||
|
||
DEPENDS | ||
MLIRNumpyOpsIncGen | ||
) | ||
|
||
target_link_libraries(NPCOMPNumpyDialect PUBLIC MLIRIR) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//===- NumpyDialect.cpp - Core numpy dialect --------------------*- C++ -*-===// | ||
// | ||
// This file is licensed 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 "npcomp/Dialect/Numpy/NumpyDialect.h" | ||
#include "npcomp/Dialect/Numpy/NumpyOps.h" | ||
|
||
using namespace mlir; | ||
using namespace mlir::npcomp::NUMPY; | ||
|
||
NumpyDialect::NumpyDialect(MLIRContext *context) | ||
: Dialect(getDialectNamespace(), context) { | ||
addOperations< | ||
#define GET_OP_LIST | ||
#include "npcomp/Dialect/Numpy/NumpyOps.cpp.inc" | ||
>(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//===- NumpyOps.cpp - Core numpy dialect ops --------------------*- C++ -*-===// | ||
// | ||
// This file is licensed 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 "npcomp/Dialect/Numpy/NumpyOps.h" | ||
#include "mlir/IR/OpImplementation.h" | ||
#include "npcomp/Dialect/Numpy/NumpyDialect.h" | ||
|
||
namespace mlir { | ||
namespace npcomp { | ||
namespace numpy { | ||
|
||
#include "npcomp/Dialect/Numpy/NumpyOps.cpp.inc" | ||
|
||
} // namespace numpy | ||
} // namespace npcomp | ||
} // namespace mlir |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters