add missing bfloat16 repr and improve assertions (#403)

- `BF16TyID` was missing a repr implementation.
- Throw a better exception on impossible casts.
- Add a few assertions. Tested with a debug build.
- Add `pointer_dtype.__str__` to aid kernel debugging.
This commit is contained in:
Madeleine Thompson
2021-12-23 17:01:17 -08:00
committed by GitHub
parent d8fce83e7a
commit 985798f101
7 changed files with 12 additions and 12 deletions

View File

@@ -131,6 +131,7 @@ public:
case FP16TyID: return "f16";
case FP32TyID: return "f32";
case FP64TyID: return "f64";
case BF16TyID: return "bf16";
case LabelTyID: return "label";
case MetadataTyID: return "md";
case TokenTyID: return "tok";
@@ -141,8 +142,7 @@ public:
case BlockTyID: return tile_repr();
default: break;
}
assert(false);
return "";
throw std::logic_error("unknown type id '" + std::to_string(id_) + "'");
};
private: