Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ir] Add missing constructors for TypedConstant #3351

Merged
merged 1 commit into from
Nov 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions taichi/ir/type.h
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,24 @@ class TypedConstant {
TypedConstant(float64 x) : dt(PrimitiveType::f64), val_f64(x) {
}

TypedConstant(int8 x) : dt(PrimitiveType::i8), val_i8(x) {
}

TypedConstant(int16 x) : dt(PrimitiveType::i16), val_i16(x) {
}

TypedConstant(uint8 x) : dt(PrimitiveType::u8), val_u8(x) {
}

TypedConstant(uint16 x) : dt(PrimitiveType::u16), val_u16(x) {
}

TypedConstant(uint32 x) : dt(PrimitiveType::u32), val_u32(x) {
}

TypedConstant(uint64 x) : dt(PrimitiveType::u64), val_u64(x) {
}

template <typename T>
TypedConstant(DataType dt, const T &value) : dt(dt) {
// TODO: loud failure on pointers
Expand Down