mlir-hlo/tools/mlir-tblgen-builder/Builder/Attribute.h

169 lines
3.1 KiB
C++

#ifndef BUILDER_ATTRIBUTE_H_
#define BUILDER_ATTRIBUTE_H_
#include <memory>
#include <vector>
namespace builder {
class PrimitiveType {
public:
static PrimitiveType PRED();
static PrimitiveType S8();
static PrimitiveType S16();
static PrimitiveType F32();
static PrimitiveType S32();
static PrimitiveType S64();
inline bool operator==(const PrimitiveType& pt);
class Impl;
std::shared_ptr<Impl> GetImpl() const { return impl_; }
PrimitiveType(std::shared_ptr<Impl>);
private:
std::shared_ptr<Impl> impl_;
// PrimitiveType(const PrimitiveType&) = default;
};
class Shape {
public:
Shape(std::vector<int64_t> dims);
class Impl;
std::shared_ptr<Impl> GetImpl() const { return impl_; }
std::vector<int64_t> GetDims();
private:
std::shared_ptr<Impl> impl_;
};
class Integer {
public:
Integer(int value);
Integer(int64_t value);
class Impl;
std::shared_ptr<Impl> GetImpl() { return impl_; }
private:
std::shared_ptr<Impl> impl_;
};
class Float {
public:
Float(float value);
Float(double value);
class Impl;
std::shared_ptr<Impl> GetImpl() { return impl_; }
private:
std::shared_ptr<Impl> impl_;
};
class Array {
public:
Array(std::vector<int> value);
Array(std::vector<int64_t> value);
Array(std::vector<std::string> value);
int64_t GetSize();
PrimitiveType GetType();
class Impl;
std::shared_ptr<Impl> GetImpl() { return impl_; }
private:
std::shared_ptr<Impl> impl_;
};
class Tensor {
public:
Tensor(Shape& shape, std::vector<int> value);
Tensor(Shape& shape, std::vector<int64_t> value);
Tensor(Shape& shape, std::vector<float> value);
Shape GetShape();
PrimitiveType GetType();
class Impl;
std::shared_ptr<Impl> GetImpl() { return impl_; }
private:
std::shared_ptr<Impl> impl_;
};
class TensorInt {
public:
TensorInt(Shape& shape, PrimitiveType& primitiveType);
Shape GetShape();
PrimitiveType GetType();
class Impl;
std::shared_ptr<Impl> GetImpl() { return impl_; }
private:
std::shared_ptr<Impl> impl_;
};
class Type {
public:
Type(Shape& shape, PrimitiveType& primitiveType);
class Impl;
const std::shared_ptr<Impl> GetImpl() const { return impl_; }
private:
std::shared_ptr<Impl> impl_;
};
class ChannelHandle {
public:
ChannelHandle();
class Impl;
std::shared_ptr<Impl> GetImpl() { return impl_; }
private:
std::shared_ptr<Impl> impl_;
};
class ConvDimensionNumbers {
public:
ConvDimensionNumbers();
class Impl;
std::shared_ptr<Impl> GetImpl() { return impl_; }
private:
std::shared_ptr<Impl> impl_;
};
class DotDimensionNumbers {
public:
DotDimensionNumbers();
class Impl;
std::shared_ptr<Impl> GetImpl() { return impl_; }
private:
std::shared_ptr<Impl> impl_;
};
class GatherDimensionNumbers {
public:
GatherDimensionNumbers();
class Impl;
std::shared_ptr<Impl> GetImpl() { return impl_; }
private:
std::shared_ptr<Impl> impl_;
};
class ScatterDimensionNumbers {
public:
ScatterDimensionNumbers();
class Impl;
std::shared_ptr<Impl> GetImpl() { return impl_; }
private:
std::shared_ptr<Impl> impl_;
};
} // namespace builder
#endif