mirror of https://github.com/llvm/torch-mlir
Rename from npcomp::NUMPY to NPCOMP::numpy to follow IREE convention.
parent
f174c0557b
commit
c4a192d5c9
|
@ -12,13 +12,13 @@
|
|||
#include "mlir/IR/Dialect.h"
|
||||
|
||||
namespace mlir {
|
||||
namespace npcomp {
|
||||
namespace NUMPY {
|
||||
namespace NPCOMP {
|
||||
namespace numpy {
|
||||
|
||||
#include "npcomp/Dialect/Numpy/NumpyOpsDialect.h.inc"
|
||||
|
||||
} // namespace NUMPY
|
||||
} // namespace npcomp
|
||||
} // namespace numpy
|
||||
} // namespace NPCOMP
|
||||
} // namespace mlir
|
||||
|
||||
#endif // NPCOMP_DIALECT_NUMPY_NUMPY_DIALECT_H
|
||||
|
|
|
@ -17,7 +17,7 @@ def Numpy_Dialect : Dialect {
|
|||
let description = [{
|
||||
Dialect of types and core numpy ops and abstractions.
|
||||
}];
|
||||
let cppNamespace = "NUMPY";
|
||||
let cppNamespace = "numpy";
|
||||
}
|
||||
|
||||
class Numpy_Op<string mnemonic, list<OpTrait> traits = []> :
|
||||
|
|
|
@ -18,14 +18,14 @@
|
|||
#include "mlir/Interfaces/SideEffects.h"
|
||||
|
||||
namespace mlir {
|
||||
namespace npcomp {
|
||||
namespace NUMPY {
|
||||
namespace NPCOMP {
|
||||
namespace numpy {
|
||||
|
||||
#define GET_OP_CLASSES
|
||||
#include "npcomp/Dialect/Numpy/NumpyOps.h.inc"
|
||||
|
||||
} // namespace NUMPY
|
||||
} // namespace npcomp
|
||||
} // namespace numpy
|
||||
} // namespace NPCOMP
|
||||
} // namespace mlir
|
||||
|
||||
#endif // NPCOMP_DIALECT_NUMPY_NUMPY_OPS_H
|
||||
|
|
|
@ -37,7 +37,7 @@ def Numpy_GenericUfuncOp : Numpy_Op<"generic_ufunc", [
|
|||
|
||||
def Numpy_UfuncReturnOp : Numpy_Op<"ufunc_return", [
|
||||
Terminator,
|
||||
HasParent<"NUMPY::GenericUfuncOp">]> {
|
||||
HasParent<"numpy::GenericUfuncOp">]> {
|
||||
let summary = "Return a value from a generic_ufunc";
|
||||
let description = [{
|
||||
Must terminate the basic block of a generic_ufunc overload.
|
||||
|
@ -49,40 +49,4 @@ def Numpy_UfuncReturnOp : Numpy_Op<"ufunc_return", [
|
|||
let assemblyFormat = "attr-dict ($operands^ `:` type($operands))?";
|
||||
}
|
||||
|
||||
// def Numpy_GenericUfuncOp : Numpy_Op<"generic_ufunc", [
|
||||
// IsolatedFromAbove,
|
||||
// Symbol,
|
||||
// NativeOpTrait<"FunctionLike">]> {
|
||||
// let summary = "Defines a ufunc in terms of elementwise operations";
|
||||
// let description = [{
|
||||
// Defines a universal-function operator in terms of a region, containing
|
||||
// a basic block of element-wise ops.
|
||||
// }];
|
||||
|
||||
// let regions = (region AnyRegion:$body);
|
||||
|
||||
// let extraClassDeclaration = [{
|
||||
// /// Returns the type of this function.
|
||||
// FunctionType getType() {
|
||||
// return getAttrOfType<TypeAttr>(getTypeAttrName())
|
||||
// .getValue()
|
||||
// .cast<FunctionType>();
|
||||
// }
|
||||
|
||||
// /// Hook for OpTrait::FunctionLike, returns the number of function
|
||||
// /// arguments. Depends on the type attribute being correct as checked by
|
||||
// /// verifyType.
|
||||
// unsigned getNumFuncArguments() { return getType().getInputs().size(); }
|
||||
|
||||
// /// Hook for OpTrait::FunctionLike, returns the number of function results.
|
||||
// /// Depends on the type attribute being correct as checked by verifyType.
|
||||
// unsigned getNumFuncResults() { return getType().getResults().size(); }
|
||||
|
||||
// /// Hook for OpTrait::FunctionLike, called after verifying that the 'type'
|
||||
// /// attribute is present. This can check for preconditions of the
|
||||
// /// getNumArguments hook not failing.
|
||||
// LogicalResult verifyType();
|
||||
// }];
|
||||
// }
|
||||
|
||||
#endif // NPCOMP_DIALECT_NUMPY_NUMPY_OPS
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include "npcomp/Dialect/Numpy/NumpyOps.h"
|
||||
|
||||
using namespace mlir;
|
||||
using namespace mlir::npcomp::NUMPY;
|
||||
using namespace mlir::NPCOMP::numpy;
|
||||
|
||||
NumpyDialect::NumpyDialect(MLIRContext *context)
|
||||
: Dialect(getDialectNamespace(), context) {
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
#include "npcomp/Dialect/Numpy/NumpyDialect.h"
|
||||
|
||||
namespace mlir {
|
||||
namespace npcomp {
|
||||
namespace NUMPY {
|
||||
namespace NPCOMP {
|
||||
namespace numpy {
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// BuildinUfuncOp
|
||||
|
@ -147,6 +147,6 @@ static void printGenericUfuncOp(OpAsmPrinter &p, GenericUfuncOp op) {
|
|||
|
||||
#define GET_OP_CLASSES
|
||||
#include "npcomp/Dialect/Numpy/NumpyOps.cpp.inc"
|
||||
} // namespace NUMPY
|
||||
} // namespace npcomp
|
||||
} // namespace numpy
|
||||
} // namespace NPCOMP
|
||||
} // namespace mlir
|
||||
|
|
|
@ -60,7 +60,7 @@ int main(int argc, char **argv) {
|
|||
mlir::registerAllDialects();
|
||||
mlir::registerAllPasses();
|
||||
|
||||
mlir::registerDialect<mlir::npcomp::NUMPY::NumpyDialect>();
|
||||
mlir::registerDialect<mlir::NPCOMP::numpy::NumpyDialect>();
|
||||
// TODO: Register standalone passes here.
|
||||
|
||||
llvm::InitLLVM y(argc, argv);
|
||||
|
|
Loading…
Reference in New Issue