Address missing default label in switch statement

Signed-off-by: Bairen Yi <yibairen.byron@bytedance.com>
pull/184/head
Bairen Yi 2021-03-11 13:27:12 +08:00 committed by Sean Silva
parent 5315598947
commit 5fed296904
2 changed files with 5 additions and 0 deletions

View File

@ -8,6 +8,8 @@
#include "npcomp/RefBackend/Runtime/UserAPI.h"
#include "llvm/Support/ErrorHandling.h"
#include <array>
#include <cassert>
#include <cstdint>
@ -119,6 +121,7 @@ std::int32_t refbackrt::getElementTypeByteSize(ElementType type) {
case ElementType::F32:
return 4;
}
llvm_unreachable("unsupported dtype");
}
Ref<Tensor> Tensor::create(ArrayRef<std::int32_t> extents, ElementType type,

View File

@ -80,6 +80,7 @@ static Type convertToMLIRType(refbackrt::ElementType type, Builder &builder) {
case refbackrt::ElementType::F32:
return builder.getF32Type();
}
llvm_unreachable("unsupported dtype");
}
static RankedTensorType getCorrespondingMLIRTensorType(refbackrt::Tensor &tensor,
@ -103,6 +104,7 @@ static Attribute convertToMLIRAttribute(refbackrt::Tensor &tensor,
return DenseFPElementsAttr::get(type, values);
}
}
llvm_unreachable("unsupported dtype");
}
static void printOutput(refbackrt::Tensor &tensor, llvm::raw_ostream &os) {