Skip to content

Commit

Permalink
[ir] Add missing constructors for TypedConstant (taichi-dev#3351)
Browse files Browse the repository at this point in the history
  • Loading branch information
strongoier authored and sjwsl committed Nov 3, 2021
1 parent 0254f3a commit 971b0bc
Showing 1 changed file with 18 additions and 0 deletions.
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

0 comments on commit 971b0bc

Please sign in to comment.