mirror of https://github.com/llvm/torch-mlir
Add central registration for type ranges.
parent
f8cedd8656
commit
bfd5fedba7
|
@ -10,6 +10,7 @@
|
||||||
#define NPCOMP_DIALECT_BASICPY_BASICPY_DIALECT_H
|
#define NPCOMP_DIALECT_BASICPY_BASICPY_DIALECT_H
|
||||||
|
|
||||||
#include "mlir/IR/Dialect.h"
|
#include "mlir/IR/Dialect.h"
|
||||||
|
#include "npcomp/Dialect/Common.h"
|
||||||
|
|
||||||
namespace mlir {
|
namespace mlir {
|
||||||
namespace NPCOMP {
|
namespace NPCOMP {
|
||||||
|
@ -17,7 +18,7 @@ namespace Basicpy {
|
||||||
|
|
||||||
namespace BasicpyTypes {
|
namespace BasicpyTypes {
|
||||||
enum Kind {
|
enum Kind {
|
||||||
PlaceholderType = Type::FIRST_PRIVATE_EXPERIMENTAL_8_TYPE,
|
PlaceholderType = TypeRanges::Basicpy,
|
||||||
LAST_BASICPY_TYPE = PlaceholderType
|
LAST_BASICPY_TYPE = PlaceholderType
|
||||||
};
|
};
|
||||||
} // namespace BasicpyTypes
|
} // namespace BasicpyTypes
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
//===- Common.h - Common definitions for all dialects -----------*- 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_COMMON_H
|
||||||
|
#define NPCOMP_DIALECT_COMMON_H
|
||||||
|
|
||||||
|
#include "mlir/IR/Types.h"
|
||||||
|
|
||||||
|
namespace mlir {
|
||||||
|
namespace NPCOMP {
|
||||||
|
|
||||||
|
namespace TypeRanges {
|
||||||
|
enum {
|
||||||
|
Basicpy = Type::FIRST_PRIVATE_EXPERIMENTAL_3_TYPE,
|
||||||
|
Numpy = Basicpy + 50,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace NPCOMP
|
||||||
|
} // namespace mlir
|
||||||
|
|
||||||
|
#endif // NPCOMP_DIALECT_COMMON_H
|
|
@ -10,16 +10,14 @@
|
||||||
#define NPCOMP_DIALECT_NUMPY_NUMPY_DIALECT_H
|
#define NPCOMP_DIALECT_NUMPY_NUMPY_DIALECT_H
|
||||||
|
|
||||||
#include "mlir/IR/Dialect.h"
|
#include "mlir/IR/Dialect.h"
|
||||||
|
#include "npcomp/Dialect/Common.h"
|
||||||
|
|
||||||
namespace mlir {
|
namespace mlir {
|
||||||
namespace NPCOMP {
|
namespace NPCOMP {
|
||||||
namespace Numpy {
|
namespace Numpy {
|
||||||
|
|
||||||
namespace NumpyTypes {
|
namespace NumpyTypes {
|
||||||
enum Kind {
|
enum Kind { AnyDtypeType = TypeRanges::Numpy, LAST_NUMPY_TYPE = AnyDtypeType };
|
||||||
AnyDtypeType = Type::FIRST_PRIVATE_EXPERIMENTAL_9_TYPE,
|
|
||||||
LAST_NUMPY_TYPE = AnyDtypeType
|
|
||||||
};
|
|
||||||
} // namespace NumpyTypes
|
} // namespace NumpyTypes
|
||||||
|
|
||||||
// The singleton type representing an unknown dtype.
|
// The singleton type representing an unknown dtype.
|
||||||
|
|
Loading…
Reference in New Issue