2020-04-27 08:20:58 +08:00
|
|
|
//===- 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"
|
2020-05-06 05:16:39 +08:00
|
|
|
#include "npcomp/Dialect/Common.h"
|
2020-04-27 08:20:58 +08:00
|
|
|
|
|
|
|
namespace mlir {
|
2020-04-30 08:10:10 +08:00
|
|
|
namespace NPCOMP {
|
2020-04-30 09:20:42 +08:00
|
|
|
namespace Numpy {
|
|
|
|
|
|
|
|
namespace NumpyTypes {
|
2020-05-06 05:16:39 +08:00
|
|
|
enum Kind { AnyDtypeType = TypeRanges::Numpy, LAST_NUMPY_TYPE = AnyDtypeType };
|
2020-04-30 09:20:42 +08:00
|
|
|
} // namespace NumpyTypes
|
|
|
|
|
|
|
|
// The singleton type representing an unknown dtype.
|
|
|
|
class AnyDtypeType : public Type::TypeBase<AnyDtypeType, Type> {
|
|
|
|
public:
|
|
|
|
using Base::Base;
|
|
|
|
|
|
|
|
static AnyDtypeType get(MLIRContext *context) {
|
|
|
|
return Base::get(context, NumpyTypes::Kind::AnyDtypeType);
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool kindof(unsigned kind) {
|
|
|
|
return kind == NumpyTypes::Kind::AnyDtypeType;
|
|
|
|
}
|
|
|
|
};
|
2020-04-27 08:20:58 +08:00
|
|
|
|
|
|
|
#include "npcomp/Dialect/Numpy/NumpyOpsDialect.h.inc"
|
|
|
|
|
2020-04-30 09:20:42 +08:00
|
|
|
} // namespace Numpy
|
2020-04-30 08:10:10 +08:00
|
|
|
} // namespace NPCOMP
|
2020-04-27 08:20:58 +08:00
|
|
|
} // namespace mlir
|
|
|
|
|
|
|
|
#endif // NPCOMP_DIALECT_NUMPY_NUMPY_DIALECT_H
|